Computer Organization Questions and Answers – Parameter Passing and Stack Frame

This set of Computer Organization Questions and Answers for Entrance exams focuses on “Parameter Passing and Stack Frame”.

1. The private work space dedicated to a subroutine is called as ________
a) System heap
b) Reserve
c) Stack frame
d) Allocation
View Answer

Answer: c
Explanation: This work space is where the intermediate values of the subroutines are stored.

2. If the subroutine exceeds the private space allocated to it then the values are pushed onto _________
a) Stack
b) System heap
c) Reserve Space
d) Stack frame
View Answer

Answer: a
Explanation: If the allocated work space is exceeded then the data is pushed onto the system stack.

3. ______ pointer is used to point to parameters passed or local parameters of the subroutine.
a) Stack pointer
b) Frame pointer
c) Parameter register
d) Log register
View Answer

Answer: b
Explanation: This pointer is used to track the current position of the stack being used.
advertisement
advertisement

4. The reserved memory or private space of the subroutine gets deallocated when _______
a) The stop instruction is executed by the routine
b) The pointer reaches the end of the space
c) When the routine’s return statement is executed
d) None of the mentioned
View Answer

Answer: c
Explanation: The work space allocated to a subroutine gets deallocated when the routine is completed.

5. The private space gets allocated to each subroutine when _________
a) The first statement of the routine is executed
b) When the context switch takes place
c) When the routine gets called
d) When the Allocate instruction is executed
View Answer

Answer: c
Explanation: When the call statement is executed, simultaneously space also gets allocated.
Note: Join free Sanfoundry classes at Telegram or Youtube

6. _____ the most suitable data structure used to store the return addresses in the case of nested subroutines.
a) Heap
b) Stack
c) Queue
d) List
View Answer

Answer: b
Explanation: None.

7. In the case of nested subroutines, the stack top is always _________
a) The saved contents of the called sub routine
b) The saved contents of the calling sub routine
c) The return addresses of the called sub routine
d) None of the mentioned
View Answer

Answer: a
Explanation: None.
advertisement

8. The stack frame for each subroutine is present in ______
a) Main memory
b) System Heap
c) Processor Stack
d) None of the mentioned
View Answer

Answer: c
Explanation: The memory for the work space is allocated from the processor stack.

9. The data structure suitable for scheduling processes is _______
a) List
b) Heap
c) Queue
d) Stack
View Answer

Answer: c
Explanation: The Queue data structure is generally used for scheduling as it is two directional.
advertisement

10. The sub-routine service procedure is similar to that of the interrupt service routine in ________
a) Method of context switch
b) Returning
c) Process execution
d) Method of context switch & Process execution
View Answer

Answer: d
Explanation: The Subroutine service procedure is the same as the interrupt service routine in all aspects, except the fact that interrupt might not be related to the process being executed.

Sanfoundry Global Education & Learning Series – Computer Organization and Architecture.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.