loops.f

This file contains the compile time handlers needed to create variaous looping and branching constructs within a Forth high level definition.

In Forth, there are two execution tokens to handle a high level branch; these are branch and ?branch. Each of these is compiled in two cells where the first cell gives the XT for the branch type and the second cell gives the target address of the branch.

All branching constructs and all conditional execution constructs within a Forth application use branch / ?branch XT's or aliases for them. The only reason they would use an alias instead of the actual XT is so that the decompiler (and thus the debugger) can tell exactly what type of control block it is decompiling.

Where the branch is in the forward direction the compiler will compile a dummy branch to address 0 and save the address of the branch vector on the parameter stack to be back patched once we know where it's branching to.