From 78209d75e5834fe3e797fd31ee3ef079b9e97216 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Isalski?= Date: Mon, 14 Sep 2026 00:24:57 +0200 Subject: [PATCH] Removed one push-pop pair --- src/hashset.asm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/hashset.asm b/src/hashset.asm index 761f105..ac661e8 100644 --- a/src/hashset.asm +++ b/src/hashset.asm @@ -78,7 +78,7 @@ pub new_hashset: add r1, r1, 4 store_32 [r1], r12 ; eq context is in r12 - push r1 + mov r12, r1 load_32 r5, [r8] ; Loading the alloc function address mov r1, 64 @@ -86,12 +86,10 @@ pub new_hashset: add r13, r13, 12 jmp r5 ; allocating the space for the data - load r2, [sp] ; Now r1 is data pointer, r2 is hashset pointer at eq context - - add r2, r2, 4 + add r2, r12, 4 ; Now r1 is data pointer, r2 is hashset pointer at data_ptr store_32 [r2], r1 ; data pointer saved - pop r1 ; Popping the pointer to start of the hashset + mov r1, r12 ; Getting the pointer to start of the hashset pop r13 ; Everything's set up, return pop r12