aboutsummaryrefslogtreecommitdiff
path: root/examples/loop_sum.hdass
diff options
context:
space:
mode:
Diffstat (limited to 'examples/loop_sum.hdass')
-rw-r--r--examples/loop_sum.hdass10
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