Tool/software: Linux
I want to write the equivalent inline assembly code for the below C code
It should support ARMv7-a and GNU v5.3.1 (LInaro)
if (low >= 0x01)
{
low -= 0x01;
propagate_carry(ptr);
}
Here ptr is any pointer.
Can someone help me out with this?
I tried like this :
__asm
(
"SUB %[input_low], #0x01 \n"
"MOV eax, %[Input1] \n"
"PUSH eax \n"
"CALL propagate_carry \n"
"POP ebx \n"
: [Input1] "=m" (ptr), [input_low] "=r" (low)
);
While building on CCS 6.2 it is throwing errors :
/tmp/ccDdqZ7X.s: Assembler messages:
/tmp/ccDdqZ7X.s:1565: Error: ARM register expected -- `mov eax,[fp,#-16]'
/tmp/ccDdqZ7X.s:1566: Error: expression too complex -- `push eax'
/tmp/ccDdqZ7X.s:1567: Error: bad instruction `call propagate_carry'
/tmp/ccDdqZ7X.s:1568: Error: expression too complex -- `pop ebx'