1 myfunc: 2 # Prologue (code for save registers are hidden) 3 4 # assign registers...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1 myfunc: 2 # Prologue (code for save registers are hidden) 3 4 # assign registers to hold arguments to myfunc 5 addi to, a0, 0 6 addi so, al, 0 7 addi a7, a2, 0 8 9 jal generate_random #code for saving/restoring regs are hidden 10 11 # store and process return value 12 addi tl, a0, 0 slli t5, t1, 2 13 14 15 # setup arguments for reverse 16 add a0, to, x0 add al, 50, x0 add a2, t5, x0 addi a3, t1, 0 20 add a7, t5, a7 21 22 jal reverse #code for saving/restoring regs are hidden 23 24 # additional 17 18 19 25 add to, s0, x0 add t1, tl, a7 26 27 add s9, 58, t1 28 add s3, x0, t5 29 30 exit: # Epilogue (code for restoring registers are hidden) 31 ret The lifetime of register t1 is between lines 12 27 Question 2 6 The lifetime of register so is between line line 17 and 0.2 pts and Question 3 What callee-saved registers must be saved on the stack in the prologue of myfunc? U U U U U U U U U U SO a7 s8 $9 t1 न to a3 s3 t5 a1 a0 Oa2 0.3 pts Question 4 What caller-saved registers must be saved on the stack before calling reverse? J U L D U 1 U U J a3 a2 SO a0 8 t5 a1 s9 a7 t1 ra to 0.3 pts s3 1 myfunc: 2 # Prologue (code for save registers are hidden) 3 4 # assign registers to hold arguments to myfunc 5 addi to, a0, 0 6 addi se, al, 0 7 addi a7, a2, 0 8 9 jal generate_random #code for saving/restoring regs are hidden 10 11 # store and process return value 12 addi tl, a0, 0 slli t5, t1, 2 13 14 15 # setup arguments for reverse 16 add a0, to, x0 add al, 50, x0 add a2, t5, x0 addi a3, t1, 0 20 add a7, t5, a7 21 22 jal reverse #code for saving/restoring regs are hidden 23 24 # additional 17 18 19 25 add to, s0, x0 add t1, tl, a7 26 27 add s9, 58, t1 28 add s3, x0, t5 29 30 exit: # Epilogue (code for restoring registers are hidden) 31 ret The lifetime of register t1 is between lines 12 27 Question 2 6 The lifetime of register so is between line line 17 and 0.2 pts and Question 3 What callee-saved registers must be saved on the stack in the prologue of myfunc? U U U U U U U U U U SO a7 s8 $9 t1 न to a3 s3 t5 a1 a0 Oa2 0.3 pts Question 4 What caller-saved registers must be saved on the stack before calling reverse? J U L D U 1 U U J a3 a2 SO a0 8 t5 a1 s9 a7 t1 ra to 0.3 pts s3 1 myfunc: 2 # Prologue (code for save registers are hidden) 3 4 # assign registers to hold arguments to myfunc 5 addi to, a0, 0 6 addi so, al, 0 7 addi a7, a2, 0 8 9 jal generate_random #code for saving/restoring regs are hidden 10 11 # store and process return value 12 addi tl, a0, 0 slli t5, t1, 2 13 14 15 # setup arguments for reverse 16 add a0, to, x0 add al, 50, x0 add a2, t5, x0 addi a3, t1, 0 20 add a7, t5, a7 21 22 jal reverse #code for saving/restoring regs are hidden 23 24 # additional 17 18 19 25 add to, s0, x0 add t1, tl, a7 26 27 add s9, 58, t1 28 add s3, x0, t5 29 30 exit: # Epilogue (code for restoring registers are hidden) 31 ret The lifetime of register t1 is between lines 12 27 Question 2 6 The lifetime of register so is between line line 17 and 0.2 pts and Question 3 What callee-saved registers must be saved on the stack in the prologue of myfunc? U U U U U U U U U U SO a7 s8 $9 t1 न to a3 s3 t5 a1 a0 Oa2 0.3 pts Question 4 What caller-saved registers must be saved on the stack before calling reverse? J U L D U 1 U U J a3 a2 SO a0 8 t5 a1 s9 a7 t1 ra to 0.3 pts s3 1 myfunc: 2 # Prologue (code for save registers are hidden) 3 4 # assign registers to hold arguments to myfunc 5 addi to, a0, 0 6 addi se, al, 0 7 addi a7, a2, 0 8 9 jal generate_random #code for saving/restoring regs are hidden 10 11 # store and process return value 12 addi tl, a0, 0 slli t5, t1, 2 13 14 15 # setup arguments for reverse 16 add a0, to, x0 add al, 50, x0 add a2, t5, x0 addi a3, t1, 0 20 add a7, t5, a7 21 22 jal reverse #code for saving/restoring regs are hidden 23 24 # additional 17 18 19 25 add to, s0, x0 add t1, tl, a7 26 27 add s9, 58, t1 28 add s3, x0, t5 29 30 exit: # Epilogue (code for restoring registers are hidden) 31 ret The lifetime of register t1 is between lines 12 27 Question 2 6 The lifetime of register so is between line line 17 and 0.2 pts and Question 3 What callee-saved registers must be saved on the stack in the prologue of myfunc? U U U U U U U U U U SO a7 s8 $9 t1 न to a3 s3 t5 a1 a0 Oa2 0.3 pts Question 4 What caller-saved registers must be saved on the stack before calling reverse? J U L D U 1 U U J a3 a2 SO a0 8 t5 a1 s9 a7 t1 ra to 0.3 pts s3
Expert Answer:
Answer rating: 100% (QA)
In analyzing the assembly codes usage of registers we can determine the lifetime of certain registers and which calleesaved and callersaved registers ... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
The chefs want to make mayonnaise, using raw unpasteurised eggs. What is the maximum time they can keep the mayonnaise, even if it's kept refrigerated and why? Stuck? Please revisit Key factors in...
-
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...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-6. On December 12, Irene purchased the building where her store is located. She paid...
-
Describe, in human terms, why delay and jitter are bad in real time (interactive) voice and video communications. Would these same problems apply to recorded voice and video stored and played back at...
-
(a) Derive a general relation for (E/P)T,n for electrochemical cells employing reactants in any state of matter. (b) E, Cohen and K. Piepenbroek (2. Physik Chem. 167A, 365 (1933)) calculated the...
-
Compare the potential for management bias when making market-based or entity specific assumptions.
-
Sketched in Fig. P12.6 are the upstream [section (1)] and downstream [section (2)] velocity triangles at the arithmetic mean radius for flow through an axial-flow turbomachine rotor. The axial...
-
The standard cost of product 777 includes 2 units of direct materials at $6.00 per unit. During August, the company bought 29,000 units of materials at $6.30 and used those materials to produce...
-
The face value of a company's commercial paper borrowings (loan) at December 31 was $6,000,000. This six-month loan originated on September 1. a. Prepare the journal entry for issuance of the loan on...
-
Exercise 2: Implement calculate_S and calculate_R Recall that the element-wise squared Euclidean distance matrix D O DE Rnxm is defined by [D D] = (x; zj) (x; Zj) - - Also, the matrices S, RE Rnxm...
-
At the time he purchased his variable annuity, Ahmed directed $5,000 of his premium into Subaccount A when the unit value was $10. A year later, the unit value had increased to $15. Assuming he made...
-
Compute hit ratio for paging in memory management?
-
On a particular day, the September S&P 5 0 0 stock index futures ( think of this as a forward ) was priced at 9 6 0 . 5 0 . The S&P index was at 9 5 6 . 4 9 . The contract expires 7 3 days later. a...
-
In 1996, Alyssa Knowlton and Jenny Larson formed a partnership and operated a hair and styling salon, which they called "House of Style." Knowlton and Larson had taken some business law courses...
-
Mega Skateboard Supplier had net sales of $ 3 . 7 million, its cost of goods sold was $ 1 . 4 million, and its net income was $ 0 . 9 million. What will be Its gross margin ratio?
-
Molly Ellen, bookkeeper for Keystone Company, forgot to send in the payroll taxes due on April 1 5 . She sent the payment November 8 . The IRS sent her a penalty charge of 1 0 . 0 0 % simple interest...
-
Before working on this primer, you may need to review: . The slope-intercept form of a straight-line equation . Finding the slone of a line Figure 654321012 -1 2 3 4 < 11 of 11 Fo 5 6 7
-
Provide a draft/outline of legal research involving an indigenous Canadian woman charged with assault causing bodily harm under (Sec 267b) of the Criminal Code, where the crown wants a 12-month jail...
-
Phil and Linda are 25-year-old newlyweds and file a joint tax return. Linda is covered by a retirement plan at work, but Phil is not. a. Assuming Phil's wages were $27,000 and Linda's wages were...
-
Marty is a sales consultant. Marty incurs the following expenses related to entertainment of his clients in 2012: Dues to a country club......................................................$4,500...
-
Leslie is a single taxpayer who is under age 65 and in good health. For 2012, she has a salary of $23,000 and itemized deductions of $1,000. Leslie is entitled to one exemption on her tax return. a....
-
Which form of financing allows the source of the funds to share in the wealth if the company which received the financing does well? a. A loan b. An investment c. Both a loan and an investment d....
-
Which form of financing requires repayment, regardless of whether the company receiving the funds does well or not? a. A loan b. An investment c. Both a loan and an investment d. Neither a loan nor...
-
What are vertical and horizontal financial statement analyses? What are their advantages?
Study smarter with the SolutionInn App