what does the the dword operand do in assembly

Brackets in [ESP+18h] mean that the destination of the MOV is memory location at ESP+18h. As an example, if ESP has value 10000000h, then your destination is memory location 10000018h.

DWORD defines ‘size’ of the memory location used for move operation. In you example, you’d be moving 0000000Ah (4 bytes) into memory location ESP+18h. As 0Ah is immediate value its size cannot be determined without using DWORD, WORD, BYTE or other similar qualifier.

Intel convention is to define the ‘size’ of the destination memory location instead of the immediate itself (e.g. MOV DWORD PTR [ESP+18h], 0Ah vs MOV [ESP+18h], dword 0Ah).

Leave a Comment