Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. Consider a function P, which generates local values a-c by simple local computation and d-f by calling Q0, RO, and SO. long P(long x,long

image text in transcribed

2. Consider a function P, which generates local values a-c by simple local computation and d-f by calling Q0, RO, and SO. long P(long x,long y,long z) Long a ...i long b = long c -.... long d = long e -.... long f = return d+e + f; 0000000000000022

22:55 23: 53 24: 48 83 ec 20 28:48 83 c7 01 2c: 48 89 7c 24 18 31: 48 83 c6 02 35 48 89 74 24 10 3a:48 83 c2 03 3e:48 89 54 24 08 43: 48 8d 74 24 10 48:48 8d 7c 24 18 4d:b8 00 00 00 00 52 e8 00 00 00 00 57:48 89 c3 5a:48 8d 74 24 08 5f: 48 8d 7c 24 10 64:b8 00 00 00 00 69 e8 00 00 00 00 6e:48 89 c5 71: 48 8d 74 24 18 76: 48 8d 7c 24 08 7b:b8 00 00 00 00 80 e8 00 00 00 00 85: 48 01 eb 88 48 01 d8 8b: 48 83 c4 20 8f:5b 90 5d 91: c3 push %rbp push %rbx sub add mov trdi , 0x18(%rsp) add $0x2 , %rsi mov trsi,0x10(%rsp) add0x3 mov trax , 0x8 ( %rsp) lea 0x10 (8rsp), rsi lea 0x18(%rsp),erdi mov callq 57 mov lea 0x8 ( %rsp ) ,%rsi lea 0x10(%rsp ) ,%rdi mov callq 6e mov lea 0x18(%rsp ) ,trsi lea 0x8 (8rsp),8rdi mov callq 85 add add add pop %rbp pop retq $0x20, %rsp $0x1,srdi , %rax $ 0x0 , %eax $ 0x0 , %eax trax, %rbp $0x0, %eax % rbp , % rbx $0x20, %rsp 1. Find the size of the stack in bytes 2. Identify the assembly statement(s) that allocate and free the local stack. 3. Identify which local values get stored in callee-saved registers 4. Identify which local values get stored on the stack. 5. Explin why the program could not sotre all of the local values in callee-saved registers. 2. Consider a function P, which generates local values a-c by simple local computation and d-f by calling Q0, RO, and SO. long P(long x,long y,long z) Long a ...i long b = long c -.... long d = long e -.... long f = return d+e + f; 0000000000000022

22:55 23: 53 24: 48 83 ec 20 28:48 83 c7 01 2c: 48 89 7c 24 18 31: 48 83 c6 02 35 48 89 74 24 10 3a:48 83 c2 03 3e:48 89 54 24 08 43: 48 8d 74 24 10 48:48 8d 7c 24 18 4d:b8 00 00 00 00 52 e8 00 00 00 00 57:48 89 c3 5a:48 8d 74 24 08 5f: 48 8d 7c 24 10 64:b8 00 00 00 00 69 e8 00 00 00 00 6e:48 89 c5 71: 48 8d 74 24 18 76: 48 8d 7c 24 08 7b:b8 00 00 00 00 80 e8 00 00 00 00 85: 48 01 eb 88 48 01 d8 8b: 48 83 c4 20 8f:5b 90 5d 91: c3 push %rbp push %rbx sub add mov trdi , 0x18(%rsp) add $0x2 , %rsi mov trsi,0x10(%rsp) add0x3 mov trax , 0x8 ( %rsp) lea 0x10 (8rsp), rsi lea 0x18(%rsp),erdi mov callq 57 mov lea 0x8 ( %rsp ) ,%rsi lea 0x10(%rsp ) ,%rdi mov callq 6e mov lea 0x18(%rsp ) ,trsi lea 0x8 (8rsp),8rdi mov callq 85 add add add pop %rbp pop retq $0x20, %rsp $0x1,srdi , %rax $ 0x0 , %eax $ 0x0 , %eax trax, %rbp $0x0, %eax % rbp , % rbx $0x20, %rsp 1. Find the size of the stack in bytes 2. Identify the assembly statement(s) that allocate and free the local stack. 3. Identify which local values get stored in callee-saved registers 4. Identify which local values get stored on the stack. 5. 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

MongoDB Applied Design Patterns Practical Use Cases With The Leading NoSQL Database

Authors: Rick Copeland

1st Edition

1449340040, 978-1449340049

More Books

Students also viewed these Databases questions

Question

Repeat Prob. 1331 for a temperature of 400 K.

Answered: 1 week ago

Question

List advantages and disadvantages of using credit cards

Answered: 1 week ago