<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Fri, 24 Feb 1989 20:00:37 GMT
From   : mailrus!sharkey!atanasoff!deimos.cis.ksu.edu!harris.cis.ksu.edu!mac@tut.cis.ohio-state.edu (Myron A. Calhoun)
Subject: Intel hex (*.HEX) format questions

In article <1796@uop.edu> mrapple@uop.edu (Nick Sayer) writes:
>Anyone have some cold, hard facts concerning the Intel .HEX format?
>I've managed to figure out a little bit of it, and have come up with this:

All of my insertions are from Intel's 1977 "MCS-80 USER'S MANUAL",
pages 6-75 and 6-76, which describe "Intellec Hex Paper Tape Format".
A "BPNF Paper Tape Format", a "Non-Intellec Hex Paper Tape Format",
an "Intellec Hex Computer Punched Card Format", and a "PN Computer
Punched Card Format" are described on later pages!

>Each line looks like this
   EACH CHARACTER POSITION IS CALLED A "FRAME"

>:10020000C30CDFC308DF7F00202020202020202007
>^ ^   ^ ^^                              ^ ^
>| |   | ||---8 * num bits - data bytes--| |
   DATA FIELD:  frames 9 to 9+2*(record length)-1
>| |   | |                                 |
>| |   | |    Checksum---------------------+
   CHECKSUM FIELD:  the checksum field contains the ASCII hexadecimal
                    representation of the two's complement of the 8-bit
                    sum of the 8-bit bytes that result from converting
                    each pair of ASCII hexadecimal digits to one byte of
                    binary, from the record length field to and including
                    the last byte of the data field.  Therefore, the sum
                    of all the ASCII pairs in a record after converting
                    to binary, from the record length field to and
                    including the checksum field, is zero.
>| |   | |
>| |   | +----Always 0. Why?
   RECORD TYPE FIELD:  all data records are type 0; end-of-file records
                       are type 1.  Other possible values for this field
                       are reserved for future expansion.
>| |   |
>| |   +------16 bits - address to start
   LOAD ADDRESS FIELD; this field in an end-of-file record contains
                       zeros or the starting address of the program
>| |
>| +----------8 bits - the number of bytes on this line
   RECORD LENGTH FIELD
>|
>+------------always a :
   RECORD MARK FIELD
>
>Final line looks like this
>
>:0000000000
>^ ^   ^ ^ ^
>| |   | | |
>| |   | | +-------Checksum
>| |   | +---------Always 0. Why?
   RECORD TYPE FIELD:  all data records are type 0; end-of-file records
                       are type 1.  Other possible values for this field
                       are reserved for future expansion.
>| |   +-----------Address. Can be non-zero, but what does that mean?
   LOAD ADDRESS FIELD; this field in an end-of-file record contains
                       zeros or the starting address of the program
>| +---------------Zero bytes on this line
>+-----------------Always a :
--Myron
--
Myron A. Calhoun, PhD EE, W0PBV, (913) 532-6350 (work), 539-4448 (home).
INTERNET: mac@ksuvax1.cis.ksu.edu
BITNET:   mac@ksuvax1.bitnet
UUCP:  ...{rutgers, texbell}!ksuvax1!harry!harv

<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>