Quiz 9.3

DIRECTIONS: Read each question carefully. Then click on the dot next to the answer that most closely fits the question. Try to answer all questions on this quiz and when you are done, click on the grade me button at the bottom.


Coverage: Section 9.5

  1. Which term is a commonly used synonym for subprogram?
procedure
parameter
invocation
all of the above

  1. When a main program tells a subprogram to start working, we say that the main .... it.
returns to
activates
calls
utilizes

  1. What term does FORTRAN and many assemblers use for subprograms?
function
subroutine
procedure
event handler
method

  1. Which CSC-1 instruction starts up a subprogram?
JMP
CAL
RET
HLT

  1. How does a subprogram get back to the main program?
JMP
CAL
RET
HLT

  1. Where does the CSC-1 save the return address when it calls a subprogram?
in the A register
in the S register
in a special PARM section of memory
in a secret register in the CPU

  1. If a subprogram calls another subprogram, what will happen?
you can't do this in the CSC-1 computer; it is too primitive
the computer will never be able to return to the first caller
it will work correctly if the return address is copied into memory before calling the other subprogram, and restored after it ends
the CSC-1 stashes the old return addresses in special system registers on chip and recovers them as the subprogram returns

  1. In the CSC-1, where are parameters to subprograms put?
anywhere in main memory you like
in special registers on the CPU
in a special main memory area called the stack
in the first several words of the subprogram's code

  1. What does SP stand for in some computers (though not in the CSC-1)?
the super pointer register
secondary parameters
the stack pointer register

  1. What name is often used to indicate that subprogram parameters may be changed within a subprogram and the results communicated back to the caller?
call by value
call by value/result
call by return
call by stack

  1. What is the first instruction of a subprogram, in the CSC-1?
any instruction you like!
LOD
NOP
RET