home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c065 / 1.ddi / CLIB1.ZIP / GETPSP.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-07  |  1.5 KB  |  44 lines

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