Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help I keep getting partial credit in LEGv8 question. What mistakes did I make? Partial Question 5 2/6 pts Write the LEGv8 assembly for

Please help I keep getting partial credit in LEGv8 question. What mistakes did I make?

image text in transcribed

Partial Question 5 2/6 pts Write the LEGv8 assembly for the following code snippet (assuming the base address of A is in X9, the base address of Bis in X10, i is in X11 and jis in X12 and that A and B store 64-bit integer values): A[i] = B[j]; NOTE: There should be no extraneous spaces in your answers, and all instructions and register characters should be capitalized. Commas are used appropriately to separate instruction arguments with a single space after Instruction Description / Comments LSLX13, X12, #3 Compute offset of elementi putting the result in register X13 ADD X13X13, X1C Compute absolute address of B, element j putting the result in register X13 LDUR X13, [X13,Move B, element from memory into register X13 LSLX14, X11.#3 Compute offset of elementi putting the result in register X14 ADD X14X14,X9 Compute absolute address of A, element i putting the result in register X14 STURX13. [X14, #0 Move the value from register X13 into A. elementi in memory Answer 1: LSL X13, X12, #3 Answer 2: ADD X13X13, X10 Answer 3: LDUR X13,[X13,#0] Answer 4: LSL X14, X11,#3 Answer 5: ADD X14X14,X9 Answer 6: STURX13. [X14, #O] Partial Question 5 2/6 pts Write the LEGv8 assembly for the following code snippet (assuming the base address of A is in X9, the base address of Bis in X10, i is in X11 and jis in X12 and that A and B store 64-bit integer values): A[i] = B[j]; NOTE: There should be no extraneous spaces in your answers, and all instructions and register characters should be capitalized. Commas are used appropriately to separate instruction arguments with a single space after Instruction Description / Comments LSLX13, X12, #3 Compute offset of elementi putting the result in register X13 ADD X13X13, X1C Compute absolute address of B, element j putting the result in register X13 LDUR X13, [X13,Move B, element from memory into register X13 LSLX14, X11.#3 Compute offset of elementi putting the result in register X14 ADD X14X14,X9 Compute absolute address of A, element i putting the result in register X14 STURX13. [X14, #0 Move the value from register X13 into A. elementi in memory Answer 1: LSL X13, X12, #3 Answer 2: ADD X13X13, X10 Answer 3: LDUR X13,[X13,#0] Answer 4: LSL X14, X11,#3 Answer 5: ADD X14X14,X9 Answer 6: STURX13. [X14, #O]

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

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

Recommended Textbook for

Database Programming Languages 12th International Symposium Dbpl 2009 Lyon France August 2009 Proceedings Lncs 5708

Authors: Philippa Gardner ,Floris Geerts

2009th Edition

3642037925, 978-3642037924

More Books

Students also viewed these Databases questions