Question: Consider the following code, in which we have omitted the expression being computed: short arith3 (short x, short y, short z) { } short p1.

Consider the following code, in which we have omitted the expression being computed:

short arith3 (short x, short y, short z) { } short p1. short p2 short p3 = short p4 = return p4; The portion

short arith3 (short x, short y, short z) { } short p1. short p2 short p3 = short p4 = return p4; The portion of the generated assembly code implementing these expressions is as follows: short arith3 (short x, short y, short z) x in %rdi, y in %rsi, z in %rdx arith3: orq %rsi,%rdx sarq $9, %rdx notq %rdx movq %rdx, %bax subq %rsi, %rbx ret Based on this assembly code, fill in the missing portions of the C code.

Step by Step Solution

3.50 Rating (147 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

This problem is fairly straightfo... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Computer Systems A Programmers Perspective Questions!