home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_144 / 1.ddi / CLIBSRC.ZIP / GETPSP.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  1.2 KB  |  43 lines

  1. /*-----------------------------------------------------------------------*
  2.  * filename - getpsp.c
  3.  *
  4.  * function(s)
  5.  *        getpsp - gets the program segment prefix
  6.  *-----------------------------------------------------------------------*/
  7.  
  8. /*
  9.  *      C/C++ Run Time Library - Version 5.0
  10.  *
  11.  *      Copyright (c) 1987, 1992 by Borland International
  12.  *      All Rights Reserved.
  13.  *
  14.  */
  15.  
  16.  
  17. #include <dos.h>
  18.  
  19. /*---------------------------------------------------------------------*
  20.  
  21. Name            getpsp - gets the program segment prefix
  22.  
  23. Usage           unsigned getpsp(void);
  24.  
  25. Prototype in    dos.h
  26.  
  27. Description     getpsp gets the segment address of the program
  28.                 segment prefix (the PSP) using DOS call 0x62.
  29.  
  30.                 This call only exists in DOS 3.x. For versions of MS-DOS 2.x
  31.                 and 3.x, the global variable _psp  set by the start-up code may
  32.                 be used instead.
  33.  
  34. Return value    getpsp returns the segment value of the PSP.
  35.  
  36. *---------------------------------------------------------------------*/
  37. unsigned getpsp(void)           /* DOS 3.0 */
  38. {
  39.         _AH = 0x62;
  40.         geninterrupt(0x21);
  41.         return(_BX);
  42. }
  43.