Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For the following C statement, write the corresponding LEGv8 assembly code. long long int func( long long int n ) {if ( n

  1. For the following C statement, write the corresponding LEGv8 assembly code. long long int func( long long int n ) {if ( n <= 1 ) {return n}return func( n 1 ) + func( n 2 );}

  2. Assume that registers X0 through X1 hold the values 0xB000000000000000 and 0x6000000000000000, respectively. a. What is the value in X9 for the following assembly code? ADD X9, X0, X1 b. Is the result in X9 the desired result, or has there been overflow? c. For the contents of registers X0 and X1 above, what is the value of X9 for the following assembly code? SUB X9, X0, X1 d. Is the result in X9 the desired result, or has there been overflow? e. For the contents of registers X0 and X1 above, what is the value of X9 for the following assembly code? ADD X9, X0, X1 ADD X9, X9, X0 f. Is the result in X9 the desired result, or has there been overflow?

  3. Provide the instruction type and hexadecimal representation of the following instruction: LDUR X9, [X12, #16]

  4. Provide the instruction type, assembly language instruction, and binary representation of the instruction described by the following LEGv8 fields:

op = 0x458, Rm = 14, Rn = 16, Rd = 18, shamt = 0

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions