
for the 64 bit MacOS quine, i have to thank Samuel Evans-Powell for the "default rel" needed in the .data section coz the source code would be longer without it.
and how to pass a data address to a formatting and locking it at the required parameter for printf()
note:
replace the parentheses with square brackets coz the forum does weird formatting with square brackets with i & x inside.
....
lea rdi,(i) ; pass "%s" as the destination
lea rax,(x) ; prep data by getting its address
mov rsi,rax ; set the data as the source | printf("%s", data);
xor rax,rax ; lock the parameters @ 2 items
call _printf ; do magic
....
section .data
default rel ; no need to use [rel i], [rel x]
x:db 2Ch,32h,37h,68h,2Ch,30h,0
i:db 25h,73h,0
his website :
http://sevanspowell.net/posts/learning-nasm-on-macos.htmland to assemble the 32 and 64 bit MacOS quines, use this nasm version
https://www.nasm.us/pub/nasm/releasebuilds/2.08rc1/which is alright and proper since MacOS Snow Leopard's built in NASM version is 0.98 (no MACHO64 directive)
NASM 2.08 already has directive for MACHO64 and the assembler can natively run on MacOS.
so to replicate my results, you should do everything in MacOS Snow Leopard WITH NASM 2.08(RCs)