inital-commit

This commit is contained in:
2025-07-07 11:37:59 +02:00
commit aa86683b35
4 changed files with 57 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
section .text
global _start
+24
View File
@@ -0,0 +1,24 @@
SYS_WRITE equ 1
STDOUT equ 1
print_str: ; takes pointer to string in rdi and retuns in rax
push rsi
push rdx
mov rsi, rdi
mov rdx, 0
.count_loop:
cmp byte [rsi+rdx], 0
je .print
inc rdx
jmp .count_loop
.print:
mov rax, SYS_WRITE
mov rdi, STDOUT
syscall
pop rdx
pop rsi
ret