aboutsummaryrefslogtreecommitdiff
path: root/ft_list_size.s
blob: 5367a17cc36e6d1734eac223dd5b8ea1868911b2 (plain)
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
; **************************************************************************** ;
;                                                                              ;
;                                                         :::      ::::::::    ;
;    ft_list_size.s                                     :+:      :+:    :+:    ;
;                                                     +:+ +:+         +:+      ;
;    By: cacharle <marvin@42.fr>                    +#+  +:+       +#+         ;
;                                                 +#+#+#+#+#+   +#+            ;
;    Created: 2019/11/22 20:59:52 by cacharle          #+#    #+#              ;
;    Updated: 2019/11/24 01:55:14 by cacharle         ###   ########.fr        ;
;                                                                              ;
; **************************************************************************** ;

global ft_list_size

; int ft_list_size(t_list *begin_list);
ft_list_size:
	xor eax, eax
FT_LIST_SIZE_LOOP:
	cmp rdi, 0
	je  FT_LIST_SIZE_END
	inc eax
	mov rdi, [rdi + 8]
	jmp FT_LIST_SIZE_LOOP
FT_LIST_SIZE_END:
	ret