mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 17:41:41 +00:00
Fix off-by-one error
Iterate from 0..9, i.e. while $t0 is < 10
This commit is contained in:
parent
f1a149c860
commit
d1d1c4af86
@ -213,8 +213,9 @@ gateways and routers.
|
||||
# instruction to continue its execution
|
||||
li $t0, 0
|
||||
while:
|
||||
bgt $t0, 10, end_while # While $t0 is less than 10,
|
||||
bgt $t0, 9, end_while # While $t0 is less than 10,
|
||||
# keep iterating
|
||||
#actual loop content would go here
|
||||
addi $t0, $t0, 1 # Increment the value
|
||||
j while # Jump back to the beginning of
|
||||
# the loop
|
||||
|
Loading…
Reference in New Issue
Block a user