Question: Program 3 : Copy an array to another In the data section 1 . Define two arrays called Array 1 and Array 2 . Each

Program 3: Copy an array to another
In the data section
1. Define two arrays called Array1 and Array2. Each array has three elements and each
element is a word. Initialize Array1 with 0xAAAAAAAA, 0xBBBBBBBB, and
0xCCCCCCCC and initialize Array2 with zeros.
Use this for Code region
Write a program to copy Array1 to Array2 using post-Index addressing mode
1. You need to use two pointers; one for each array, e.g., r0 and r1
2. Initialize the two pointers so that r0 points at the beginning of Array1 and r1 points
at the beginning of Array2
3. Read a word from the location pointed by r0 and copy it in another register (e.g.,
r2).
4. Copy r2 to the location pointed by r1
5. Update r0 and r1 to point at the next elements in the arrays
6. Repeat steps 3-5 to copy element 2
7. Repeat steps 3-5 to copy element 3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!