doubtsman
Newbie
Hi,
I am trying to load address of a C variable to register R3 using inline assembly using arm-none-eabi-gcc toolchain for cortex m4 microcontroller.
I am able to load the value of the variable but not sure how to load the address of variable. Any tips ?
I am trying to load address of a C variable to register R3 using inline assembly using arm-none-eabi-gcc toolchain for cortex m4 microcontroller.
I am able to load the value of the variable but not sure how to load the address of variable. Any tips ?
C:
volatile uint32_t val = 100;
asm("ldr r3, %[value]"
:
: [value]"m" (val) /* How to copy address of val to r3 ?*/
: /* No clobbers */
);