I am trying to make a bootloader for PIC18 so I need to understand how to process a hex file correctly. For example I understand what to do with the following hex line.
:040C0000E2EFFFF030
04
: number of bytes
0C00
: Address of hex digits
00
: Data records
E2EFFFF0
: Sequence of data
30
: Checksum
so I would know what to do with the above line, but how about the following hex line.
:020000040001F9
02
: # of bytes
0000
: Address
04
: Extended Linear Address Record
0001
: data
F9
: Checksum
But what exactly do I do with it? Am I writing those data to that address? Can you translate it to machine language?
By the way my application program starts at address 0c00
and bootloader starts at address 0020
, and above it, is the interrupt vector. Thanks!
Update
If the third line of hex file was the following, would the address FFC0
change ?
:10FFC000FF00FF00FF00FF00FF00FF000001E9EF5E
I am thinking since the second line of hex file has 04
(Extended Linear Address Record), then I should add 0001
to the address of the third line FFC0
, so the new address would be like this.
$0001 + $FFC0
will equal 1FFC0
, so the next set of data bytes from line 3 should be written to this address 1FFC0
, is this correct ?