X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=adoc%2Fp_begin.adoc;h=da124abb1076d85352994226fabab83e52f9a2b8;hb=d7958ae7b474ef357864237fc40412139e43b117;hp=ca4f1af8160b00d8905cd34584995661b33dff97;hpb=d5a8f559318ac57934871a48e964bac18557b601;p=rrq%2Frrqforth.git diff --git a/adoc/p_begin.adoc b/adoc/p_begin.adoc index ca4f1af..da124ab 100644 --- a/adoc/p_begin.adoc +++ b/adoc/p_begin.adoc @@ -14,3 +14,21 @@ implement structured execution control. BEGIN simply places the address for resolving branches back to this point during execution, and then a 0 as a marker so as to allow for an unknown number of block exit points. + +==== +.Usage example {counter:example}: +---- +: WTELL ( tfa -- ; Print word pname ) + 24 + DUP 8 + SWAP @ TELL SP EMIT +; + +: WORDS ( wordlist -- ; Print all words of word list ) + BEGIN + @ DUP 0= IFBREAK + DUP WTELL + END + DROP + NL EMIT +; +---- +====