DOS executable (.com)
m |
|||
Line 1: | Line 1: | ||
{{FormatInfo | {{FormatInfo | ||
− | |subcat=Executables | + | | subcat = Executables |
− | |extensions={{ext|com | + | | extensions = {{ext|com}} |
− | + | ||
− | + | ||
}} | }} | ||
− | + | '''COM''' ("command file") is the native executable format of [[wikipedia:CP/M|CP/M]]. The format was inherited by the DOS family of operating systems; MS-DOS 1.0 introduced [[MS-DOS EXE|MZ]] as a replacement. COM files are raw, flat binaries without relocations; there are no identifying headers or magic numbers, except for a variant introduced in CP/M 3 which contains a 256-byte header. | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | On PC computers, COM files are loaded at fixed offset 0x100 in an arbitrary [[wikipedia:x86 memory segmentation#Real mode|real mode memory segment]]. The entry point is located at the start of the file. Many COM files start with a jump instruction (opcode <code>0xe9</code> or <code>0xeb</code>), but this isn't required. Since the executable is limited to a single segment, the maximum size of a COM file is 65280 (0xff00) bytes. | |
− | + | Some files carrying the <code>.com</code> extension are in fact in the [[MS-DOS EXE|MZ]] format: for example, the <code>COMMAND.COM</code> and <code>EDIT.COM</code> binaries distributed with Windows 95 and later are MZ executables. The DOS loader can detect this and load the file appropriately. | |
− | ==References== | + | == References == |
− | *[ | + | * [[Wikipedia: COM file]] |
− | *[http://www.fileformat.info/format/com/corion.htm Entry] on fileformat.info | + | * [http://www.fileformat.info/format/com/corion.htm Entry] on fileformat.info |
− | + |
Revision as of 18:56, 27 August 2015
COM ("command file") is the native executable format of CP/M. The format was inherited by the DOS family of operating systems; MS-DOS 1.0 introduced MZ as a replacement. COM files are raw, flat binaries without relocations; there are no identifying headers or magic numbers, except for a variant introduced in CP/M 3 which contains a 256-byte header.
On PC computers, COM files are loaded at fixed offset 0x100 in an arbitrary real mode memory segment. The entry point is located at the start of the file. Many COM files start with a jump instruction (opcode 0xe9
or 0xeb
), but this isn't required. Since the executable is limited to a single segment, the maximum size of a COM file is 65280 (0xff00) bytes.
Some files carrying the .com
extension are in fact in the MZ format: for example, the COMMAND.COM
and EDIT.COM
binaries distributed with Windows 95 and later are MZ executables. The DOS loader can detect this and load the file appropriately.
References
- Wikipedia: COM file
- Entry on fileformat.info