MB>From: Mervyn Baldwin
MB>Subject: Re: Bosskey.Asm - sysreq.asm
MB>Hello Folks,
MB>New kid on block coming to you via e-mail.
MB>>It's not the same on the return. Which is major crash problem one. SS:SP
are
MB>>toasted after the INT 2E call.
MB>Need advice re INT 2eh. Have always heard it to be a dodgy INT, prone
MB>to cause worst sort of crashes. Is this true? Is it safe to use it
MB>instead of EXEC? Are there precautions which make it safer?
According to my reference ("PC Interrupts" by Ralf Brown & Jim Kyle), all
registers except for CS:IP get destroyed on return from an int 2Eh... however
you could do something like this:
******
.DATA
SaveSS dw ?
SaveSP dw ?
SaveBP dw ?
.CODE
SafeInt2Eh:
MOV [SaveSS], SS
MOV [SaveSP], SP
MOV [SaveBP], BP
INT 2Eh
CLI ; make sure the restoration of the registers in uninterrupted
MOV AX, SEG _DATA
MOV DS, AX
MOV SP, [SaveSP]
MOV SS, [SaveSS]
MOV BP, [SaveBP]
STI ; registers restored, so interrupts OK
RET
******
Normally you might PUSH registers to preserve them before an interrupt, but
since SS:SP is also destroyed, you have to take different precautions.
((Cloud))
MauveCloud@juno.com
* OLX 2.2 * A dry sense of humor is better than slobbering everywhere
--- PCBoard (R) v15.3/M 10
---------------
* Origin: Next time, Dial The Wrong Number! (209) 943-1880 (1:208/205)
|