bill@hp-pcd.UUCP (bill) (10/09/86)
Each data record of Intel Hex format is a line of ascii text that looks something like this: : Start character BC Byte count. Two-digit Hexadecimal number of data bytes in the record. AAAA Four-digit hexadecimal Address of first data byte in the record. TT Two-digit hexadecimal Record Type. "00" for a data record. DD First two-digit hexadecimal data byte in this record.} ... ... } BC data bytes DD Last two-digit hexadecimal data byte in this record. } (see above) CC Two-digit hexadecimal Checksum. This is the two's complement of the binary summation of the preceding byte count (BC), address (AAAA), and data bytes (DD). <cr> Carriage return at end of record <lf> Line feed at end of record After all of the data records, you might find an end-of-file record: : Start character BC Byte count. This is "00" in an EOF record. AAAA Address. TT Record type. "01" for an EOF record. CC Checksum. "FF" in an EOF record. <cr> Carriage return at end of record <lf> Line feed at end of record There's also an extended address format, which I believe lets you specify the "segment" to be applied to subsequent data records, while the addresses in the data records specify offsets within that segment. I've never used that feature, however. I think that most devices/programs that understand Intel Hex ignore control characters; the <cr><lf> is usually there to enhance readability, and isn't really necessary. For that matter, you can probably put anything you want after the checksum field of one record and the ":" start character of the next record. bill frolik hp-pcd!bill Hewlett-Packard Portable Computer Division Corvallis, Oregon