-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathft_strlen.s
27 lines (23 loc) · 1.16 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
; /* *********************************************************************** */
; /* */
; /* ::: :::::::: */
; /* ft_strlen.s :+: :+: :+: */
; /* +:+ +:+ +:+ */
; /* By: mihykim <[email protected]> +#+ +:+ +#+ */
; /* +#+#+#+#+#+ +#+ */
; /* Created: 2020/11/10 15:15:17 by mihykim #+# #+# */
; /* Updated: 2020/11/11 08:49:17 by mihykim ### ########.fr */
; /* */
; /* *********************************************************************** */
section .text
global _ft_strlen
_ft_strlen:
mov rax, 0 ; i = 0
jmp get_length
get_length:
cmp byte [rdi + rax], 0 ; if (str[i] == '\0')
je end ; break
inc rax ; i++
jmp get_length
end:
ret ; return i