Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!kitty!larry From: larry@kitty.UUCP (Larry Lippman) Newsgroups: net.micro,net.micro.cpm Subject: Re: looking for information on Intel Hex file format Message-ID: <1321@kitty.UUCP> Date: Wed, 8-Oct-86 21:28:58 EDT Article-I.D.: kitty.1321 Posted: Wed Oct 8 21:28:58 1986 Date-Received: Thu, 9-Oct-86 05:34:44 EDT References: <753@ur-tut.UUCP> Organization: Recognition Research Corp., Clarence, NY Lines: 26 Keywords: Intel hex format opcode Summary: And the format is... Xref: mnetor net.micro:6220 net.micro.cpm:2456 In article <753@ur-tut.UUCP>, tuba@ur-tut.UUCP (Jon Krueger) writes: > > I have a file in Intel Hex format. This is a hex representation of a binary > file. I need to decode it and, ultimately, load it into memory. Does > anyone know how to read these files? How to interpret the different fields? The start of record character is a colon [:]. This is followed by a 2-digit (in HEX) byte count that establishes the record length. This is followed by a 4-digit loading address. This is followed by a 2-digit record type, for which ``00'' denotes a data record, and ``01'' denotes end-of-file record. The next field consists of data in HEX, with two characters per byte. The last field is a 2-digit HEX field which is a checksum, based upon the 2's complement of the binary sum of all the the bytes in the record. For _contiguously_ loaded memory data, the record length is generally always 16 bytes of data, with the last record often being less than 16 bytes. If the first loading address does not begin on a ``0'' boundary, then the first record may be adjusted to be less than 16 bytes so that all subsequent records begin on boundaries ending in ``0''. There is no requirement for this boundary adjustment other than to improve human readability of the HEX file. Since there are no spaces in the hex file, human readability is a bitch - but one gets used to it after a while... ==> Larry Lippman @ Recognition Research Corp., Clarence, New York ==> UUCP: {allegra|decvax|rocksanne|rocksvax|watmath}!sunybcs!kitty!larry ==> VOICE: 716/688-1231 {hplabs|ihnp4|seismo|utzoo}!/ ==> FAX: 716/741-9635 {G1,G2,G3} "Have you hugged your cat today?"