3
未知的令牌當編譯此代碼與蘋果LLVM 4.1在Xcode我得到一個錯誤:內聯彙編使用LLVM Intel語法:在表達
#include <stdio.h>
int main(int argc, const char * argv[])
{
int a = 1;
printf("a = %d\n", a);
asm volatile(".intel_syntax noprefix;"
"mov [%0], 2;"
:
: "r" (&a)
);
printf("a = %d\n", a);
return 0;
}
的錯誤是Unknown token in expression
。
如果我在& T語法,它工作正常:
asm volatile("movl $0x2, (%0);"
:
: "r" (&a)
: "memory"
);
什麼是錯的第一個代碼?
相關:http://stackoverflow.com/questions/ 10990018 /如何對生成組件代碼與 - 鐺功能於Intel的語法 –