Subtopic 1 of 5
8.1Three-address code
Each instruction has at most one operator on the right: x = y op z. Compound expressions need temporaries: one per operator. Also copies, jumps, indexed and pointer assignments.
- 1: t1 = uminus c
- 2: t2 = b * t1
- 3: t3 = uminus c
- 4: t4 = b * t3
- 5: t5 = t2 + t4
- 6: a = t5
Each instruction has at most one operator and three addresses. Count: 1 temp per operator. (6 instructions, 5 temporaries)
Previous year questions: Intermediate Code Generation (5)
PYQs are grouped by topic, so this is the full set for Intermediate Code Generation; try the ones that match this subtopic. Open all 5 on the topic page.