home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_07_04 / v7n4028a.txt < prev    next >
Text File  |  1989-02-09  |  3KB  |  66 lines

  1.  
  2.      :04FEDC00210080CFB2
  3.      ^ ^   ^ ^ ^ ^ ^ ^ ^
  4.      | |   | | | | | | +-- checksum     Adding all count, address, record
  5.      | |   | | | | | |                  type, data, and checksum bytes
  6.      | |   | | | | | |                  together modulo 256 will yield a sum
  7.      | |   | | | | | |                  of 0x00 if the record is valid.  In
  8.      | |   | | | | | |                  this case, 0x04 + 0xFE + 0xDC + 0x00 +
  9.      | |   | | | | | |                  0x21 + 0x00 + 0x80 + 0xCF + 0xB2 =
  10.      | |   | | | | | |                  0x00.
  11.      | |   | | | | | |
  12.      | |   | | +-+-+-+---- data bytes   There are four data bytes in this
  13.      | |   | |                          record:  0x21, 0x00, 0x80, and 0xCF.
  14.      | |   | |
  15.      | |   | +------------ record type  0x00 for data records, 0x01 for EOF
  16.      | |   |                            records.
  17.      | |   |
  18.      | |   +-------------- load address The first byte of this data record
  19.      | |                                loads at address 0xFEDC. Subsequent
  20.      | |                                data bytes load at subsequent
  21.      | |                                addresses.  For EOF records, program
  22.      | |                                execution begins at this address.
  23.      | |
  24.      | +------------------ byte count   There are 0x04 data bytes in this
  25.      |                                  data record.  EOF records normally
  26.      |                                  have 0x00 data bytes.
  27.      |
  28.      +-------------------- start-of-    All Intel hex records begin with an
  29.                            record char  ASCII ':'.
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.      S107FEDC210080CFAE
  37.      ^^ ^   ^ ^ ^ ^ ^ ^
  38.      || |   | | | | | +--- checksum     Adding all count, address, data, and
  39.      || |   | | | | |                   checksum bytes together modulo 256
  40.      || |   | | | | |                   will yield a sum of 0xFF if the record
  41.      || |   | | | | |                   is valid.  In this case, 0x07 + 0xFE +
  42.      || |   | | | | |                   0xDC + 0x21 + 0x00 + 0x80 + 0xCF +
  43.      || |   | | | | |                   0xAE = 0xFF.
  44.      || |   | | | | |
  45.      || |   | +-+-+-+----- data bytes   There are four data bytes in this
  46.      || |   |                           record:  0x21, 0x00, 0x80, and 0xCF.
  47.      || |   |
  48.      || |   +------------- load address The first byte of this data record
  49.      || |                               loads at address 0xFEDC. Subsequent
  50.      || |                               data bytes load at subsequent
  51.      || |                               addresses.  For EOF records, program
  52.      || |                               execution begins at this address.
  53.      || |
  54.      || +----------------- byte count   There are 0x07 - 0x03 = 0x04 data
  55.      ||                                 bytes in this data record.  EOF
  56.      ||                                 records normally have a byte count of
  57.      ||                                 0x03 because they have 0x03 - 0x03 =
  58.      ||                                 0x00 data bytes.
  59.      ||
  60.      |+------------------- record type  ASCII '0' for header records, '1' for
  61.      |                                  data records, or '9' for EOF records.
  62.      |
  63.      +-------------------- start-of-    All S-records begin with an ASCII 'S'.
  64.                            record char
  65.  
  66.