Question: 8. (15 pts) Consider two integer arrays B and D of 100 elements. Let X2 and X3 contain the base address of array B and

 8. (15 pts) Consider two integer arrays B and D of

8. (15 pts) Consider two integer arrays B and D of 100 elements. Let X2 and X3 contain the base address of array "B" and D, respectively, and the index i is in X0, h is in X10. Write LEGV8 code to perform the following operations: (a) Get B[15] from memory and put it in register X5. (b) Put the value 132 in D[6]. (c) Translate the following C code into LEGv8 instructions int j = 50, h; do { D[2*j] = (B[j] + B[j+2])*9 - h; j=j - 2; while {j >0}; DO NOT use multiply instruction in your code, use shift instruction for multiplication instead! (d)How many instructions are executed during the running of the code in (c), and how many memory data references are made during execution? 1

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!