correction
[rrq/rrqforth.git] / reference.html
index 7b6cb8a76ba03b4ffab29e3c1afa8e80369db11c..9137d075cfd0bd68e35fda305d8050d21cc8f636 100644 (file)
@@ -770,17 +770,24 @@ asciidoc.install();
 <a href="#p_put">!</a> &#160;\r
 <a href="#p_Cget">C@</a> &#160;\r
 <a href="#p_Cput">C!</a> &#160;\r
+<a href="#p_Wget">W@</a> &#160;\r
+<a href="#p_Wput">W!</a> &#160;\r
+<a href="#p_Dget">D@</a> &#160;\r
+<a href="#p_Dput">D!</a> &#160;\r
 <a href="#p_2get">2@</a> &#160;\r
 <a href="#p_2put">2!</a> &#160;\r
 <a href="#p_put_plus">!&#43;</a> &#160;\r
 <a href="#p_get_n_increment">@n&#43;&#43;</a> &#160;\r
 <a href="#p_get_n_decrement">@n--</a> &#160;\r
 <a href="#p_Ccomma">C,</a> &#160;\r
-<a href="#p_literal_string">S"</a> &#160;\r
+<a href="#p_Wcomma">W,</a> &#160;\r
+<a href="#p_Dcomma">D,</a> &#160;\r
+<a href="#p_literal_string_compile">S"</a> &#160;\r
 <a href="#p_gtR">&gt;R</a> &#160;\r
 <a href="#p_Rget">R@</a> &#160;\r
 <a href="#p_Rgt">R&gt;</a> &#160;\r
-<a href="#p_rbpn">R[n]</a> &#160;</p></div>\r
+<a href="#p_rbpn">R[n]</a> &#160;\r
+<a href="#p_dsp">D[n]</a> &#160;</p></div>\r
 <div class="paragraph"><p><a href="#data_stack">DATA-STACK</a> &#160;\r
 <a href="#return_stack">RETURN-STACK</a> &#160;\r
 &#160;\r
@@ -801,10 +808,12 @@ asciidoc.install();
 <a href="#p_begin">BEGIN</a> &#160;\r
 <a href="#p_break">BREAK</a> &#160;</p></div>\r
 <div class="paragraph"><p><a href="#p_cfa2flags_get">CFA&gt;FLAGS@</a> &#160;\r
+<a href="#p_cfa2tfa">CFA&gt;TFA</a> &#160;\r
 <a href="#p_clear_stream">CLEAR-STREAM</a> &#160;\r
 <a href="#p_create">CREATE</a> &#160;\r
 <a href="#p_current_wordlist">CURRENT-WORDLIST</a> &#160;</p></div>\r
 <div class="paragraph"><p><a href="#p_decimal">DECIMAL</a> &#160;\r
+<a href="#p_definitions">DEFINITIONS</a> &#160;\r
 <a href="#p_depth">DEPTH</a> &#160;\r
 <a href="#p_digits">DIGITS</a> &#160;\r
 <a href="#p_divmod">/MOD</a> &#160;\r
@@ -838,10 +847,13 @@ asciidoc.install();
 <a href="#p_immediate">IMMEDIATE</a> &#160;\r
 <a href="#p_input">INPUT</a> &#160;</p></div>\r
 <div class="paragraph"><p><a href="#p_literal">LIT</a> &#160;\r
+<a href="#p_literal_string">LIT-STRING</a> &#160;\r
 <a href="#p_load_buffer_size">LOAD-BUFFER-SIZE</a> &#160;\r
 <a href="#p_load_file">LOAD-FILE</a> &#160;</p></div>\r
 <div class="paragraph"><p><a href="#p_args">MAIN-ARGS</a> &#160;\r
-<a href="#p_malloc">MALLOC</a> &#160;</p></div>\r
+<a href="#p_malloc">MALLOC</a> &#160;\r
+<a href="#p_min">MIN</a> &#160;\r
+<a href="#p_max">MAX</a> &#160;</p></div>\r
 <div class="paragraph"><p><a href="#p_negate">NEGATE</a> &#160;\r
 <a href="#p_nip">NIP</a> &#160;\r
 <a href="#p_nl">NL</a> &#160;\r
@@ -855,8 +867,10 @@ asciidoc.install();
 <a href="#p_program_version">PROGRAM_VERSION</a> &#160;</p></div>\r
 <div class="paragraph"><p><a href="#p_quit">QUIT</a> &#160;</p></div>\r
 <div class="paragraph"><p><a href="#p_read_stream_char">READ-STREAM-CHAR</a> &#160;\r
+<a href="#p_read_stream_char">READ-STREAM-LINE</a> &#160;\r
 <a href="#p_read_word">READ-WORD</a> &#160;\r
 <a href="#p_realloc">REALLOC</a> &#160;\r
+<a href="#p_return">RETURN</a> &#160;\r
 <a href="#p_roll">ROLL</a> &#160;\r
 <a href="#p_rot">ROT</a> &#160;\r
 <a href="#p_rbp">RSP</a> &#160;</p></div>\r
@@ -865,6 +879,7 @@ asciidoc.install();
 <a href="#p_stdin">STDIN</a> &#160;\r
 <a href="#p_stream">STREAM</a> &#160;\r
 <a href="#p_stream_nchars">STREAM-NCHARS</a> &#160;\r
+<a href="#p_str2temp">STR&gt;TEMP</a> &#160;\r
 <a href="#p_strlen">STRLEN</a> &#160;\r
 <a href="#p_strncmp">STRNCMP</a> &#160;\r
 <a href="#p_strncpy">STRNCPY</a> &#160;\r
@@ -872,6 +887,10 @@ asciidoc.install();
 <a href="#p_system">SYSTEM</a> &#160;</p></div>\r
 <div class="paragraph"><p><a href="#p_tell">TELL</a> &#160;\r
 <a href="#p_dot_temp">.TEMP</a> &#160;\r
+<a href="#p_temp.adoc">TEMP</a> &#160;\r
+<a href="#p_tempheld.adoc">TEMPHELD</a> &#160;\r
+<a href="#p_tempspace">TEMPSPACE</a> &#160;\r
+<a href="#p_tempused.adoc">TEMPUSED</a> &#160;\r
 <a href="#p_terminate0">TERMINATE0</a> &#160;\r
 <a href="#p_tfa2cfa">TFA&gt;CFA</a> &#160;\r
 <a href="#p_tfa2dfa">TFA&gt;DFA</a> &#160;\r
@@ -881,7 +900,8 @@ asciidoc.install();
 <a href="#p_this_word">THIS-WORD</a> &#160;\r
 <a href="#p_true">TRUE</a> &#160;\r
 <a href="#p_tuck">TUCK</a> &#160;</p></div>\r
-<div class="paragraph"><p><a href="#p_unstream">UNSTREAM</a> &#160;</p></div>\r
+<div class="paragraph"><p><a href="#p_unstream">UNSTREAM</a> &#160;\r
+<a href="#p_use">USE</a> &#160;</p></div>\r
 <div class="paragraph"><p><a href="#p_verboseQ">VERBOSE?</a> &#160;</p></div>\r
 <div class="paragraph"><p><a href="#p_within">WITHIN</a> &#160;\r
 <a href="#p_words">WORDS</a> &#160;</p></div>\r
@@ -1134,6 +1154,85 @@ at the current free head address, which also is incremented.</p></div>
 <div style="text-align:center">\r
 _______________________________________________________\r
 </div>\r
+<div class="paragraph"><p><a id="p_Wcomma"></a></p></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_word_w">Word: W,</h3>\r
+<div class="literalblock">\r
+<div class="content">\r
+<pre><code>Data stack: ( v -- )</code></pre>\r
+</div></div>\r
+<div class="paragraph"><p>"W," (W-comma) is a function word that puts a "word" (double-byte) on\r
+the <a href="#p_here">HERE</a> heap. The two least significant bytes of the value\r
+are put at the current free head address, which also is incremented\r
+accordingly.</p></div>\r
+<div class="exampleblock">\r
+<div class="content">\r
+<div class="sidebarblock">\r
+<div class="content">\r
+<div class="title">Definition concept for W,</div>\r
+<div class="paragraph"><p>: W, HERE @ 2 ALLOT W! ;</p></div>\r
+</div></div>\r
+</div></div>\r
+<div style="text-align:center">\r
+_______________________________________________________\r
+</div>\r
+<div class="paragraph"><p><a id="p_Dcomma"></a></p></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_word_d">Word: D,</h3>\r
+<div class="literalblock">\r
+<div class="content">\r
+<pre><code>Data stack: ( v -- )</code></pre>\r
+</div></div>\r
+<div class="paragraph"><p>"D," (D-comma) is a function word that puts a "double word"\r
+(double-byte) on the <a href="#p_here">HERE</a> heap. The four least significant\r
+bytes of the value are put at the current free head address, which\r
+also is incremented accordingly.</p></div>\r
+<div class="exampleblock">\r
+<div class="content">\r
+<div class="sidebarblock">\r
+<div class="content">\r
+<div class="title">Definition concept for D,</div>\r
+<div class="paragraph"><p>: D, HERE @ 4 ALLOT D! ;</p></div>\r
+</div></div>\r
+</div></div>\r
+<div style="text-align:center">\r
+_______________________________________________________\r
+</div>\r
+<div class="paragraph"><p><a id="p_dsp"></a></p></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_word_d_n">Word: D[n]</h3>\r
+<div class="literalblock">\r
+<div class="content">\r
+<pre><code>Data stack: ( n -- a )</code></pre>\r
+</div></div>\r
+<div class="paragraph"><p>"D[n]" is a function word that pushes the address for the n:th cell of\r
+the data stack onto the data stack.</p></div>\r
+<div style="text-align:center">\r
+_______________________________________________________\r
+</div>\r
+<div class="paragraph"><p><a id="p_cfa2tfa"></a></p></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_word_cfa_gt_tfa">Word: CFA&gt;TFA</h3>\r
+<div class="literalblock">\r
+<div class="content">\r
+<pre><code>Data stack: ( cfa -- tfa )</code></pre>\r
+</div></div>\r
+<div class="paragraph"><p>"CFA&gt;TFA" is a function word that pushes word tfa of the given cfa.</p></div>\r
+<div class="exampleblock">\r
+<div class="content">\r
+<div class="sidebarblock">\r
+<div class="content">\r
+<div class="title">Definition concept for CFA&gt;TFA</div>\r
+<div class="paragraph"><p>: CFA&gt;TFA 14 - @ ;</p></div>\r
+</div></div>\r
+</div></div>\r
+<div style="text-align:center">\r
+_______________________________________________________\r
+</div>\r
 <div class="paragraph"><p><a id="p_Cget"></a></p></div>\r
 </div>\r
 <div class="sect2">\r
@@ -1146,6 +1245,32 @@ _______________________________________________________
 <div style="text-align:center">\r
 _______________________________________________________\r
 </div>\r
+<div class="paragraph"><p><a id="p_Wget"></a></p></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_word_w_2">Word: W@</h3>\r
+<div class="literalblock">\r
+<div class="content">\r
+<pre><code>Data stack: ( a -- v )</code></pre>\r
+</div></div>\r
+<div class="paragraph"><p>"W@" is a function word that pushes the "word" (double-byte) value v\r
+from the address a.</p></div>\r
+<div style="text-align:center">\r
+_______________________________________________________\r
+</div>\r
+<div class="paragraph"><p><a id="p_Rget"></a></p></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_word_r">Word: R@</h3>\r
+<div class="literalblock">\r
+<div class="content">\r
+<pre><code>Data stack: ( -- v )   Return stack: ( v -- v )</code></pre>\r
+</div></div>\r
+<div class="paragraph"><p>"R@" is a function word that "copies" the top return stack value onto\r
+the data stack.</p></div>\r
+<div style="text-align:center">\r
+_______________________________________________________\r
+</div>\r
 <div class="paragraph"><p><a id="p_Cput"></a></p></div>\r
 </div>\r
 <div class="sect2">\r
@@ -1159,10 +1284,36 @@ significant byte of the cell) at the address a.</p></div>
 <div style="text-align:center">\r
 _______________________________________________________\r
 </div>\r
+<div class="paragraph"><p><a id="p_Wput"></a></p></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_word_w_3">Word: W!</h3>\r
+<div class="literalblock">\r
+<div class="content">\r
+<pre><code>Data stack: ( v a -- )</code></pre>\r
+</div></div>\r
+<div class="paragraph"><p>"W!" is a function word that stores the "word" (2-byte) value v (the\r
+two least significant bytes of the cell) at the address a.</p></div>\r
+<div style="text-align:center">\r
+_______________________________________________________\r
+</div>\r
+<div class="paragraph"><p><a id="p_Dput"></a></p></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_word_d_2">Word: D!</h3>\r
+<div class="literalblock">\r
+<div class="content">\r
+<pre><code>Data stack: ( v a -- )</code></pre>\r
+</div></div>\r
+<div class="paragraph"><p>"D!" is a function word that stores the "doublw word" (4-byte) value v\r
+(the four least significant bytes of the cell) at the address a.</p></div>\r
+<div style="text-align:center">\r
+_______________________________________________________\r
+</div>\r
 <div class="paragraph"><p><a id="p_Rget"></a></p></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_word_r">Word: R@</h3>\r
+<h3 id="_word_r_2">Word: R@</h3>\r
 <div class="literalblock">\r
 <div class="content">\r
 <pre><code>Data stack: ( -- v )   Return stack: ( v -- v )</code></pre>\r
@@ -1264,7 +1415,8 @@ _______________________________________________________
 </div></div>\r
 <div class="paragraph"><p>"ARGS" is a value word that holds a pointer to the command line data\r
 block which consists of a count cell followed by that many asciiz\r
-pointers and then a 0 cell.</p></div>\r
+pointers and then a 0 cell. That is next followed by the environment\r
+as a number of asciiz pointers and a 0 cell.</p></div>\r
 <div class="exampleblock">\r
 <div class="content">\r
 <div class="listingblock">\r
@@ -1272,9 +1424,10 @@ pointers and then a 0 cell.</p></div>
 <div class="content">\r
 <pre><code>ARGS -&gt; 8 bytes: count of non-zero asciiz pointers following\r
         8 bytes: command name string\r
-        8 bytes: first argument string\r
-        8* ...\r
-        8 zero</code></pre>\r
+        8* bytes: argument strings\r
+        8 bytes: zero cell\r
+        8* bytes: envirnment strings\r
+        8 bytes: zero cell</code></pre>\r
 </div></div>\r
 </div></div>\r
 <div style="text-align:center">\r
@@ -1634,6 +1787,27 @@ _______________________________________________________
 <div style="text-align:center">\r
 _______________________________________________________\r
 </div>\r
+<div class="paragraph"><p><a id="p_definitions"></a></p></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_word_definitions">Word: DEFINITIONS</h3>\r
+<div class="literalblock">\r
+<div class="content">\r
+<pre><code>Data stack: ( wordlist -- )</code></pre>\r
+</div></div>\r
+<div class="paragraph"><p>"DEFINITIONS" is a function word that installs the given wordlist as\r
+the <a href="#p_current_wordlist">CURRENT-WORDLIST</a> one.</p></div>\r
+<div class="exampleblock">\r
+<div class="content">\r
+<div class="sidebarblock">\r
+<div class="content">\r
+<div class="title">Definition concept for DEFINITIONS</div>\r
+<div class="paragraph"><p>: DEFINITIONS CURRENT-WORDLIST ! ;</p></div>\r
+</div></div>\r
+</div></div>\r
+<div style="text-align:center">\r
+_______________________________________________________\r
+</div>\r
 <div class="paragraph"><p><a id="p_depth"></a></p></div>\r
 </div>\r
 <div class="sect2">\r
@@ -2112,11 +2286,10 @@ _______________________________________________________
 <h3 id="_word_exit">Word: EXIT</h3>\r
 <div class="literalblock">\r
 <div class="content">\r
-<pre><code>Data stack: ( -- )</code></pre>\r
+<pre><code>Data stack: ( -- )</code></pre>\r
 </div></div>\r
-<div class="paragraph"><p>"EXIT" is a function word that implements the ending of a FORTH\r
-definition and its threading to the subsequent step of the calling\r
-definition.</p></div>\r
+<div class="paragraph"><p>"EXIT" is a function word that terminates the <code>rrqforth</code> process\r
+immediately with the given exit code.</p></div>\r
 <div style="text-align:center">\r
 _______________________________________________________\r
 </div>\r
@@ -2498,22 +2671,40 @@ _______________________________________________________
 <div class="paragraph"><p><a id="p_literal_string"></a></p></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_word_s">Word: S"</h3>\r
+<h3 id="_word_lit_string">Word: LIT-STRING</h3>\r
 <div class="literalblock">\r
 <div class="content">\r
 <pre><code>Data stack: ( -- chars* n )</code></pre>\r
 </div></div>\r
-<div class="paragraph"><p>"S"" is a function word that pushes the [n:char] pointer for a string\r
-inlined subsequently to it in the containing definition. This is\r
-similar to <a href="#p_lit">LIT</a> but for a string literal.</p></div>\r
+<div class="paragraph"><p>"LIT-STRING" is a function word that pushes the char* and length n of\r
+a subsequent inline string, then advances execution to continue after\r
+the string. This is similar to <a href="#p_lit">LIT</a> but for a block literal.</p></div>\r
+<div class="paragraph"><p>Note that the inlined byte count includes the terminating NUL byte.</p></div>\r
 <div class="exampleblock">\r
 <div class="content">\r
 <div class="sidebarblock">\r
 <div class="content">\r
-<div class="title">Definition concept for LIT</div>\r
-<div class="paragraph"><p>: LIT R&gt; DUP @ 2DUP + 8 + &gt;R SWAP 8 + SWAP ;</p></div>\r
+<div class="title">Definition concept for LIT-STRING</div>\r
+<div class="paragraph"><p>: LIT-STRING  R@ DUP @ 8 +  R@ @  2DUP + R&gt; + &gt;R  1 - ;</p></div>\r
+</div></div>\r
 </div></div>\r
+<div style="text-align:center">\r
+_______________________________________________________\r
+</div>\r
+<div class="paragraph"><p><a id="p_literal_string_compile"></a></p></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_word_s">Word: S"</h3>\r
+<div class="literalblock">\r
+<div class="content">\r
+<pre><code>Data stack: ( -- )  Input stream: " chars"</code></pre>\r
 </div></div>\r
+<div class="paragraph"><p>"S"" is an immediate function word that compiles the subseqent\r
+characters up to terminating double-quote into the current definition,\r
+preceded by a <a href="#p_literal_string">LIT-STRING</a> cell, and the count of\r
+bytes scanned. The inline text includes a terminating NUL character\r
+which also is included in the inlined count.</p></div>\r
+<div class="paragraph"><p>Note that "S"" uses <a href="#p_double_quote">"</a> for reading the string.</p></div>\r
 <div style="text-align:center">\r
 _______________________________________________________\r
 </div>\r
@@ -2584,6 +2775,32 @@ page" of mmap for details.</p></div>
 <div style="text-align:center">\r
 _______________________________________________________\r
 </div>\r
+<div class="paragraph"><p><a id="p_max"></a></p></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_word_max">Word: MAX</h3>\r
+<div class="literalblock">\r
+<div class="content">\r
+<pre><code>Data stack: ( v1 v2 -- v3 )</code></pre>\r
+</div></div>\r
+<div class="paragraph"><p>"MAX" is a function word that selects the greatest of v1 and v2. To\r
+that end, the values are 64-bit signed integers.</p></div>\r
+<div style="text-align:center">\r
+_______________________________________________________\r
+</div>\r
+<div class="paragraph"><p><a id="p_min"></a></p></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_word_min">Word: MIN</h3>\r
+<div class="literalblock">\r
+<div class="content">\r
+<pre><code>Data stack: ( v1 v2 -- v3 )</code></pre>\r
+</div></div>\r
+<div class="paragraph"><p>"MIN" is a function word that selects the least of v1 and v2. To that\r
+end, the values are 64-bit signed integers.</p></div>\r
+<div style="text-align:center">\r
+_______________________________________________________\r
+</div>\r
 <div class="paragraph"><p><a id="p_minus"></a></p></div>\r
 </div>\r
 <div class="sect2">\r
@@ -2868,8 +3085,8 @@ _______________________________________________________
 <div class="content">\r
 <pre><code>Data stack: ( n -- a )</code></pre>\r
 </div></div>\r
-<div class="paragraph"><p>"R[n]" is a function word that pushes the address for the n:th cell on\r
-the top return stack value onto the data stack.</p></div>\r
+<div class="paragraph"><p>"R[n]" is a function word that pushes the address for the n:th cell of\r
+the return stack onto the data stack.</p></div>\r
 <div class="exampleblock">\r
 <div class="content">\r
 <div class="sidebarblock">\r
@@ -2899,6 +3116,22 @@ instead.</p></div>
 <div style="text-align:center">\r
 _______________________________________________________\r
 </div>\r
+<div class="paragraph"><p><a id="p_read_stream_line"></a></p></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_word_read_stream_line">Word: READ-STREAM-LINE</h3>\r
+<div class="literalblock">\r
+<div class="content">\r
+<pre><code>Data stack: ( stream -- n )</code></pre>\r
+</div></div>\r
+<div class="paragraph"><p>"READ-STREAM-LINE" is a function word that gets the next line from the\r
+given stream buffer into PAD and returns number of characters. If the\r
+stream is backed by a file descriptor, the stream buffer is refilled\r
+from there as needed, by a SYS_READ call when more characters are\r
+needed.</p></div>\r
+<div style="text-align:center">\r
+_______________________________________________________\r
+</div>\r
 <div class="paragraph"><p><a id="p_read_word"></a></p></div>\r
 </div>\r
 <div class="sect2">\r
@@ -2945,6 +3178,20 @@ kernel, and the granularity is in pages, i.e. a multiple of 4 kb.</p></div>
 <div style="text-align:center">\r
 _______________________________________________________\r
 </div>\r
+<div class="paragraph"><p><a id="p_return"></a></p></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_word_return">Word: RETURN</h3>\r
+<div class="literalblock">\r
+<div class="content">\r
+<pre><code>Data stack: ( -- )</code></pre>\r
+</div></div>\r
+<div class="paragraph"><p>"RETURN" is a function word that implements the ending of a FORTH\r
+definition and make execution return to the next step in the calling\r
+definition.</p></div>\r
+<div style="text-align:center">\r
+_______________________________________________________\r
+</div>\r
 <div class="paragraph"><p>compile.asm:    WORD p_right_bracket,<em>]</em>,fasm</p></div>\r
 <div class="paragraph"><p><a id="p_right_bracket"></a></p></div>\r
 </div>\r
@@ -3012,8 +3259,9 @@ _______________________________________________________
 <div class="content">\r
 <pre><code>Data stack: ( -- )</code></pre>\r
 </div></div>\r
-<div class="paragraph"><p>";" (semi-colon) is a function word that ends a new forth definition\r
-by means of adding an <a href="#p_exit">EXIT</a></p></div>\r
+<div class="paragraph"><p>";" (semi-colon) is an immediate function word that ends a new forth\r
+definition by means of adding an <a href="#p_exit">EXIT</a> cell, then changing\r
+&lt;&lt;p_state,STATE&gt; to interpreting.</p></div>\r
 <div class="exampleblock">\r
 <div class="content">\r
 <div class="sidebarblock">\r
@@ -3178,6 +3426,29 @@ stream (or filling it by reading the backing file).</p></div>
 <div style="text-align:center">\r
 _______________________________________________________\r
 </div>\r
+<div class="paragraph"><p><a id="p_str2temp"></a></p></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_word_str_gt_temp">Word: STR&gt;TEMP</h3>\r
+<div class="sidebarblock">\r
+<div class="content">\r
+<div class="paragraph"><p>Data stack: ( char* n&#8201;&#8212;&#8201;char* n )</p></div>\r
+</div></div>\r
+<div class="paragraph"><p>"STR&gt;TEMP" is a function word that copies a given string plus a\r
+terminating NUL character into a <a href="#p_tempspace">TEMPSPACE</a> snippet,\r
+all preceded by a length cell. It returns a pointer for to the text in\r
+the snippet and its length, excluding the NUL character at end and the\r
+length cell before tie text.</p></div>\r
+<div class="listingblock">\r
+<div class="title">Layout for copied string</div>\r
+<div class="content">\r
+<pre><code>        length: 8 bytes\r
+returned char*: n bytes\r
+           nul: 1 byte</code></pre>\r
+</div></div>\r
+<div style="text-align:center">\r
+_______________________________________________________\r
+</div>\r
 <div class="paragraph"><p><a id="p_strlen"></a></p></div>\r
 </div>\r
 <div class="sect2">\r
@@ -3263,6 +3534,90 @@ descriptor 1).</p></div>
 <div style="text-align:center">\r
 _______________________________________________________\r
 </div>\r
+<div class="paragraph"><p><a id="p_temp"></a></p></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_word_temp_2">Word: TEMP</h3>\r
+<div class="sidebarblock">\r
+<div class="content">\r
+<div class="paragraph"><p>Data stack: ( size&#8201;&#8212;&#8201;addr )</p></div>\r
+</div></div>\r
+<div class="paragraph"><p>"TEMP" is a function word that "allocates" a <a href="#p_tempspace">TEMPSPACE</a>\r
+area of given size and returns its base address. The allocation is\r
+temporary and only valid until there is a later allocation that\r
+overruns this area.</p></div>\r
+<div class="paragraph"><p>Allocations are done in succession until the requested size overruns\r
+the <a href="#p_tempspace">TEMPSPACE</a>. If so, the allocation pointer is reset\r
+and the space is allocated from start again. This is all intended for\r
+small and short-lived data areas.</p></div>\r
+<div style="text-align:center">\r
+_______________________________________________________\r
+</div>\r
+<div class="paragraph"><p><a id="p_tempheld"></a></p></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_word_tempheld">Word: TEMPHELD</h3>\r
+<div class="literalblock">\r
+<div class="content">\r
+<pre><code>Data stack: ( -- a )</code></pre>\r
+</div></div>\r
+<div class="paragraph"><p>"TEMPHELD" is a variable word that keeps the lowest offset of the\r
+<a href="#p__tempspace">TEMPSPACE</a> space to reuse upon cycling. The space\r
+below TEMPHELD is "held" in the sense of not being reused upon\r
+cycling. An application may change the TEMPSPACE offset as needed to\r
+dynamically preserve memory longer term.</p></div>\r
+<div style="text-align:center">\r
+_______________________________________________________\r
+</div>\r
+<div class="paragraph"><p><a id="p_tempspace"></a></p></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_word_tempspace">Word: TEMPSPACE</h3>\r
+<div class="literalblock">\r
+<div class="content">\r
+<pre><code>Data stack: ( -- a )</code></pre>\r
+</div></div>\r
+<div class="paragraph"><p>"TEMPSPACE" is a variable word that holds three cells the for managing\r
+"temporary memory":</p></div>\r
+<div class="ulist"><ul>\r
+<li>\r
+<p>\r
+the size of the temporary memory space (default 104857600 bytes)\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+the base address for whole temporary memory area\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+the amount currently used\r
+</p>\r
+</li>\r
+</ul></div>\r
+<div class="paragraph"><p>This memory is intended to be used by requesting snippets of memory in\r
+a cyclic fashion via <a href="#p_temp">TEMP</a> without concern about it possibly\r
+overlapping a prior request.</p></div>\r
+<div style="text-align:center">\r
+_______________________________________________________\r
+</div>\r
+<div class="paragraph"><p><a id="p_tempused"></a></p></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_word_tempused">Word: TEMPUSED</h3>\r
+<div class="literalblock">\r
+<div class="content">\r
+<pre><code>Data stack: ( -- a )</code></pre>\r
+</div></div>\r
+<div class="paragraph"><p>"TEMPUSED" is a variable word that keeps the lowest offset of the\r
+<a href="#p__tempspace">TEMPSPACE</a> space to use next as temporary space. This\r
+is advance upon each allocation via <a href="#p_temp">TEMP</a>, and recycled back\r
+to <a href="#p_tempheld">TEMPHELD</a> when next allocation otherwise would exceed\r
+the space size.</p></div>\r
+<div style="text-align:center">\r
+_______________________________________________________\r
+</div>\r
 <div class="paragraph"><p><a id="p_terminate0"></a></p></div>\r
 </div>\r
 <div class="sect2">\r
@@ -3462,8 +3817,24 @@ at (stream* + 16) is its size.</p></div>
 <div style="text-align:center">\r
 _______________________________________________________\r
 </div>\r
-<div class="paragraph"><p><a id="p_verboseQ"></a></p></div>\r
+<div class="paragraph"><p><a id="p_use"></a></p></div>\r
+</div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_word_use">Word: USE</h3>\r
+<div class="literalblock">\r
+<div class="content">\r
+<pre><code>Data value: ( wordlist -- )  Input stream: word</code></pre>\r
+</div></div>\r
+<div class="paragraph"><p>"USE" is a function word that looks up next word given the wordlist.\r
+It reads next word on <a href="#p_input">INPUT</a> via <a href="#p_read_word">READ-WORD</a>,\r
+then temporarily changes <a href="#p_current_wordlist">CURRENT-WORDLIST</a> to\r
+<a href="#p_find">FIND</a> the word via the given wordlist, and returns the TFA\r
+of that word, or just 0 if the word coudn&#8217;t be found.</p></div>\r
+<div style="text-align:center">\r
+_______________________________________________________\r
 </div>\r
+<div class="paragraph"><p><a id="p_verboseQ"></a></p></div>\r
 </div>\r
 <div class="sect2">\r
 <h3 id="_word_verbose">Word: VERBOSE?</h3>\r
@@ -3554,7 +3925,7 @@ is deepest.</p></div>
 <div id="footer">\r
 <div id="footer-text">\r
 Last updated\r
- 2021-06-05 20:46:13 AEST\r
+ 2021-06-17 17:12:21 AEST\r
 </div>\r
 </div>\r
 </body>\r