Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

1. Consider the following disassembled C function compute: 1. Dump of assembler code for function compute: 2. 0x00400626 3. 0x00400629 4. 0x0040062c : 5. 0x0040062e

image text in transcribed

1. Consider the following disassembled C function compute: 1. Dump of assembler code for function compute: 2. 0x00400626 3. 0x00400629 4. 0x0040062c : 5. 0x0040062e : 6. 0x00400632 7. 0x00400635 : 8. 0x0040063a : 9. 0x0040063e trdi, trax mov test %rdi , %rdi jns 0x40063e sub $0x8,%rsp neg callq 0x400626 add $0x8,%rsp repz retq %rdi Write pseudo-C corresponding to each line of the function. Note: Use brief English descriptions for lines that have no C equivalent such as test of a register, and manipulating the stack pointer a. b. Trace the execution of compute (-3). Write the line number of each line that is being executed and write the values of the registers after execution of that line Show what you know about condition codes and whether branches are taken or not. Take particular note of any procedure calls and returns. Here is a start on your answer Line rdi raxcondition codesotes (This is the entry values) 3 c. What is the final return value of compute (-3)? d. What is compute actually computing

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_2

Step: 3

blur-text-image_3

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

Introduction To Constraint Databases

Authors: Peter Revesz

1st Edition

1441931554, 978-1441931559

More Books

Students explore these related Databases questions