我正在尝试从汇编代码中更改变量的值。但我给出了下一个错误:
main.cpp:10:9: error: 32-bit absolute addressing is not supported in 64-bit mode
这是我正在使用的代码:
#include <iostream>
using std::endl;
using std::cout;
int main()
{
int64_t i = 0;
asm("mov i,%rax");
cout << "i = " << i << endl;
return 0;
}
在Mac OS上使用clang可以做到这一点吗?感谢任何帮助。