The Motorola S-Record Format was devised
for the purpose of encoding programs or data files in printable
format for transport between computer platforms.
Each S-record is a character string
composed of few fields which identify:
Each byte of binary data is encoded
in the S-record as two-character hexadecimal number:
- The first character represents the
four bits of the byte
- The second character represents the
fours bits of the byte
The five fields that comprise an S-record
are shown in the table below:
The S-record fields fields are described
in the table below:
|| Printable Characters
||S-Record type - S0, S1, etc.
||Character pair count in the
record, excluding the type and record length.
||2-,3-,4- byte address at
which the data field is to be loaded into memory.
||From 0 to N bytes of executable
code, memory loadable data or describe information.
For compatibility with teletypewriter , some programs
may limit the number of bytes to as few as 28 (56 printable
characters in the S-record
||Least significant byte of
the one's complement of the sum of the values represented
by the pairs of characters making up the record length,
address, and the code/data fields.
Eight types of S-record have been defined
to accommodate the several needs of the encoding, transport
and decoding function. The various Motorola upload, download
and other record transport control programs, as well as
cross assemblers, linkers and other file-creating or debugging
programs, utilize only those S-record which serve the purpose
of the program.
A typical S-record format, as printed
or displayed, is shown in this example:
S1 14 C0 1E 0B 29 BD C0 2A 18 38 6A 3B 6F 3B 39 18 09 26
FC 39 DE
S1 - record type 14 - number of hex characters following
Len= $14 hex ( 20 dec ) $CO1E - memory load address field
$0B - - - - $39 - code\data field $DE - checksum
byte A part from the letter S at the start, all characters
in the records are hexadecimal digits presented in ASCII
format. Checksum formula below: