I have a Windows Mobile 6 ARMV4I project where I would like to get the program counter value.
The function is declared as follows:
extern "C" unsigned __int32 GetPC();
My build code is as follows:
GetPC FUNCTION
EXPORT GetPC
ldr r0, [r15] ; load the PC value in to r0
mov pc, lr ; return the value of r0
ENDFUNC
But when I call the function GetPC(), I get the same number every time. So, I assume that my assembly does not do what I think it does. Can someone point out what I can do wrong?
Thanks PaulH
Paulh source
share