add other basic functions and test with them

This commit is contained in:
2025-03-29 19:54:58 +01:00
parent 76cf33dd1c
commit b6ad45ab6d
17 changed files with 311 additions and 6 deletions

View File

@ -0,0 +1,20 @@
global ft_write
extern __errno_location
section .text
ft_write:
mov rax, 1 ;syscall number for write, args are already set at the right place
syscall
cmp rax, 0 ; if return is < 0, it's an error in negative
jg success
neg rax ; inv errno, and set errno
mov edi, eax
call __errno_location wrt ..plt
mov [rax], edi
mov rax, -1
success:
ret