NPTEL Compiler Design Week 12 Assignment Answers 2025
1. Backpatching is needed to generate intermediate code using
(A) Single pass
(B) Two passes
(C) Multiple passes
(D) None of the other options
Answer :- For Answers Click Here
2. Jump table is suitable for
(A) Small number of cases
(B) Large number of cases
(C) Any number of cases
(D) None of the other options
Answer :-
3. If case values are widely spaced, it is better to use
(A) Jump table
(B) Table search
(C) Either jump table or simple table
(D) None of the other options
Answer :-
4. Function call actions are divided into sequences
(A) Calling and return
(B) Calling and composition
(C) Return and composition
(D) None of the other options
Answer :-
5. Evaluation of actual parameters is done by
(A) Callee
(B) Caller
(C) Both Caller and Callee
(D) None of the other options
Answer :- For Answers Click Here
6. “In a callee-save register convention, who is responsible for saving registers?”
(A) Caller
(B) Callee
(C) Both Caller and Callee
(D) None of the above
“In a callee-save register convention, who is responsible for saving registers?”
Answer :-
7. Local storage is created by
(A) Callee
(B) Caller
(C) Both Caller and Callee
(D) None of the other options
Answer :-
8. For a switch statement, the expression can result into values in the range -5 to +6. Number of entries in the jumptable should be
(A) 5
(B) 6
(C) 11
(D) 12
Answer :-
9. For a switch statement implemented as a jumptable, default_case is
(A) A part of jumptable
(B) Not a part of jumptable
(C) in the middle of the jumptable
(D) at the beginning of the jumptable
Answer :-
10. For pair of goto based storage allocation for functions, the second goto statement transfers control to the beginning of
(A) Storage space
(B) Function code
(C) Program
(D) None of the other options
Answer :-
11. In a jump table-based switch statement, how is the index for the jump table calculated
when the case values include negative numbers?
(A) Using the case value directly as the index
(B) By shifting all case values so that the smallest value maps to index 0
(C) By skipping negative case values in the jump table
(D) By using absolute values of case numbers
Answer :-
12. Which of the following occurs during the calling sequence of a function call?
(A) Saving the return address and passing arguments
(B) Restoring registers and returning control to the caller
(C) Freeing allocated memory and clearing local variables
(D) None of the above
Answer :- For Answers Click Here