Fix off-by-one error

Iterate from 0..9, i.e. while $t0 is < 10
This commit is contained in:
xnumad 2023-03-24 21:43:38 +01:00 committed by GitHub
parent f1a149c860
commit d1d1c4af86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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