home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 13 / 13.iso / s / s001 / 1.ddi / TS / SRC / TSR.C < prev    next >
Encoding:
C/C++ Source or Header  |  1987-09-03  |  661 b   |  32 lines

  1.                 /******************************************
  2.            *            TSR.C             *
  3.                * Copyright TimeSlice, Inc. 1985, 86, 87. *
  4.                ******************************************/
  5.  
  6. #define    FLAG    0
  7. #define PSP    1
  8. #define SIZE    3
  9.  
  10. /***
  11. * TSR()
  12. * Terminate and Stay Resident.
  13. ***/
  14. void tsr() {
  15.   char tpa[ 5 ] ;              /*MS-DOS memory arena block header*/
  16.  
  17.   struct {
  18.     unsigned ax, bx, cx, dx, si, di, flags;
  19.   } regs;
  20.  
  21.   regs.ax = 0x6200;        /*get Prog Seg Prefix*/
  22.   intdos( ®s, ®s );
  23.   peek( regs.bx - 1, 0, tpa, sizeof(tpa) );
  24.   regs.ax = 0x3100;
  25.   regs.dx = *(int *)(tpa + SIZE) ;
  26.   int86( 0x21, ®s, ®s );
  27. }
  28.  
  29.  
  30.  
  31.  
  32.