From c90117251f11e03452ae9808ff8626016c7958a1 Mon Sep 17 00:00:00 2001 From: Charles Date: Sat, 23 Nov 2019 00:28:03 +0100 Subject: Compiling with nasm --- ft_strcpy.s | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'ft_strcpy.s') diff --git a/ft_strcpy.s b/ft_strcpy.s index 820d970..1857933 100644 --- a/ft_strcpy.s +++ b/ft_strcpy.s @@ -1,27 +1,27 @@ -# **************************************************************************** # -# # -# ::: :::::::: # -# ft_strcpy.s :+: :+: :+: # -# +:+ +:+ +:+ # -# By: cacharle +#+ +:+ +#+ # -# +#+#+#+#+#+ +#+ # -# Created: 2019/11/22 03:04:28 by cacharle #+# #+# # -# Updated: 2019/11/22 21:18:38 by cacharle ### ########.fr # -# # -# **************************************************************************** # +; **************************************************************************** ; +; ; +; ::: :::::::: ; +; ft_strcpy.s :+: :+: :+: ; +; +:+ +:+ +:+ ; +; By: cacharle +;+ +:+ +;+ ; +; +;+;+;+;+;+ +;+ ; +; Created: 2019/11/22 03:04:28 by cacharle ;+; ;+; ; +; Updated: 2019/11/22 21:18:38 by cacharle ;;; ;;;;;;;;.fr ; +; ; +; **************************************************************************** ; -.globl _ft_strcpy +global _ft_strcpy -# char *ft_strcpy(char *dst, const char *src); +; char *ft_strcpy(char *dst, const char *src); _ft_strcpy: - mov rax, rdi # dst - mov rbx, rsi # src + 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 + cmp byte [rbx + rcx], 0 jne FT_STRCPY_LOOP - mov byte ptr [rax + rcx], 0 + mov byte [rax + rcx], 0 ret -- cgit