IntelHex provides some metadata about the hex file it contains.To obtain address limits use methods
.minaddr()
and .maxaddr()
.These are computed based on the lowest and highest used memory spacesrespectively.Some linkers write to produced HEX file information about start address(either record 03 or 05). IntelHex is able correctly read such recordsand store information internally in
start_addr
attribute that itselfis either None
or a dictionary with the address value(s).1/26/2007: 06/12/14: CJCSI 3810.01F: Meteorological and Oceanographic Operations: 4/23/2019: CJCSI 3900.01D: Position (Point And Area) Reference Procedures: 5/14/2015: CJCSI 4120.02E: List of Priorities - Department of Defense Transportation Movement Priority System: 2/12/2020: CJCSI 4310.01E: Logistics Planning Guidance for Pre-Positioned War. FSIS 5200-2: Application for Federal Inspection (Meat, Poultry, Siluriformes Fish, Egg Products and Import Inspection) FSIS 5200-6: Application/Approval for Voluntary Reimbursable Inspection Service: FSIS 9060-6: Application for Export Certificate: FSIS 9010-1: Application for the Return of Exported Products to the United States: FSIS 10,110-2.
When input HEX file contains record type 03 (Start Segment Address Record),
start_addr
takes value:Smultron 12 0 8 fraction. Here:
Library Inspector 2 1 Full
![Library Inspector 2 1 Library Inspector 2 1](https://www.feirox.com/rivu/2014/04/Subway-Surfers-Rome-3.png)
Library Inspector 2 1 Download
XXX
is value of CS registerYYY
is value of IP register
To obtain or change
CS
or IP
value you need to use their names as keysfor start_addr
dictionary:When input HEX file contains record type 05 (Start Linear Address Record),
start_addr
takes value:Here
ZZZ
is value of EIP register.Example:
You can manually set required start address:
To delete start address info give value
None
or empty dictionary:When you write data to HEX file you can disable writing start addresswith additional argument
write_start_addr
:When
start_addr
is None
or an empty dictionary nothing will be writtenregardless of write_start_addr
argument value.For more information about start address, please see the Intel Hex file formatspecification.
Because Intel Hex files do not specify every location in memory,it is necessary to have a padding byte defined. Whenever a read is attemptedfrom an address that is unspecified, the padding byte is returned.This default data is set via attribute
.padding
of class instance.This defaults to ‘0xFF’, but it can be changed by the user like so:Summarizing the data chunks¶
One of the more useful properties of HEX files is that they can specify datain discontinuous segments. There are two main methods to summarize whichdata addresses are occupied:
The first will return a list of occupied data addresses in sorted order. Thesecond will return a list of 2-tuples objects, in sorted order, representingstart and stop addresses of contiguous segment chunks of occupied data.Those 2-tuples are suitable to be used as
start
and stop
arguments of standard range
function.