+------------------+---------------+-------------+----------------+---------------+-------------------+ | RECORD | LOAD | | | INFO | | | MARK | RECLEN | OFFSET | RECTYP | or | CHKSUM | | ': ' | | | | DATA | | +------------------+---------------+-------------+----------------+---------------+-------------------+ 1- byte 1- byte 2- bytes 1- byte n- bytes 1- byte
Each record begins with a RECORD MARK field containing 03AH, the ASCII code for the colon (': ') character.
Each record has a RECLEN field which specifies the number of bytes of information or data which follows the RECTYP field of the record. Note that one data byte is represented by two ASCII characters. The maximum value of the RECLEN field is hexadecimal 'FF' or 255.
Each record has a LOAD OFFSET field which specifies the 16- bit starting load offset of the data bytes, therefore this field is only used for Data Records. In other records where this field is not used, it should be coded as four ASCII zero characters ('0000' or 030303030H).
Each record has a RECTYP field which specifies the record type of this record. The RECTYP field is used to interpret the remaining information within the record. The encoding for all the current record types are:
00 | Data Record |
01 | End of File Record |
02 | Extended Segment Address Record |
03 | Start Segment Address Record |
04 | Extended Linear Address Record |
05 | Start Linear Address Record |
Each record has a variable length INFO/ DATA field, it consists of zero or more bytes encoded as pairs of hexadecimal digits. The interpretation of this field depends on the RECTYP field.
Each record ends with a CHKSUM field that contains the ASCII hexadecimal representation of the two's complement of the 8- bit bytes that result from converting each pair of ASCII hexadecimal digits to one byte of binary, from and including the RECLEN field to and including the last byte of the INFO/ DATA field. Therefore, the sum of all the ASCII pairs in a record after converting to binary, from the RECLEN field to and including the CHKSUM field, is zero.