add: ft_list_push_front

This commit is contained in:
2024-09-05 18:14:20 +02:00
parent b1a86b85fe
commit eadf7cde62
3 changed files with 60 additions and 2 deletions

View File

@ -0,0 +1,27 @@
extern malloc
section .text
global ft_list_push_front
ft_list_push_front:
push rdi
push rsi
mov rdi, 16
call malloc wrt ..plt
cmp rax, 0
je out
pop rsi
pop rdi
mov rdx, [rdi]
mov [rax + 0], rsi ; .data = arg#1
mov [rax + 8], rdx ; .next = *arg#0
mov [rdi], rax
out:
ret