This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How do I access void pointer in ARM Assembly?

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?

Parents Reply Children
  • 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.