bgez $t0,else # question (f) sub $t7,$zero,$t0 j exit
else: add $t7,$zero,$t0 exit:
j test # question (g) loop: add $s1,$s1,$t0 addi $t2,$t2,4 lw $t0,0($t2)
test: bne $t0,$zero,loop exit1:
li $t1,99 # question (h) j test1
loop1: add $v0,$v0,$t1 addi $t1,$t1,-1 test1: bgtz $t1,loop1 exit2: li $t0,1 # intipowr_for(int x, unsigned p) j test2
loop2: andi $s1,$s2,1 beq $s1,$zero,mullabel mult $t0,$t1 mflo $t0
mullabel:mult $t1,$t1 mflo $t1 srl $s2,$s2,1
test2: bne $s2,$zero,loop2 exit3: