Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

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

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Beginning Microsoft SQL Server 2012 Programming

Authors: Paul Atkinson, Robert Vieira

1st Edition

1118102282, 9781118102282

More Books

Students also viewed these Databases questions

Question

Why is employee referral so important in the recruitment process?

Answered: 1 week ago

Question

Describe Table Structures in RDMSs.

Answered: 1 week ago