本文介绍了gcc,内联汇编 - 缺少 pushad/popad?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有什么方法可以避免将 pushad
/poppad
指令体复制粘贴到我的代码中?
因为 gcc (current flags: -Wall -m32
) 抱怨
__asm__("pushad;");
错误:没有这样的指令:`pushad'
__asm__("poppad;");
错误:没有这样的指令:`poppad'
解决方案
GCC 使用 AT/T 汇编语法,而 pushad/popad
是 Intel 约定,试试这个:
__asm__("pushal;");__asm__("popal;");
Any way to avoid having to copy-paste the pushad
/popad
instruction body into my code?
Because gcc (current flags: -Wall -m32
) complains that
__asm__("pushad;");
__asm__("popad;");
解决方案
GCC use AT/T assembly syntax, while pushad/popad
are Intel convention, try this:
__asm__("pushal;");
__asm__("popal;");
这篇关于gcc,内联汇编 - 缺少 pushad/popad?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!