Reputation: 523
What is the difference between:
1st
mov cx, word ptr d
-loads a word size value of d into cx
2nd
mov cx, word ptr d + 2
-what does that + 2 do ?
Upvotes: 1
Views: 282
Reputation: 58467
In MASM/TASM syntax (which your code seems to be using), mov cx, word ptr d
means the same thing as mov cx, word ptr [d]
. So mov cx, word ptr d + 2
is the same as mov cx, word ptr [d + 2]
(i.e. it's reading a word from the address of d
plus 2 and storing the value in cx
).
Upvotes: 2
Reputation: 409206
If I'm not misremembering, it adds an offset to the address d
.
Upvotes: 0