此函数用于获取堆栈的起始地址:
unsigned long find_start(void){
__asm__("movq %rsp, %eax");
}
当我编译它时,得到一个错误:
Error: suffix or operands invalid for `movq'
最佳答案:
movq
是需要64位操作数的指令。rsp
是64位寄存器,而eax
是32位寄存器。
也许可以试试?
此函数用于获取堆栈的起始地址:
unsigned long find_start(void){
__asm__("movq %rsp, %eax");
}
Error: suffix or operands invalid for `movq'
最佳答案:
movq
是需要64位操作数的指令。rsp
是64位寄存器,而eax
是32位寄存器。
也许可以试试?