-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_strcat.s
46 lines (40 loc) · 1.23 KB
/
ft_strcat.s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# **************************************************************************** #
# #
# ::: :::::::: #
# ft_strcat.s :+: :+: :+: #
# +:+ +:+ +:+ #
# By: edelangh <edelangh@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2015/03/23 14:23:52 by edelangh #+# #+# #
# Updated: 2015/03/27 15:01:30 by edelangh ### ########.fr #
# #
# **************************************************************************** #
section .text
global _ft_strcat
; rdi rsi rdx
_ft_strcat:
push rbp
mov rbp, rsp
test rdi, rdi
jz end
test rsi, rsi
jz end
mov rbx, rdi
mov rcx, rsi
loop1:
cmp byte [rbx], 0
je loop2
inc rbx
jmp loop1
loop2:
cmp byte [rcx], 0
je end
mov al, byte [rcx]
mov byte [rbx], al
inc rcx
inc rbx
jmp loop2
end:
mov rax, rdi
leave
ret