Each line has 00 in columns 8 and 9 except for the last line, which has 01 marking it as
end of file.
The last 2 columns of each line contain a check sum. This is the sum of all of the other
bytes on the line, ANDed with 0x00FF, and subtracted from 0x0100. For example, for the
second-last line:
ED = 0100 - [[03 + 40 + 4E + 00 + 30 + 80 + D2] AND 00FF]
MOV DPTR,#data16
It is not practical for a utility program to determine whether to relocate the operand of
MOV DPTR,#data16. If DPTR will be used by JMP @A+DPTR then #data16 must be
relocated. If it will be used by MOVC A,@A+DPTR then it probably must be relocated.
If it will be used by MOVX @DPTR,A then it probably must not be relocated. It is
possible also that a "clever" programmer is loading the two registers DPH and DPL with
data using this one instruction.
When the MultiMIPS 8051 HEX Relocator program finds MOV DPTR,#data16 in the
machine language, it asks the user to decide whether to relocate #data16 or not. The
correct procedure in each case can be determined by examining the machine language
code. More simply, if the #data16 value falls within the same range as the load addresses,
it probably needs to be relocated. This may be a trial and error situation.
AJMP and ACALL
If the program is to be relocated by a multiple of 2K bytes then AJMP and ACALL
instructions will automatically relocate with no problems. But it is not always possible to
relocate the operand of these instructions to an arbitrarily chosen load address.
When the MultiMIPS 8051 HEX Relocator program finds AJMP or ACALL in the
machine language, it attempts to relocate the operand. If it is not successful, it displays a
message containing the numeric information needed to effect a successful relocation.
This may again be a trial and error situation, as there may be several AJMPs or ACALLs
with conflicting needs, and the corrections required may conflict with other AJMPs or
ACALLs.
The two items of numeric information displayed are the load address for the AJMP or
ACALL instruction, and the operand address. The requirement is that these two addresses
be within the same fixed address 2K [0x800 or 2048 decimal] block of memory as is the
first byte of the instruction following the ACALL or AJMP.