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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started