Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!apple!voder!pyramid!prls!gordon From: gordon@prls.UUCP (Gordon Vickers) Newsgroups: comp.os.cpm Subject: Re: Intel hex (*.HEX) format questions Message-ID: <19411@prls.UUCP> Date: 24 Feb 89 18:05:54 GMT References: <1796@uop.edu> Reply-To: gordon@prls.UUCP (Gordon Vickers) Organization: Philips Research Labs, Sunnyvale, California Lines: 43 In article <1796@uop.edu> mrapple@uop.edu (Nick Sayer) writes: >Anyone have some cold, hard facts concerning the Intel .HEX format? I was going to email this to Mr. Sayer but it seems like something that many would like to know. There are two forms of Intel Hex format. One is often referred to as Intellect format, the other is Extended Intellec. I beleive that the former is also known as Motorala 'S' records. Intellect format: :100000007320457175697320446f7320457175693c : 10 0000 00 7320457175697320446f732045717569 5c | | | | |--------- data ---------------| |- check sum | | | |-- record type, 00 = data, 01 = End record | | |-- start address for data | |- number of bytes in record (normally ten, but last line may have less) |- start of a record, if you don't have this, line is ignored Extended Intellect format As above but recognizes a record type 02. Record type 02 is followd by a four digit base address and the checksum. Addresses in subsequent type 00 and type 01 records are relitive to this base address. This allows address up to FFFFF to be specified. In both formats the checksum is determined by: remove start code and checksum from line ( :5c ) add the remaining bytes together ( 10+00+00+00+73+20.......+69 = A4 ) compilment and add 1 ( A4 xor ff = 5b, 5b + 1 = 5c ) the result is the checksum: 5c This is an oversimplification. Remember to add the values in the bit stream (the actual binary values) and not the ascii values of the numbers that get printed to the record. Don't forget to change the checksum into two ascii digits when tacking it on the the end of the record. Hope this helps. Referance: Stag PP39 device programmer's manual. Gordon Vickers 408/991-5370 (Sunnyvale,Ca); {mips|pyramid|philabs}!prls!gordon Every extinction, whether animal, mineral, or vegetable, hastens our own demise.