COM: Difference between revisions

Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content deleted Content added
basic description
 
added loading and see also sections
Line 1: Line 1:
'''This is about the executable format, not Microsoft's [[Component Object Model]]'''
{{Stub}}
{{Stub}}
{{File formats}}
{{File formats}}
==COM Files==

===Introduction===
COM files are extremely simple, making them useful if you want to load programs but you don't want to worry about relocating symbols, reading file headers, and other complications. However, their simplicity makes their usefulness limited, so you'll definitely want to support something more complex but useful, once your OS is advanced.
COM files are extremely simple, making them useful if you want to load programs but you don't want to worry about relocating symbols, reading file headers, and other complications. However, their simplicity makes their usefulness limited, so you'll definitely want to support something more complex but useful, once your OS is advanced.


Line 9: Line 11:


COM files usually terminate with a RET instruction. The operating system starts the COM program using a CALL instruction, so RET returns to the OS, allowing any cleanup (like restarting the command prompt).
COM files usually terminate with a RET instruction. The operating system starts the COM program using a CALL instruction, so RET returns to the OS, allowing any cleanup (like restarting the command prompt).
===Loading===
To load a COM file you need to load it to a low memory location, set ds and es to be pointing to the start of the file with an 0x100 org, and jump to the start, with offset 0x100.
==See also==
===Executables===
====16 bit====
*[[MZ]]
*[[NE]]
====32 bit====
*[[PE]]