Difference between revisions of "AMSDOS Header"
From CPCWiki - THE Amstrad CPC encyclopedia!
(Link to details in Firmware Guide chapter 9, page 4.) |
(wrong byte offsets for file length and checksum (thanks to Targhan)) |
||
Line 9: | Line 9: | ||
Byte 24 and 25: file length | Byte 24 and 25: file length | ||
Byte 26 and 27: execution address for machine code programs | Byte 26 and 27: execution address for machine code programs | ||
− | Byte 64 and 65: checksum for byte 00 to byte 66 | + | Byte 64 and 65: (file length) |
− | + | Byte 67 and 68: checksum for byte 00 to byte 66 | |
</pre> | </pre> | ||
Revision as of 16:03, 23 March 2014
In AMSDOS it is possible to store files in two ways: headerless and with a header. Headerless files are often files which were created with OPENOUT and SAVE"filename",a. Programs normally have a file header, which is consists of 128 bytes and contains the following data:
Byte 00: User number Byte 01 to 08: filename Byte 09 bis 11: Extension Byte 18: type-byte Byte 21 and 22: loading address Byte 24 and 25: file length Byte 26 and 27: execution address for machine code programs Byte 64 and 65: (file length) Byte 67 and 68: checksum for byte 00 to byte 66
To calculate the checksum, just add byte 00 to byte 66 to each other.
This is only a summary. All details are in Firmware Guide chapter 9, page 4.