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...
-
Drop a sheet of paper and a coin at the same time. Which reaches the ground first? Why? Now crumple the paper into a small, tight wad and again drop it with the coin. Explain the difference observed....
-
Assume the short-run aggregate supply curve can be expressed algebraically as where Y d is aggregate demand. Find the numerical values for equilibrium output, Y, and the equilibrium inflation rate, ,...
-
Perform the following operations without a calculator. Simplify if possible. 1. \((19 \sqrt{3}) \times(5.6 \sqrt{12})\) 2. \(13 \pi \times 8 \pi\)
-
Sepracor, Inc., a U.S. drug company, reported the following information. The company prepares its financial statements in accordance with U.S. GAAP . 2007 (, 000) Current liabilities $ 554,114...
-
Tony??s favorite memories of his childhood were the times he spentwith his dad at camp. Tony was daydreaming of those days a bit ashe and Suzie jogged along a nature trail and came across awonderf 2...
-
Assignment Instructions The newly appointed accountant of a start-up company Pioneer Limited, which has received funding from two sharks jointly in the Shark Tank against the issue of debentures, has...
-
Suppose that Ally Financial Inc. issued a bond with 10 years until? maturity, a face value of $ 1 comma 000 $1,000?, and a coupon rate of 7 % 7% ?(annual payments). The yield to maturity on thi...
-
How would you communicate and implement training activities so everyone within the team is aware of budget/financial plans?
-
Debt Ratios The Ford Motor Company (F) designs, manufactures, markets, and sells cars, trucks, and sport utility vehicles (SUVs). Ford is a major competitor of General Motors Company (GM). The...
-
An alkaline battery with an emf of e = 1 . 5 2 5 V has an internal resistance r = 0 . 4 2 5 ohms. a multimeter is used to measure a voltage across R = 1 . 0 0 Kilo - ohms load resistor connected...
-
Taylor Series stock is $562/sh today and its futures contract (due in 6 months) is $580. Dividends of $2 are expected in 1 month and 5 months. The interest rate is 4% p.a. (flat term structure with...
-
Determine the absolute pressure at the bot- tom of a lake that is 35.6 m deep. The accel- eration of gravity is 9.8 m/s and atmospheric pressure is 1.01 x 105 Pa. The density of wa- ter is of course...
-
Based on the book, Kerzner, H. (2017). Project Management: A systems approach to Planning, Scheduling, and Controlling (12th ed.). or in PMBOK 7th Edition, answer the below question: NPV (Net Present...
-
How can a promoter avoid personal liability for pre-incorporation contracts?
-
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...
-
In confirming accounts receivable on December 31, 2001, the auditor found 15 discrepancies between the cus tomer s records and the recorded amounts in the subsidiary ledger. A copy of all...
-
Baerg & Vetzel, a public accounting firm, were the auditors of South-Western Development, Inc., a real estate company that owned several shopping centres in southwest ern Ontario. It was...
-
A partner in your public accounting firm has asked you to explain to a group of juniors the importance of engagement letters and the importance of following up unusual or unexplained items discovered...
Study smarter with the SolutionInn App