Trusted by Students Everywhere
Why Choose Us?
0% AI Guarantee
Human-written only.
24/7 Support
Anytime, anywhere.
Plagiarism Free
100% Original.
Expert Tutors
Masters & PhDs.
100% Confidential
Your privacy matters.
On-Time Delivery
Never miss a deadline.
University of California, Irvine ICS 141 Chapter 9 - Subroutines and Control Abstraction 1)What is a subroutine calling sequence? What does it do? What is meant by the subroutine prologue and epilogue? How do calling sequences typically differ in older (CISC) and newer (RISC) instruction sets? 3
University of California, Irvine
ICS 141
Chapter 9 - Subroutines and Control Abstraction
1)What is a subroutine calling sequence? What does it do? What is meant by the subroutine prologue and epilogue?
- How do calling sequences typically differ in older (CISC) and newer (RISC) instruction sets?
3. Describe how to maintain the static chain during a subroutine call.
-
- What is a display? How does it differ from a static chain?
- What are the purposes of the stack pointer and frame pointer registers? Why does a subroutine often need both?
-
- Why do modern machines typically pass subroutine parameters in registers rather than on the stack?
- Why do subroutine calling conventions often give the caller responsibility for saving half the registers and the callee responsibility for saving the other half?
- If work can be done in either the caller or the callee, why do we typically prefer to do it in the callee?
- Why do compilers typically allocate space for arguments in the stack, even when they pass them in registers?
- List the optimizations that can be made to the subroutine calling sequence in important special cases (e.g., leaf routines).
- How does an in-line subroutine differ from a macro?
- Under what circumstances is it desirable to expand a subroutine in-line?
Chapter 9.3
-
- What is the difference between formal and actual parameters?
- Describe four common parameter-passing modes. How does a programmer choose which one to use when?
- Explain the rationale for READONLY parameters in Modula-3.
- What parameter mode is typically used in languages with a reference model of variables?
-
- Describe the parameter modes of Ada. How do they differ from the modes of other modern languages?
- List three reasons why a language implementation might implement a parameter as a closure.
- What is a conformant (open) array?
- What are default parameters? How are they implemented?
- What are named (keyword) parameters? Why are they useful?
- Explain the value of variable-length argument lists. What distinguishes such lis wets in Java and C# from their counterparts in C and C++?
-
- Describe three common mechanisms for specifying the return value of a function. What are their relative strengths and drawbacks?
- Describe three ways in which a language may allow programmers to declare exceptions.
- Explain why it is useful to define exceptions as classes in C++, Java, and C#.
- Explain the behavior and purpose of a try... finally construct.
-
- Explain how to implement exceptions in a way that incurs no cost in the common case (when exceptions don’t arise).
- Describe the operations that must be performed by the implicit handler for a subroutine.
- What is a volatile variable in C? Under what circumstances is it useful?
Expert Solution
PFA
Archived Solution
Unlocked Solution
You have full access to this solution. To save a copy with all formatting and attachments, use the button below.
Already a member? Sign In
Important Note:
This solution is from our archive and has been purchased by others. Submitting it as-is may trigger plagiarism detection. Use it for reference only.
For ready-to-submit work, please order a fresh solution below.
For ready-to-submit work, please order a fresh solution below.
Or get 100% fresh solution
Get Custom Quote





