J INTEL HEX RECORDS

Intel Hex records describe the hexadecimal object file format for 8-bit, 16-bit and 32-bit microprocessors. The hexadecimal object file is an ASCII representation of an absolute binary object file. There are six different types of records:

For the TriCore the locator generates records in the 32-bit format (4-byte addresses).

General Record Format

In the output file, the record format is:

: length offset type content checksum

Where:

: is the record header.

length is the record length which specifies the number of bytes of the content field. This value occupies one byte (two hexadecimal digits). The locator outputs records of 255 bytes (32 hexadecimal digits) or less; that is, length is never greater than FFH.

offset is the starting load offset specifying an absolute address in memory where the data is to be located when loaded by a tool. This field is two bytes long. This field is only used for Data Records. In other records this field is coded as four ASCII zero characters ('0000').

type is the record type. This value occupies one byte (two hexadecimal digits). The record types are:

Byte Type Record type
00 Data
01 End of File
02 Extended segment address (not used)
03 Start segment address (not used)
04 Extended linear address (32-bit)
05 Start linear address (32-bit)

content is the information contained in the record. This depends on the record type.

checksum is the record checksum. The locator computes the checksum by first adding the binary representation of the previous bytes (from length to content). The locator then computes the result of sum modulo 256 and subtracts the remainder from 256 (two's complement). Therefore, the sum of all bytes following the header is zero.

Extended Linear Address Record

The Extended Linear Address Record specifies the two most significant bytes (bits 16-31) of the absolute address of the first data byte in a subsequent Data Record:

: 02 0000 04 upper_address checksum

The 32-bit absolute address of a byte in a Data Record is calculated as:

where:

address is the base address, where the two most significant bytes are the upper_address and the two least significant bytes are zero.

offset is the 16-bit offset from the Data Record.

index is the index of the data byte within the Data Record (0 for the first byte).

Example:

Data Record

The Data Record specifies the actual program code and data.

: length offset 00 data checksum

The length byte specifies the number of data bytes. The locator has an option that controls the length of the output buffer for generating Data records. The default buffer length is 32 bytes.

The offset is the 16-bit starting load offset. Together with the address specified in the Extended Address Record it specifies an absolute address in memory where the data is to be located when loaded by a tool.

Example:

Start Linear Address Record

The Start Linear Address Record contains the 32-bit program execution start address.

Layout:

: 04 0000 05 address checksum

Example:

End of File Record

The hexadecimal file always ends with the following end-of-file record:


Copyright © 2002 Altium BV