5.2. Intel Extended HEX

Extended means that Intel added an additional record type to the original standard when the 8086 came along, to accomodate program segments.

There are four types of records that may make up a hex file:

  1. Extended address record
  2. Start address record
  3. Data record
  4. end of file record

Each record begins with a record mark (a colon), and ends with carriage return. Each record has a length field which specifies the number of bytes of info or data which follows the record type field. Note that one byte is represented by two ascii characters. Each record ends with a checksum field that contains the ascii hex representation of the two's complement of the eight-bit sum of the eight-bit bytes that result from converting each pair of hexadecimal digits to one byte of binary, from and including the record length field to and including the last byte of the data field. Therefore, the sum of all the ascii pairs in a record after converting to binary, from the record length field to and including the checksum field, is zero. The following are the formats of the different records. Note that in the real records, there are no spaces, they have been inserted here for clarity.

Intel hexadecimal Object File Format Specification Revision A, 1/6/88