Question: MIPS - copy one array to another Assume that you have an array of 10 elements with base address in $s0. Assume that the base
MIPS - copy one array to another
Assume that you have an array of 10 elements with base address in $s0. Assume that the base address of the second array is in $t0. Copy the elements from the first array to the second. In order to receive full credit you must use a loop to traverse the elements of the arrays.
#Lab 3: Copy the elements of an array into another. #Assembler Directives .data .word 7 .word 3 .word 1 .word 12 .word 10 .word 2 .word 5 .word 9 .word 16 .word 11 .text .globl main main: add $s0, $zero, $zero add $t0, $zero, $zero lui $s0, 0x1001 ori $s0,$s0,0 #$s0 contains the address of the first element of the first array lui $t0, 0x1001 ori $t0, $t0, 0x0040 #$t0 contains the address of the first element of the second array ############################################# # Put your code here: # ############################################# jr $ra
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
