I am trying to compile and link my first program on Assembler. I try to compile the following code:
; %include \"stud_io.inc\"
global _main
section .te
I would recommend first updating your NASM.
After that, try running this:
nasm -f macho64 main.asm -o main.o && ld -e _main -macosx_version_min 10.8 -arch x86_64 main.o -lSystem
Notice that the new command adds JasonD's suggestion above (macho64
), but also adds the -lSystem
to the ld
command to stop ld from throwing following error:
ld: dynamic main executables must link with libSystem.dylib for architecture x86_64