int main()
{
__asm__(\"movl $0x1,%%eax;
movl $0x0,%%ebx;
int $0x80;
\":::\"eax\",\"ebx\");
}
I try to simul
From what I remember of inline assembly, you probably need to terminate each line with \n\t
after the semicolon or something like that.
Clarification:
It is not enough to terminate each line in inline assembly with ;
. Inline assembly is fed directly to the assembler by gcc as a string. If you do not terminate each line with \n
, the assembler will get strings like movl $0x1,%%eax;movl $0x0,%%ebx;
which it will not be able to parse. You probably do not need to use \n\t
any longer since gcc can handle assembly files where commands are not preceded by \t
.
You cannot have embedded newlines inside quoted strings
// bad
"two
lines"
Rewrite as
// good
"two\n"
"lines"
The preprocessor will join the strings seamlessly, to
"two\nlines"