LOOP : s l t $t2, $0, $t1 LOOP : addi $t2, $0, 0xA a. LOOP : s l t $t2, $0, $t1
ID: 3608612 • Letter: L
Question
LOOP : s l t $t2, $0, $t1
LOOP : addi $t2, $0, 0xA
a.LOOP : s l t $t2, $0, $t1
bne $t2, $zero, ELSE j DONE ELSE : addi $s2, $s2, 2 subi $t1, $t1, 1 j LOOP DONE : b.LOOP : addi $t2, $0, 0xA
LOOP2: addi $s2, $s2, 2 subi $t2, $t2, 1 bne $t2, $0, LOOP2 subi $t1, $t1, 1 bne $t1, $0, LOOP DONE :Explanation / Answer
LOOP : s l t $t2, $0, $t1 $0<$t1 $t2=1
1st iteration of loop
LOOP : addi $t2, $0, 0xA $t2=0+10=10
LOOP : s l t $t2, $0, $t1 $0<$t1 $t2=1
j DONE ELSE : addi $s2, $s2, 2 $s2=0+2=2
subi $t1, $t1, 1 $t1=10-1=9
j LOOP DONE : b.
1st iteration of loop
LOOP : addi $t2, $0, 0xA $t2=0+10=10
subi $t2, $t2, 1 $t2=10-1=9
goes through loop adding 2 to $s2 and subtracting 1 from $t2until $t2=0 stops when$s2=22 and $t2=0 (will do loop 8 moretimes when completely done $s2=182 (can't guarantee,but should get you started)
bne $t2, $0, LOOP2 subi $t1, $t1, 1 $t1 goes to 8
bne $t1, $0, LOOP repeats this until $t1 decremented to0
DONE:
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.