blob: 6a959097bb87b295b8d78c24662039c63e525d95 (
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
26
27
28
29
30
31
32
33
34
35
36
37
|
; **************************************************************************** ;
; ;
; ::: :::::::: ;
; ft_list_push_front.s :+: :+: :+: ;
; +:+ +:+ +:+ ;
; By: cacharle <marvin@42.fr> +#+ +:+ +#+ ;
; +#+#+#+#+#+ +#+ ;
; Created: 2019/11/22 20:55:08 by cacharle #+# #+# ;
; Updated: 2019/11/22 21:17:45 by cacharle ### ########.fr ;
; ;
; **************************************************************************** ;
extern _malloc
global _ft_list_push_front
; void ft_list_push_front(t_list **begin_list, void *data);
_ft_list_push_front:
cmp rdi, 0
je FT_LIST_PUSH_FRONT_END
push rdi
push rsi
xor rdi, rdi
mov edi, 16
call _malloc
pop rsi
pop rdi
cmp rax, 0
je FT_LIST_PUSH_FRONT_END
mov qword [rax + 0], rsi
mov r10, [rdi]
mov [rax + 8], r10
mov [rdi], rax
FT_LIST_PUSH_FRONT_END:
ret
|