A. Which registers are used to hold program values x, y, and n? B. How has the

Question:

For the C code short dw_loop (short x) { short y = x/9; short *p=&x; short do { } n 4*x; = x += y; (*p) += 5;

1 2 23 4 5 6 7 8 9 10 11 short dw_loop (short x) x initially in /rdi dw_loop: movq movq idivq leaq .L2: %rdi,

A. Which registers are used to hold program values x, y, and n?

B. How has the compiler eliminated the need for pointer variable p and the pointer dereferencing implied by the expression (*p)+=5?

C. Add annotations to the assembly code describing the operation of the program, similar to those shown in Figure 3.19(c).

Figure 3.19(c) 

(c) Corresponding assembly-language code long fact_do (long n) n in %rdi 1 2 3 4 5 6 7 8 fact_do: movl .L2:

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

Step by Step Answer:

Related Book For  answer-question

Computer Systems A Programmers Perspective

ISBN: 9781292101767

3rd Global Edition

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

Question Posted: