GCC内联汇编错误:表达式后垃圾`(%ebp)+4'

时间:2011-06-02 06:08:20

标签: c++ visual-c++ gcc assembly inline-assembly

我正在尝试编译内联汇编(使用 -fasm-blocks ),它在 MSVC 中工作,但 GCC 给了我< strong>垃圾`(%ebp)+4'表达后错误...为什么它不接受语法,我该如何解决这个问题?

uint64_t _tmp = 100;

_asm
{
     //_tmp value may be changed
     //...
     cmp dword ptr _tmp, 100 // Ok
     jnae temp
     cmp dword ptr _tmp + 4, 50 // It seems GCC doesn't want to accept _tmp + 4
     jnae temp
     //...
     temp:
};

1 个答案:

答案 0 :(得分:3)

您应将其更改为:

cmp dword ptr [_tmp + 4], 50