Hello Barry,
BB> ...the stack is the same on return from Int 2E.
DB> It's not the same on the return.
DB> SS:SP are toasted after the INT 2E call.
DB> BEFORE INT 2E CALL
DB> SS = 1538 SP = FFFE
DB> AFTER INT 2E CALL
DB> SS = 0E38 SP = 0603
DB> Which is why...SS:SP...needs to be saved.
BB> I reassembled with the 2 relevant lines rem'ed out.
BB> My OS is ms-dos 6.20 rev. A
The above test was with MS-DOS v6.20 rev A too.
BB> I tried to use the debug.exe that came with dos 6.20, but the tsr
Here's my "test" that I used with DOS's debug program:
=] INT2ETST.DBG [==========================================================
A
mov BX,200 ;need to adjust memory size freeing some for COMMAND.COM
mov CL,4 ;otherwise you'll get a memory error with COMMAND.COM
shr BX,CL
inc BX
mov AH,4A
int 21
mov SI,80
int 2E
NINT2ETST.COM
RCX
200
W
Q
===========================================================================
Snip 'N' save the test to the indicated file above. Then use
DEBUG < INT2ETST.DBG to create the COM file.
Now from the command line, try this:
DEBUG INT2ETST.COM VER
Then (P)roceed step through the code, you'll notice that after the INT 2E
call EVERYthing except CS:IP is destroyed. (with my DOS it is)
When I say EVERYthing, I mean it, I just noticed some extras ones being
destroyed. Here's a run down of my findings for the individual registers.
AX - destroyed CS - preserved BP - destroyed SI - destroyed
BX - destroyed DS - destroyed IP - --------- DI - destroyed
CX - destroyed ES - destroyed SP - destroyed
DX - destroyed SS - destroyed flags - destroyed
"destroyed" means the original value before the call was modified in some
way. "preserved" means the original value maintained itself during the call.
The important ones here would be: SS:SP, DS and the flags, the rest can
probably be junked as is.
Cheers,
... Documentation - The worst part of programming.
___ Blue Wave/QWK v2.12
--- Maximus/2 3.01
---------------
* Origin: Frog Hollow Port Moody BC 604-469-0264/0284 (1:153/290)
|