aboutsummaryrefslogtreecommitdiff
path: root/examples/loops.asm
blob: 5b464c3dc3a3e2347203f42552ce86edb6393100 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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
    ; jump to label "loop" until the zero flag is not set
    jnz loop

hlt