aboutsummaryrefslogtreecommitdiff
path: root/ft_strcpy.s
diff options
context:
space:
mode:
Diffstat (limited to 'ft_strcpy.s')
-rw-r--r--ft_strcpy.s20
1 files changed, 11 insertions, 9 deletions
diff --git a/ft_strcpy.s b/ft_strcpy.s
index 2b7bbb9..228ea04 100644
--- a/ft_strcpy.s
+++ b/ft_strcpy.s
@@ -1,11 +1,13 @@
+.globl _ft_strcpy
+
_ft_strcpy:
- pop ax
- pop bx
- mov ecx, eax ; copy
-FT_STRCPY_LOOP:
- mov [ecx], ebx
- inc ebx
- inc ecx
- cmp ebx, 0
- jneq FT_STRCPY_LOOP
+ mov rax, rdi # dst
+ mov rbx, rsi # src
+ xor rcx, rcx
+ FT_STRCPY_LOOP:
+ mov dl, [rbx + rcx]
+ mov [rax + rcx], dl
+ inc rcx
+ cmp byte ptr [rbx + rcx], 0
+ jne FT_STRCPY_LOOP
ret