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

main.s

        .globl _start

        .section .rodata
msg:    .ascii "Hello World!\n"
        .set MSG_LEN, . - msg

        .section .text
_start:
        ##  write (STDOUT_FILENO, msg, MSG_LEN)
        movq $1, %rax       # sys_write
        movq $1, %rdi       # STDOUT_FILENO
        movq $msg, %rsi
        movq $MSG_LEN, %rdx
        syscall

        ##  exit (0)
        movq $60, %rax   # sys_exit
        movq $0, %rdi
        syscall

build instructions

as -o main.o main.s
ld -o main main.o