From f8ac822458e9a5702349b0e4bf69f5f80b61a309 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Sun, 22 Jun 2025 16:16:16 -0400 Subject: [PATCH] more cleanup --- code/asm/hello_files.asm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/code/asm/hello_files.asm b/code/asm/hello_files.asm index c4f303f..ecdaa56 100644 --- a/code/asm/hello_files.asm +++ b/code/asm/hello_files.asm @@ -291,15 +291,16 @@ def_Slice Byte ; Usage: cf_end (call-frame end) ; Tears down the stack frame, deallocating all memory and restoring the caller's frame. %macro cf_end 0 - ; Deallocate the entire frame at once by resetting RSP to the saved RBP - mov rstack_ptr, rstack_base_ptr - ; Restore the caller's frame pointer - pop rstack_base_ptr + mov rstack_ptr, rstack_base_ptr ; Deallocate the entire frame at once by resetting RSP to the saved RBP + pop rstack_base_ptr ; Restore the caller's frame pointer %endmacro +; Usage: cf_ctbl +; Meant to only be used with call-table structs: _ctbl naming convention %macro cf_ctbl 1 - cf - cf_alloc %1 %+ _ctbl_size - cf_commit + push rstack_base_ptr + mov rstack_base_ptr, rstack_ptr + sub rstack_ptr, %1 %+ _ctbl_size + and rstack_ptr, ~15 %endmacro ; Usage stac_alloc %1: