This commit is contained in:
starnakin 2024-08-07 17:42:16 +02:00
commit 391e0a21f9
5 changed files with 48 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
*.o
a.out
main.c

0
Makefile Normal file
View File

19
ft_strcmp.asm Normal file
View File

@ -0,0 +1,19 @@
section .text
global ft_strcmp
ft_strcmp:
mov rax, rdi
mov rbx, rsi
loop:
mov al, [rax]
mov bl, [rbx]
cmp al, bl
jne out
cmp al, 0
je out
inc rax
inc rbx
jmp loop
out:
sub rax, rbx
ret

14
ft_strcpy.asm Normal file
View File

@ -0,0 +1,14 @@
section .text
global ft_strcpy
ft_strcpy:
mov rax, 0
loop:
mov bl, [rsi + rax]
mov [rdi + rax], bl
cmp BYTE [rsi + rax], 0
je out
inc rax
jmp loop
out:
ret

12
ft_strlen.asm Normal file
View File

@ -0,0 +1,12 @@
section .text
global ft_strlen
ft_strlen:
mov rax, 0
loop:
cmp BYTE [rdi + rax], 0
je out
inc rax
jmp loop
out:
ret