I am trying to teach myself NASM on my 64-bit MacBook Pro. I've got the typical Hello World program compiling and running correctly.
I'm trying to do some simple arithmetic by following the code here... http://www.csee.umbc.edu/portal/help/nasm/intarith_64.asm
However I cannot get a simple assignment to work. When I try and compile this using nasm -f macho64 filename.asm
I get the following message:
error: Mach-O 64-bit format does not support 32-bit absolute addresses
referring to the line mov [b], rax
. Does anyone have any suggestions on how to overcome this?
global start
section .data
a: dq 1
section .bss
b: resq 1
section .text
start:
mov rax, [a]
mov [b], rax