Answered step by step
Verified Expert Solution
Question
1 Approved Answer
8. (15 pts) Consider two integer arrays A and B of 100 elements. Let X10 and X11 contain the base address of array A and
8. (15 pts) Consider two integer arrays A and B of 100 elements. Let X10 and X11 contain the base address of array "A" and B, respectively, and the index i is in X30, sum is in X5. Write LEGV8 code to perform the following operations: (a) Get B[10] from memory and put it in register X10. (b) Put the value sum*10 in A[12]. (c) Translate the following code into LEGv8 instructions int sum = 0; for (i = 40; i >10; i++) sum = sum + B[i+5] - A[i+1]*20; 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
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