Submit a pdf (filename format: HomeworkXX_lastname.pdf) to Canvas. (No ZIP or doc files accepted) (15 Points)...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Submit a pdf (filename format: HomeworkXX_lastname.pdf) to Canvas. (No ZIP or doc files accepted) (15 Points) Consider the following 5 x86-64 assembly code snippets. Each of those snippets is generated by a particular version of GCC with particular settings of the command-line options. For each part: (1) Briefly explain each assembly instruction inside the snippet and its effect. (2) What is the content of the rax register (in hexadecimal) right after this entire code snippet is executed? Assume that the initial value stored in rax prior to executing each of the following code snippets is 0. (3) This assembly code snippet was part of assembly code that was generated by compiling C code with the following form: foo() { } var1 = var2 = ( ; // the numerical value assigned to var1 here must be in decimal ) varl; Assuming this is the only code inside the dummy function foo, fill in all missing parts of the C code inside this function. 1) movb $-16, -5(%rbp) movzbl -5(%rbp), %eax movl %eax, -4(%rbp) 2) movb $0x88, -3(%rbp) movsbw -3(%rbp), %ax movw %ax, -2(%rbp) 3) movw $0x7FFF, -6(%rbp) movswl -6(%rbp), %eax movl %eax, -4(%rbp) 4) movb $0x9C, -9(%rbp) movsbq -9(%rbp), %rax movq %rax, -8(%rbp) 5) movl $-2,-8(%rbp) movl -8(%rbp), %eax movl %eax, -4(%rbp) Submit a pdf (filename format: HomeworkXX_lastname.pdf) to Canvas. (No ZIP or doc files accepted) (15 Points) Consider the following 5 x86-64 assembly code snippets. Each of those snippets is generated by a particular version of GCC with particular settings of the command-line options. For each part: (1) Briefly explain each assembly instruction inside the snippet and its effect. (2) What is the content of the rax register (in hexadecimal) right after this entire code snippet is executed? Assume that the initial value stored in rax prior to executing each of the following code snippets is 0. (3) This assembly code snippet was part of assembly code that was generated by compiling C code with the following form: foo() { } var1 = var2 = ( ; // the numerical value assigned to var1 here must be in decimal ) varl; Assuming this is the only code inside the dummy function foo, fill in all missing parts of the C code inside this function. 1) movb $-16, -5(%rbp) movzbl -5(%rbp), %eax movl %eax, -4(%rbp) 2) movb $0x88, -3(%rbp) movsbw -3(%rbp), %ax movw %ax, -2(%rbp) 3) movw $0x7FFF, -6(%rbp) movswl -6(%rbp), %eax movl %eax, -4(%rbp) 4) movb $0x9C, -9(%rbp) movsbq -9(%rbp), %rax movq %rax, -8(%rbp) 5) movl $-2,-8(%rbp) movl -8(%rbp), %eax movl %eax, -4(%rbp)
Expert Answer:
Related Book For
Intermediate Accounting
ISBN: 978-1260481952
10th edition
Authors: J. David Spiceland, James Sepe, Mark Nelson, Wayne Thomas
Posted Date:
Students also viewed these programming questions
-
Addressing the following questions is part of HR strategy Except. a . Does the HR department offer their employees competencies that are required to meet their goals? b . What are the steps that a...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
A dipole of 6.6 nC point charges arranged 0.16 cm apart is centered at the origin and oriented along the x-axis. The positive charge is on the negative x axis. How m energy is required to place a...
-
The rotational constant of 12/16OC is 0.39021 cm. Calculate the bond length of the molecule (m (l2C) = 12 u exactly, m (16O) = 15.9949 u).
-
For the cascaded system of Fig. 5.174 with two identical stages, determine: a. The loaded voltage gain of each stage. b. The total gain of the system, Av and Avs. c. The loaded current gain of each...
-
Do shallow waves propagate at the same speed in all fluids? Explain why or why not.
-
Refer to the data in Exercise 6-31. The president of Tiger Furnishings is confused about the differences in costs that result from using direct labor costs and machine-hours. Required a. Explain why...
-
Give a summary of concepts and the applications for the following quistion: When a 200.0-g mass is attached to a spring, it stretches the spring by 7.50 cm. With that mass-spring system in...
-
Jerry Stevenson is the manager of a medical clinic in Scottsdale, AZ. He wants to analyze patient data to identify high-risk patients for cardiovascular diseases. From medical literature, he learned...
-
Why is Amazon's cash cycle so much shorter than that of competitor Barnes & Noble? How does this comparison affect financial management decisions of other retailers?
-
Burns Company reported $931.480 million in net income in 2021. On January 1, 2021, the company had 404 million shares of common stock outstanding. On March 1, 2021, 26.4 million new shares of common...
-
Divide. Show your work. x34x+6 x+3
-
Using the Black-Scholes formula, how much would one call option to buy a share of Marathon have been worth on December 1, 2021? 1...
-
Extrude-rite Corporation, a manufacturer of industrial machinery and components for the plastics industry, has recently had several product quality problems. These have occurred both before and after...
-
Divide using synthetic division. (4x+7x-13)+(x+5)
-
Suppose that a company plans to produce 1,000 units of product called Enco during June 2016. The expected time to produce a unit of Enco is five hours, and the budgeted fixed overhead is K2,000,000....
-
Air pollution generated by a steel mill is an example of a) a positive production externality. b) a negative production externality. c) a public good. d) the free-rider problem. State and local taxes...
-
On April 1, 2023, Titan Corporation purchases office equipment for $50,000. For tax reporting, the company uses MACRS and classifies the equipment as 5-year personal property. In 2023, this type of...
-
Explain the difference between an ordinary annuity and an annuity due.
-
The FASB Accounting Standards Codification represents the single source of authoritative U.S. generally accepted accounting principles. Required: 1. Obtain the relevant authoritative literature on...
-
The chief goal of the private sector is effciency.Why? The primary focus of the public sector is equity. Why? It is quite possible to be highly effcient yet ineffective. It is also possible to be...
-
Why is healthcare reform such a contentious issue in the United States? Why have public and private efforts been unsuccessful in fully addressing the challenge of affordable health care? What role(s)...
-
Drawing on economic theory, what kinds of market failure underlie the worlds most pressing problems? Examine three examples: hunger, groundwater contamination, and literacy.
Study smarter with the SolutionInn App