Lecture 10a: Compiling Conditionals and Boolean Operators

(Continuing Lecture 10.)

Review questions:

  • how to represent 'false' and 'true'
  • give examples of branching instructions
  • how to translate: if-then-else
    • assuming boolean on stack
    • if (x < y)
  • how to translate while

Compiling Relations and Boolean Operators

The Cool Way: Better Code Generation for Conditions

Some More Instructions

Final Points