various improvements
[rrq/rrqforth.git] / adoc / p_read_word.adoc
index f917434f55980efb848c8183f30beaa3adaa75be..95baa767f5abe960d66ad6c15073c3889977b594 100644 (file)
@@ -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
+<<p_pad,PAD>>, 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
+<<p_lparen,parethesis commenting>>.
+====