aboutsummaryrefslogtreecommitdiff
path: root/examples/loops.asm
diff options
context:
space:
mode:
Diffstat (limited to 'examples/loops.asm')
-rw-r--r--examples/loops.asm7
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/loops.asm b/examples/loops.asm
index 5c49d2b..5b464c3 100644
--- a/examples/loops.asm
+++ b/examples/loops.asm
@@ -1,8 +1,13 @@
+; move imm 3 to register b
mov b, 3
+; move imm 1 to register a
mov a, 1
+; delcare a label
loop:
+ ; subtract a from b
sub b, a
- jz loop
+ ; jump to label "loop" until the zero flag is not set
+ jnz loop
hlt