Intel's COM (Command Executable) File Format

The COM files are raw binary executables and are a leftover from the old CP/M machines with 64K RAM. A COM program can only have a size of less than one segment (64K), including code and static data since no fixups for segment relocation or anything else is included. One method to check for a COM file is to check if the first byte in the file could be a valid jump or call opcode, but this is a very weak test since a COM file is not required to start with a jump or a call. In principle, a COM file is just loaded at offset 100h in the segment and then executed.

OFFSET Count TYPEDescription
0000h1 byte ID=0E9hID=0EBh
Those are not safe ways to determine wether a file is a COM file or not, but most COM files start with a jump.

No comments: