小太郎
小太郎

Reputation: 5620

What does `dword ptr` mean?

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

and     dword ptr [ebp-4], 0

Upvotes: 161

Views: 208673

Answers (3)

unwind
unwind

Reputation: 400109

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.

Upvotes: 162

L4m0r
L4m0r

Reputation: 95

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

Upvotes: 7

mico
mico

Reputation: 1926

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;

Upvotes: 11

Related Questions