DOS executable (.com)

From Just Solve the File Format Problem
(Difference between revisions)
Jump to: navigation, search
(Category:MS-DOS)
Line 3: Line 3:
 
  | 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.
+
'''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.
 
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.
+
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.
  
 
== See also ==
 
== See also ==
Line 15: Line 15:
 
* [[Wikipedia: COM file]]
 
* [[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
 +
 +
 +
[[Category:Microsoft]]
 +
[[Category:MS-DOS]]

Revision as of 16:25, 29 March 2017

File Format
Name DOS executable (.com)
Ontology
Extension(s) .com

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.

See also

References

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox