Answer:
lw $t0, 16($s7) // $t0 = B[4]
lw $t1, 12($s7) // $t1 = B[3]
sub $t0, $t0, $t1 // $t0 = B[4] – B[3]
sll $t0, $t0, 2 // $t0 = $t0 * 4
add $t0, $t0, $s6 // $t0 = &A[B[4] – B[3]]
lw $t1, 0($t0) // $t1 = A[B[4] – B[3]]
add $s0, $s1, $t1 // f = g + A[B[4] – B[3]
Explanation:
lw $t0, 16($s7) // $t0 = B[4]
lw $t1, 12($s7) // $t1 = B[3]
sub $t0, $t0, $t1 // $t0 = B[4] – B[3]
sll $t0, $t0, 2 // $t0 = $t0 * 4
add $t0, $t0, $s6 // $t0 = &A[B[4] – B[3]]
lw $t1, 0($t0) // $t1 = A[B[4] – B[3]]
add $s0, $s1, $t1 // f = g + A[B[4] – B[3]