inital-commit
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
section .text
|
||||
global _start
|
||||
|
||||
+24
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user