*** Welcome to piglix ***

COM file

COM
Filename extension .COM
Type of format Executable
Extended to DOS MZ executable

A COM file is a type of simple executable file. On the Digital Equipment operating systems of the 1970s, .COM was used as a filename extension for text files containing commands to be issued to the operating system (similar to a batch file). With the introduction of CP/M (a microcomputer operating system), the type of files commonly associated with COM extension changed to that of executable files. This convention was later carried over to MS-DOS. Even when complemented by the more general .exe file format for executables, the compact COM files remain viable and frequently used in MS-DOS.

The .COM file name extension has no relation to the .com (for "commercial") top-level Internet domain name. However, this similarity in name has been exploited by malicious computer virus writers.

The COM format is the original binary executable format used in CP/M and MS-DOS. It is very simple; it has no header (with the exception of CP/M 3 files), and contains no standard metadata, only code and data. This simplicity exacts a price: the binary has a maximum size of 65,280 (FF00h) bytes (256 bytes short of 64 KB) and stores all its code and data in one segment.

Since it lacks relocation information, it is loaded by the operating system at a pre-set address, at offset 0100h immediately following the PSP, where it is executed (hence the limitation of the executable's size): the entry point is fixed at 0100h. This was not an issue on early 8-bit machines because of how the segmentation model works, but it is the main reason why the format fell into disuse soon after the introduction of 16- and then 32-bit processors with their much larger, segmented memory.


...
Wikipedia

...