Question: Starting from the element i in A, read m elements at position i and below, and write them to array B starting from the position


Starting from the element i in A, read m elements at position i and below, and write them to array B starting from the position k and up. a) Fill in the blanks. 14pts .data A: : word 101112131415161718192021222324 i: word 7 B: .word 404550556065 k: word 1 m: word 5 How many f: .word 15 \#size of A g: .word 6 Asize of B .text -globl main main: \# load registers for array A \#how many to overwrite Iw $4,m \# load word g (how many) into s4 \# initialize registers to get A[i] sll $s6,$s2,2 add $56,$s6, \# address of A[i] ( new base) \# initialize registers to get B[k] sll $s7,$s3,2 add $s7,$s7, \# address of B (new base) \#what is the A index to stop? Let's put it into 55 HLoop through A and B Loop: # use sit to compare $s5 and $s2, place the result in to \# load A[i] and store into B[k] Iw \$t0, 0(\$s6) sw \$t0, 0($s7) \#update of the indices addi $s3,$s3, addi $s2,$s2, \#update the address addi $s7,$s7, addi $s6,$s6, j Loop end: ori \$v0, \$zero, 10 \#exit syscall
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
