Suppose we want to generate assembly code for the following C function: The code that follows is

Question:

Suppose we want to generate assembly code for the following C function:

long shift_left4_rightn (long x, long n) { } x < >= n; return x;

The code that follows is a portion of the assembly code that performs the actual shifts and leaves the final value in register %rax. Two key instructions have been omitted. Parameters x and n are stored in registers %rdi and %rsi, respectively.

long shift_left4_rightn (long x, long n) x in %rdi, n in %rsi. shift_left4_rightn: movq %rdi, %rax movl %esi,

Fill in the missing instructions, following the annotations on the right. The right shift should be performed arithmetically.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Computer Systems A Programmers Perspective

ISBN: 9781292101767

3rd Global Edition

Authors: Randal E. Bryant, David R. O'Hallaron

Question Posted: