## hpr4011 :: The Intel Hex file format

 notes:
https://en.wikipedia.org/wiki/Intel_HEX
an example intel hex file with 1 record containing 3 data bytes (02h
33h 7ah) and an end of file marker:
:03|0030|00|02337A|1E
:00000001FF
espeak incantation:
espeak-ng -v mb-us3 -s 163 -p 38 -f intel-hex.org -w intel-hex.wav
script:
Hello Hacker Public Radio, Brian in Ohio here. I am out from under my
rock and this episode is about an old file format that despite its age
is still in use in many places today.
That format is the Intel Hex format. What is this format? Glad you
asked.
From the book of knowledge we read,
Intel hexadecimal object file format, Intel hex format or Intellec
Hex is a file format that conveys binary information in ASCII text
form.
If you have ever programmed an arduino board the file that is used to
program the board.
The file generated by the arduino eye dee eee is an intel hex
file.
The format consists of any number of lines, called records.
Intel HEX consists of lines of ASCII text that are separated by line
feed or carriage return characters or both.
Each text line contains uppercase hexadecimal characters that encode
multiple binary numbers.
The binary numbers may represent data, memory addresses, or other
values, depending on their position in the line and the type and length
of the line.
Each text line is called a record.
A record consists of six fields that appear in order from left to
right

Start code, one character, an ASCII colon.
Byte count, indicating the number of bytes in the data field.
Address, four hex digits, representing the 16-bit beginning memory
address offset of the data.
Record type two hex digits, 00 to 05, defining the meaning of the
data field.
Data, a sequence of bytes of data
Checksum, a computed value that can be used to verify the record has
no errors.

An end of file record must occur exactly once per file in the last
record of the file. The byte count is 00, the address field is typically
0000 and the data field is omitted.
A record's checksum byte is the two's complement of the least
significant byte of the sum of all decoded byte values in the record
preceding the checksum.
It is computed by summing the decoded byte values and extracting the
least significant byte of the sum, and then calculating the two's
complement of the sum, by inverting its bits and adding one.
I have included in the show notes an example of a record with pipes
used to break up the line.
Hope you enjoyed the espeak episode.
There are so many ways to produce shows, there is no excuse not
to!
This is Brian in Ohio signing off reminding everyone.
We are all creatures of ego.
