1

Im new to assembly

Code that is confusing me :


Section .data

V1 dq 0x1ABC00000000000
    
Section .text
 mov eax, dword [v1]
 mov edx, dword [v1+4] 

At debugger it is showing:

eax = 0x0

edx = 0x1ABC0000


My question :

Why eax not showing 0x1ABC0000 Since i selected dword from v1 Starting address

Is dword[v1] =0x[1ABC0000]0000000 And dword[v1+4] = 0x1ABC0000[0000000] ? or is it related to little endian and v1 is shown to me 0x1ABC000000000000(when represented by debugger or when i write it's value in code ) and inside memory it is 0x000000000000BC1A and when i said mov dword [ v1+4] it took from how it is sitting in memory 0x00000000[0000BC1A] and debugger showed to me it as 0x1ABC0000 and edx really in memory sitting 0x0000BC1A ?

  • 5
    x86 is little endian. The least significant bytes are stored at the lower addresses. – Jester Jun 13 '21 at 23:13
  • 2
    Since you are using a debugger (kudos for that) you can use its examine memory feature to look at the bytes directly. – Jester Jun 13 '21 at 23:23

0 Answers0