Author Topic: Variable  (Read 93 times)

Offline Siko7

  • Jr. Member
  • *
  • Posts: 3
Variable
« on: January 19, 2019, 01:18:04 PM »
Can someone explain, why the value of the register R9 = 0x200000000000000 and not 0x1 is?

Tanks a lot.

Code: [Select]
SECTION .data
var1: dq 0 ; Variable 1 is initialized to 0
SECTION .text
_start:
mov R9, [var1+1]

Offline debs3759

  • Jr. Member
  • *
  • Posts: 47
  • Country: gb
    • GPUZoo
Re: Variable
« Reply #1 on: January 19, 2019, 07:14:16 PM »
It looks like you are trying to add 1 to var1 then load the result in r9.

What you are actually doing is load r9 with the value stored at the memory location starting at the second byte of var1.
My graphics card database: www.gpuzoo.com