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
Hi there,
Please note that CMSIS (Cortex Microcontroller Software Interface Standard) is extending CMSIS-CORE to Cortex-A processors.
This is still work in progress, but you can see some examples in
https://github.com/ARM-software/CMSIS_5/tree/develop/CMSIS/Core_A
Hope this helps.