Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 3.58 27 of 27 Part A For a function with prototype long decode2(long x, long y, long z) GCC generates the following assembly code

image text in transcribed

Problem 3.58 27 of 27 Part A For a function with prototype long decode2(long x, long y, long z) GCC generates the following assembly code Write C code for decode2 that will have an effect equivalent to the assembly code shown Drag the terms on the left to the appropriate blanks on the right. 1 decode2: 2 subq %rdx, %rsi 3 imulq%rsi, %rdi 4 movq%rsi, %rax 5 salq$63, %rax Rese sarq $63, %rax xorq %rdi, %rax t1 t1 t2 t2 + t1 t3 & t2 1 long decode2(long x, long y, long z) 8 ret 3 long t1- 4 long t2 5 long t3- 6 long t4- Parameters x, y, and z are passed in registers %rdi %rsi, and %rdx. The code stores the return value in register %rax. return t4 t4 -t3 (t1 >63 (t2 >> 63) 63) >> 63 9j

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

Object Oriented Databases Prentice Hall International Series In Computer Science

Authors: John G. Hughes

1st Edition

0136298745, 978-0136298748

More Books

Students also viewed these Databases questions

Question

2. Are you varying your pitch (to avoid being monotonous)?

Answered: 1 week ago

Question

3. Are you varying your speaking rate and volume?

Answered: 1 week ago