嵌入汇编在ubuntu下不能编译
本帖最后由 zhanghuafeng25 于 2013-02-21 16:28 编辑在unbuntu下用内嵌函数编写程序老是报错,不能通过!不知道是什么原因!
这是原程序
#include<stdio.h>
int main(void)
{
int input, output,temp;
input = 1;
__asm__ __volatile__("movl $0, %%eax;
movl %%eax, %1;
movl %2, %%eax;
movl %%eax, %0; "
:"=m"(output),"=m"(temp) /**//* output */
:"r"(input) /**//* input */
);
return 0;
}
这是出错提示:
yo.c:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’n
myo.c:6:28: warning: missing terminating " character
myo.c:6: error: missing terminating " character
myo.c:9:31: warning: missing terminating " character
myo.c:9: error: missing terminating " character
请高手指点一下,是什么原因导致的!
页:
[1]