Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;64 bit
- ;nasm -f elf64 main.asm -o main.o
- ;ld main.o -o test
- section .data
- msg: db "Hello World !", 10
- msgLen: equ $-msg
- section .text
- global _start
- _start:
- mov rax, 1 ; sys_write
- mov rdi, 1 ; write to stdout
- mov rsi, msg ; string address
- mov rdx, msgLen ; size of string
- syscall ; syscall
- mov rax, 60 ; sys_exit
- mov rdi, 0 ; return code 0
- syscall ; syscall
Advertisement