非常不言自明的代码。为什么它不起作用!
#include <stdio.h>
int main() {
__asm__("number dw 0"); // declare number?
printf("%d",number);
__asm__("mov %eax,number"
"inc %eax"
"mov number,%eax");
printf("%d",number);
return 0;
}
cc ex1.c -o ex1
ex1.c: In function ‘main’:
ex1.c:22:17: error: ‘number’ undeclared (first use in this function)
ex1.c:22:17: note: each undeclared identifier is reported only once for each function it appears in
make: *** [ex1] Error 1
谢谢。
我有很多知识空白要填补...... gcc 手册让我对内联汇编感到困惑,谷歌的教程结果也是如此......
在英特尔 i7 处理器上工作