CMD file (CP/M)
From Wikipedia, the free encyclopedia
In CP/M-86, CMD is the filename extension used by executable programs. It corresponds to COM in CP/M-80 and EXE in MS-DOS.
[edit] Binary format
b CMD file has a 128-byte header, followed by 1-8 groups of code or data. Each group can be up to 1 megabyte in size. In later versions of the format, CMD files can also contain relocation information and Resident System Extensions.
The start of the header lists the groups present in the file, and their types. Each type can be used at most once; they are:
- Code
- Data
- Extra
- Stack
- User 1
- User 2
- User 3
- User 4
- Shared Code (Code and Shared Code cannot be present in the same file).
The first 256 bytes of the data group must be zero; they will be populated by CP/M-86 with the zero page (comparable to the Program Segment Prefix in MS-DOS). If there is no data group, then the first 256 bytes of the code group will be used instead.