ICC内联汇编程序不喜欢push / pop

时间:2012-01-12 11:37:00

标签: inline-assembly icc

我尝试在ms asm中使用icc内联执行汇编程序:

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不接受推送和弹出?

提前致谢!

1 个答案:

答案 0 :(得分:0)

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

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

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