首页 文章

push dword ptr [eax 22]是什么意思?

提问于
浏览
0

我知道,例如push eax会将eax保存到堆栈并将esp减少4.而push dword ptr意味着它需要推送4个字节,但后来我很困惑 . 如果是[esi 22]那么这也是一回事吗?

2 回答

  • 0

    与许多其他x86指令非常相似, push 指令可以采用各种操作数:立即值,寄存器和内存地址:

    push 10                 ; pushes the value 10 (32 bits in 32-bit mode)
    push eax                ; pushes the contents of the 32-bit register eax
    push DWORD [ebx + 42]   ; pushes 32 bits from the memory location ebx + 42
    

    寄存器形式从寄存器的大小推断出大小 . 存储器形式需要具有指定的大小(例如,在此处以英特尔语法显示) . 对于立即值,操作数大小为16或32位;当前模式是默认模式,可以明确选择其他大小(例如,32位模式下的 push WORD 10 ) .

  • 5

    push dword ptr [eax+22]esp 减少4,然后从内存位置 ebx + 22 保存4bytes数据 . 并且 pop eax 以相反的方式执行,首先将 esp 中存储的位移动到 esp + 3eax ,然后将 esp 递增4 .

相关问题