Functions and Subroutine MCQ’s

Read Time:1 Minute, 27 Second

This set of Microcontroller Multiple Choice Questions & Answers (MCQs) focuses on “Functions and Subroutine”.

1. ret instruction is used for _________
a) determining the end of the program
b) for returning back from the subroutine to the main program
c) for transferring data from one place to another
d) none of the mentioned

2. According to conventions being followed, R12 to R15 are used for _________
a) parameter passing
b) preserved for call
c) all of the mentioned
d) none of the mentioned

3. Which instruction is used to call functions?
a) MOV
b) GO
c) CALL
d) All of the mentioned

4. We can store the temporary results across a call instruction with the help of which of the following registers
a) R1-R4
b) R4-R11
c) R12-R15
d) All of the mentioned

5. Which registers are reserved for passing the parameters to a subroutine and then returning the final result?
a) R1-R4
b) R4-R11
c) R12-R15
d) All of the mentioned

6. When any subroutine is called, then the first value of stack will be
a) value of PC
b) the return address
c) none of the mentioned
d) both are one and the same things

7. Can we allocate variables on the stack?
a) yes
b) no
c) cant be said
d) depends on the conditions

8. What actually is the order of stack frame for a parameter to pass to a subroutine?
a) parameter passed to a subroutine
b) return address
c) saved copies of registers(R4-R11)
d) all of the mentioned

9. Which of the following instruction/s is/are used to return back to the main program after the subroutine is completed?
a) ret
b) reti
c) ret and reti
d) none of the mentioned

10. Is the approach of making subroutines effective or not?
a) yes
b) no
c) cant be said
d) depends on the conditions

Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

Leave a Reply

Your email address will not be published. Required fields are marked *

Previous post Addressing Modes MCQ’s
Next post Interrupts MCQ’s