aboutsummaryrefslogtreecommitdiff
path: root/ft_strdup.s
diff options
context:
space:
mode:
Diffstat (limited to 'ft_strdup.s')
-rw-r--r--ft_strdup.s27
1 files changed, 23 insertions, 4 deletions
diff --git a/ft_strdup.s b/ft_strdup.s
index a10f383..b174239 100644
--- a/ft_strdup.s
+++ b/ft_strdup.s
@@ -1,11 +1,30 @@
+# **************************************************************************** #
+# #
+# ::: :::::::: #
+# ft_strdup.s :+: :+: :+: #
+# +:+ +:+ +:+ #
+# By: cacharle <marvin@42.fr> +#+ +:+ +#+ #
+# +#+#+#+#+#+ +#+ #
+# Created: 2019/11/22 03:04:32 by cacharle #+# #+# #
+# Updated: 2019/11/22 03:16:37 by cacharle ### ########.fr #
+# #
+# **************************************************************************** #
+
+.globl _ft_strdup
+
_ft_strdup:
- pop eax
- push eax
+ push rbp
+ mov rbp, rsp
+ mov rbx, rdi
+ mov rax, rbx
call _ft_strlen
- inc eax
- push eax
+ inc rax
+ mov rdi, rax
call _malloc
+ mov rdi, rax
+ mov rsi, rbx
call _ft_strcpy
+ pop rbp
ret