我正在尝试使用 gcc 编译器在 linux 下编译此代码:
static inline unsigned long get_current(void)
{
unsigned long current;
asm volatile (
" movl %%esp, %%eax;"
" andl %1, %%eax;"
" movl (%%eax), %0;"
: "=r" (current)
: "i" (0xfffff000)
);
return current;
}
但我收到了这个错误:
program.c: Assembler messages: program.c:455: Error: incorrect
register `%rbx' used with `l' suffix
这里有什么问题?