ibara / 8088ify

The famous Intel 8080 CP/M 2.2 to Intel 8086/8088 MS-DOS assembly language translator.
https://briancallahan.net/blog/20210606.html
ISC License
87 stars 4 forks source link

Simplify translation of `call 0`/`jmp 0`/`call 5`/`jmp 5` #4

Closed tkchia closed 3 years ago

tkchia commented 3 years ago

Proposed changes:

Thank you!

ibara commented 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.

tkchia commented 3 years ago

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!

ibara commented 3 years ago

OK. Let's stick with what you have for now. We can revisit the MS-DOS < 2 question later.

tkchia commented 3 years ago

@ibara : OK, thank you!