Skip to content

Commit d308189

Browse files
committed
write message with system call
1 parent 4998e26 commit d308189

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

ex2

8.45 KB
Binary file not shown.

ex2.asm

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
global _start
3+
4+
section .data
5+
msg db "Hello, world!", 0x0a
6+
len equ $ - msg
7+
8+
section .text
9+
_start:
10+
mov eax, 4 ; sys_write system call
11+
mov ebx, 1 ; stdout file descriptor
12+
mov ecx, msg ; bytes to write
13+
mov edx, len ; number of bytes to write
14+
int 0x80 ; perform system call
15+
mov eax, 1 ; sys_exit system call
16+
mov ebx, 0 ; exit status is 0
17+
int 0x80

0 commit comments

Comments
 (0)