Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

inline assembly in ARM Cortex to load address of a C variable to register

Status
Not open for further replies.

doubtsman

Newbie
Newbie level 1
Joined
Oct 28, 2020
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
14
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 ? :)


C:
volatile uint32_t val = 100;


asm("ldr    r3, %[value]"
    :
    : [value]"m"   (val) /* How to copy address of val to r3 ?*/
    : /* No clobbers */
   );
 




Regards, Dana.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top