Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. What is an: a. Open subroutine? b. Closed subroutine? 2. When is: a. An open

ID: 3687003 • Letter: 1

Question

1. What is an:

a. Open subroutine?

b. Closed subroutine?

2. When is:

a. An open subroutine better than a closed subroutine?

b. A closed subroutine better than an open subroutine?

3. What SPARC instruction is used to invoke a (closed) subroutine?

4. What is a register window?

5. Which groups of registers are shared between register windows?

6. How many unique registers does each register window have?

7. How does a register window relate to a stack frame?

8. What SPARC instruction opens a new register window for a subroutine?

9. What causes a window overflow exception?

10. How does the system respond to a window overflow exception?

Explanation / Answer

1.(a) A subroutine that can be included in a routine from wherever said subroutine is stored is called an open subroutine.
    (b)A closed subroutine must be placed in a specified location to be accessed by a routine.

2. (a) Advantage of Open subroutine over Closed Subroutine

     (b) Open Subroutines also called as macros and biggest disadvantage of the macro is the size of the program. The reason is, the pre-processor will replace all the macros in the program by its real definition prior to the compilation process of the program.

3. The SPARC architecture supports two instructions, call and jmpl, for linking to subroutines

4, Register Windows is a technique to improve the performance of a particularly common operation, the procedure call.

5. Register Window comprise of

6 Each register window involves 24 registers (8 input, 8 local, 8 output)

7.Register windows are, naturally, intimately related to the stack. It is the area used by the operating system (Solaris, SunOS, and Linux at least) to save the current local and in registers upon a system interupt, exception, or trap instruction

8. Load - which moves data from memory to registers

9. When there is not enough space in memory to run the hardware interrupt routines results in an overflow exception

10 Overflow exception can cause System to Hang