Closed tkchia closed 3 years ago
Hello --
I think the push ax/pop ax came from DRI's tool and probably doesn't make much sense for MS-DOS.
What do you think about leaving jmp and call to 0000h as-is? That should work for all MS-DOS and allow us to de-special case 0000h entirely, which would be nice.
Hello @ibara,
I think the push ax/pop ax came from DRI's tool and probably doesn't make much sense for MS-DOS.
Thanks for the information.
What do you think about leaving jmp and call to 0000h as-is? That should work for all MS-DOS and allow us to de-special case 0000h entirely, which would be nice.
Leaving jmp 0
and call 0
as-is should Just Work on all versions of MS-DOS (including 1.x) — as long as the cs
register points to the Program Segment Prefix.
PSP:0 will always point to an int 0x20
instruction. int 0x20
wil terminate the program as long as cs
= PSP.
For .com
files, cs
= PSP at startup always. For .exe
files though — needed for small memory model support — this will need to be specially ensured.
Thank you!
OK. Let's stick with what you have for now. We can revisit the MS-DOS < 2 question later.
@ibara : OK, thank you!
Proposed changes:
push ax
andpop ax
surrounding each system call translated fromcall 5
/jmp 5
. I believe this is more correct: some CP/M (and MS-DOS 1.x) syscalls return status codes in thea
(oral
) register, andpush ax
...pop ax
will destroy these.cl
=dl
= 0 when exiting the program viaint 0x21
,ah
=0x4c
. The only parameter the syscall accepts is an exit status, which will come fromal
.int 0x20
here, which will work on MS-DOS < 2. Yet another alternative might be to simply leavecall 0
andjmp 0
as-is.)Thank you!