4 ms·
It's a plain 16-bit executable without headers or linking information. Specific to DOS.
by nanochess 7y ago
It's a plain 16-bit executable without headers or linking information. Specific to DOS.
- johannes1234321 7y agoWhich essentially is equal to a raw machine binary, except that the MBR's boot loader is mapped to 0x7c00, while DOS's COM loader maps the start at 0x1000. Of course the pure MBR version has no access to DOS interrupt handlers for IO access or similar. (Interrupt 0x21)
- farmerbb 7y agoInteresting that, when you compare the MBR and COM versions side-by-side in a hex editor, the only changes (apart from the required few bytes at the end of the MBR version) are in what I assume are memory addresses: a 7D byte in the MBR version ends up being 02 in the COM version. One higher than 7C and 01 in the respective starting addresses.
- johannes1234321 7y agoYou can also easily see this in the (really nice) code, where the only difference is the starting address set at https://github.com/nanochess/Pillman/blob/master/pillman.asm#L50 https://github.com/nanochess/Pillman/blob/master/pillman.asm... and the MBR magic bytes in the very bottom. If you now wonder what the difference between a .com and a .exe file is: A .com file has a single page which is loaded in that specific location, with all addresses in the code assuming absolute addresses. The .exe (MZ file) allows DOS to put the program anywhere into memory and the rewrite address references (or rather segments) according the relocation table from the program header. With MZ files DOS also sets up space for the stack and sets registers accordingly.