Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!ncar!noao!mcdsun!mcdchg!michael From: michael@mcdchg.UUCP (Michael Bodine) Newsgroups: comp.sys.m68k Subject: Re: Motorola "S records" Message-ID: <7439@mcdchg.UUCP> Date: 29 Apr 88 15:53:56 GMT References: <9200@agate.BERKELEY.EDU> Reply-To: michael@mcdchg.UUCP (Michael Bodine) Organization: Motorola Microcomputer, Schaumburg, IL Lines: 54 swackham@violet.berkeley.edu.UUCP writes: > Motorola "S records". What is the format/structure of these records? > Please E-mail responses to: swackham@violet.berkeley.edu Altho you requested mailed responses, i've noticed requests for Srecord format a couple of times recently, so i'm posting this for general interest: Motorola S-records are intended to provide an ASCII-encoded hex format for binary records allowing the downloading of executable code or data into target systems or EPROM programs or communication of same across media prone to problems with binary transmissions. Most PROM blowers and M68K family debug tools understand the S-record format, which is as follows: Sxllaaaa[aa[aa]]dddd......ddcc where: Sx -- is the S-record format descriptor: S0 : header record, which is unused by almost any interpreter and which may contain standard ASCII data describing file contents S1 : a binary record with a 16-bit address S2 : a binary record with a 24-bit address S3 : a binary record with a 32-bit address S5 : a block record, contains the number of S1, S2 or S3 records in the following block, in the address field. dd data field is empty. Normally not used. S7 : termination record for a block of S3 records. Address field will optionally contain the start address for the completed program. S8 : termination record for S2 records. S9 : termination record for S1 records. Note that only one termination record is recquired at the end of the file to take the target out of load mode. S1, S2 and S3 records may be intermixed quite randomly, altho most vendors will typically choose the largest address in the file and make all S-records use that type of descriptor. ll -- the number of character pairs in the record inluding the descriptor and length, but not including the checksum aaaa[aa[aa]] -- the address into which the data is to be loaded, where the number of bits represented is 16 for S1, 24 for S2 and 32 for S3. dd -- a ASCII-coded hexadecimal pair representing one byte of binary data cc -- the low-order byte of the one's complement sum of all byte pairs in the record except the descriptor and the checksum, that is, the length, address and data fields are checksummed. An example: S1130000285F245F2212226A000424290008237C2A SXllaaaaddddddddddddddddddddddddddddddddcc A similar description of S-records is included with almost every firmware debugger manual available from Motorola. Enjoy! -- [ Michael Bodine, michael@mcdchg.UUCP Opinions expressed are mine and haven't ] [ been seen, commented on or in any way approved or even allowed by Motorola ] [ MicroComputer Division, Motorola General Systems Group or Motorola, Inc. ] [ No one else agrees with me; why should my employer? ]