program 002 - Hello World with kernel
architecture x86-64
assembler nasm

main.asm

        global _start

        section .rodata
msg:    db "Hello World!", 10
MSG_LEN equ $ - msg

        section .text
_start:
        ;;  write (STDOUT_FILENO, msg, MSG_LEN)
        mov rax, 1      ; sys_write
        mov rdi, 1      ; STDOUT_FILENO
        mov rsi, msg
        mov rdx, MSG_LEN
        syscall

        ;;  exit (0)
        mov rax, 60     ; sys_exit
        mov rdi, 0
        syscall


build instructions

nasm -f elf64 -o main.o main.asm
ld -o main main.o