diff options
| author | Charles <sircharlesaze@gmail.com> | 2019-11-23 02:54:37 +0100 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2019-11-23 02:54:37 +0100 |
| commit | b4b6364c2fc4b14a0aaac406891c3880243a9733 (patch) | |
| tree | e204b7a7cefd18c764cfbf8adb7f1491b689352c /ft_strcpy.s | |
| parent | c90117251f11e03452ae9808ff8626016c7958a1 (diff) | |
| download | libasm-b4b6364c2fc4b14a0aaac406891c3880243a9733.tar.gz libasm-b4b6364c2fc4b14a0aaac406891c3880243a9733.tar.bz2 libasm-b4b6364c2fc4b14a0aaac406891c3880243a9733.zip | |
refactored mandatory functions, to respect c calling convention
Diffstat (limited to 'ft_strcpy.s')
| -rw-r--r-- | ft_strcpy.s | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ft_strcpy.s b/ft_strcpy.s index 1857933..5d32f2d 100644 --- a/ft_strcpy.s +++ b/ft_strcpy.s @@ -14,14 +14,17 @@ global _ft_strcpy ; char *ft_strcpy(char *dst, const char *src); _ft_strcpy: + push rbx + push rcx mov rax, rdi ; dst mov rbx, rsi ; src - xor rcx, rcx + mov rcx, -1 FT_STRCPY_LOOP: - mov dl, [rbx + rcx] - mov [rax + rcx], dl inc rcx + mov dl, byte [rbx + rcx] + mov byte [rax + rcx], dl cmp byte [rbx + rcx], 0 jne FT_STRCPY_LOOP - mov byte [rax + rcx], 0 + pop rcx + pop rbx ret |
