#include <stdint.h>
uint64_t rip;
int main()
{
asm(
"movq %%rip, %0\n" : "=m" (rip)
);
sleep(10);
}
当我编译时,我得到
cc -m64 rip.c -o rip
/tmp/ccwNbZi1.s: Assembler messages:
/tmp/ccwNbZi1.s:12: Error: suffix or operands invalid for `movq'
make: *** [rip] Error 1