aboutsummaryrefslogtreecommitdiff
path: root/examples/fibonacci.hdass
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-09-09 05:14:44 +0200
committerhachem <im@hachem.wtf>2026-09-09 05:14:44 +0200
commit8b76d35b0a045e0a3277be422513b938ef33dcce (patch)
treeb876d92ba3afb810e38f3f83792fc3fb849dd457 /examples/fibonacci.hdass
parentb9eff51ee157b22d8fa46aeecac7b95d5ed345d9 (diff)
feat: fasm backend
Diffstat (limited to 'examples/fibonacci.hdass')
-rw-r--r--examples/fibonacci.hdass16
1 files changed, 8 insertions, 8 deletions
diff --git a/examples/fibonacci.hdass b/examples/fibonacci.hdass
index 9436580..47224fb 100644
--- a/examples/fibonacci.hdass
+++ b/examples/fibonacci.hdass
@@ -45,16 +45,16 @@ proc main
r13 = 1
r15 = 10 // syscall clobbers rcx/r11, so keep the counter in r15
-loop:
- print_number(r12)
+ while .sequence r15 > 0
+ {
+ print_number(r12)
- rax = r12
- r12 = r13
- r13 += rax
+ rax = r12
+ r12 = r13
+ r13 += rax
- r15 -= 1
- if r15 != 0
- goto loop
+ r15 -= 1
+ }
rax = SYS_EXIT
rdi = 0