← 📝 Intermediate Code Generation
Subtopic 5 of 5

8.5Control flow translation

Boolean expressions with short-circuit evaluation compile to conditional jumps with true/false labels; backpatching fills in the targets when they become known.

  • if a < b goto L1 first test
  • goto Lfalse first operand false: skip the second test (short circuit)
  • L1: if c < d goto Ltrue evaluated only if a < b
  • goto Lfalse second operand false

Boolean operators become control flow. With backpatching, Ltrue/Lfalse are filled in once their addresses are known.

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.