diff options
| author | Charles <sircharlesaze@gmail.com> | 2019-11-23 00:28:03 +0100 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2019-11-23 00:28:03 +0100 |
| commit | c90117251f11e03452ae9808ff8626016c7958a1 (patch) | |
| tree | b4ef9f0f562d3394e23af4a698ad35964f18bc23 /ft_strcpy.s | |
| parent | 8e3a5ac569a3ccc1101b58fe8ef673f02b4961fb (diff) | |
| download | libasm-c90117251f11e03452ae9808ff8626016c7958a1.tar.gz libasm-c90117251f11e03452ae9808ff8626016c7958a1.tar.bz2 libasm-c90117251f11e03452ae9808ff8626016c7958a1.zip | |
Compiling with nasm
Diffstat (limited to 'ft_strcpy.s')
| -rw-r--r-- | ft_strcpy.s | 34 |
1 files changed, 17 insertions, 17 deletions
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 <marvin@42.fr> +#+ +:+ +#+ # -# +#+#+#+#+#+ +#+ # -# Created: 2019/11/22 03:04:28 by cacharle #+# #+# # -# Updated: 2019/11/22 21:18:38 by cacharle ### ########.fr # -# # -# **************************************************************************** # +; **************************************************************************** ; +; ; +; ::: :::::::: ; +; ft_strcpy.s :+: :+: :+: ; +; +:+ +:+ +:+ ; +; By: cacharle <marvin@42.fr> +;+ +:+ +;+ ; +; +;+;+;+;+;+ +;+ ; +; 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 |
