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

  1. /*-----------------------------------------------------------------------*
  2.  * filename - keep.c
  3.  *
  4.  * function(s)
  5.  *        keep - exits and remains resident
  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. extern void _restorezero(void);
  21.  
  22. /*---------------------------------------------------------------------*
  23.  
  24. Name        keep - exits and remains resident
  25.  
  26. Usage        void keep(unsigned char status, unsigned size);
  27.  
  28. Prototype in    dos.h
  29.  
  30. Description    keep returns to MS-DOS with the exit status in
  31.         status. The current program remains resident, however. The
  32.         program is set to size paragraphs in length, and the
  33.         remainder of the memory of the program is freed.
  34.  
  35.         keep can be used when installing a TSR program. keep uses DOS
  36.         function 0x31.
  37.  
  38. Return value    None
  39.  
  40. *---------------------------------------------------------------------*/
  41. void keep(unsigned char status, unsigned size)
  42. {
  43.     _restorezero();
  44.     _DX = size;
  45.     _AL = status;
  46.     _AH = 0x31;
  47.     geninterrupt(0x21);
  48. }
  49.