home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / STAYRESP.ZIP / STAYSAVE.410 < prev    next >
Encoding:
Text File  |  1986-05-04  |  3.0 KB  |  43 lines

  1. Inline(
  2.                               {;****************************************************************************;}
  3.                               {;                 S  T  A  Y  S  A  V  E  .  I  N  C                         ;}
  4.                               {;****************************************************************************;}
  5.                               {;This Inline routine will save the regs and Stack for Stay resident programs.}
  6.                               {; It restores DS and SS from the previously saved integer constants "OurDseg"}
  7.                               {; and "OurSSeg".  DS is restored from the Turbo Initialization Savearea.}
  8.                               {; Author: Copyr. 1985, 1986}
  9.                               {;                Lane Ferris}
  10.                               {;              - The Hunter's Helper -}
  11.                               {;       Distributed to the Public Domain for use without profit.}
  12.                               {;                    Original Version 5.15.85}
  13.   $FA                         {       CLI                       ; Stop all interrupts}
  14.   /$2E                        {       CS:}
  15.   /$80/$0E/>STATUS/<INUSE     {       Or by   [<Status],<InUse  ; Set Active bit}
  16.                               {;               Switch the SS:Sp reg pair over to ES:Si}
  17.                               {;               Put Turbo's Stack pointers into SS:Sp}
  18.   /$2E                        {       CS:}
  19.   /$8C/$1E/>DOSDSEG           {       Mov     [>DosDSeg],DS        ; Save DOS DataSegment}
  20.   /$2E                        {       CS:}
  21.   /$8C/$16/>DOSSSEG           {       Mov     [>DosSSeg],SS        ; Save Dos Stack Segment}
  22.   /$2E                        {       CS:}
  23.   /$89/$26/>DOSSPTR           {       Mov     [>DosSPtr],Sp        ; Save Dos Stack Ptr}
  24.                               {;          Stack Dos/User interrupted pgm regs for Exit.}
  25.                               {;          These are the original interrupt process regs}
  26.                               {;          that must be returned on interrupt return}
  27.   /$2E                        {       CS:}
  28.   /$8E/$16/>OURSSEG           {       Mov     SS,[>OurSSeg]}
  29.   /$2E                        {       CS:}
  30.   /$8E/$1E/>OURDSEG           {       Mov     DS,[>OurDSeg]}
  31.   /$8B/$26/$74/$01            {       Mov     Sp,[$174]    ; Sp set by code at $B2B in Turbo initialization}
  32.   /$55                        {       Push    Bp}
  33.   /$50                        {       Push    Ax}
  34.   /$53                        {       Push    Bx}
  35.   /$51                        {       Push    Cx}
  36.   /$52                        {       Push    Dx}
  37.   /$56                        {       Push    Si}
  38.   /$57                        {       Push    Di}
  39.   /$06                        {       Push    Es}
  40.   /$FB                        {       STI                     ; Enable Interrupts}
  41.                               {;...........................................................................}
  42. );
  43.