-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathx86-64.asm
More file actions
17 lines (14 loc) · 709 Bytes
/
x86-64.asm
File metadata and controls
17 lines (14 loc) · 709 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
section .data
msg db "Hello, World!", 0xA ; string to print with newline
len equ $ - msg ; length of the string
section .text
global _start
_start:
mov rax, 1 ; syscall number for sys_write (1)
mov rdi, 1 ; file descriptor (1 = stdout)
mov rsi, msg ; pointer to the message
mov rdx, len ; length of the message
syscall ; trigger system call
mov rax, 60 ; syscall number for sys_exit (60)
xor rdi, rdi ; exit code 0
syscall ; trigger system call