We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hopefully someone knows...
I'm writing a jump table for a number of functions. The jump table located '__at' a location in memory contains __asm instructions to branch to all required functions defined previously, using "__asm{B func1}", for example.
Some code I am using contains a function pointer array (*funcptr[16])(arg..), and I'm not sure how to branch to it. if I try __asm{B funcptr}, the compiler (uvision3) complains that the "Target is out of range", which is understandable. Unfortunately my asm abilities are nearly non-existent and I'm unsure how to rectify it.
extern void func1(char stuff); extern void(* funcptr[16]) (unsigned int arg); void usb_table(void) __at 0x00002000 } __asm{B func1} // located at 0x2000 __asm{B funcptr} // target out of range {
Just to note, the jump table at 0x2000 is still in flash, but it will be moved to SRAM later along with the rest of the code.