diff options
| author | hachem <im@hachem.wtf> | 2026-09-09 05:14:44 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-09-09 05:14:44 +0200 |
| commit | 8b76d35b0a045e0a3277be422513b938ef33dcce (patch) | |
| tree | b876d92ba3afb810e38f3f83792fc3fb849dd457 /examples/loop_sum.hdass | |
| parent | b9eff51ee157b22d8fa46aeecac7b95d5ed345d9 (diff) | |
feat: fasm backend
Diffstat (limited to 'examples/loop_sum.hdass')
| -rw-r--r-- | examples/loop_sum.hdass | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/loop_sum.hdass b/examples/loop_sum.hdass index 2427b17..130f055 100644 --- a/examples/loop_sum.hdass +++ b/examples/loop_sum.hdass @@ -8,11 +8,11 @@ proc main rbx = 0 // running total rcx = 5 // counter -loop: - rbx += rcx - rcx -= 1 - if rcx != 0 - goto loop + while .countdown rcx > 0 + { + rbx += rcx + rcx -= 1 + } rdi = rbx rax = SYS_EXIT |
