![Dajabrooks492](/avatars/9677.jpg)
Dajabrooks492
22.02.2020 •
Computers and Technology
For the LEGv8 assembly instructions below, what is the corresponding C statement? Assume that the variables f, g, h, i, and j are assigned to registers X0, X1, X2, X3, and X4, respectively. Assume that the base address of the arrays A and B are in registers X6 and X 7, respectively. LSL X9. XO. #3//X9 = f*8 ADD X9. X6. X9//X9 = &A[f] LSL X10. X1. #3//X10 = g*8 ADD X10. X7. X10//X10 = &B[g] LDUR X0. [X9.#0]//f = A[f] ADDI X11. X9. #8 LDUR X9. [X11. #0] ADD X9. X9. X0 STUR X9. [X10. #0]
Solved
Show answers
More tips
- S Sport How to Do a Jumping Split...
- A Animals and plants What Do Terriers Eat?...
- F Food and Cooking Discover the Benefits and Properties of Dates...
- C Computers and Internet Dynamically Assigned IP Address: What Is It and How Does It Work?...
- S Style and Beauty How to Get Rid of Acne: Scientifically Proven Methods...
- H Health and Medicine Simple Ways to Lower Cholesterol in the Blood: Tips and Tricks...
- O Other How to Choose the Best Answer to Your Question on The Grand Question ?...
- L Leisure and Entertainment History of International Women s Day: When Did the Celebration of March 8th Begin?...
- S Style and Beauty Intimate Haircut: The Reasons, Popularity, and Risks...
- A Art and Culture When Will Eurovision 2011 Take Place?...
Answers on questions: Computers and Technology
- M Mathematics Find the angle between u = i+ V7; and v= a. 68.99 b. 27.0 + 9. Round to the nearest tenth of a degree, C. 14.4 d. 14.5 Please select the best answer from the choices provided...
- M Mathematics Find the value of each variable. Write answers in simplest radical form....
- M Mathematics Which composition of similarity transformations maps polygon ABCD to polygon A B C D ? O a dilation with a scale factor of and then a rotation O a dilation with a scale factor of...
- E English To identify an optimistic tone, look for words that indicate an author feels hopeless about a character or situation is this ture or false?...
- H Health Aclient is admitted with parkinson’s disease. the client has been taking carbidopa/levodopa (sinemet) for 1 year. which clinical manifestation would be the most important to report?...
Ответ:
Response: B[g]= A[f]+ A[f + 1];
Explanation:
• The very first command "LSL, X9, X0, #3" was to multiply the factor "f" by "8" use the shift function, this really is essential to get 8-byte words from the arrays.
• The next command was to enter the array element "A" with index "f," the index of A[f] would be in' X9' from the first instruction implementation.
• The third and fourth instructions are the same as first and second statements however the array will be "B" and the index will be "g"
• The fifth statement "LDUR X0,[ X9, #0]" will assign the array value in "A[f]" to the variable "f" located in X0.
• The sixth command "ADDI X11, X9, #8" should lead in the next array value being stored after the "X11" address "A[f]," which is the value of the item A[f+1].
• The next command "LDUR X9,[ X11,#0]" would be to load the command to "X9."
• The next "ADD X9, X9, X0" instruction results in the addition of X0 with X9 contents, i.e. A[f] and A[f+1] array contents, resulting in X9 register.
• During the last request, the value stored in X9 is stored in X10, assigned to the address of B[ g] • Therefore, the overall operation performed by the instructions given is: B[g]= A[f]+ A[f + 1]
Therefore, the related C statement is B[g]= A[f]+ A[f + 1].
Ответ:
hope that !