diff options
author | Christian Cunningham <cc@localhost> | 2024-07-14 11:07:06 -0700 |
---|---|---|
committer | Christian Cunningham <cc@localhost> | 2024-07-14 11:07:06 -0700 |
commit | 13799fb3f48d8446046b901233c449fadc1af3b2 (patch) | |
tree | 56d89be961021aa8f1754231748fc1fe5e1cf38d | |
parent | 5b0f04f0c5d406def1acbcdbcc114e9b4bf5c7da (diff) |
Display Flag Registers
-rw-r--r-- | debug.inc | 6 | ||||
-rw-r--r-- | linked_list.inc | 16 | ||||
-rw-r--r-- | main.asm | 10 |
3 files changed, 25 insertions, 7 deletions
@@ -37,4 +37,10 @@ m_bind data_to_zstring_m%2 m_call print_zstring %endm + +%macro FLAGD 0-1 h + pushfq + pop rax + REGD rax, %1 +%endm %endif 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 @@ -146,13 +146,9 @@ _main: pop rax pop rax pop rax - dll_end -.free_loop: - mov rbx, [rax + dll_prev] - dll_free - mov rax, rbx - cmp rbx, 0 - jne .free_loop + call _dll_free + + FLAGD b exit_prog |