TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: SYLVAIN LAUZON
from: DENIS BOYLES
date: 1997-04-18 10:46:00
subject: Switching Stacks

SL>The program worked until i load something in memory. I modified it a bit
SL>but still bug. The keyboard interrupt didn't respond correctly after its
SL>execution. Take a look on what i added. nothing fancy and should work 
t??
SL>NewTck PROC
SL>    pusha
SL>    pusha
You don't need the extra pusha, since the first one will save the
registers. Anyway I've found the "big" problem, change the second pusha
into a PUSH ES.
SL>    cmp byte ptr es:[bx],00h
SL>    jnz short Exit
SL>    popa
SL>    pusha
Again the pop/push are extras which aren't needed, remove those two lines
entirely.
SL>Exit:
SL>    popa                                    ;pop all registers
SL>    popa
Same thing again, but now change the first popa into a POP ES. Now try the
program, it should work now, or atleast no crash.
[ie:
    pusha
    push ES
    ...
    pop  ES
    popa]
Why? Well, I just doubled checked the PUSHA instruction and it ONLY saves
the following registers: AX,BX,CX,DX,SP,BP,SI,DI
You note that ES isn't among them. Since you modified it within the
handler, you must save this as a seperate PUSH ES call. The same thing goes
with popa, so you must use a seperate POP ES to restore ES.
Shreddies! :?
  Denis Boyles
 * OLX 2.1 TD * Chicken heads are the chief food of captive alligators.
--- 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™.