srec_motorola(5)
๐
srec_motorola(5) โ Motorola SโRecord hexadecimal file format ๐
Okay bestie, this is the File Formats Manual page for srec_motorola(5), and we're gonna make S-Records make sense. No cap. ๐ซถ
๐ธ NAME ๐ธ
srec_motorola โ Motorola SโRecord hexadecimal file format.
๐ DESCRIPTION ๐
This format is also known as the Exorciser, Exormacs or Exormax format.
Motorola's Sโrecord format allows binary files to be uploaded and downloaded between two computer systems. This type of format is widely used when transferring programs and data between a computer system (such as a PC, Macintosh, or workstation) and an emulator or evaluation board for Motorola microcontrollers and microprocessors.
๐ The Lines ๐
Most SโRecord files contain only SโRecord lines (see the next section), which always start with a capital S character. Some systems generate various โextensionsโ which usually manifest as lines which start with something else. These โextensionโ lines may or may not break other systems made by other vendors. Caveat emptor. ๐
๐ง The Fields ๐ง
The SโRecord format consists of 5 fields. These are the type field, length field, address field, data field, and the checksum. The lines always start with a capital S character.
โโโโโฌโโโโโโโฌโโโโโโโโโโโโโโโโฌโโโโโโโโโโฌโโโโโโโฌโโโโโโโโโโโ
โ S โ Type โ Record Length โ Address โ Data โ Checksum โ
โโโโโดโโโโโโโดโโโโโโโโโโโโโโโโดโโโโโโโโโโดโโโโโโโดโโโโโโโโโโโ
- Type โ the type field is a
1character field that specifies whether the record is anS0,S1,S2,S3,S5,S6,S7,S8orS9field. - Record Length โ the record length field is a
2character (1byte) field that specifies the number of character pairs (bytes) in the record, excluding the type and record length fields. - Address โ this is a
2-,3- or4-byte address that specifies where the data in the SโRecord is to be loaded into memory. - Data โ the data field contains the executable code, memoryโloadable data or descriptive information to be transferred.
- Checksum โ the checksum is an
8โbit field that represents the least significant byte of the one's complement of the sum of the values represented by the pairs of characters making up the record's length, address, and data fields.
๐ฅ Record Types ๐ฅ
S0โ this type of record is the header record for each block of SโRecords. The data field may contain any descriptive information identifying the following block of SโRecords. (It is commonly โHDRโ on many systems.) The address field is normally zero.S1โ a record containing data and the2โbyte address at which the data is to reside.S2โ a record containing data and the3โbyte address at which the data is to reside.S3โ a record containing data and the4โbyte address at which the data is to reside.S5โ an optional record containing the number ofS1,S2andS3records transmitted in a particular block. The count appears in the twoโbyte address field. There is no data field.
This record is optional, you do not have to use it. Nobody knows if you can have more than one in a file; and if you do, nobody knows whether or not the line count resets after each one.
The srec_cat command will only ever use one, provided the number of lines fits in 16 bits, otherwise it will use S6.
S6โ an optional record containing the number ofS1,S2andS3records transmitted in a particular block. The count appears in the threeโbyte address field. There is no data field.
This record is optional, you do not have to use it. Nobody knows if you can have more than one in a file; and if you do, nobody knows whether or not the line count resets after each one.
Nobody knows what happens if you mix S5 and S6 records in a file.
The srec_cat command will only ever use one, provided the number of lines fits in 24 bits.
S7โ a termination record for a block ofS3records. The address field may contain the4โbyte address of the instruction to which control is passed. There is no data field.S8โ a termination record for a block ofS2records. The address field may optionally contain the3โbyte address of the instruction to which control is passed. There is no data field.S9โ a termination record for a block ofS1records. The address field may optionally contain the2โbyte address of the instruction to which control is passed. If not specified, the first entry point specification encountered in the object module input will be used. There is no data field.
๐ฆ Size Multiplier ๐ฆ
In general, binary data will expand in sized by approximately 2.4 times when represented with this format. (Yes, it says โin sizedโ โ the 2.4ร number is the important part, bestie. ๐ญ)
โญ EXAMPLE โญ
Here is an example SโRecord file. It contains the data โHello, Worldโ to be loaded at address 0.
S00600004844521B
S110000048656C6C6F2C20576F726C640A9D
S5030001FB
S9030000FC
๐ COPYRIGHT ๐
srec_cat version 1.65 Copyright (C) 1998... Peter Miller
The srec_cat program comes with ABSOLUTELY NO WARRANTY; for details use the srec_cat -VERSion License command. This is free software and you are welcome to redistribute it under certain conditions; for details use the srec_cat -VERSion License command.
๐ MAINTAINER ๐
- Scott Finneran โ EโMail:
scottfinneran@yahoo.com.au - Peter Miller โ EโMail:
pmiller@opensource.org.au
Cute sign-off from the Reference Manual / SRecord corner for srec_motorola(5) โ the footer had no date, so I'm not inventing one, periodt. ๐โจ
๐ฆ where this page comes from
- opensuse-leap 16.0: srecord 1.65.0-bp160.1.12 ยท GPL-3.0-or-later
- opensuse-leap 16.0: srecord 1.65.0-bp160.1.12 ยท GPL-3.0-or-later
- opensuse-leap 16.0: srecord 1.65.0-bp160.1.12 ยท GPL-3.0-or-later
- opensuse-leap 16.0: srecord 1.65.0-bp160.1.12 ยท GPL-3.0-or-later
- Copyright (C) 1998, 2000-2002, 2006-2009 Peter Miller
- Copyright (C) 1998, 2006-2009, 2014 Peter Miller
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms