<< Home | About Forth | About TurboForth | Download | Language Reference | Resources | Tutorials | YouTube >>


Words in category Flow Control Words in glossary TurboForth Kernal

Search:
The following words are listed in this category (27 words found): Word Types: S = Standard, I = Immediate , IC = Immediate-compiling.
Word Name Word Type Data Stack Signature Return Stack Signature Description Availability
V1.0 V1.1 V1.2
(+LOOP) S n -- -- ret_addr max index | -- Internal assembly-code representation of +LOOP. Compiled by +LOOP.
(DO) S max index -- -- ret_addr max index Internal assembly-code representation of DO. Compiled by DO.
(FOR) S count -- -- ret_addr max index Internal assembly-code representation of FOR. Compiled by FOR.
(LOOP) S -- -- ret_addr max index | -- Internal assembly-code represenation of LOOP. Compiled by LOOP.
(NEXT) S -- -- ret_addr max index | -- Compiled into a definition by NEXT. Cause the loop index to be evaluated against zero, and the loop to be repeated if the index is not 0.
+LOOP IC n -- -- Adds n to the current loop index. If the index equals or exceeds the loop limit, the loop exits, otherwise the loop executes again.
0BRANCH S flag -- -- Branches to the address specified in the following cell if flag is FALSE, otherwise takes no action.
AGAIN IC -- -- Loops back unconditionally to associated BEGIN.
BEGIN I -- -- Marks the beginning of a BEGIN...WHILE...REPEAT loop or a BEGIN...UNTIL loop.
BRANCH S -- -- Branches unconditionally to the address in the following cell.
CASE I -- -- Marks the beginning of case-by-case processing.
DO IC max start -- -- Begins a DO/LOOP or a DO/+LOOP sequence.
ELSE IC -- -- Words following ELSE will be executed if the parent IF clause evaluates to FALSE.
ENDCASE IC -- -- Ends case-by-case processing. See CASE.
ENDOF IC -- -- Marks the end of a particular test case. See CASE.
FOR IC count -- -- Begins a FOR/NEXT loop.
I S -- index -- Returns the current index in a DO/LOOP or FOR/NEXT loop.
IF IC flag -- -- Executes the words following IF if flag evaluates to TRUE. Starts an IF...ELSE...THEN clause.
J S -- index -- Returns the outer index when used in a nested DO or FOR loop.
LEAVE S -- ret_add max index -- In a DO/LOOP or FOR/NEXT loop, causes the loop to exit. LEAVE should be used inside an IF...THEN block.
LOOP IC -- ret_add max index --ret_add index | -- Causes a DO/LOOP to repeat from the word immediately following DO.
NEXT IC -- -- Causes a FOR/NEXT loop to repeat from the word following FOR.
OF IC -- -- Marks the beginning of a case test. See CASE.
REPEAT IC -- -- Loops back unconditionally to associated BEGIN.
THEN IC -- -- Marks the end of an IF...ELSE...THEN construct.
UNTIL IC flag -- -- Jumps back to associated BEGIN if flag evaluates to FALSE. I.e the loop exits if flag is TRUE.
WHILE IC flag -- -- Enters a WHILE/REPEAT block if flag evaluates to TRUE.

<< Home | About Forth | About TurboForth | Download | Language Reference | Resources | Tutorials | YouTube >>