My thought process is the following: I learnt two commands are for program memory access: MOVP and MOVP3.
MOVP3 seems to allow access to page 3 of the program memory.. but that means it can not access all of program memory if I am not wrong.
So it is not useful for this purpose.
so this leaves only the MOVP command... but the problem is MOVP only allows to access program code in an area of one page around
the current program counter value. So this is a big limitation.
Initially I was searching for a construct with for-loops and a single read program memory command which access all of ROM.....
like I would do it in C. But now given the limitations of MOVP I actually think the only way to achieve the checksum over the whole ROM is
to split and spread the checksum calculation routine over the whole ROM (each page must contain one part of the routine).
And then each part of the routine has a jump command to the next part.
I think the following codes parts take part in the ROM checksum calculation: (3 example blocks)
L00FC:
00FC : FF " " mov a,r7
00FD : A3 " " movp a,@a
00FE : 7E "~" addc a,r6
00FF : AE " " mov r6,a
0100 : FF " " mov a,r7
0101 : A3 " " movp a,@a
0102 : 7E "~" addc a,r6
0103 : AE " " mov r6,a
0104 : 44 FC "D " jmp L02FC
02FC L02FC:
02FC : FF " " mov a,r7
02FD : A3 " " movp a,@a
02FE : 7E "~" addc a,r6
02FF : AE " " mov r6,a
0300 : FF " " mov a,r7
0301 L0301:
0301 : A3 " " movp a,@a
0302 : 7E "~" addc a,r6
0303 : AE " " mov r6,a
0304 : 84 FC " " jmp L04FC
04FC L04FC:
04FC : FF " " mov a,r7
04FD : A3 " " movp a,@a
04FE : 7E "~" addc a,r6
04FF : AE " " mov r6,a
0500 : FF " " mov a,r7
0501 : A3 " " movp a,@a
0502 : 7E "~" addc a,r6
0503 : AE " " mov r6,a
0504 : C4 FD " " jmp L06FD
as can be seen one block jumps to the next block. you also wrote that the checksum is done by adding up to a sum, and also that the carry is added to the next byte.
So after the movp is an addition which fits to your description. Simular blocks like above can also be found at other program memory locations.
But unfortunetly I am not able right now to see the big picture, i mean I do not know where the routine starts and where it actually ends.
It is pretty complicated to try and find the red line through the code. And I am also not sure if there are actually enough blocks like above to reach all parts of the ROM.
I also tried to search for "OUTL P2, #0BFH" commands to alter A12, but there are to many to use them as an orientation point.
Am I on the right track with my assumptions? I can not wait to read your answer and to see if I am correct or not. Unfortunetly I have to go to bed now and I will only
be able to answer again in 8 hours... it seems we are maybe in different time zones
Thank you very much again for your insight, it makes a lot of fun to go through the code and try to find the things you describe or point out.