Changes

AMSDOS Header

135 bytes added, 02:39, 13 January 2021
Update summary to a table
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 consist of 128 bytes and contain the following data:
Byte 00: {| class="wikitable"|-! Size !! Name !! Notes|-| BYTE || User number (value from || 0 to -15 , or #E5 for deleted entries) Byte 01 to 08: filename (fill unused char |-| 8 BYTES || Filename || Unused characters are filled with spaces)space Byte 09 to 11: |-| 3 BYTES || Extension (fill unused char || Unused characters are filled with spaces)space Byte 16: first block (tape |-| BYTE || Block number || Tape only) Byte 17: first |-| BYTE || Last block (tape || Tape only) Byte 18: file |-| BYTE || File type (|| 0:basic BASIC 1:protected Protected 2:binaryBinary (ASCII files don't have headers) Byte 21 and 22: loading |-| WORD || Length || ???|-| WORD || Load address LSB first|| Byte 23: first |-| BYTE || First block (tape || Tape only?) Byte 24 and 25: |-| WORD || Logical length || Actual file length LSB firstis here Byte 26 and 27: execution |-| WORD || Entry address for machine code program LSB first|| Byte 64 and 66: 24 bits file |-| 36 BYTES || Unused || |-| 3 BYTES || Real length LSB first|| 24-bit number. Just a copy, not used! Byte 67 and 68: checksum for |-| WORD || Checksum || Unsigned sum of all bytes 00until this field|-66 stored LSB first Byte 69 to 127: undefined content, free | 59 BYTES || Unused || Free to use|}
To calculate the checksum just add all bytes from 00 up to and including byte 66 together.
11
edits