JVM Instructions for Branching
Unconditional jumps: goto
Conditional branch on comparison to zero:
- by convention on booleans in Booleans and Data Representation, we can use if_eq to mean ifFalse
- can use if_ne to mean ifTrue (because 1 is not equal to 0)
There are also conditional branches for comparison of two operands:
- in general called if_icmpcond
for different 'OP'
We examine next: how to use these instructions to compile
- control-flow operations
- later, boolean expressions