moddef.codec.bytes module¶
Register/byte assembly honoring byte order within a word and word order across words (spec §9). Mirrors go/codec and the TS/Rust byte helpers.
- moddef.codec.bytes.assemble(regs: Sequence[int], byte_big: bool, word_big: bool) bytes[source]¶
Normalize registers into a big-endian byte stream.
- moddef.codec.bytes.decode_uint(b: bytes) int[source]¶
Big-endian unsigned integer of the byte stream (arbitrary width).
- moddef.codec.bytes.pad_bytes(b: bytes, total: int) bytes[source]¶
Zero-pad (or truncate) to exactly total bytes.