aboutsummaryrefslogtreecommitdiff
path: root/ft_strlen.s
blob: 2f2dd264a4d771a3de940b64fdc591ed304da808 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
; **************************************************************************** ;
;                                                                              ;
;                                                         :::      ::::::::    ;
;    ft_strlen.s                                        :+:      :+:    :+:    ;
;                                                     +:+ +:+         +:+      ;
;    By: cacharle <marvin@42.fr>                    +;+  +:+       +;+         ;
;                                                 +;+;+;+;+;+   +;+            ;
;    Created: 2019/11/22 03:04:20 by cacharle          ;+;    ;+;              ;
;    Updated: 2019/11/23 00:17:47 by cacharle         ;;;   ;;;;;;;;.fr        ;
;                                                                              ;
; **************************************************************************** ;

global _ft_strlen

; int ft_strlen(char *);
_ft_strlen:
	mov eax, -1
FT_STRLEN_LOOP:
	inc eax
	cmp byte [rdi + rax], 0  ; compare rbx[rax] and '\0'
	jne FT_STRLEN_LOOP
	ret