Re:stack pointer access?
Yes, you must get it from the stack. Just pay attention to use the correct stack pointer. The interrupts always use the main stack pointer and the user code can use the process or the main stack pointer.
Once you know which stack pointer you user code is using you will find the PC at StackPointer + 24.
In case you must get the process stack pointer you must use the following instruction:
mrs r0, psp
This instruction will load the current process stack pointer to the register r0.
To load then the PC to the register r0 you can then use (assuming the correct stack pointer is stored in r0 before):
ldr r0, [r0, #24]
Hope can help,
Ravaz
Post edited by: ravaz, at: 2008/08/13 19:45
login or register to reply
|