assembly-playground/x86-64/hello.asm

20 lines
403 B
NASM
Raw Normal View History

2024-06-11 13:42:37 +07:00
format ELF64 executable 3
segment readable executable
entry main
main:
lea rsi, [msg] ; load effective address of msg into rdi
mov rax, 0x01 ; move 1 into rax (write syscall)
mov rdi, 1 ; stdout = 1
mov rdx, 14 ; add length to rdx register
syscall
mov rdi, 0 ; 0 return code
mov rax, 0x3c # exit syscall number
syscall
segment readable writable
msg db "Hello world!", 10, 0