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

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