作者在 2010-08-18 01:25:50 发布以下内容
/**
* hello_asm_reg.c -- a demo for printing "Hello, Gcc Inline Assembly World!n" in gcc inline assembly
* */
int main(void)
{
char *str="Hello, Gcc Inline Assembly World!n";
__asm__ __volatile__ (
"pushl %%edx\n"
"call puts\n"
:
:"d"(str)
);
return 0;
}
* hello_asm_reg.c -- a demo for printing "Hello, Gcc Inline Assembly World!n" in gcc inline assembly
* */
int main(void)
{
char *str="Hello, Gcc Inline Assembly World!n";
__asm__ __volatile__ (
"pushl %%edx\n"
"call puts\n"
:
:"d"(str)
);
return 0;
}