How can I access the void pointer in C, using arm inline assembly. I want to get the address of the pointer. Something like this,
void* funcAddr;
__asm(
"LDR r0, =funcAddr"
);
Is there any way to do this?
Local is being placed in the stack. As long as the stack frame lives yes but once you return from/unwind the frame no. See:
void Func(void) {
void (*FuncPointer) (void);
FuncPointer = FuncPointed;
(*FuncPointer) (); //run FuncPointed()
return;
}
then in assembly
bl Func
next instruction
And only in Func() you can refer to the symbol FuncPointer (eg. adr, ldr as above). Once you go out of the function (after "ret" in assembly) the FuncPointer doesn't exist, the stack frame got unwound.
That's general not assembly or inline assembly specific.