Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider a function P, which generates local values a-c by simple local computation and d-f by calling Q(), R(), and S(). (See Practice problem 3.34

Consider a function P, which generates local values a-c by simple local computation and d-f by calling Q(), R(), and S(). (See Practice problem 3.34 in page 252 for reference.)

 long P(long x,long y,long z) { long a = ...; long b = ...; long c = ...; long d = ...; long e = ...; long f = ...; return d + e + f; } 0000000000000022 

: 22: 55 push %rbp 23: 53 push %rbx 24: 48 83 ec 20 sub $0x20,%rsp 28: 48 83 c7 01 add $0x1,%rdi 2c: 48 89 7c 24 18 mov %rdi,0x18(%rsp) 31: 48 83 c6 02 add $0x2,%rsi 35: 48 89 74 24 10 mov %rsi,0x10(%rsp) 3a: 48 83 c2 03 add $0x3,%rdx 3e: 48 89 54 24 08 mov %rdx,0x8(%rsp) 43: 48 8d 74 24 10 lea 0x10(%rsp),%rsi 48: 48 8d 7c 24 18 lea 0x18(%rsp),%rdi 4d: b8 00 00 00 00 mov $0x0,%eax 52: e8 00 00 00 00 callq 57 57: 48 89 c3 mov %rax,%rbx 5a: 48 8d 74 24 08 lea 0x8(%rsp),%rsi 5f: 48 8d 7c 24 10 lea 0x10(%rsp),%rdi 64: b8 00 00 00 00 mov $0x0,%eax 69: e8 00 00 00 00 callq 6e 6e: 48 89 c5 mov %rax,%rbp 71: 48 8d 74 24 18 lea 0x18(%rsp),%rsi 76: 48 8d 7c 24 08 lea 0x8(%rsp),%rdi 7b: b8 00 00 00 00 mov $0x0,%eax 80: e8 00 00 00 00 callq 85 85: 48 01 eb add %rbp,%rbx 88: 48 01 d8 add %rbx,%rax 8b: 48 83 c4 20 add $0x20,%rsp 8f: 5b pop %rbx 90: 5d pop %rbp 91: c3 retq

Find the size of the stack in bytes.

Identify the assembly statement(s) that allocate and free the local stack.

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

Identify which local values get stored on the stack.

Explin why the program could not sotre all of the local values in callee-saved registers.

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

Databases And Python Programming MySQL MongoDB OOP And Tkinter

Authors: R. PANNEERSELVAM

1st Edition

9357011331, 978-9357011334

More Books

Students also viewed these Databases questions

Question

1. Provide a step-by-step explanation of destination visioning.

Answered: 1 week ago