separate declarations in libasm.h file and add list_push_front and list_size

This commit is contained in:
2025-04-03 04:55:28 +02:00
parent 394b016f2f
commit 34b139c60b
5 changed files with 126 additions and 10 deletions

View File

@ -0,0 +1,29 @@
global ft_list_push_front
extern malloc
section .text
ft_list_push_front:
test rdi, rdi
je err
push rdi
push rsi
mov rdi, 10
call malloc wrt ..plt
pop rsi
pop rdi
test rax, rax ; did malloc return 0
je err
push rdi
mov rdi, [rdi]
mov [rax + 8], rdi ;set both settings
mov [rax], rsi
pop rdi
mov [rdi], rax
err:
ret