-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_strlen.s
37 lines (32 loc) · 1.1 KB
/
ft_strlen.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
# **************************************************************************** #
# #
# ::: :::::::: #
# ft_strlen.s :+: :+: :+: #
# +:+ +:+ +:+ #
# By: edelangh <edelangh@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2015/03/23 13:24:51 by edelangh #+# #+# #
# Updated: 2015/03/27 18:37:57 by edelangh ### ########.fr #
# #
# **************************************************************************** #
section .text
global _ft_strlen
; rdi rsi rdx
; edi esi edx
_ft_strlen:
enter 0, 0
;init
mov al, 0
mov rcx, 0
test rdi, rdi
jz end
;strlen
sub rcx, 1
cld
repne scasb
not rcx
sub rcx, 1
end:
mov rax, rcx
leave
ret