User manual

OBSEND ST Assembler-Linker
46/89 Doc ID 11392 Rev 4
The next two characters are the record type for this line: 00 is a data line, and 01 signals
EOF. The following characters, until the last two, are the 16 data bytes for this line, the last
two are a checksum for the line, calculated by starting with $00 subtracting the real value of
all characters sent after the ':' until the checksum itself. 'Real value' means that for example,
the two characters 3 and 0 should subtract $30 from the checksum, not 51 and 48. Every
line ends with a CR-LF combination, $0A and $0D.
The last line sent must be an END-OF-FILE line, which is denoted by a line with no data
bytes and a record type of 01 instead of 00.
Giving I32 or i32 instead of intel as the argument uses the same format, but sends 32 bytes
of data per line.
6.2.6 Motorola S-record format
<format>= s
This is another complex method for sending data. Again it cuts the data into 16-byte
'records' with overhead both sides. S-record come in four types: S0, known as a header
record, S1 and S2 data records with 16 and 24-bit address fields, and S9 and S8 EOF
records with 16 and 24-bit address fields.
Note: The convention is to close an S1 16-bit data record with the S9 16-bit EOF record, and to
close an S2 24-bit data record with the S8 24-bit EOF record.
S10D0010E0006285E000628562856D
S1 record type
0D number of bytes left,address,data and checksum (13 in decimal)
0010 address
.... data bytes
6D checksum
The first two characters define the record type: S0, S1, S2, S8 or S9.
The next two characters form a hexadecimal representation of the numbers of bytes left in
the record (that is, numbers of characters /2) This count must include the checksum and
addresses bytes that follow. The address field is four characters wide in S0, S1, S9 and six
characters wide in S2 and S8. The most significant character always comes first.
OBSEND always uses S1 type records wherever possible (that is, when the address is less
than $10000) and use S2 type data records where it has to (that is, address > $FFFF).
Up to 16 data bytes then follow, with the checksum appended on the end. The checksum is
calculated by starting with $FF and subtracting the 'real value' of all bytes sent from and
including the byte count field until the checksum itself. In this context, 'real value' means the
value of the byte before it is expanded into two ASCII characters.
The record is concluded by a CR-LF combination $0A, $0D. The S0, S8 and S9 (that is,
header and EOF) records are always the same:
S00600004844521B
and:
S804000000FB
S9030000FC
A complete example of S-record transmission may look like:
S00600004844521B