dword ptr
部分称为大小指令。 This page 解释了它们,但无法直接链接到正确的部分。
基本上,它的意思是“目标操作数的大小是 32 位”,所以这将通过取 ebp
寄存器的内容并用 0 减去 4 来计算地址处的 32 位值。
考虑 the figure enclosed in this other question。 ebp-4
是您的第一个局部变量,并且被视为双字指针,它是必须清除的 32 位整数的地址。也许你的来源开始于
Object x = null;
这是一个 32 位的声明。如果在程序集文件的顶部键入语句 [bits 32],则无需键入 DWORD PTR。例如:
[bits 32]
.
.
and [ebp-4], 0
PTR
部分? dword 不足以编码大小吗? NASM 不使用ptr
AFAIK。Modern processors, including embedded systems, usually have a word size of 8, 16, 24, 32, or 64 bits, while modern general purpose computers usually use 32 or 64 bits.
en.wikipedia.org/wiki/Word_(computer_architecture)PTR
吗?