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

时间:2014-02-06 06:11:52

标签: assembly x86

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

2 个答案:

答案 0 :(得分:5)

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

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)。

答案 1 :(得分:0)

push dword ptr [eax+22]会将esp递减4,然后从内存位置ebx + 22保存4字节数据。 并且pop eax以相反的方式执行操作,首先将esp中存储的位移至esp + 3eax,然后将esp增加4。

相关问题