I am brushing up on my assembly cause I would like to build a compiler without llvm, just plain assembly. I forgot the basics. I am on MAC OS with an x8664 machine. I would like to loop, keeping the counter inside a register, and build the array using the value inside the register as an offset. I keep getting either a mismatch operator
error, or a Mach-O 64-bit format does not support 32-bit absolute addresses
.
I put DEFAULT REL
so technically I can avoid the use of rel
; this is what I want
xor rbx, rbx
mov rax, 1
; now load this inside array
; this is all the stuff I tried, nothing works
mov [final+rbx], rax ; 1
mov byte[final+rbx], rax
mov byte[final+bl], al
mov [final+bl], al
mov [final+bl], rax
section .bss
array resb 3
none of these work. It seems kinda odd, as in this answer link the author uses this mov [array+rsi], al ; store the new value into array
. I have no idea how to solve this, could someone help?