From: sherlock@nrtpa16.bnr.ca (Steve Holmes x4807)
Subject: Motorola S-Record Formats
Keywords: Motorola S-Records Object 
Reply-To: sherlock@bnr.ca
Organization: Bell-Northern Research, Research Triangle Park, NC
Date: Fri, 8 Jan 1993 12:54:42 GMT

/*P  Motorola (S) record layouts */
/*+***************************************************************
 
  The general layout of an S record is as follow:
 
  S rr ll xx xx xx xx xx ..... cc
    || || ||                   ||
    || || ||                   ====  Ones compliment checksum
    || || =========================  Data of length ll - 1
    || ============================  Length of bytes to follow
    ===============================  Record type
 
  S records are in displayable  ascii characters.
  The 'S' and record type are NOT included in the checksum.
  The checksum is a Ones compliment checksum, such that after
  the checksum is computed the one's compliment of the sum
  is compared to the checksum byte.
 
  Record Types:
  -------------
 
  Note: 'll' is the length of data to follow
        'cc' is the ones compliment checksum
 
 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
 
  0: Comment Record.
     Normally the first record of the load, but optional.
     Some linkers imbed the name of the load in this record.
     The Microtec Linker always builds the same S0 record.
 
  S0 ll xx xx xx xx .... cc
         \_____________/
                |
                +---------------  optional (comments)
                                  defined by linker
 
 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
 
 
  1: Data Record (2-byte address field).
     This record contains the actual load data.
 
  S1 ll aa aa dd dd dd dd .... cc
        \___/ \______________/
          |          |
          |          +----------  actual load data
          +---------------------  16-bit destination address
 
 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
 
 
  2: Data Record (3-byte address field).
     This record contains the actual load data.
 
  S2 ll aa aa aa dd dd dd dd .... cc
        \______/ \______________/
           |            |
           |            +--------  actual load data
           +---------------------  24-bit destination address
 
 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
 
 
  3: Data Record (4-byte address field).
     This record contains the actual load data.
 
  S3 ll aa aa aa aa dd dd dd dd .... cc
        \_________/ \______________/
             |             |
             |             +-----  actual load data
             +-------------------  32-bit destination address
 
 
 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
 
 
  5: Record Count.
     This record contains the total count of S1, S2 and S3
     records that have been sent prior.  The loader will
     verify that the count does indeed match with how
     many have been received.  The size of the count
     field is based upon the length of the record.
 
  S5 ll rr ... rr cc
        \_______/
            |
            +---------------- 16,24 or 32-bit record count
 
 
 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
 
 
 
  7: End of Load record.
     This record signals the end of the load.  The record
     contains a 4-byte transfer address (entry point).
 
     Note: some linkers will set the transfer address to
           zero, while others allow it to set via linker or
           assembler options.
 
           The Microtec linker allows you to either specify
           a START option in the linker control file,
           or the Microtec Assembler allows an assembler
           option where the transfer address is specified
           on the END statement on any ONE module.
 
 
  S7 ll aa aa aa aa cc
        \_________/
             |
             +---------------------  OPTIONAL 32-bit Entry Point
 
 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
 
 
 
  8: End of Load record.
     This record signals the end of the load.  The record
     contains a 3-byte transfer address (entry point).
 
  S8 ll aa aa aa cc
        \______/
           |
           +---------------------  OPTIONAL 24-bit Entry Point
 
 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
 
 
  9: End of Load record.
     This record signals the end of the load.  The record
     contains a 2-byte transfer address (entry point).
 
  S9 ll aa aa cc
        \___/
          |
          +---------------------  OPTIONAL 16-bit Entry Point
 
 
 *-***************************************************************/
 

steve holmes                       BNR
email: sherlock@bnr.ca             Research Triangle Park, NC
Newsgroups: comp.sys.convex