Clean up Assembly files (#1003)

This commit is contained in:
MrBrain295
2021-05-08 09:57:36 -05:00
committed by GitHub
parent 45856bf57b
commit 7f7369291b
20 changed files with 174 additions and 196 deletions

View File

@@ -1,17 +1,16 @@
section .rodata
msg db "Hello World", 0xA ; String to print
len equ $- msg ; Length of string
msg db "Hello World", 0xA
len equ $- msg
section .text
global _start ; Specify entry point to linker
global _start
_start:
mov eax, 1 ; System call ID (sys_write)
mov edi, eax ; File descriptor (stdout)
mov esi, msg ; Text to print
mov edx, len ; Length of text to print
syscall ; Call kernel
mov eax, 1
mov edi, eax
mov esi, msg
mov edx, len
syscall
mov eax, 60 ; System call ID (sys_exit)
xor edi, edi ; Error code (EXIT_SUCCESS)
syscall ; Call kernel
mov eax, 60
xor edi, edi
syscall