Compiler Construction MCQs with Answers
Practice important Compiler Construction MCQs with answers and explanations.
Multiple Choice Questions
Q1101: The quadruple at index 107 in the example is:
- A: x=y+z
- B: x=y-z
- C: goto _
- D: goto 106
View Answer
C
Q1102: The primary task of code generation in a compiler is to:
- A: Map intermediate code to machine code
- B: Map source code to machine code
- C: Optimize source code
- D: Parse source code
View Answer
A
Q1103: Which of the following is NOT an issue handled by the code generation module?
- A: Memory management
- B: Instruction selection
- C: Parsing syntax
- D: Register allocation
View Answer
C
Q1104: In code generation, what is the input to the code generation module?
- A: High-level language code
- B: Machine code
- C: Intermediate code
- D: Assembly language code
View Answer
C
Q1105: The target machine architecture discussed uses instructions of which format?
- A: One-address
- B: Two-address
- C: Three-address
- D: Four-address
View Answer
B
Q1106: What is the size of a word in the target machine?
- A: 1 byte
- B: 2 bytes
- C: 4 bytes
- D: 8 bytes
View Answer
C
Q1107: The assembly instruction SUB source, destination performs which operation?
- A: Destination = Destination - Source
- B: Source = Destination - Source
- C: Destination = Source - Destination
- D: Source = Source - Destination
View Answer
A
Q1108: Which addressing mode has zero added cost?
- A: Absolute
- B: Indexed
- C: Register
- D: Literal
View Answer
C
Q1109: The addressing mode c(R) is called:
- A: Absolute
- B: Indexed
- C: Indirect Register
- D: Stack
View Answer
B
Q1110: What does the "added cost" in code generation refer to?
- A: Execution time
- B: Instruction length
- C: Memory address cost
- D: Register usage cost
View Answer
B