Using a LPC2368 & RTX I'm trying to remap exception vectors to RAM in order to run a bootloader and application in separate areas of memory. This is similar to http://www.keil.com/forum/docs/thread10212.asp
Bootloader code is at 0x00000000 - 0x00010000, main code is 0x00010000+, exception vectors are at 0x40000000 I have the RAM exception vectors set to import the handler addresses from a shadow set of vectors in the main startup source - this way the scatterload takes care of updating the copy in RAM when switching from bootloader to main application (or back).
Everything is looking good execpt I can't figure out how to process the VIC interrupt. What I need to do is read the vector address from the VicVectAddr register (0xFFFFFF00 on the LPC2368) and jump to the vector address. The usual technique for this is:
LDR PC, [PC, #-0x0120]
This works assuming the vector is at 0x18 (PC + 0x08 - 0x120 = 0xFFFFFF00), but I can't figure out what code to use when the PC is over the relative limit (+-0x1000). eg this is invalid:
LDR PC, [PC, #-0x10120]
What I want to do is something like:
IRQ_Handler LDR R0, =0xFFFFFF00 LDR PC, [R0]
but without clobbering R0.
Yes, it has been a long time since I've had to do any assembly coding.