; 2 and 24 below are SYSCALL_CLASS_UNIX and SYSCALL_CLASS_SHIFT, defined in ; http://opensource.apple.com/source/xnu/xnu-1228/osfmk/mach/i386/syscall_sw.h .code public start,main start: ; Entry point main: ; gdb breakpoint MOV RAX,2 shl 24 or 4 ; SYS_write (/usr/include/sys/syscall.h) MOV RDI,1 ; File descriptor 1: stdout (standard output) LEA RSI,MSG ; String address MOV RDX,LEN ; Strings length SYSCALL ; Call the corresponding OS kernel function MOV RAX,2 shl 24 or 1 ; SYS_exit (process termination) SYSCALL .data MSG db 'Hello, world!',10,10 LEN dq $ - MSG end