To test for loop termination, the constant 401 is needed. Assume that it is placed in memory when the program is loaded:
lw $t8, AddressConstant401($zero) # $t8 = 401
lw $t7, 4($a0) # $t7 = length of a[]
lw $t6, 4($a1) # $t6 = length of b[]
add $t0, $zero, $zero # initialize i = 0
Loop: slt $t4, $t0, $zero # $t4 = 1 if i < 0
bne $t4, $zero, IndexOutOfBounds # if i < 0, goto Error
slt $t4, $t0, $t6 # $t4 = 0 if i >= length b
beq $t4, $zero, IndexOutOfBounds # if i >= length, goto Error
slt $t4, $t0, $t7 # $t4 = 0 if i >= length a
beq $t4, $zero, IndexOutOfBounds # if i >= length, goto Error
add $t1, $a1, $t0 # $t1 = address of b[i]
lw $t2, 8($t1) # $t2 = b[i]
add $t2, $t2, $s0 # $t2 = b[i] + c
add $t3, $a0, $t0 # $t3 = address of a[i]
sw $t2, 8($t3) # a[i] = b[i] + c
addi $t0, $t0, 4 # i = i + 4
slt $t4, $t0, $t8 # $t8 = 1 if $t0 < 401, i.e., i <= 100
bne $t4, $zero, Loop # goto Loop if i <= 100
The number of instructions executed is