I'm using mingw 4.7.2.
Could someone please tell me what's wrong in this MACRO All I want to do is a simple asm macro which add two int and puts the result into result variable
#define add(result,a,b) \ __asm__ __volatile__( \ " movl %1, %%eax \n" \ " addl %2, %%eax \n" \ " movl %%eax, %0 \n" \ " :"=r"(result) \ :"r"(a),"r"(b) ) The compiler says error: missing terminating " character
Thanks in advance
eaxin your clobber (or use the fact that %1 is already in a register, so you don't actually need to move it anywhere to add it to another register)