X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=adoc%2Fp_read_word.adoc;h=95baa767f5abe960d66ad6c15073c3889977b594;hb=60057839785134cd60545fa503c31ab50d4056d2;hp=f917434f55980efb848c8183f30beaa3adaa75be;hpb=b7da3f7bbd1cb10241163abdb950472e539e796d;p=rrq%2Frrqforth.git diff --git a/adoc/p_read_word.adoc b/adoc/p_read_word.adoc index f917434..95baa76 100644 --- a/adoc/p_read_word.adoc +++ b/adoc/p_read_word.adoc @@ -1,9 +1,29 @@ +// stdio.asm: WORD p_read_word,'READ-WORD',fasm + anchor:p_read_word[] -Word: READ-WORD ---------------- +=== Word: READ-WORD +.... +Data stack: ( stream -- char* n ) +.... + +"READ-WORD" is a function word that "reads" the next whitespace +separated word from the given stream and returns the [n:char*] duoble +cell pointer for it. The characters of the word are copied to +<>, and there is a limit of 1024 characters. + +At the end of the stream READ-WORD returns 0 length. ----- -stdio.asm: WORD p_read_word,'READ-WORD',fasm ----- +.Whitespace +[caption='Special syntax {counter:syntax}: '] +==== +All character codes less or equal to 32 are regarded as "whitespace". +==== +.Rest-of-line comment +[caption='Special syntax {counter:syntax}: '] +==== +The "#" character following whitespace starts a line comment and the +rest of the line is ignored. Note that this is also recognised with +<>. +====