Since [si] in brackets is like the value at the address si like the *si in C
and since offset si is like &si
what about ptr in
mov dword ptr [si], ax
?
Since [si] in brackets is like the value at the address si like the *si in C
and since offset si is like &si
what about ptr in
mov dword ptr [si], ax
?
Here's a concrete example:
Assuming this memory situation (all numbers in hexadecimal), each box represents one byte:
mov eax, dword ptr [si],eaxcontains66554433.mov eax, word ptr [si],ax(16 low bits ofeax) contains4433.mov eax, byte ptr [si],al(8 low bits ofeax) contains33.dword ptr [x]means: we want to read/write a double word (4 bytes) from/to the memory address contained inx.word ptr [x]means: we want to read/write a word (2 bytes) from/to the memory address contained inxmemory adddre.byte ptr [x]means: we want to read/write a single byte from/to the memory address contained inx.Now you may ask why we need to put
dword ptrand not justdword. It's just a convention.