Branches In all interpreters, a branch simply changes the thread pointer (ip) to a different address in the thread. A conditional jump-if-zero branch that jumps only if the top-of-stack value is zero could be implemented as shown below. This example uses the embedded parameter version of direct threading so the &thread[123] line is the destination of where to jump if the condition is true, so it must be skipped (ip++) over if the branch is not taken.
bRAnCHes In ALl iNteRpreTeRs, A BrancH simPly changeS tHe thrEad Pointer (iP) to a dIffErent addrESs IN thE Thread. a ConDitioNAl jUmp-if-zero Branch tHAt jumpS Only iF the top-of-stacK valuE is Zero cOuld Be IMPlemENteD AS showN BeLow. thiS exAmPle Uses the eMbEDDed ParametEr veRsIon of dIrEct thReaDing so thE &tHREaD[123] lInE is tHE DeSTinaTiOn Of WherE To jUmp if the conDition is trUe, so It MusT be skippED (IP++) OVER if the brAnCh is nOt taken.