ICC内联汇编器不喜欢push/pop [英] ICC inline assembler doesn`t like push/pop

查看:321
本文介绍了ICC内联汇编器不喜欢push/pop的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在msasm中使用icc内联汇编程序:

I try to excute assembler inline with icc in msasm:

int main (void)
{
  __asm{
    mov eax, 5h;  //works
    push eax;     // after shell command /opt/intel/bin/icc -use_msasm asm.c:
                  // asm.c(7): (col. 5) error: Unsupported instruction form in asm                          
                  // instruction push.

   //pop ebp;    // the same 
        };

printf("success!\n");
return 1;
}

有人知道为什么icc不接受推送和弹出吗?

Does anybody know why icc doesn`t accept push and pop?

提前谢谢!

推荐答案

您应该改用x64版本的寄存器. 因此正确的版本应如下所示:

You should use x64 version of registers instead. So the correct version should like this:

__asm{
    mov rax, 5h;
    push rax;
};

此外,在处理指针,0x8 *******等时,请注意体系结构的差异.在未先阅读内联代码的情况下,切勿使用批处理Find and Replace.

Also, pay attention to architecture differences when dealing with pointers, 0x8*******, etc. You should never use batch Find and Replace without reading your inline first.

这篇关于ICC内联汇编器不喜欢push/pop的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆