We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I have to write an assembly code in arm (cortex A-8) ,which assigns a value passed by the user(pass by value) to a particular general purpose register(for example r0).
my function looks like this
int assign_to_reg(int x)
{
MOVE_TO_R0(x);
return 0;
}
And the MACRO looks like this,
#define MOVE_TO_R0(val) \ __asm__ __volatile__ \ ( \ "mov r0, %0" \ : \ :"r0" (val) \ );
This assembly code is not assigning value to r0 .can anyone please help me on this