Muhammad Ahsan
Muhammad Ahsan

Reputation: 11

Use of Ptr operator?

I get confused about this - please can any one tell me how it works ?

array db 10,20,30,40

mov eax,DWORD PTR array    ;eax should contains 40302010 (in Little endian.)

but this is not working in my computer/system. Please can anyone help me - why is it like that ? In my program it contains some garbage value. Please help me.

Upvotes: 1

Views: 616

Answers (1)

Jens Björnhager
Jens Björnhager

Reputation: 5649

Your eax contains $281E140A. The hexadecimal $28, $1E, $14 and $0A corresponds to your declared elements. for it to say $40302010, your array needs to be:

array db $10,$20,$30,$40

Upvotes: 2

Related Questions