mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-24 01:51:38 +00:00
commit
2505a5efe5
@ -162,7 +162,7 @@ gateways and routers.
|
|||||||
blt $t0, $t1, t0_gt_t1 # Branches when $t0 < $t1
|
blt $t0, $t1, t0_gt_t1 # Branches when $t0 < $t1
|
||||||
ble $t0, $t1, t0_gte_t1 # Branches when $t0 <= $t1
|
ble $t0, $t1, t0_gte_t1 # Branches when $t0 <= $t1
|
||||||
bltz $t0, t0_lt0 # Branches when $t0 < 0
|
bltz $t0, t0_lt0 # Branches when $t0 < 0
|
||||||
slt $s0, $t0, $t1 # Instruction that sends a signal
|
slt $s0, $t0, $t1 # "Set on Less Than"
|
||||||
# when $t0 < $t1 with result in $s0
|
# when $t0 < $t1 with result in $s0
|
||||||
# (1 for true)
|
# (1 for true)
|
||||||
|
|
||||||
@ -186,6 +186,7 @@ gateways and routers.
|
|||||||
# else
|
# else
|
||||||
# max = c;
|
# max = c;
|
||||||
# else
|
# else
|
||||||
|
# if (b > c)
|
||||||
# max = b;
|
# max = b;
|
||||||
# else
|
# else
|
||||||
# max = c;
|
# max = c;
|
||||||
@ -212,8 +213,9 @@ gateways and routers.
|
|||||||
# instruction to continue its execution
|
# instruction to continue its execution
|
||||||
li $t0, 0
|
li $t0, 0
|
||||||
while:
|
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
|
# keep iterating
|
||||||
|
#actual loop content would go here
|
||||||
addi $t0, $t0, 1 # Increment the value
|
addi $t0, $t0, 1 # Increment the value
|
||||||
j while # Jump back to the beginning of
|
j while # Jump back to the beginning of
|
||||||
# the loop
|
# the loop
|
||||||
|
Loading…
Reference in New Issue
Block a user