📄 gforth.htm
字号:
address <kbd>ADDRESS -> INTEGER-DOUBLE</kbd>.</p>
<hr><p><pre><b>+! ( INTEGER ADDRESS -> INTEGER-DOUBLE -- )</b></pre></p>
<p>Add <kbd>INTEGER</kbd> with zero extension to the double-precision
integer at address <kbd>ADDRESS -> INTEGER-DOUBLE</kbd>.</p>
<hr><p><pre><b>+! ( SIGNED ADDRESS -> INTEGER-DOUBLE -- )</b></pre></p>
<p>Add <kbd>SIGNED</kbd> with sign extension to the double-precision
integer at address <kbd>ADDRESS -> INTEGER-DOUBLE</kbd>.</p>
<hr><p><pre><b>+! ( INTEGER CADDRESS -> INTEGER -- )</b></pre></p>
<p>Add <kbd>INTEGER</kbd> to the character size integer at
address <kbd>CADDRESS -> INTEGER</kbd>.</p>
<hr><p><pre><b>+! ( INTEGER ADDRESS -> ADDRESS -- )</b></pre></p>
<p>Add <kbd>INTEGER</kbd> to the address stored at
address <kbd>ADDRESS -> ADDRESS</kbd>.</p>
<hr><p><pre><b>+! ( INTEGER ADDRESS -> ADDRESS -> SINGLE -- )</b></pre></p>
<p>Add <kbd>INTEGER</kbd> to the address stored at address
<kbd>ADDRESS -> ADDRESS -> SINGLE</kbd>. Since <kbd>ADDRESS</kbd> points to a
cell, <kbd>INTEGER</kbd> is automatically multiplied with the number
of address units per cell before the actual addition takes place.</p>
<hr><p><pre><b>+! ( INTEGER ADDRESS -> ADDRESS -> DOUBLE -- )</b></pre></p>
<p>Add <kbd>INTEGER</kbd> to the address stored at
address <kbd>ADDRESS -> ADDRESS -> DOUBLE</kbd>. Since <kbd>ADDRESS</kbd> points
to a double cell, <kbd>INTEGER</kbd> is automatically multiplied with the number
of address units per double cell before the actual addition takes place.</p>
<hr><p><pre><b>+! ( INTEGER ADDRESS -> CADDRESS -- )</b></pre></p>
<p>Add <kbd>INTEGER</kbd> to the address stored at
address <kbd>ADDRESS -> CADDRESS</kbd>. Since <kbd>CADDRESS</kbd> points
to an item of character size, <kbd>INTEGER</kbd> is automatically
multiplied with the number of address units per character before the
actual addition takes place.</p>
<hr><p><pre><b>+ATTRIBUTE ( LOGICAL -- )</b></pre></p>
<p>Set the attibutes specified by <kbd>LOGICAL</kbd> in the latest
definition. An ambiguous condition exists if one these attributes is
already set.</p>
<hr><p><pre><b>+LOOP ( DO-SYS -- )</b></pre></p>
<p>Interpretation:
<br>An exception is thrown if <kbd>+LOOP</kbd> is interpreted.</p>
<p>Compilation:
<br>Append the runtime semantics given below to the current definition.
Resolve both the forward and the backward reference of <kbd>DO-SYS</kbd>.
Forget the loop index I, which is assumed to be the latest local.
Rename the loop index J, if it exists, to I. An exception is thrown
if the contents of the compiler data type heap do not exactly match
the copy that was saved when <kbd>DO-SYS</kbd> was created.</p>
<p>Runtime: <b><kbd>( INTEGER -- ) ( R: loop-sys1 -- | loop-sys2 )</b></kbd>
<br>An ambiguous condition exists if the loop control parameters are unavailable.
Add <kbd>INTEGER</kbd>* to the loop index. If the loop index crosses the boundary
between the loop limit minus one and the loop limit, discard the current loop
control parameters and continue execution.
Otherwise, branch to the beginning of the loop.</p>
<p>* Note: <kbd>+LOOP</kbd> takes regard of the data type of the loop index.
If the loop index is an address of a single cell, <kbd>INTEGER</kbd> is
multiplied with the size of a single cell in address units before it is added
to the loop index. If the loop index is an address of a double
cell, <kbd>INTEGER</kbd> is multiplied with the size of a double cell in
address units before it is added to the loop index. If the loop index is a
character address, <kbd>INTEGER</kbd> is multiplied with the size of a character
in address units before it is added to the loop index.</p>
<p><kbd>+LOOP</kbd> is an immediate word.</p>
<hr><p><pre><b>+LOOP, ( DO-SYS TOKEN -- )</b></pre></p>
<p>If <kbd>TOKEN</kbd> is the execution token of <kbd>NOOP</kbd>, execute
<kbd>+LOOP</kbd>. Otherwise, compile <kbd>TOKEN</kbd> and execute
<kbd>+LOOP</kbd>. An ambiguous condition exists if <kbd>TOKEN</kbd> is not
the execution token of one of the versions of <kbd>(+STEP-S)</kbd> </p>
<hr><p><pre><b>+PARAM ( DEFINITION UNSIGNED -- 1ST 2ND )</b></pre></p>
<p>Starting at the basic data type with index <kbd>UNSIGNED</kbd>,
find the beginning of the next compound data type, or the end of the
parameter list of <kbd>DEFINITION</kbd>. Return this index as <kbd>2ND</kbd>.
All indices start with 0. An ambiguous condition exists if <kbd>UNSIGNED</kbd> is
greater than the length of the parameter list.</p>
<hr><p><pre><b>, ( SINGLE -- )</b></pre></p>
<p>Reserve one cell in the data space and store <kbd>SINGLE</kbd> in
the cell. If the first unused address of the data space is aligned
prior to execution of <kbd>,</kbd>, it will remain aligned
when <kbd>,</kbd> finishes execution. An ambiguous condition exists if the
first unused address of the data space is not aligned prior to
execution of <kbd>,</kbd>.</p>
<hr><p><pre><b>, ( DOUBLE -- )</b></pre></p>
<p>Reserve two cells in the data space and store <kbd>DOUBLE</kbd> in
the cells. If the first unused address of the dara space is aligned
prior to execution of <kbd>,</kbd>, it will remain aligned
when <kbd>,</kbd> finishes execution. An ambiguous condition exists if the
first unused address of the data space is not aligned prior to
execution of <kbd>,</kbd>.</p>
<hr><p><pre><b>- ( INTEGER INTEGER -- 1ST )</b></pre></p>
<p>Subtract the second <kbd>INTEGER</kbd> from the first <kbd>INTEGER</kbd>,
giving the difference <kbd>1ST</kbd>.</p>
<hr><p><pre><b>- ( ADDRESS INTEGER -- 1ST )</b></pre></p>
<p>Subtract <kbd>INTEGER</kbd> from <kbd>ADDRESS</kbd>, giving the
difference <kbd>1ST</kbd>.</p>
<hr><p><pre><b>- ( ADDRESS -> SINGLE INTEGER -- 1ST )</b></pre></p>
<p>Subtract <kbd>INTEGER</kbd> from <kbd>ADDRESS -> SINGLE</kbd>, giving
the difference <kbd>1ST</kbd>. Since <kbd>ADDRESS</kbd> points to a
cell, <kbd>INTEGER</kbd> is automatically multiplied with the number of address
units per cell before the actual subtraction takes place.</p>
<hr><p><pre><b>- ( ADDRESS -> DOUBLE INTEGER -- 1ST )</b></pre></p>
<p>Subtract <kbd>INTEGER</kbd> from <kbd>ADDRESS -> DOUBLE</kbd>, giving
the difference <kbd>1ST</kbd>. Since <kbd>ADDRESS</kbd> points to a double
cell, <kbd>INTEGER</kbd> is automatically multiplied with the number of address
units per double cell before the actual subtraction takes place.</p>
<hr><p><pre><b>- ( CADDRESS INTEGER -- 1ST )</b></pre></p>
<p>Subtract <kbd>INTEGER</kbd> from <kbd>CADDRESS</kbd>, giving
the difference <kbd>1ST</kbd>. Since <kbd>CADDRESS</kbd> points to an item
of character size, <kbd>INTEGER</kbd> is automatically multiplied with the number
of address units per character before the actual subtraction takes place.</p>
<hr><p><pre><b>- ( INTEGER-DOUBLE INTEGER-DOUBLE -- 1ST )</b></pre></p>
<p>Subtract the second <kbd>INTEGER-DOUBLE</kbd> from the
first <kbd>INTEGER-DOUBLE</kbd>, giving the difference <kbd>1ST</kbd>.</p>
<hr><p><pre><b>- ( INTEGER-DOUBLE INTEGER -- 1ST )</b></pre></p>
<p>Subtract <kbd>INTEGER</kbd> with zero extension
from <kbd>INTEGER-DOUBLE</kbd>, giving the double-precision
difference <kbd>1ST</kbd>.</p>
<hr><p><pre><b>- ( INTEGER-DOUBLE SIGNED -- 1ST )</b></pre></p>
<p>Subtract <kbd>SIGNED</kbd> with sign extension
from <kbd>INTEGER-DOUBLE</kbd>, giving the double-precision
difference <kbd>1ST</kbd>.</p>
<hr><p><pre><b>- ( ADDRESS 1ST -- SIGNED )</b></pre></p>
<p>Subtract <kbd>1ST</kbd> from <kbd>ADDRESS</kbd>, giving the
difference <kbd>SIGNED</kbd>.</p>
<hr><p><pre><b>- ( ADDRESS -> SINGLE 1ST -- SIGNED )</b></pre></p>
<p>Subtract <kbd>1ST</kbd> from <kbd>ADDRESS -> SINGLE</kbd>, giving
the intermediate difference <em>n</em>. Since <kbd>ADDRESS</kbd> points to a cell,
the result <kbd>SIGNED</kbd> is equal to <em>n</em> divided by the number of
address units per cell.</p>
<hr><p><pre><b>- ( ADDRESS -> DOUBLE 1ST -- SIGNED )</b></pre></p>
<p>Subtract <kbd>1ST</kbd> from <kbd>ADDRESS -> DOUBLE</kbd>, giving
the intermediate difference <em>n</em>. Since <kbd>ADDRESS</kbd> points to a double cell,
the result <kbd>SIGNED</kbd> is equal to <em>n</em> divided by the number of
address units per double cell.</p>
<hr><p><pre><b>- ( CADDRESS 1ST -- SIGNED )</b></pre></p>
<p>Subtract <kbd>1ST</kbd> from address <kbd>CADDRESS</kbd>, giving
the intermediate difference <em>n</em>. Since <kbd>CADDRESS</kbd> points to an item of
character size, the result <kbd>SIGNED</kbd> is equal to <em>n</em> divided
by the number of address units per character.</p>
<hr><p><pre><b>-- ( STACK-DIAGRAM -- 1ST )</b></pre></p>
<p>Remove the input parameter attribute and add the output parameter
attribute of <kbd>STACK-DIAGRAM</kbd>, giving <kbd>1ST</kbd>.</p>
<p><kbd>--</kbd> is used in a stack diagram to separate input and output
parameters. An exception is thrown if <kbd>--</kbd> is preceded
by <kbd>-></kbd> or if it is used more than once within the same stack
diagram.</p>
<hr><p><pre><b>-> ( "<spaces><em>name</em>" x -- y )</b></pre></p>
<p>Skip leading space delimiters. Parse <em>name</em> delimited by a space.
Convert <kbd>x</kbd> to <kbd>y</kbd>, where <kbd>x</kbd> is any data type
and <kbd>y</kbd> is a compound data type created by appending the basic data
type identified by <em>name</em> to the data type of <kbd>x</kbd>.
An exception is thrown if <em>name</em> is not the name of a data type.</p>
<p><kbd>-></kbd> is an immediate word.</p>
<hr><p><pre><b>-> ( STACK-DIAGRAM -- 1ST )</b></pre></p>
<p>Add the prefix attribute to <kbd>STACK-DIAGRAM</kbd>, giving <kbd>1ST</kbd>.
An exception is thrown if <kbd>STACK-DIAGRAM</kbd> is a null data
type or if it's prefix attribute is already set.</p>
<p><kbd>-></kbd> is used in a stack diagram to create compound data types
as input or output parameters.</p>
<hr><p><pre><b>-TRAILING ( CADDRESS -> CHARACTER UNSIGNED -- 1ST 3RD )</b></pre></p>
<p>If <kbd>UNSIGNED</kbd> is greater than zero, <kbd>3RD</kbd> is equal
to <kbd>UNSIGNED</kbd> less the number of spaces at the end of the
character string specified by <kbd>CADDRESS -> CHARACTER UNSIGNED</kbd>.
If <kbd>UNSIGNED</kbd> is zero or the entire string consists of spaces,
<kbd>3RD</kbd> is zero.</p>
<hr><p><pre><b>. ( SINGLE -- )</b></pre></p>
<p>Display <kbd>SINGLE</kbd> as an unsigned number in free field format.</p>
<hr><p><pre><b>. ( SIGNED -- )</b></pre></p>
<p>Display <kbd>SIGNED</kbd> as a signed number in free field format.</p>
<hr><p><pre><b>. ( DOUBLE -- )</b></pre></p>
<p>Display <kbd>DOUBLE</kbd> as an unsigned double-precision number in
free field format.</p>
<hr><p><pre><b>. ( SIGNED-DOUBLE -- )</b></pre></p>
<p>Display <kbd>SIGNED-DOUBLE</kbd> as a signed double-precision number in
free field format. </p>
<hr><p><pre><b>. ( CHARACTER -- )</b></pre></p>
<p>If <kbd>CHARACTER</kbd> is a graphic character in the
ASCII character set, display <kbd>CHARACTER</kbd>.
The effect of <kbd>.</kbd> for all other values of <kbd>CHARACTER</kbd> is
undefined.</p>
<hr><p><pre><b>. ( FLAG -- )</b></pre></p>
<p>Display <kbd>TRUE</kbd> and a trailing space if <kbd>FLAG</kbd> is true.
Display <kbd>FALSE</kbd> and a trailing space if <kbd>FLAG</kbd> is false.</p>
<hr><p><pre><b>. ( DATA-TYPE -- )</b></pre></p>
<p>Display the name of <kbd>DATA-TYPE</kbd> as a character string, followed
by a space.</p>
<hr><p><pre><b>. ( DEFINITION -- )</b></pre></p>
<p>Display the header of <kbd>DEFINITION</kbd>,
consisting of the definition's name and its stack diagram,
plus a trailing space character.</p>
<hr><p><pre><b>. ( WID -- )</b></pre></p>
<p>Display the name of the vocabulary that corresponds to the word list
identified by <kbd>WID</kbd> as a character string, followed by a
space. If the word list is invalid or is not associated with a vocabulary,
display <kbd>???</kbd> instead.</p>
<hr><p><pre><b>." ( -- )</b></pre></p>
<p>Interpretation: <kbd><b>( "ccc<quote>" -- )</b></kbd>
<br>Parse <kbd>ccc</kbd> delimited by <kbd>"</kbd> (double-quote).
Display <kbd>ccc</kbd>.</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>( -- )</b></kbd>
<br>Display <kbd>ccc</kbd>.</p>
<p><kbd>."</kbd> is an immediate word.</p>
<hr><p><pre><b>.( ( -- )</b></pre></p>
<p>Interpretation: <kbd><b>( "ccc<right-paren>" -- )</b></kbd>
<br>Parse <kbd>ccc</kbd> delimited by <kbd>)</kbd> (right parenthesis).
Display <kbd>ccc</kbd>.</p>
<p>Compilation: <kbd><b>( "ccc<right-paren>" -- )</b></kbd>
<br>Parse <kbd>ccc</kbd> delimited by <kbd>)</kbd> (right parenthesis).
Append the runtime semantics given below to the current definition.</p>
<p>Runtime: <kbd><b>( -- )</b></kbd>
<br>Display <kbd>ccc</kbd>.</p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -