Once again, I play with MinGW inline assembly.
#include <stdio.h>
int foobar(int);
int main(){
int n = 0;
printf("Number: ");
scanf("%d", &n);
printf("\n%d",foobar(n));
return 0;
}
int foobar(int num){
int result = 0;
asm(".intel_syntax noprefix\n");
asm("mov eax, num\n");
asm("add eax, 110b\n");
asm("sub eax, 2\n");
asm("mov result, eax\n");
return result;
}
Compile it:
C:\Users\Andre\Codes>gcc asmtest.c -o asmtest -masm=intel
Ouch, there are errors:
C:\Users\Andre\AppData\Local\Temp\ccqny4yb.s: Assembler messages: C:\Users\Andre\AppData\Local\Temp\ccqny4yb.s:53: Error: backward ref to unknown label "110:"
What's wrong here? I think my code is valid already?