Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

1. Assembly Programming Write an assembly fragment which reads numbers from an input array, multiplies them by 4, and stores the result into another array.

image text in transcribed

1. Assembly Programming Write an assembly fragment which reads numbers from an input array, multiplies them by 4, and stores the result into another array. Assume that each entry of the array is a 32-bit number. RO contains the address of the first element of the input array, R1 contains the address of the first element of the output array, and R2 is the number of elements in the array it may be equal to zero!). Try to use as few instructions in your loop as possible. a) What is the size of your code in bytes? You can find the binary encoding for each instruction that you used on the ARMv7-M Reference Manual b) c) Now write the same code fragment as a function following ARM's calling convention. The function takes three arguments: the address of the first element of the input array, the address of the first element of the output array, and the number of elements in the array. The following shows the function prototype. void multby4 (int inarrayll, int outarrayll, int n); 1. Assembly Programming Write an assembly fragment which reads numbers from an input array, multiplies them by 4, and stores the result into another array. Assume that each entry of the array is a 32-bit number. RO contains the address of the first element of the input array, R1 contains the address of the first element of the output array, and R2 is the number of elements in the array it may be equal to zero!). Try to use as few instructions in your loop as possible. a) What is the size of your code in bytes? You can find the binary encoding for each instruction that you used on the ARMv7-M Reference Manual b) c) Now write the same code fragment as a function following ARM's calling convention. The function takes three arguments: the address of the first element of the input array, the address of the first element of the output array, and the number of elements in the array. The following shows the function prototype. void multby4 (int inarrayll, int outarrayll, int n)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions