Consider a function P, which generates local values, named a0a8. It then calls function Q using these

Question:

Consider a function P, which generates local values, named a0–a8. It then calls function Q using these generated values as arguments. Gcc produces the following code for the first part of P:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 long P(long x) x in %rdi P: pushq pushq pushq pushq pushq

A. Identify which local values get stored in callee-saved registers.

B. Identify which local values get stored on the stack.

C. Explain why the program could not store all of the local values in calleesaved registers.

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: