Skip to main content
Renesas Singapore - Knowledgebase

What is Intel HEX format when ordering ROM code?

Latest Updated:04/01/2006


I was told to use Intel HEX format when ordering ROM code.  What is Intel HEX format?


Intel HEX (hexadecimal) format is a format used when dealing with objects (machine-language code). In this format, each byte is converted to a two-digit hexadecimal value by ASCII code.
Each record (line of code) can represent up to 255 bytes of data, and this conversion is repeated for the required amount of data. A detailed example of this format is shown below.

":" indicates the start of a record.
 The next two hexadecimal digits (10) indicate the record's data length (the number of data).
 The next four hexadecimal digits (0000) indicate the data's address.
 The next two hexadecimal digits (10) indicate the record type (in this case, it shows the type is a data record).
("00" indicates data record, "01" indicates end record, and "02" indicates segment record.)
 This section contains the actual data. The data values here are "00", "01", "02", and so on up to "0E" and "0F."
 These last two hexadecimal digits are used for error checking (checksum). This checks whether or not the lower eight bits are "00" in the sum obtained by adding the hexadecimal values starting from the data length value.

Finally, a carriage return code is appended to the end of each line to complete it as a record.
The second line is an end record with the data length  = "00" and the record type  = "01."


The above type of record can indicate only 16-bit addresses (64-Kbyte address spaces).
A segment record (record type 02) can be used to specify larger addresses.
In the example below, a segment record has been inserted before the first line of code that was shown in the above example.
Segment values specified in a segment record are multiplied by 16 and added to the following record's address specification.
In this case, "1000 (H)" () is specified as a segment value, so it means that the following data is stored to the address range from 10000H to 1000FH.

Suitable Products
  • Was this article helpful?