Skip to content

v2.2.1: DO .. LOOP extension

Compare
Choose a tag to compare
@TG9541 TG9541 released this 11 Dec 11:06
· 863 commits to master since this release

STM8EF v2.2.1 adds DO ( n n --), LEAVE ( -- ), LOOP ( -- ), and +LOOP ( +n -- )
The new words should work like specified in ANS Forth.

Example:
: test DO R@ DUP . 3 = IF LEAVE THEN 2 +LOOP ; ok
10 -9 test -9 -7 -5 -3 -1 1 3 ok
10 2 test 2 4 6 8 ok