add other basic functions and test with them
This commit is contained in:
@ -0,0 +1,29 @@
|
||||
section .text
|
||||
global ft_strcpy
|
||||
|
||||
ft_strcpy:
|
||||
test rdi, rdi
|
||||
je err
|
||||
test rsi, rsi
|
||||
je err
|
||||
push rdi
|
||||
jmp loop_start
|
||||
condition_check:
|
||||
mov al, [rdi]
|
||||
test al, al
|
||||
je end
|
||||
|
||||
loop_start:
|
||||
mov rax, [rsi]
|
||||
mov [rdi], rax
|
||||
lea rdi, [rdi + 1]
|
||||
lea rsi, [rsi + 1]
|
||||
jmp condition_check
|
||||
|
||||
end:
|
||||
pop rax
|
||||
ret
|
||||
|
||||
err:
|
||||
xor rax, rax
|
||||
ret
|
||||
|
Reference in New Issue
Block a user