From e137cb88aee7a4b81ab6589e88c119b57e8dedbe Mon Sep 17 00:00:00 2001 From: SpookyDervish <78246495+SpookyDervish@users.noreply.github.com> Date: Tue, 9 Sep 2025 18:03:58 +1000 Subject: [PATCH] 39% speed increase from optimizer! --- out | Bin 4664 -> 4712 bytes out.asm | 15 +++++++++------ test2.grnd | 10 +++++++--- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/out b/out index 878b3e5d6a7063c531caa1ddce001755aa5410d6..83f17b831ed301409946042b1d8269ea23dc2379 100644 GIT binary patch delta 206 zcmdm?@x>wh&a{fH`5}LW#*0f)b(z0uWC^Pw>fa2tL0#y?auuRSnRN#PF rGI62AftE5bO};9q&A9<8qd1vU$ei;c5>Flgx>6&! diff --git a/out.asm b/out.asm index 18a8f72..58ddf61 100644 --- a/out.asm +++ b/out.asm @@ -5,11 +5,14 @@ section .text global _start _start: push 0 -mov rax, 1000 -cmp rax, [rsp + 0] -setg al -movzx rax, al -push rax +push 1 +.loop: +mov rax, [rsp + 8] +add rax, 1 +mov QWORD [rsp + 8], rax +mov rax, 100000000 +cmp rax, [rsp + 8] +jg .loop mov rax, 60 -mov rdi, [rsp + 0] +mov rdi, 0 syscall diff --git a/test2.grnd b/test2.grnd index b3e36af..f44404c 100644 --- a/test2.grnd +++ b/test2.grnd @@ -1,3 +1,7 @@ -set &var 0 -greater 1000 $var &cond -end $cond \ No newline at end of file +set &counter 0 +set &cond 1 +@loop +add $counter 1 &counter +greater 100000000 $counter &cond +if $cond %loop +end 0 \ No newline at end of file