Files
libasm/ft_write.s
2024-03-19 12:45:17 +01:00

17 lines
237 B
ArmAsm

global ft_write
extern __errno_location
ft_write:
mov eax, 0x1 ; put the syscall number of write
syscall
test rax, rax
js .error
ret
.error:
mov rdx, rax
call __errno_location wrt ..plt
neg rdx
mov [rax], rdx
mov rax, -1
ret