4. (40 pts) The disassembled code for two functions first and last is shown below, along...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
4. (40 pts) The disassembled code for two functions first and last is shown below, along with the code for a call of first by function main: 1234 569879 10 11 Disassembly of last (long u, long v) u in rdi, v in irsi 0000000000400540 : 1,x+1) 400540: 48 89 8 400543: 48 Of af c6 400547: c3 L2 L3 F4 M2 0000000000400548 : 400548 48 8d 77 01 40054c: 48 83 ef 01 400550: e8 eb ff ff ff 400555: 3 c3 mov imul retq Disassembly of first (long x) x in Srdi lea sub trdi, trax rsi, rax 0xl (rdi), rsi $0x1, trdi callq 400540 repz retq 400560: e8 e3 ff ff ff callq 400548 400565: 48 89 c2 mov trax, rdx L1: u L2: utv L3: Return Instruction Label PC (Srip) Instruction Srdi Arsi Brax M1 0x400560 callq 10 F1 F2 F3 L1 F1: x+1 F2: x-1 F3: Call last (x- F4: Return Starting with the calling of first (10) by main, fill in the following table of trace instruction execution through to the point where the program returns back to main. MI: Call first (10) M2: Resume State values (at beginning) 8rsp 0x7fffffffe820 8rsp Description Call first (10) 4. (40 pts) The disassembled code for two functions first and last is shown below, along with the code for a call of first by function main: 1234 569879 10 11 Disassembly of last (long u, long v) u in rdi, v in irsi 0000000000400540 : 1,x+1) 400540: 48 89 8 400543: 48 Of af c6 400547: c3 L2 L3 F4 M2 0000000000400548 : 400548 48 8d 77 01 40054c: 48 83 ef 01 400550: e8 eb ff ff ff 400555: 3 c3 mov imul retq Disassembly of first (long x) x in Srdi lea sub trdi, trax rsi, rax 0xl (rdi), rsi $0x1, trdi callq 400540 repz retq 400560: e8 e3 ff ff ff callq 400548 400565: 48 89 c2 mov trax, rdx L1: u L2: utv L3: Return Instruction Label PC (Srip) Instruction Srdi Arsi Brax M1 0x400560 callq 10 F1 F2 F3 L1 F1: x+1 F2: x-1 F3: Call last (x- F4: Return Starting with the calling of first (10) by main, fill in the following table of trace instruction execution through to the point where the program returns back to main. MI: Call first (10) M2: Resume State values (at beginning) 8rsp 0x7fffffffe820 8rsp Description Call first (10)
Expert Answer:
Related Book For
Computer Systems A Programmers Perspective
ISBN: 9781292101767
3rd Global Edition
Authors: Randal E. Bryant, David R. O'Hallaron
Posted Date:
Students also viewed these programming questions
-
The disassembled code for two functions first and last is shown below, along with the code for a call of first by function main: Each of these instructions is given a label, similar to those in...
-
Q1. You have identified a market opportunity for home media players that would cater for older members of the population. Many older people have difficulty in understanding the operating principles...
-
The insurance company Helmet is considering acquiring BeSafe, a life insurance company. According to BeSafes most recent financial statements, its loss ratio stands at 0.9, and its expense ratio...
-
The amount of solar energy transmitted through each square meter of space prior to entry in the earth's atmosphere, as measured by satellites, is called the total solar irradiance (TSI). A random...
-
Raner, Harris and Chan is a consulting firm that specializes in information systems for medical and dental clinics. The firm has two offices-one in Chicago and one in Minneapolis. The firm classifies...
-
An air cushion vehicle is supported by forcing air into the chamber created by a skirt around the periphery of the vehicle as shown in Fig. P3.116. The air escapes through the 3-in. clearance between...
-
Explore the data included in Table 4-9. Assume that the primary key of this relation consists of two components: Author's ID (AID) and Book number (BNbr). The relation includes data regarding...
-
The following events occur for Wainwright Engineering during 2024 and 2025, its first two years of operations. February 2, 2024 July 23, 2024 December 31, 2024 April 12, 2025 June 28, 2025 September...
-
Euro Corporation, a U.S. corporation, operates through a branch in Germany. During 2022, the branch reported taxable income of $1,000,000 and paid German income taxes of $300,000. In addition, Euro...
-
How do you reconcile the tension between optimizing temporal efficiency and fostering sustainable long-term productivity and well-being ?
-
The English enrollments at five high schools in the Santa Rosa Unified School District are as follows: In Problems 42-47, suppose that 45 copies of an important instructional video are to be...
-
Consider the following apportionment problem for College Town: Suppose each council member is to represent approximately 2,500 citizens. Use the apportionment plan requested in Problems 41-45...
-
The U.S. president is elected with a vote of the Electoral College. However, if the vote were conducted using the Hare method, what would be the outcome? Use the data in Table 17.3, and assume that...
-
In the apportionment of the House of Representatives based on the 1790 census , there are 15 states. At that time, Maine was still considered part of Massachusetts. If Maine had been a separate...
-
The Hamming distance between two bit strings of length \(n\) is equal to the number of bits in which the two strings differ. Write a program that reads in an integer \(k\) and a bit string \(s\) from...
-
Q.No (04): (a). Three horses A, B and C are in race. A is three times as likely to win the race as B. B is twice as likely to win as C. what is the Probability that B or C win. (15) (b)- What is the...
-
Inexhaustible collections of ONPOs are not required to be capitalized or depreciated, if certain criteria are met. Why is this so, and what accounting and reporting recognition, if any, is required...
-
Figure 12.5 demonstrates a concurrent server in which the parent process creates a child process to handle each new connection request. Trace the value of the reference counter for the associated...
-
Consider the call to function swap in object file m.o (Figure 7.5). Now suppose that the linker relocates .text in m.o to address 0x4004d0 and swap to address 0x4004e8. Then what is the value of the...
-
Let us analyze the relative performance of using conditional data transfers versus conditional control transfers for the programs you wrote for Problems 4.5 and 4.6. Assume that we are using these...
-
The period of free vibration of a linear system is independent of initial conditions. Indicate whether the statement presented is true or false. If true, state why. If false, rewrite the statement to...
-
A system with a natural frequency of \(10 \mathrm{rad} / \mathrm{s}\) has a shorter period than a system of natural frequency \(100 \mathrm{rad} / \mathrm{s}\). Indicate whether the statement...
-
The natural frequency determined directly from the differential equation of motion has units of Hertz. Indicate whether the statement presented is true or false. If true, state why. If false, rewrite...
Study smarter with the SolutionInn App