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

Soa*_*oap 1 x86 assembly

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

Ker*_* SB 6

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
Run Code Online (Sandbox Code Playgroud)

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