home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 June
/
SIMTEL_0692.cdr
/
msdos
/
turbopas
/
stay42.arc
/
STAYRSTR.420
< prev
next >
Wrap
Text File
|
1986-08-06
|
4KB
|
67 lines
Inline(
{;****************************************************************************;}
{; S T A Y R S T R . I N C ;}
{; ;}
{; This is the StayRstr.Inc file included above ;}
{;****************************************************************************;}
{;Version 4.15}
{ ; Inline Code to restore the stack and regs moved}
{ ; to the Turbo Resident Stack which allows}
{ ; Turbo Terminate & Stay Resident programs.}
{ ; Copr. 1985, 1986}
{ ; Author: Lane Ferris}
{ ; - The Hunter's Helper -}
{ ; Distributed to the Public Domain for use without profit.}
{ ; Original Version 5.15.85}
{;----------------------------------------------------------------------;}
{; Restore the Dos (or interrupted pgm) Regs and Stack ;}
{;----------------------------------------------------------------------;}
{; Replace the Users Saved Stack}
{; Note that pushes on the stack go in the opposite direction of our}
{; moves. Thus we dont worry about REP stack activity overlaying the}
{; enabled REP fuction.}
$FA { CLI}
/$2E { CS: ;Avoid stack manipulation if never "StaySaved"}
/$A1/>DOSSSIZ { Mov Ax,[>DosSsiz]}
/$09/$C0 { Or Ax,Ax}
/$74/$20 { Jz NotinDos}
/$8C/$D0 { Mov Ax,SS ;Source is our Stack}
/$8E/$D8 { Mov DS,Ax}
/$89/$E6 { Mov Si,Sp ;Point to Last used USER word on our stack}
/$46 { Inc Si}
/$46 { Inc Si}
/$2E { CS:}
/$8E/$06/>DOSSSEG { Mov ES,[>DosSSeg] ;Dest is Dos indos primary Stack}
/$2E { CS:}
/$8B/$3E/>DOSSPTR { Mov Di,[>DosSptr]}
/$2E { CS:}
/$8B/$0E/>DOSSSIZ { Mov Cx,[>DosSsiz] ;Saved words}
/$29/$CF { Sub Di,Cx ;point to last used word of Dos stack}
/$29/$CF { Sub Di,Cx}
/$FC { CLD}
/$F2/$A5 { Rep Movsw ;Careful! Interrupt are enabled here}
/$89/$F4 { Mov Sp,Si ;Skip over moved words}
{;--}
{NotinDos:}
/$07 { Pop Es}
/$5F { Pop Di}
/$5E { Pop Si}
/$5A { Pop Dx}
/$59 { Pop Cx}
/$5B { Pop Bx}
/$58 { Pop Ax}
/$2E { CS:}
/$80/$26/>STATUS/<FOXS-INUSE-HOTKEY_ON{ And by [<Status],<Foxs-Inuse-HotKey_on ; Clear INUSE flag}
/$2E { CS: ; .. and HotKey}
/$8E/$1E/>USRDSEG { Mov DS,[<UsrDSeg]}
/$2E { CS:}
/$8E/$16/>USRSSEG { Mov SS,[<UsrSSeg]}
/$2E { CS:}
/$8B/$26/>USRSPTR { Mov SP,[<UsrSPtr]}
/$5D { Pop Bp ; Remove Bp,Sp from Procedure entry}
/$5D { Pop Bp}
/$FB { STI ; enable interrupts}
/$C3 { RET}
{;.......................................................................}
);