1srec_motorola(5) File Formats Manual srec_motorola(5)
2
3
4
6 srec_motorola - Motorola S‐Record hexadecimal file format
7
9 This format is also known as the Exorciser, Exormacs or Exormax format.
10
11 Motorola's S‐record format allows binary files to be uploaded and down‐
12 loaded between two computer systems. This type of format is widely
13 used when transferring programs and data between a computer system
14 (such as a PC, Macintosh, or workstation) and an emulator or evaluation
15 board for Motorola microcontrollers and microprocessors.
16
17 The Lines
18 Most S‐Record file contain only S‐Record lines (see the next section),
19 which always start with a capital S character. Some systems generate
20 various “extensions[rq] which usually manifest as lines which start
21 with something else. These “extension[rq] lines may or may not break
22 other systems made by other vendors. Caveat emptor.
23
24 The Fields
25 The S‐Record format consists of 5 fields. These are the type field,
26 length field, address field, data field, and the checksum. The lines
27 always start with a capital S character.
28
29 ┌──┬──────┬───────────────┬─────────┬──────┬──────────┐
30 │S │ Type │ Record Length │ Address │ Data │ Checksum │
31 └──┴──────┴───────────────┴─────────┴──────┴──────────┘
32 Type The type field is a 1 character field that specifies whether
33 the record is an S0, S1, S2, S3, S5, S6, S7, S8 or S9 field.
34
35 Record Length
36 The record length field is a 2 character (1 byte) field that
37 specifies the number of character pairs (bytes) in the record,
38 excluding the type and record length fields.
39
40 Address This is a 2‐, 3‐ or 4‐byte address that specifies where the
41 data in the S‐Record is to be loaded into memory.
42
43 Data The data field contains the executable code, memory‐loadable
44 data or descriptive information to be transferred.
45
46 Checksum
47 The checksum is an 8‐bit field that represents the least sig‐
48 nificant byte of the one's complement of the sum of the values
49 represented by the pairs of characters making up the record's
50 length, address, and data fields.
51
52 Record Types
53 S0 This type of record is the header record for each block of S‐
54 Records. The data field may contain any descriptive informa‐
55 tion identifying the following block of S‐Records. (It is com‐
56 monly “HDR[rq] on many systems.) The address field is normally
57 zero.
58
59 S1 A record containing data and the 2‐byte address at which the
60 data is to reside.
61
62 S2 A record containing data and the 3‐byte address at which the
63 data is to reside.
64
65 S3 A record containing data and the 4‐byte address at which the
66 data is to reside.
67
68 S5
69 An optional record containing the number of S1, S2 and S3
70 records transmitted in a particular block. The count appears
71 in the two‐byte address field. There is no data field.
72
73 This record is optional, you do not have to use it. Nobody
74 knows if you can have more than one in a file; and if you do,
75 nobody knows whether or not the line count resets after each
76 one.
77
78 The srec_cat command will only ever use one, provided the num‐
79 ber of lines fits in 16 bits, otherwise it will use S6.
80
81 S6
82 An optional record containing the number of S1,
83 S2 and S3 records transmitted in a particular
84 block. The count appears in the three‐byte
85 address field. There is no data field.
86
87 This record is optional, you do not have to use
88 it. Nobody knows if you can have more than one
89 in a file; and if you do, nobody knows whether
90 or not the line count resets after each one.
91
92 Nobody knows what happens if you mix S5 and S6
93 records in a file.
94
95 The srec_cat command will only ever use one,
96 provided the number of lines fits in 24 bits.
97
98 S7 A termination record for a block of S3 records.
99 The address field may contain the 4‐byte address
100 of the instruction to which control is passed.
101 There is no data field.
102
103 S8 A termination record for a block of S2 records.
104 The address field may optionally contain the
105 3‐byte address of the instruction to which con‐
106 trol is passed. There is no data field.
107
108 S9 A termination record for a block of S1 records.
109 The address field may optionally contain the
110 2‐byte address of the instruction to which con‐
111 trol is passed. If not specified, the first
112 entry point specification encountered in the
113 object module input will be used. There is no
114 data field.
115
116 Size Multiplier
117 In general, binary data will expand in sized by approximately 2.4 times
118 when represented with this format.
119
121 Here is an example S‐Record file. It contains the data “Hello,
122 World[rq] to be loaded at address 0.
123 S00600004844521B
124 S110000048656C6C6F2C20576F726C640A9D
125 S5030001FB
126 S9030000FC
127
129 srec_cat version 1.64
130 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
131 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Peter Miller
132
133 The srec_cat program comes with ABSOLUTELY NO WARRANTY; for details use
134 the 'srec_cat -VERSion License' command. This is free software and you
135 are welcome to redistribute it under certain conditions; for details
136 use the 'srec_cat -VERSion License' command.
137
139 Scott Finneran E‐Mail: scottfinneran@yahoo.com.au
140 Peter Miller E‐Mail: pmiller@opensource.org.au
141
142
143
144Reference Manual SRecord srec_motorola(5)