; uasm -Fo hellon6u.o -elf64 -q -mf -Fl -Sa -zcw -Zd hellon6u.s ; tail -4 hellon6u.s | as -o ident.o - ; ld -o hello hellon6u.o ident.o .code public _start,main _start: ; Entry point main: ; gdb breakpoint MOV RAX,4 ; SYS_write (see /usr/include/sys/syscall.h) MOV RDI,1 ; File descriptor 1: stdout (standard output) MOV RSI,OFFSET MSG; String address MOV RDX,LEN ; String length SYSCALL ; Call the corresponding OS kernel function MOV RAX,1 ; SYS_exit (process termination) SYSCALL .data MSG db 'Hello, world!',10,10 LEN equ $ - MSG end .section ".note.netbsd.ident", "a" .int 7,4,1 .ascii "NetBSD\0\0" .int 200000000 # Version 2.0 is the first one ported to AMD64