NASM - The Netwide Assembler
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Search
Calendar
Login
Register
NASM - The Netwide Assembler
»
NASM Forum
»
Programming with NASM
»
Variable
« previous
next »
Print
Pages: [
1
]
Author
Topic: Variable (Read 9129 times)
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]
Logged
debs3759
Global Moderator
Full Member
Posts: 224
Country:
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.
Logged
My graphics card database:
www.gpuzoo.com
Print
Pages: [
1
]
« previous
next »
NASM - The Netwide Assembler
»
NASM Forum
»
Programming with NASM
»
Variable