TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: SYLVAIN LAUZON
from: DENIS BOYLES
date: 1997-04-13 18:12:00
subject: dosdebug.asm

SL>Allo Denis!
SL>Here is the program you sent me. I modified it to practice with the 
xample
SL>of dos stack swaping. I really want to make it. If you can find the "bug"
SL>send it back.
SL>YourStack   DD 00000000
SL>MyStack     DD 00000000
SL>NewCas PROC
SL>    cmp     AX,8500h                   ;keyboard calls this if ALT-SYSRQ 
pres
SL>    jne     NC1                        ;if not, then chain to previous 
handle
       cli
You should disable the interrupts during the switch. Otherwise an
interrupt might occur and get a different stack than intended.
SL>    mov word ptr [YourStack][0],sp   ;
SL>    mov word ptr [YourStack][2],ss   ;
SL>    mov ss,cs: word ptr [MyStack][2] ;
SL>    mov sp,cs: word ptr [MyStack][0] ;
       sti
Then turn the interrupts back on again, if you wish so as not to be an
interrupt hog. :)
Cheers,
  Denis Boyles
 * OLX 2.1 TD * It's only a hobby ... only a hobby ... only a
--- Maximus/2 3.01
---------------
* Origin: Frog Hollow Port Moody BC 604-469-0264/0284 (1:153/290)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.