# Demo 2 - while loop .text main: lw $s0, upper lw $s1, lower # While $s0 > $s1 { # $s1 = $s1 + 2 # $s0 = $s0 + 1 # } loop: ble $s0, $s1, after # note the test is negated from what you see in the while addi $s1, $s1, 2 addi $s0, $s0, 1 b loop after: jr $ra .data upper: .word 10 # also could be a comma-separated list to init an array lower: .word 5 #