There's something weird going on I don't understand.
I have a data variable:
variable_a dq 0
I check it's 0:
(gdb) x variable_a
0x0: Cannot access memory at address 0x0
So far so good.
I have rax:
(gdb) i r
rax 0x7fffffffe9e2 140737488349666
I MOV rax into variable.
mov [variable_a], rax
I print variable.
(gdb) x variable_a
0xffffffffffffe9e2: <error: Cannot access memory at address 0xffffffffffffe9e2>
Why is this happening? It looks like 1/4 of the variable is getting set to 1s when it should be 0s.
I changed to using a BSS variable and it works just fine. I'm using YASM.