2

Im having trouble understanding how the address location is determined when decoding from assembly to Y86. In the example,

0x030          
0x030: 6300                     # xorq %rax , %rax
0x032: 50030001000000000000     # mrmovq 0x100(%rax ) , %rbx
0x03c: 50010002000000000000     # mrmovq 0x200(%rax ) , %rcx

how does the address location go from 0x030 to 0x032 to 0x03c? What is the equation for determining how much the location is increased by?

Mika Lammi
  • 1,278
  • 9
  • 21

1 Answers1

2

How many bytes are there in 6300? Answer: 2 and 0x030 + 2 = 0x032. How many bytes are there in 50030001000000000000? Answer: 10 and 0x032 + 10 = 0x03c.

So you just count the number of bytes in the machine code and add to the previous address to get the next address.

user3386109
  • 34,287
  • 7
  • 49
  • 68