int Math::test_iadd(int a, int { __asm volatile ( "add r0, %0, %1 \n\t" : : "r" (a), "r" ( : "r0" );}
int Math::test_iadd2(int a, int { int ret; __asm volatile ( "add %0, %1, %2 \n\t" : "=r" (ret) : "r" (a), "r" ( : "r0" ); return ret;}
Yes, but you are assuming the compiler (which parses the inline assembler and can shove it through the optimizer) actually assigns the "real" r0 to the symbolic r0 in your program and hasn't reordered any of the instructions in the instruction stream.