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

 1. Consider the following disassembled C function compute: 1. Dump of

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!