This set of Computer Organization and Architecture Multiple Choice Questions & Answers (MCQs) focuses on “Subroutines and Nesting”.
1. The return address of the Sub-routine is pointed to by _______
a) IR
b) PC
c) MAR
d) Special memory registers
View Answer
Explanation: The return address from the subroutine is pointed to by the PC.
2. The location to return to, from the subroutine is stored in _______
a) TLB
b) PC
c) MAR
d) Link registers
View Answer
Explanation: The registers store the return address of the routine and is pointed to by the PC.
3. What is subroutine nesting?
a) Having multiple subroutines in a program
b) Using a linking nest statement to put many subroutines under the same name
c) Having one routine call the other
d) None of the mentioned
View Answer
Explanation: None.
4. The order in which the return addresses are generated and used is _________
a) LIFO
b) FIFO
c) Random
d) Highest priority
View Answer
Explanation: That is the routine called first is returned first.
5. In case of nested subroutines the return addresses are stored in __________
a) System heap
b) Special memory buffers
c) Processor stack
d) Registers
View Answer
Explanation: In this case, there will be more number of return addresses it is stored on the processor stack.
6. The appropriate return addresses are obtained with the help of ____ in case of nested routines.
a) MAR
b) MDR
c) Buffers
d) Stack-pointers
View Answer
Explanation: The pointers are used to point to the location on the stack where the address is stored.
7. When parameters are being passed on to the subroutines they are stored in ________
a) Registers
b) Memory locations
c) Processor stacks
d) All of the mentioned
View Answer
Explanation: In the case of, parameter passing the data can be stored on any of the storage space.
8. The most efficient way of handling parameter passing is by using ______
a) General purpose registers
b) Stacks
c) Memory locations
d) None of the mentioned
View Answer
Explanation: By using general purpose registers for the parameter passing we make the process more efficient.
9. The most Flexible way of logging the return addresses of the subroutines is by using _______
a) Registers
b) Stacks
c) Memory locations
d) None of the mentioned
View Answer
Explanation: The stacks are used as Logs for return addresses of the subroutines.
10. The wrong statement/s regarding interrupts and subroutines among the following is/are ______
i) The sub-routine and interrupts have a return statement
ii) Both of them alter the content of the PC
iii) Both are software oriented
iv) Both can be initiated by the user
a) i, ii and iv
b) ii and iii
c) iv
d) iii and iv
View Answer
Explanation: None.
Sanfoundry Global Education & Learning Series – Computer Organization and Architecture.
- Check Computer Science Books
- Practice BCA MCQs
- Practice Computer Science MCQs
- Practice Information Technology MCQs
- Apply for Computer Science Internship