Just a precaution. I’m a complete noob on assembly. My only question is that only the following commands in DOS:
MOV AH, 09
INT 21
MOV AX, 4C01
INT 21
Does the second interrupt still have the parameter 09 meaning display screen or does the AX change that in some way?
You need to search for Ralf Brown’s Interrupt List, it’s the definitive guide to these old DOS/Windows interrupts.
Calling INT 21h with AH = 09H outputs a
$-terminated string located atDS:DXto the console.Calling INT 21H with AH = 4cH exits your program with the return code in
AL(01H in this case).The second call will not have
AHset to09Hsimply becauseAHis simply the upper 8 bits ofAX. The secondMOVsetsAHto4cHas part of settingAX:In more detail (from Wikipedia):
This register-made-from-other-registers has a long history at Intel with:
axbeing made up ofahandal;eaxbeing made up from 16 bits plus the other 16 fromax;raxbeing made up of 32 bits plus the other 32 fromeax.along with similar approaches for the other general purpose registers and special registers like index or base registers, and the stack pointer.
Interestingly enough, they didn’t duplicate the ability to access the high halves of the expanded registers, such as with
eaxbeing made up ofeahandeal(both mythical, but the latter being an alias forax).That would have given us a large cache of extra small registers in higher modes, though I’m not sure what the cost would have been (no doubt Intel/AMD do know the cost and it was probably deemed too expensive).