Fixed a lot of segfaults and bad practices

This commit is contained in:
2024-03-18 10:12:30 +01:00
parent c8170cfd3e
commit ddabaeba7f
10 changed files with 146 additions and 15 deletions

View File

@@ -1,10 +1,10 @@
extern _strcpy
global ft_strcpy
_strcpy:
ft_strcpy:
xor rbx, rbx
.cpy:
cmp dword [rsi + rbx], 0
cmp byte [rsi + rbx], 0
je .end
mov rax, [rsi + rbx]
mov [rdi + rbx], rax
@@ -12,5 +12,6 @@ _strcpy:
jmp .cpy
.end:
mov byte [rdi + rbx], 0
mov rax, rdi
ret