# i = 1 # k = 5 # while (save[i] == k) # i += 1 # .data save: .word 5,5,5,5,7,6,6,7 # The array is called 'save'. So, e.g., save[0] is 5, save[4] is 7 # and save[5] is 6. Each is one word, because we used the ".word" # assembler directive. #Question: before looking at the assembly language, what should "i" #be after the while loop is executed?______________ .text li $s3,1 # $s3 is i la $s6,save # $s6 is the base address of array li $s5,5 # $s5 is k loop: sll $t1,$s3,2 #shift the value left by 2; this multiplies the #value by 4. So, $t1 now contains i * 4 add $t1,$t1,$s6 #Now $t1 points to (contains the address of) # save[i]. (We needed to multiply by 4 since each # element is 4 bytes long.) lw $t0,0($t1) #$t0 = save[i]. bne $t0,$s5,exitloop # if $t0 and $s5 are not equal, jump to exitloop addi $s3,$s3,1 # i += 1 j loop exitloop: add $s6,$s3,$zero # just to have an instruction here