Columns below are:
Line,Address,Opcode hex, Opcode ASM, <params>
1847 virgin bootloader first memory locations:
1 0000 3198 MOVLP 0x18
2 0001 2D98 GOTO 0x598
This is as expected for this source code:
Code: Select all
program boot16
include BootForAll16
main: org 0x1D98 ' org main
orgall(0x1D98) ' store bootloader code at the end of program memory
1 0000 1008 BCF 0x8, 0
2 0001 0588 ANDWF 0x8, F
3 0002 2D98 GOTO 0x598
< from here, the target program code is placed>
Register #8 is the BSR: Bank Select Register. Why is the BSR getting adjusted just prior to a jump into far memory? And since the PCLATH reg is zero at reset, the program appears to jump to 0x598, no where near 0x1D98.
How are the first two instructions getting changed after using the bootloader?
I ask because at this point, neither the downloaded code works nor does the bootloader any longer. At reset, there is no string of 'ggggggggg...' coming out of the uart. Ideas, anyone?