hexrec.records#
Hexadecimal record management.
The core of this library are hexadecimal record files. Such files are used to store binary data in text form, where each byte octet is represented in hexadecimal format. Over the whole byte addressing range of the memory to store (typically 32-bit addressing), only the relevant data is kept.
The hexadecimal data text is split into record lines, which give the name to this family of file formats. Each line should at least be marked with the address of its first byte, so that it is possible to load data from sparse records.
Usually not only plain data records exist, but also records holding metadata, such as: a terminator record, the record count, the start address to set the program counter upon loading an executable, a generic header string, and so on. Each record line is thus marked with a tag to indicate which kind of data it holds.
Record lines are commonly protected by a checksum, so that each line can be checked for (arguably weak) consistency. A count number is used to measure the record line length some way.
Summarizing, a record line holds the following fields:
a tag to tell which kind of (meta)data is hold;
some bytes of actual data, or tag-specific;
the address of its first data byte, or tag-specific;
the count of record line characters;
a checksum to protect the record line.
This module provides functions and classes to handle hexadecimal record files, from the record line itself, to high-level procedures.
Module attributes
Registered record types. |
Functions
Converts blocks to records. |
|
Converts a record file to another record type. |
|
Converts records to another type. |
|
Finds the record type class. |
|
Finds the record type name. |
|
Extracts data records. |
|
Loads blocks from a record file. |
|
Loads a virtual memory from a file. |
|
Loads records from a record file. |
|
Merges record files. |
|
Merges data records. |
|
Converts records to blocks. |
|
Saves blocks to a record file. |
|
Saves a data chunk to a record file. |
|
Saves a virtual memory to a record file. |
|
Saves records to a record file. |
Classes