Question: Exercise 6.20 Consider the following high-level code snippet. Assume that the base addresses of array1 and array2 are held in R1 and R2 and that

Exercise 6.20 Consider the following high-level code snippet. Assume that the base addresses of array1 and array2 are held in R1 and R2 and that array2 is initialized before it is used.

int i; int array1[100]; int array2[100]; ... for (i=0; i<100; i=i+1) array1[i] = array2[i];

(a) Write the code snippet in ARM assembly without using pre- or post-indexing or a scaled register. Use as few instructions as possible (given the constraints).

(b) Write the code snippet in ARM assembly with pre- or post-indexing and a scaled register available. Use as few instructions as possible.

(c) Compare the difference in code density (i.e., number of instructions) between (a) and (b). Discuss any advantages or disadvantages.

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 Databases Questions!