FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
How to define a lit23 GOTO in PCD? |
Posted: Thu Sep 25, 2008 8:03 am |
|
|
Hello,
in EX_PCD_Bootloader.c, a jump to the real bootloader is performed by
Code: | #asm
goto LOADER_ADDR
#endasm |
For most PIC24 chips, LOADER_ADDR is a 23-Bit literal, e. g. 0x207FA.
PCD inserts a far GOTO instruction, but strips of the upper bits. Even inserting 23 Bit constant instead of a symbol doesn't generate the correct address.
There is also a built-in function goto_address(), but it seems to generate a near branch instruction unconditionally.
How to perform the necessary far GOTO?
Regards,
Frank |
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Thu Sep 25, 2008 8:30 am |
|
|
As an additional question, how to use symbols in literal MOV instructions, e. g.:
Code: | #asm
MOV #LOADER_ADDR, W0 |
It gives an error Invalid Pre-Processor directive. I don't see that PCD provides an option. |
|