; Print "hello world" on an AMD64 in long mode under Linux ; ; To compile and run: ; yasm -f elf -m amd64 hello.asm (yasm installed at olin.fit.edu:/udrive/faculty/mmahoney/yasm-0.4.0/yasm) ; gcc hello.o -o hello ; ./hello bits 64 global main extern printf section .data ; writable data greeting db 'hello world',10,0 section .text ; code and read-only data main: mov rdi, greeting ; first 6 args in rdi,rsi,rdx,rcx,r8,r9 then push from right call printf ret