I am trying to pull the data from the link register and save it to a c variable. I could not find a structure to use to find the LR, so I am trying to use inline assembly to save it to a varibale. Looking online, i tried doing the following:
int val;
asm(" mov r14,%0" : "=r" (val));
When I do that, i get an error saying it expected a ")". When I try:
int val;
asm(" mov r14,val");
I get errors for undefined symbol and invalid operand. What would be the right way to use inline assembly to write to a c variable? Is there an easier way to save the link register in a variable?
Thanks