What does `dword ptr` mean?

2019-01-08 05:44发布

Could someone explain what this means? (Intel Syntax, x86, Windows)

and     dword ptr [ebp-4], 0

3条回答
Summer. ? 凉城
2楼-- · 2019-01-08 06:16

Consider the figure enclosed in this other question. ebp-4 is your first local variable and, seen as a dword pointer, it is the address of a 32 bit integer that has to be cleared. Maybe your source starts with

Object x = null;
查看更多
Anthone
3楼-- · 2019-01-08 06:20

It is a 32bit declaration. If you type at the top of an assembly file the statement [bits 32], then you don't need to type DWORD PTR. So for example:

[bits 32]
.
.
and  [ebp-4], 0
查看更多
欢心
4楼-- · 2019-01-08 06:33

The dword ptr part is called a size directive. This page explains them, but it wasn't possible to direct-link to the correct section.

Basically, it means "the size of the target operand is 32 bits", so this will bitwise-AND the 32-bit value at the address computed by taking the contents of the ebp register and subtracting four with 0.

查看更多
登录 后发表回答