Motorola S-Record Parser

Parse a Motorola S-record, checking its count, address width, ones-complement checksum, and record-type payload constraints.

Description

Motorola S-records encode addresses and bytes as printable hexadecimal text with a count and checksum.

Motorola S-records encode addresses and bytes as printable hexadecimal text with a count and checksum. A single-record parser checks local integrity before a firmware-image workflow interprets the record.1

Parse a Motorola S-record, checking its count, address width, ones-complement checksum, and record-type payload constraints.

When to use Motorola S-Record Parser

Use this tool to parse a Motorola S-record, checking its count, address width, ones-complement checksum, and record-type payload constraints.

Prepare the single firmware record, sampled digital states or effective timing/register parameters requested. Confirm byte order, bit numbering, units and device-specific limits before interpreting the calculation.

How to use Motorola S-Record Parser and understand its results

  1. Prepare the single firmware record, sampled digital states or effective timing/register parameters requested. Confirm byte order, bit numbering, units and device-specific limits before interpreting the calculation.
  2. Enter line using the field table and calculation rules, then run the tool.
  3. Read recordType, address, data, checksum. The explanation below defines the units, signs, ordering and any flags or placeholder values.
  4. If the tool reports an input issue, correct the values and run it again. Apply the stated assumptions when interpreting a successfully returned result.
Input fieldMeaningValue type; see rules belowRequirement
lineOne Motorola S-record.string; maximum length: 1000000Required

Paste one record. Trim outer whitespace, require uppercase S with hex-byte pairs and reject reserved S4. Address widths are two bytes for S0/S1/S5/S9, three for S2/S6/S8 and four for S3/S7. Check count, decode big-endian address and require no payload in S5–S9. Return type, address, data bytes and checksum.

sum(count,address,data,checksum) mod256=255

Units, indexing, boundary conditions and exceptional cases are defined in the calculation rules above.

Output fieldMeaningValue type
recordTypeS-record type.integer; minimum: 0; maximum: 9
addressUnsigned address or count value.integer; minimum: 0; maximum: 4294967295
dataRecord payload bytes.list of integer; minimum: 0; maximum: 255; minimum entries: 0; maximum entries: 252
checksumRecord checksum byte.integer; minimum: 0; maximum: 255
json
{
  "input": {
    "line": "S10512340102B1"
  },
  "output": {
    "recordType": 1,
    "address": 4660,
    "data": [
      1,
      2
    ],
    "checksum": 177
  }
}

Limitations and assumptions

It does not assemble a complete image, compare count records with earlier data or program hardware. A valid checksum is not cryptographic authenticity.

Numeric inputs must be finite. Follow the calculation-specific rules for overflow, underflow and exceptional cases. Extremely large text inputs are rejected. Missing required fields, extra fields, wrong value types and violations of the calculation rules are input errors.

Alternative or Complementary methods

Use Intel HEX Record Generator: Serialize explicit bytes as one Intel HEX record with a computed byte count and checksum, enforcing control-record shapes. For a complementary task, use Intel HEX Record Parser: Parse one Intel HEX record and verify its byte count, two-complement checksum, record type, and control-record shape.

References

  1. Motorola S-Record Parser — tool.io

Similar or alternative tools

  • Intel HEX Record Generator

    Serialize explicit bytes as one Intel HEX record with a computed byte count and checksum, enforcing control-record shapes.

  • Intel HEX Record Parser

    Parse one Intel HEX record and verify its byte count, two-complement checksum, record type, and control-record shape.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies