20 lines
403 B
NASM
20 lines
403 B
NASM
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
|