init
This commit is contained in:
commit
391e0a21f9
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
*.o
|
||||
a.out
|
||||
main.c
|
19
ft_strcmp.asm
Normal file
19
ft_strcmp.asm
Normal 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
14
ft_strcpy.asm
Normal 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
12
ft_strlen.asm
Normal 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
|
Loading…
Reference in New Issue
Block a user