-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathx86.asm
More file actions
17 lines (14 loc) · 708 Bytes
/
x86.asm
File metadata and controls
17 lines (14 loc) · 708 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 eax, 4 ; syscall number for sys_write (4)
mov ebx, 1 ; file descriptor (1 = stdout)
mov ecx, msg ; pointer to the message
mov edx, len ; length of the message
int 0x80 ; trigger system call
mov eax, 1 ; syscall number for sys_exit (1)
xor ebx, ebx ; exit code 0
int 0x80 ; trigger system call