MOS Technology file format

The MOS Technology file format is a file format that conveys binary information in ASCII text form.

History
The KIM-1 single-board computer specified a file format for magnetic tape and a format for paper tape. The paper tape format was adapted slightly and has been used to interchange files for computers based on the MOS Technology 6502 microprocessor.

The open-source Srecord package simplified this tape format by eliminating the  and XOFF characters.

Format
Each record begins with a semicolon, followed by two hexadecimal digits denoting the length of the data in the record. The next two bytes represent the starting address of the data, in big-endian (most-significant byte first) hexadecimal. Up to 24 bytes of data follow. Then, there is a 2-byte (4-character) checksum: the sum of the other non-; data in the record. Finally, a record ends with a carriage return (), a line break (), and six null characters ().

The last record on the paper tape is empty (its length field is 0000), with the starting address field representing the total number of data bytes contained in the transmission. The file ends with a XOFF.