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'' which usually manifest as lines which start with
21 something else. These ``extension'' lines may or may not break other
22 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, 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'' 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 A record containing the number of S1, S2 and S3 records trans‐
69 mitted in a particular block. The count appears in the two-
70 byte address field. There is no data field.
71
72 S6 A record containing the number of S1, S2 and S3 records trans‐
73 mitted in a particular block. The count appears in the three-
74 byte address field. There is no data field.
75
76 S7 A termination record for a block of S3 records. The address
77 field may contain the 4-byte address of the instruction to
78 which control is passed. There is no data field.
79
80 S8 A termination record for a block of S2 records. The address
81 field may optionally contain the 3-byte address of the instruc‐
82 tion to which control is passed. There is no data field.
83
84 S9 A termination record for a block of S1 records. The address
85 field may optionally contain the 2-byte address of the instruc‐
86 tion to which control is passed. If not specified, the first
87 entry point specification encountered in the object module
88 input will be used. There is no data field.
89
90 Size Multiplier
91 In general, binary data will expand in sized by approximately 2.4 times
92 when represented with this format.
93
95 Here is an example S-Record file. It contains the data ``Hello,
96 World'' to be loaded at address 0.
97 S00600004844521B
98 S110000048656C6C6F2C20576F726C640A9D
99 S5030001FB
100 S9030000FC
101
103 srec_cat version 1.35
104 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
105 2007 Peter Miller
106
107 The srec_cat program comes with ABSOLUTELY NO WARRANTY; for details use
108 the 'srec_cat -VERSion License' command. This is free software and you
109 are welcome to redistribute it under certain conditions; for details
110 use the 'srec_cat -VERSion License' command.
111
113 Peter Miller E-Mail: millerp@canb.auug.org.au
114 /\/\* WWW: http://www.canb.auug.org.au/~millerp/
115
116
117
118Reference Manual SRecord srec_motorola(5)