add: makefile
This commit is contained in:
0
src/ft_strcmp.asm
Normal file
0
src/ft_strcmp.asm
Normal file
19
src/ft_strcpy.asm
Normal file
19
src/ft_strcpy.asm
Normal file
@ -0,0 +1,19 @@
|
||||
section .text
|
||||
global ft_strcpy
|
||||
|
||||
ft_strcpy:
|
||||
mov rcx, 0
|
||||
loop:
|
||||
mov al, [rsi + rcx]
|
||||
|
||||
mov [rdi + rcx], al
|
||||
|
||||
cmp al, 0
|
||||
je out
|
||||
|
||||
inc rcx
|
||||
|
||||
jmp loop
|
||||
out:
|
||||
mov rax, rcx
|
||||
ret
|
14
src/ft_strlen.asm
Normal file
14
src/ft_strlen.asm
Normal file
@ -0,0 +1,14 @@
|
||||
section .note.GNU-stack noalloc noexec nowrite progbits
|
||||
section .text
|
||||
global ft_strlen
|
||||
|
||||
ft_strlen:
|
||||
mov rcx, 0
|
||||
loop:
|
||||
cmp BYTE [rdi + rcx], 0
|
||||
je out
|
||||
inc rcx
|
||||
jmp loop
|
||||
out:
|
||||
mov rax, rcx
|
||||
ret
|
Reference in New Issue
Block a user