<Motorola S Records example>
S00C000054455354312E4845586F
S315CAFE010055AA55AA55AA55AA55AA55AA55AA55AA29
S315CAFE0110000102030405060708090A0B0C0D0E0F99
S315CAFE0120AA55AA55AA55AA55AA55AA55AA55AA5509
S315CAFE013000000000000000000000000000000000F1
S315CAFE014055AA55AA55AA55AA55AA55AA55AA55AAE9
S315CAFE0150FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE1
S70500000000FA
<Structure of a Motorola S-Record>
① Record Mark "S" (1 character)
② Record Type (1 character)
③ Record Length (1 byte/2 characters)
④ Address (16 bits/4 characters, 24 bits/6 characters, 32 bits/8 characters)
⑤ Data (n bytes/2n characters)
⑥ Checksum (1 byte/2 characters)
①Motorola S records always begin with the letter "S".
②Record Type
| 0 | Start Record (Optional): Include supplementary information such as comments and filenames in the data record section. In the example above, the filename "TEST1.HEX" is included. |
| 1 | Data Record (16-bit address: 4 characters for address specification) |
| 2 | Data Record (24-bit address: 6 characters for address specification) |
| 3 | Data Record (32-bit address: 8 characters for address specification) |
| 5 | Number of data records (S1-S3) since the previous S5 record (16-bit count) |
| 6 | Number of data records (S1-S3) since the previous S6 record (24-bit count) *Not supported in NETIMPRESS. |
| 7 | End Record: End of S3 format (32-bit address) |
| 8 | End Record: End of S2 format (24-bit address) |
| 9 | End Record: End of S1 format (16-bit address) |
③ Record Length: Indicates the number of bytes of data represented by the following records using two characters.
If an S3 record has a data field of 10H (=16) bytes (20H (=32) characters),
then: 4 (address) + 10H (data) + 1 (checksum) = 15H.
This is why the record length for the second and subsequent lines in the example above is 15.
④ Address: Specifies the address where the first byte of the record is stored
using 4 characters (S1 record) / 6 characters (S2 record) / 8 characters (S3 record).
⑤ Data: Represents 1 byte of data with 2 characters.
⑥ Checksum: 2 characters (1 byte) of data. The one's complement of the sum of the record length, address field, and the sum of each byte value of the data.