Skip to content

Commit 571e828

Browse files
committed
Reverted simple hello world
1 parent dc8f1c2 commit 571e828

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

HelloWorld/HelloWorld.asm

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,11 @@ section .text
1111

1212
_start:
1313

14-
xor eax, eax ;clean up the registers to avoid generating nulls
15-
xor ebx, ebx
16-
xor edx, edx
17-
xor ecx, ecx
14+
mov eax, 4 ; ssize_t sys_write(unsigned int fd, const char * buf, size_t count) (write in console)
15+
mov ebx, 1 ; sys_write argv #1 (unsigned int)
16+
mov ecx, msg; sys_write argv #2 (char *)
17+
mov edx, len; sys_write argv #3 (size_t)
18+
int 0x80 ; interrumpt system (execute)
1819

19-
; Using 8 bits registers because 16 bits are unused
20-
21-
mov al, 4 ; ssize_t sys_write(unsigned int fd, const char * buf, size_t count) (write in console)
22-
mov bl, 1 ; sys_write argv #1 (unsigned int)
23-
mov cl, msg; sys_write argv #2 (char *)
24-
mov dl, len; sys_write argv #3 (size_t)
25-
int 0x80 ; interrumpt system (execute)
26-
27-
xor eax, eax
28-
mov al, 1 ; sys_exit
29-
xor ebx,ebx
20+
mov eax, 1 ; sys_exit
3021
int 0x80

0 commit comments

Comments
 (0)