FORTH and Threaded Interpretive Languages

first previous next last


Max-Gerd Retzlaff, 5. July 2008

https://entropia.de/GPN7

Jonesforth by Richard W. M. Jones

BRANCHING --------------------------------------------------------------------------- BRANCH is an unconditional branch +---------------------+-------+---- - - ---+------------+------------+---- - - - ----+------------+ | (Dictionary header) | DOCOL | | BRANCH | offset | (skipped) | word | +---------------------+-------+---- - - ---+------------+-----|------+---- - - - ----+------------+ ^ | ^ | | | | +-----------------------+ %esi added to offset 0BRANCH is the same except the branch happens conditionally. defcode "BRANCH",6,,BRANCH add (%esi),%esi // add the offset to the instruction pointer NEXT defcode "0BRANCH",7,,ZBRANCH pop %eax test %eax,%eax // top of stack is zero? jz code_BRANCH // if so, jump back to the branch function above lodsl // otherwise we need to skip the offset NEXT 33