Text File

Aunc.3389 net.micro utzoo!decvax!duke!unc!jqw Sun May 2 20:35:47 1982 Intel Hex Format

Thanks to all the replies to my question, here is the complete (?) Intel hex format. Note that bytes are stored as ASCII hex nybbles, 00 to FF All calculations (length and checksum) are made with original bytes, not ASCII representation.

The general form of a record is as follows:

:LLaaaaRRdddd..ddCC

where LL is the number of bytes of data between RR and CC, not including RR or CC. aaaa is an address (see below), RR is a record type, dd are data bytes, and CC is a checksum, calculated as follows: CC = - ( LL + aaaa + RR + dd + dd + ... ( modulo 256 ) ) That is, adding all the bytes LL to CC (inclusive), you should get zero.

For sixteen-bit address files (for 8080 and Z80) these are the record types needed: RR = 00 record type = data. aaaa is the load address for the data. RR = 01 record type = end of file. aaaa is the beginning execution address. LL is 00. :00aaaa01CC

For extended address files (for 8086, etc.), there are two more record types.

RR = 02 record type = Extended Address :02000002eeeeCC where "eeee" is bits 4 to 19 of the address where data should be loaded. All addresses in data records are added to this to form the full address. If there is no extended address record, the base address is assumed to be zero.

RR = 03 record type = Start Address :04000003PPPPiiiiCC where PPPP is the 8086 code segment register, and iiii is the Instruction pointer register. If this record is used, the address in the end of file record should be set to zero.

----------------------------------------------------------------- gopher://quux.org/ conversion by John Goerzen <jgoerzen@complete.org> of http://communication.ucsd.edu/A-News/

This Usenet Oldnews Archive article may be copied and distributed freely, provided:

1. There is no money collected for the text(s) of the articles.

2. The following notice remains appended to each copy:

The Usenet Oldnews Archive: Compilation Copyright (C) 1981, 1996 Bruce Jones, Henry Spencer, David Wiseman.