aboutsummaryrefslogtreecommitdiff
path: root/linked_list.inc
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2024-07-14 11:07:06 -0700
committerChristian Cunningham <cc@localhost>2024-07-14 11:07:06 -0700
commit13799fb3f48d8446046b901233c449fadc1af3b2 (patch)
tree56d89be961021aa8f1754231748fc1fe5e1cf38d /linked_list.inc
parent5b0f04f0c5d406def1acbcdbcc114e9b4bf5c7da (diff)
Display Flag RegistersHEADmaster
Diffstat (limited to 'linked_list.inc')
-rw-r--r--linked_list.inc16
1 files changed, 16 insertions, 0 deletions
diff --git a/linked_list.inc b/linked_list.inc
index 0e5042b..6e0e0e4 100644
--- a/linked_list.inc
+++ b/linked_list.inc
@@ -99,4 +99,20 @@ _dll_end:
mov qword [rax + dll_prev], %1
%endm
+_dll_free:
+ push rbp
+ mov rbp, rsp
+ push rbx
+
+ dll_end
+.free_loop:
+ mov rbx, [rax + dll_prev]
+ dll_free
+ mov rax, rbx
+ cmp rbx, 0
+ jne .free_loop
+ pop rbx
+ mov rsp, rbp
+ pop rbp
+ ret
%endif