📄 gforth.htm
字号:
<html>
<head>
<title>StrongForth.f Glossary</title>
</head>
<body>
<h1>StrongForth.f Glossary</h1>
<hr><p><pre><b>! ( SINGLE ADDRESS -> 1ST -- )</b></pre></p>
<p>Store <kbd>SINGLE</kbd> at address <kbd>ADDRESS</kbd>.</p>
<hr><p><pre><b>! ( DOUBLE ADDRESS -> 1ST -- )</b></pre></p>
<p>Store <kbd>DOUBLE</kbd> at address <kbd>ADDRESS</kbd>.</p>
<hr><p><pre><b>! ( SINGLE CADDRESS -> 1ST -- )</b></pre></p>
<p>Store <kbd>SINGLE</kbd> at address <kbd>CADDRESS</kbd>.
Only the number of low-order bits
corresponding to character size are transferred.</p>
<hr><p><pre><b>" ( -- )</b></pre></p>
<p>Interpretation: <kbd><b>( "ccc<quote>" -- CADDRESS -> CHARACTER UNSIGNED )</b></kbd>
<br>Parse <kbd>ccc</kbd> delimited by <kbd>"</kbd> (double-quote).
Store the resulting string at address <kbd>STR</kbd>. and return
<kbd>STR</kbd> as <kbd>CADDRESS -> CHARACTER</kbd>. Store the length
of the resulting string at <kbd>#STR</kbd> and return it as
<kbd>UNSIGNED</kbd>. An ambiguous condition exists if the length of
the string exceeds 80 characters.</p>
<p>Note: Subsequent uses of <kbd>"</kbd> will overwrite the buffer.</p>
<p>Compilation: <kbd><b>( "ccc<quote>" -- )</b></kbd>
<br>Parse <kbd>ccc</kbd> delimited by <kbd>"</kbd> (double-quote).
Append the runtime semantics given below to the current definition.</p>
<p>Runtime: <kbd><b>( -- CADDRESS -> CHARACTER UNSIGNED )</b></kbd>
<br>Return <kbd>CADDRESS -> CHARACTER</kbd> as the address and
<kbd>UNSIGNED</kbd> as the character count of a character string
consisting of the characters <kbd>ccc</kbd> that were parsed during
compilation. A program shall not alter the returned string.</p>
<p><kbd>"</kbd> is an immediate word.</p>
<hr><p><pre><b># ( NUMBER-DOUBLE -- 1ST )</b></pre></p>
<p>Divide <kbd>NUMBER-DOUBLE</kbd> by the current number-conversion radix
giving the quotient <kbd>1ST</kbd> and the remainder <em>n</em> (<em>n</em>
is the least-significant digit of <kbd>NUMBER-DOUBLE</kbd>). Convert
<em>n</em> to external form and add the resulting character to the
beginning of the pictured numeric output string.</p>
<hr><p><pre><b>#> ( NUMBER-DOUBLE -- CADDRESS -> CHARACTER UNSIGNED )</b></pre></p>
<p>Drop <kbd>NUMBER-DOUBLE</kbd>. Make the pictured numeric output
string available as a character string <kbd>CADDRESS -> CHARACTER UNSIGNED</kbd>.
A program may replace characters within the string.</p>
<hr><p><pre><b>#FIB ( -- ADDRESS -> UNSIGNED )</b></pre></p>
<p><kbd>ADDRESS -> UNSIGNED</kbd> is the address of a cell containing the
number of characters in the file input buffer.</p>
<hr><p><pre><b>#ORDER ( -- ADDRESS -> UNSIGNED )</b></pre></p>
<p><kbd>ADDRESS -> UNSIGNED</kbd> is the address of a cell containing the
number of word lists in the present search order.</p>
<hr><p><pre><b>#PARAMS ( DEFINITION -- UNSIGNED )</b></pre></p>
<p><kbd>UNSIGNED</kbd> is the length of the parameter list of <kbd>DEFINITION</kbd>,
i. e. the total number of basic data types in
<kbd>DEFINITION</kbd>'s stack diagram.</p>
<hr><p><pre><b>#S ( NUMBER-DOUBLE -- 1ST )</b></pre></p>
<p>Convert one digit of <kbd>NUMBER-DOUBLE</kbd>
according to the rule for <kbd>#</kbd>. Continue conversion until the quotient
is zero. <kbd>1ST</kbd> is zero.</p>
<hr><p><pre><b>#STR ( -- ADDRESS -> UNSIGNED )</b></pre></p>
<p><kbd>ADDRESS -> UNSIGNED</kbd> is the address of a cell containing the
number of characters in the string buffer.</p>
<p>Note: The string buffer is used by <kbd>"</kbd> in interpretation
state.</p>
<hr><p><pre><b>#TIB ( -- ADDRESS -> UNSIGNED )</b></pre></p>
<p><kbd>ADDRESS -> UNSIGNED</kbd> is the address of a cell containing the number
of characters in the terminal input buffer.</p>
<hr><p><pre><b>' ( "<spaces><em>name</em>" -- DEFINITION )</b></pre></p>
<p>Skip leading space delimiters. Parse <em>name</em> delimited by a space.
Find <em>name</em> and return <kbd>DEFINITION</kbd>, the latest definition
in the dictionary with that name. An ambiguous condition exists if
<em>name</em> is not found.</p>
<hr><p><pre><b>#VOCS ( -- UNSIGNED )</b></pre></p>
<p><kbd>UNSIGNED</kbd> is the maximum number of word lists in the
search order.</p>
<hr><p><pre><b>'HOST ( "<spaces><em>name</em>" -- TOKEN )</b></pre></p>
<p>Skip leading space delimiters. Parse <em>name</em> delimited by a space.
Find name in the ANS Forth host system's dictionary and return <kbd>TOKEN</kbd>,
the execution token for <em>name</em>. An ambiguous condition exists if
<em>name</em> is not found.</p>
<hr><p><pre><b>'HOST-PARSING ( "<spaces><em>name1</em>" -- TOKEN )</b></pre></p>
<p>Skip leading space delimiters. Parse <em>name1</em> delimited by a space.
Create a new definition with no name and link field and return its
execution token <kbd>TOKEN</kbd>. Compile the runtime semantics given
below into the new definiton.</p>
<p>Runtime: <b><kbd>( "<spaces><em>name2</em>" -- )</kbd></b>
<br>Skip leading space delimiters. Parse <em>name2</em> delimited by a space.
Save the current input source specification. Store <kbd>STRING-ID</kbd>
in <kbd>SOURCE-ID</kbd>. Make the string "<kbd><em>name1 name2</em></kbd>" both
the input source and input buffer, set <kbd>>IN</kbd> to zero, and interpret.
Restore the prior input source specification.
Other stack effects are due to the words evaluated.</p>
<p><kbd>'HOST-PARSING</kbd> has to be used instead of <kbd>'HOST</kbd> when
a parsing word is to be imported from the host. The new definition ensures
that the parsing word parses correctly.</p>
<hr><p><pre><b>( ( -- FLAG STACK-DIAGRAM )</b></pre></p>
<p>Produce <kbd>STACK-DIAGRAM</kbd> with the input parameter attribute.
<kbd>FLAG</kbd> is the current value of <kbd>STATE</kbd>.
Enter interpretation state.</p>
<p><kbd>(</kbd> starts a stack diagram.</p>
<p>Note that the semantics of <kbd>(</kbd> is not the same as in ANS Forth.</p>
<p><kbd>(</kbd> is an immediate word.</p>
<hr><p><pre><b>(+LOOP) ( DO-SYS -- )</b></pre></p>
<p>Interpretation:
<br>Interpretation semantics for this word are undefined.</p>
<p>Compilation: <kbd>( DO-SYS -- )</kbd>
<br>Append the runtime semantics given below to the current definition.
Resolve the destination of all unresolved occurrences of <kbd>LEAVE</kbd>
between the location given by <kbd>DO-SYS</kbd> and the next location for a
transfer of control, to execute the words following <kbd>(+LOOP)</kbd>.</p>
<p>Runtime: <b><kbd>( INTEGER -- ) ( R: loop-sys1 -- | loop-sys2 )</kbd></b>
<br>An ambiguous condition exists if the loop control parameters are unavailable.
Add <kbd>INTEGER</kbd> to the loop index. If the loop index did not cross the
boundary between the loop limit minus one and the loop limit, continue execution
at the beginning of the loop. Otherwise, discard the current loop control
parameters and continue execution immediately following the loop.</p>
<p><kbd>(+LOOP)</kbd> is an internal definition used by <kbd>LOOP</kbd> and
<kbd>+LOOP</kbd>.</p>
<hr><p><pre><b>(+STEP-S) ( INTEGER INTEGER -- )</b></pre></p>
<p><kbd>(+STEP-S)</kbd> is an internal definition compiled by <kbd>+LOOP</kbd>
in order to adjust the compiler data type heap.</p>
<hr><p><pre><b>(+STEP-S) ( INTEGER ADDRESS -- )</b></pre></p>
<p><kbd>(+STEP-S)</kbd> is an internal definition compiled by <kbd>+LOOP</kbd>
in order to adjust the compiler data type heap.</p>
<hr><p><pre><b>(+STEP-S) ( INTEGER ADDRESS -> SINGLE -- )</b></pre></p>
<p>Multiply <kbd>INTEGER</kbd> with the size of a cell in address units.</p>
<p><kbd>(+STEP-S)</kbd> is an internal definition compiled by <kbd>+LOOP</kbd>
in order to adjust the compiler data type heap.</p>
<hr><p><pre><b>(+STEP-S) ( INTEGER ADDRESS -> DOUBLE -- )</b></pre></p>
<p>Multiply <kbd>INTEGER</kbd> with the size of two cells in address units.</p>
<p><kbd>(+STEP-S)</kbd> is an internal definition compiled by <kbd>+LOOP</kbd>
in order to adjust the compiler data type heap.</p>
<hr><p><pre><b>(+STEP-S) ( INTEGER CADDRESS -- )</b></pre></p>
<p>Multiply <kbd>INTEGER</kbd> with the size of a character in address units.</p>
<p><kbd>(+STEP-S)</kbd> is an internal definition compiled by <kbd>+LOOP</kbd>
in order to adjust the compiler data type heap.</p>
<hr><p><pre><b>(2DROP-S) ( INTEGER 1ST -- )</b></pre></p>
<p>Drop the loop limit <kbd>INTEGER</kbd> and the loop index <kbd>1ST</kbd>.</p>
<p><kbd>(2DROP-S)</kbd> is an internal definition compiled by <kbd>DO</kbd>.</p>
<hr><p><pre><b>(2DROP-S) ( ADDRESS 1ST -- )</b></pre></p>
<p>Drop the loop limit <kbd>ADDRESS</kbd> and the loop index <kbd>1ST</kbd>.</p>
<p><kbd>(2DROP-S)</kbd> is an internal definition compiled by <kbd>DO</kbd>.</p>
<hr><p><pre><b>(>R) ( SINGLE -- )</b></pre></p>
<p>Push <kbd>SINGLE</kbd> onto the return stack.</p>
<p><kbd>(>R)</kbd> is an internal definition compiled by
<kbd>>R</kbd> and <kbd>(LOCAL)</kbd>.</p>
<hr><p><pre><b>(>R) ( DOUBLE -- )</b></pre></p>
<p>Push <kbd>DOUBLE</kbd> onto the return stack.</p>
<p><kbd>(>R)</kbd> is an internal definition compiled by <kbd>>R</kbd> and
<kbd>(LOCAL)</kbd>.</p>
<hr><p><pre><b>(?DO) ( -- DO-SYS )</b></pre></p>
<p>Interpretation:
<br>Interpretation semantics for this word are undefined.</p>
<p>Compilation: <kbd>( -- DO-SYS )</kbd>
<br>Place <kbd>DO-SYS</kbd> onto the stack. Append the runtime semantics
given below to the current definition. The semantics are incomplete until
resolved by a consumer of <kbd>DO-SYS</kbd> such as <kbd>LOOP</kbd>. </p>
<p>Runtime: <b><kbd>( SINGLE 1ST -- ) ( R: -- loop-sys )</kbd></b>
<br>If <kbd>SINGLE</kbd> is equal to <kbd>1ST</kbd>, continue execution at
the location given by the consumer of <kbd>DO-SYS</kbd>. Otherwise set up
loop control parameters with index <kbd>1ST</kbd> and limit <kbd>SINGLE</kbd>
and continue executing immediately following <kbd>?DO</kbd>. Anything already
on the return stack becomes unavailable until the loop control parameters
are discarded.</p>
<p><kbd>(?DO)</kbd> is an internal definition used by <kbd>?DO</kbd>.</p>
<hr><p><pre><b>(ABORT") ( SINGLE CADDRESS -> CHARACTER UNSIGNED -- )</b></pre></p>
<p>If any bit of <kbd>SINGLE</kbd> is not zero, save
<kbd>CADDRESS -> CHARACTER</kbd> and <kbd>UNSIGNED</kbd>,
and then perform the function of <kbd>-2 THROW</kbd>.</p>
<p><kbd>(ABORT")</kbd> is an internal definition compiled by <kbd>ABORT"</kbd>.</p>
<hr><p><pre><b>(AGAIN) ( DEST -- )</b></pre></p>
<p>Interpretation:
<br>Interpretation semantics for this word are undefined.</p>
<p>Compilation: <kbd>( DEST -- )</kbd>
<br>Append the runtime semantics given below to the current definition,
resolving the backward reference <kbd>DEST</kbd>.</p>
<p>Runtime: <b><kbd>( -- )</kbd></b>
<br>Continue execution at the location specified by <kbd>DEST</kbd>.
If no other control flow words are used, any program code after
<kbd>AGAIN</kbd> will not be executed.</p>
<p><kbd>(AGAIN)</kbd> is an internal definition used by <kbd>AGAIN</kbd>.</p>
<hr><p><pre><b>(AHEAD) ( -- ORIG )</b></pre></p>
<p>Interpretation:
<br>Interpretation semantics for this word are undefined.</p>
<p>Compilation: <kbd>( -- ORIG )</kbd>
<br>Put the location of a new unresolved forward reference <kbd>ORIG</kbd>
onto the stack. Append the runtime semantics given below to the current
definition. The semantics are incomplete until <kbd>ORIG</kbd> is resolved
(e.g., by <kbd>THEN</kbd>).</p>
<p>Runtime: <b><kbd>( -- )</kbd></b>
<br>Continue execution at the location specified by the resolution of
<kbd>ORIG</kbd>.</p>
<p><kbd>(AHEAD)</kbd> is an internal definition used by <kbd>AHEAD</kbd>.</p>
<hr><p><pre><b>(BEGIN) ( -- DEST )</b></pre></p>
<p>Interpretation:
<br>Interpretation semantics for this word are undefined.</p>
<p>Compilation: <kbd>( -- DEST )</kbd>
<br>Put the next location for a transfer of control, <kbd>DEST</kbd>,
onto the stack. Append the runtime semantics given below to the current
definition.</p>
<p>Runtime: <b><kbd>( -- )</kbd></b>
<br>Continue execution.</p>
<p><kbd>(BEGIN)</kbd> is an internal definition used by <kbd>BEGIN</kbd>.</p>
<hr><p><pre><b>(CASE) ( -- CASE-SYS )</b></pre></p>
<p>Interpretation:
<br>Interpretation semantics for this word are undefined.</p>
<p>Compilation: <kbd>( -- CASE-SYS )</kbd>
<br>Mark the start of the <kbd>CASE ... OF ... ENDOF ... ENDCASE</kbd> structure.
Append the runtime semantics given below to the current definition.</p>
<p>Runtime: <b><kbd>( -- )</kbd></b>
<br>Continue execution.</p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -