Intel HEX file format:
http://en.wikipedia.org/wiki/Intel_HEX
Also useful:
http://www.8052.com/tutintel.phtml
The basic formatting is this:
Each line must have the format ":LLAAAATT<data>SS"
Where:
1st char is a colon
Everything afterward are 2-hex-char (high-nibble/low-nibble) representations of bytes, eg. "12"==0x12
Those bytes are:
LL is the length
AAAA is the address
TT is the record type
<data> is 'LL' of data bytes
SS is the checksum
The line sequence is:
An Address record (rectype=EXTSEG, STARTSEG, EXTLINADDR, or STARTLINADDR)
Any number of Data records (rectype=DATA)
Either:
An EOF record, or
Another Address record (with attendant data records)