User manual
Monitor12 (MON12) User Manual 05/30/01
23
APPENDIX A: S-RECORD INFORMATION
INTRODUCTION
The Motorola S-record format was devised for the purpose of encoding programs
(object code) or data files in a printable format for transportation between
computer systems. This transportation process can therefore be monitored and
the S-records can be easily edited.
S-RECORD CONTENT
When observed, S-records are essentially character strings made of several
fields which identify the record type, record length, memory address, code/data,
and checksum. Each byte of binary data is encoded as a 2-character hexadecimal
number: the first character representing the high-order 4 bits, and the second
the low-order 4 bits of the byte.
Five fields which compromise an S-record are shown below:
TYPE RECORD LENGTH ADDRESS CODE/DATA CHECKSUM
where the fields are composed as follows:
PRINTABLE
FIELD CHARACTERS CONTENTS
Type 2 S-record type - S0, S1, etc.
Record Length 2 Character pair count in the record,
excluding the type and record length.
Address 4,6, or 8 2-, 3-, or 4-byte address at which the data
field is to be loaded into memory.
Code/data 0-2n From 0 to n bytes of executable code, memory
data, or descriptive information. For
compatibility with teletypewriters, some
programs may limit the number of bytes to as
few as 28 (56 printable characters in the S-
Checksum 2 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.
Each record may be terminated with a CR/LF/NULL. Additionally, an S-record may
have an initial field to accommodate other data such as line numbers generated
by some time-sharing systems.
Accuracy of transmission is ensured by the record length (byte count) and
checksum fields.