10.3.6.6 Branch Instructions
All the conditional branch instructions described below work in the
same way:
- They pop off Scheme object(s) located on the stack for use in the
branch condition
- If the condition is true, then the instruction pointer is
increased by the offset passed as an argument to the branch
instruction;
- Program execution proceeds with the next instruction (that is,
the one to which the instruction pointer points).
Note that the offset passed to the instruction is encoded as three 8-bit
integers, in big-endian order, effectively giving Guile a 24-bit
relative address space.
— Instruction:
br offset
Jump to offset. No values are popped.
— Instruction:
br-if offset
Jump to offset if the object on the stack is not false.
— Instruction:
br-if-not offset
Jump to offset if the object on the stack is false.
— Instruction:
br-if-eq offset
Jump to offset if the two objects located on the stack are
equal in the sense of eq?. Note that, for this instruction, the
stack pointer is decremented by two Scheme objects instead of only
one.
— Instruction:
br-if-not-eq offset
Same as br-if-eq for non-eq? objects.
— Instruction:
br-if-null offset
Jump to offset if the object on the stack is '().
— Instruction:
br-if-not-null offset
Jump to offset if the object on the stack is not '().