Hello! How can i insert necessary for me asm comands like push/pop? for example i got example from here www.keil.com/.../armclang_ref_chr1383658400125.htm
int add(int i, int j) { int res = 0; __asm ( "ADD %[result], %[input_i], %[input_j]" : [result] "=r" (res) : [input_i] "r" (i), [input_j] "r" (j) ); return res; } int main(void) { int a = 1; int b = 2; int c = 0; c = add(a,b); }
End got a error: Source\main.c(21): error: #18: expected a ")" :D .
But it was strange syntax for me. Then I do next:
int main(void) { __asm { nop nop } }
So it works well, but as sson as I add push/pop or use any registers automaticly catch error
__asm { push {lr} //!!! nop nop add r0, r1 //!!! pop {lr} //!!! }
Can i dissable this error? I'll be able to cortol stack by myself.
Looks to be using GNU/GCC format, you should perhaps check if that is supported by the Keil tools when selected as the default.
In first code wrong number of error string, string with error is
: [result] "=r" (res)
I'm shure that it just a one error from snowball, but this is same string with compiler error.
View all questions in Keil forum