home *** CD-ROM | disk | FTP | other *** search
- Inline(
- {;****************************************************************************;}
- {; S T A Y S A V E . I N C ;}
- {;****************************************************************************;}
- {;This Inline routine will save the regs and Stack for Stay resident programs.}
- {; It restores DS and SS from the previously saved integer constants "OurDseg"}
- {; and "OurSSeg". DS is restored from the Turbo Initialization Savearea.}
- {; Author: Copyr. 1985, 1986}
- {; Lane Ferris}
- {; - The Hunter's Helper -}
- {; Distributed to the Public Domain for use without profit.}
- {; Original Version 5.15.85}
- $FA { CLI ; Stop all interrupts}
- /$2E { CS:}
- /$80/$0E/>STATUS/<INUSE { Or by [<Status],<InUse ; Set Active bit}
- {; Switch the SS:Sp reg pair over to ES:Si}
- {; Put Turbo's Stack pointers into SS:Sp}
- /$2E { CS:}
- /$8C/$1E/>DOSDSEG { Mov [>DosDSeg],DS ; Save DOS DataSegment}
- /$2E { CS:}
- /$8C/$16/>DOSSSEG { Mov [>DosSSeg],SS ; Save Dos Stack Segment}
- /$2E { CS:}
- /$89/$26/>DOSSPTR { Mov [>DosSPtr],Sp ; Save Dos Stack Ptr}
- {; Stack Dos/User interrupted pgm regs for Exit.}
- {; These are the original interrupt process regs}
- {; that must be returned on interrupt return}
- /$2E { CS:}
- /$8E/$16/>OURSSEG { Mov SS,[>OurSSeg]}
- /$2E { CS:}
- /$8E/$1E/>OURDSEG { Mov DS,[>OurDSeg]}
- /$8B/$26/$74/$01 { Mov Sp,[$174] ; Sp set by code at $B2B in Turbo initialization}
- /$55 { Push Bp}
- /$50 { Push Ax}
- /$53 { Push Bx}
- /$51 { Push Cx}
- /$52 { Push Dx}
- /$56 { Push Si}
- /$57 { Push Di}
- /$06 { Push Es}
- /$FB { STI ; Enable Interrupts}
- {;...........................................................................}
- );
-