SongYZZZ/moon-firmware/ihex does not have a README file

    Record

    pub struct Record {
    kind : Int
    address : Int
    data : Bytes
    } derive(Eq,
    Debug
    )

    Validated wire record. Address is the 16-bit offset, not an absolute address.

    Record::encode

    fn Record::encode(self : Record, uppercase? : Bool) -> String

    Encode one validated record and compute its two's complement checksum.

    Record::new

    fn Record::new(kind : Int, address : Int, data : Bytes) -> Record raise
    FirmwareError

    Validate a record's structural fields, independent of document state.

    WriterOptions

    pub(all) struct WriterOptions {
    data_length : Int
    uppercase : Bool
    line_ending :
    LineEnding

    max_output_length : Int
    } derive(Eq,
    Debug
    )

    Record length is configurable; output uses extended linear addressing.

    WriterOptions::default

    fn WriterOptions::default() -> WriterOptions

    Standard 16-byte uppercase LF output with a bounded text allocation.

    compute_checksum

    fn compute_checksum(body : Bytes) -> Byte

    Intel HEX two's complement of count, address, type and data bytes.

    encode

    Write a complete deterministic Intel HEX file, preserving execution metadata.

    for_each_record

    Walk records without allocating the full text document. Callback failures stop emission; streaming clients are responsible for staging partially written IO.

    parse_document

    Parse a complete Intel HEX document into normalized absolute-address memory.

    parse_line

    fn parse_line(text : String, line? : Int) -> Record raise
    FirmwareError

    Parse one unpadded record, always enforcing checksum and structural lengths.

    validate

    Verify syntax, checksums, ordering, bounds and overlaps without exposing state.

    verify_checksum

    fn verify_checksum(record_bytes : Bytes) -> Bool

    A complete decoded Intel record sums to zero modulo 256.

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io