⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gforth.htm

📁 strongForth: a strongly typed dialect of Forth implemented in ANS Forth.
💻 HTM
📖 第 1 页 / 共 5 页
字号:
<p><kbd>(STEP-S)</kbd> is an internal definition compiled by <kbd>LOOP</kbd> 
in order to adjust the compiler data type heap.</p>
<p>Push the size of two cells in address units onto the stack.</p>
<hr><p><pre><b>(STEP-S) ( CADDRESS -- )</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>
<p>Push the size of a character in address units onto the stack.</p>
<hr><p><pre><b>(THEN) ( ORIG -- )</b></pre></p>
<p>Interpretation:
<br>Interpretation semantics for this word are undefined.</p>
<p>Compilation: <kbd>( ORIG -- )</kbd>
<br>Append the runtime semantics given below to the current definition. 
Resolve the forward reference <kbd>ORIG</kbd> using the location of the 
appended runtime semantics.</p>
<p>Runtime: <b><kbd>( -- )</kbd></b>
<br>Continue execution.</p>
<p><kbd>(THEN)</kbd> is an internal definition used by <kbd>THEN</kbd>.</p>
<hr><p><pre><b>(UNLOOP) ( -- )</b></pre></p>
<P>Discard the loop control parameters for the current nesting level. 
<kbd>UNLOOP</kbd> is required for each nesting level before the definition 
may be <kbd>EXIT</kbd>ed. An ambiguous condition exists if the loop-control 
parameters are unavailable.</p>
<hr><p><pre><b>(UNTIL) ( 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>( SINGLE -- )</kbd></b>
<br>If all bits of <kbd>SINGLE</kbd> are zero, continue execution at the 
location specified by <kbd>DEST</kbd>.</p>
<p><kbd>(UNTIL)</kbd> is an internal definition used by <kbd>UNTIL</kbd>.</p>
<hr><p><pre><b>(VARIABLE) ( STACK-DIAGRAM -- 1ST )</b></pre></p>
<p>Compile the stack diagram of a variable into the dictionary. 
Modify <kbd>STACK-DIAGRAM</kbd>. The compiler data heap pointer is assumed to 
point to the compound data type of the variable.</p>
<p><kbd>(VARIABLE)</kbd> is used by <kbd>VARIABLE</kbd>.</p>
<hr><p><pre><b>(WHILE) ( DEST -- ORIG 1ST )</b></pre></p>
<p>Interpretation:
<br>Interpretation semantics for this word are undefined.</p>
<p>Compilation: <kbd>( DEST -- ORIG 1ST )</kbd>
<br>Put the location of a new unresolved forward reference <kbd>ORIG</kbd> 
onto the stack, under the existing <kbd>DEST</kbd>. Append the runtime 
semantics given below to the current definition. The semantics are 
incomplete until <kbd>ORIG</kbd> and <kbd>DEST</kbd> are resolved 
(e.g., by REPEAT).</p>
<p>Runtime: <b><kbd>( SINGLE -- )</kbd></b>
<br>If all bits of <kbd>SINGLE</kbd> are zero, continue execution at the 
location specified by the resolution of <kbd>ORIG</kbd>.</p>
<p><kbd>(WHILE)</kbd> is an internal definition used by <kbd>WHILE</kbd>.</p>
<hr><p><pre><b>) ( FLAG STACK-DIAGRAM -- )</b></pre></p>
<p>Mark the end of a definition's stack diagram. Compile the stack diagram. 
Store <kbd>FLAG</kbd> in <kbd>STATE</kbd>. An exception is thrown if the current 
definition already has a stack diagram, or if the stack diagram is invalid.</p>
<hr><p><pre><b>) ( COLON-SYS FLAG STACK-DIAGRAM -- 1ST )</b></pre></p>
<p>Mark the end of a colon definition's stack diagram. Compile the stack 
diagram and place a copy of the input parameter list onto the compiler data 
type heap. Re-enter compilation state. An exception is thrown if the current 
definition already has a stack diagram, or if the stack diagram is invalid.</p>
<p>Note: <kbd>FLAG</kbd> is assumed to be <kbd>TRUE</kbd>.</p>
<hr><p><pre><b>)' ( FLAG STACK-DIAGRAM "&lt;spaces><em>name</em>" -- DEFINITION )</b></pre></p>
<p>Mark the end of a definition's stack diagram. Store <kbd>FLAG</kbd> in 
<kbd>STATE</kbd>. 
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 and with exactly the given stack diagram. 
An exception is thrown if no definition with that name and exactly 
the given stack diagram is found.</p>
<hr><p><pre><b>)CAST ( FLAG STACK-DIAGRAM -- )</b></pre></p>
<p>Mark the end of a stack diagram <kbd>STACK-DIAGRAM</kbd>. Restore the 
compilation state indicated by <kbd>FLAG</kbd>. If
<kbd>FLAG</kbd> is false, change the interpreter data type heap according 
to the stack effect of <kbd>STACK-DIAGRAM</kbd>. If
<kbd>FLAG</kbd> is true, change the compiler data type heap according to 
the stack effect of <kbd>STACK-DIAGRAM</kbd>. The data stack remains 
unchanged.</p>
<p>Note: <kbd>)CAST</kbd> is an immediate word. It does not compile any 
execution semantics if used in compilation state.
<kbd>)CAST</kbd> may corrupt the data type system, because it arbitrarily 
modifies the contents of the data type heap without performing appropriate 
changes on the data stack.</p>
<hr><p><pre><b>)PROCREATES ( FLAG STACK-DIAGRAM "&lt;spaces><em>name</em>" -- )</b></pre></p>
<p>Mark the end of a stack diagram <kbd>STACK-DIAGRAM</kbd>. Drop
<kbd>FLAG</kbd>. 
Skip leading space delimiters. Parse <em>name</em> delimited by a space. 
Create a definition with name <em>name</em> that identifies a new data type. 
The new data type is a direct subtype of <kbd>TOKEN</kbd>. 
It is called a <em>qualified token</em>. Create another definition with 
name <kbd>EXECUTE</kbd>, whose stack diagram is a copy 
of <kbd>STACK-DIAGRAM</kbd>, supplemented with the just created qualified 
token as the last input parameter.</p>
<p>Execution: <b><kbd><em>name</em> ( STACK-DIAGRAM -- 1ST )</kbd></b>
<br>When used in a stack diagram, specifies an input or output parameter 
with the data type of the qualified token.</p>
<p>Execution: <b><kbd>EXECUTE ( x0 ... xm <em>name</em> -- y0 ... yn )</kbd></b>
<br>Execute the word specified by the qualified token
<kbd><em>name</em></kbd>. The word's stack diagram has to match the stack 
diagram that was supplied to <kbd>)PROCREATES</kbd>.
<br><kbd>x0 ... xm</kbd> are the input parameters of the stack diagram.
<br><kbd>y0 ... yn</kbd> are the output parameters of the stack diagram.</p>
<hr><p><pre><b>* ( INTEGER UNSIGNED -- 1ST )</b></pre></p>
<p>Multiply <kbd>INTEGER</kbd> by <kbd>UNSIGNED</kbd> giving the 
product <kbd>1ST</kbd>. Note that the multiplicand can be any integer 
(signed or unsigned), while the multiplicator is unsigned. 
The result has the same data type as the multiplicand. 
Since the product of an unsigned number (multiplicand) and a 
signed number (multiplicator) should be a signed number, 
the two operands have to be swapped in this case.</p>
<hr><p><pre><b>* ( SIGNED SIGNED -- 1ST )</b></pre></p>
<p>Multiply two <kbd>SIGNED</kbd> numbers giving the product <kbd>1ST</kbd>. 
Note that the multiplicand as well as the multiplicator are signed. 
The result has the same data type as the multiplicand.</p>
<hr><p><pre><b>* ( INTEGER-DOUBLE UNSIGNED -- 1ST )</b></pre></p>
<p>Multiply <kbd>INTEGER-DOUBLE</kbd> by <kbd>UNSIGNED</kbd> giving 
the double-precision product <kbd>1ST</kbd>. 
Note that the multiplicand can be any integer (signed or unsigned), 
while the multiplicator is unsigned.</p>
<hr><p><pre><b>* ( SIGNED-DOUBLE SIGNED -- 1ST )</b></pre></p>
<p>Multiply <kbd>SIGNED-DOUBLE</kbd> by <kbd>SIGNED</kbd> giving 
the double-precision product <kbd>1ST</kbd>. 
Note that the multiplicand as well as the multiplicator are signed. 
The result has the same data type as the multiplicand.</p>
<hr><p><pre><b>*/ ( UNSIGNED UNSIGNED UNSIGNED -- 1ST )</b></pre></p>
<p>Multiply the first <kbd>UNSIGNED</kbd> by the second <kbd>UNSIGNED</kbd> producing 
an intermediate unsigned double-precision result. Divide the intermediate result 
by the third <kbd>UNSIGNED</kbd> giving the unsigned single-precision 
quotient <kbd>1ST</kbd>. An ambiguous condition exists if the third 
<kbd>UNSIGNED</kbd> is zero or if the quotient <kbd>1ST</kbd> lies 
outside the range of an unsigned single-precision number.</p>
<hr><p><pre><b>*/ ( SIGNED SIGNED SIGNED -- 1ST )</b></pre></p>
<p>Multiply the first <kbd>SIGNED</kbd> by the second <kbd>SIGNED</kbd> producing 
an intermediate signed double-precision result. Divide the intermediate result 
by the third <kbd>SIGNED</kbd> giving the signed single-precision 
quotient <kbd>1ST</kbd>. An ambiguous condition exists if the third 
<kbd>SIGNED</kbd> is zero or if the quotient <kbd>1ST</kbd> 
lies outside the range of a signed single-precision number.</p>
<hr><p><pre><b>*/ ( UNSIGNED-DOUBLE UNSIGNED UNSIGNED -- 1ST )</b></pre></p>
<p>Multiply <kbd>UNSIGNED-DOUBLE</kbd> by the first <kbd>UNSIGNED</kbd> producing 
an intermediate unsigned triple-precision result. Divide the intermediate result 
by the second <kbd>UNSIGNED</kbd> giving the unsigned double-precision 
quotient <kbd>1ST</kbd>. An ambiguous condition exists if the second 
<kbd>UNSIGNED</kbd> is zero or if the quotient <kbd>1ST</kbd> lies 
outside of the range of an unsigned double-precision number.</p>
<hr><p><pre><b>*/ ( SIGNED-DOUBLE SIGNED SIGNED -- 1ST )</b></pre></p>
<p>Multiply <kbd>SIGNED-DOUBLE</kbd> by the first <kbd>SIGNED</kbd> producing 
an intermediate unsigned triple-precision result. Divide the intermediate result 
by the second <kbd>SIGNED</kbd> giving the signed double-precision 
quotient <kbd>1ST</kbd>. An ambiguous condition exists if the second 
<kbd>SIGNED</kbd> is zero or if the second <kbd>SIGNED</kbd> is 
negative, or if the quotient <kbd>1ST</kbd> lies outside of the range of a 
signed double-precision number.</p>
<hr><p><pre><b>*/MOD ( UNSIGNED UNSIGNED UNSIGNED -- 3RD 1ST )</b></pre></p>
<p>Multiply the first <kbd>UNSIGNED</kbd> by the second <kbd>UNSIGNED</kbd> producing 
an intermediate unsigned double-precision result. Divide the intermediate result 
by the third <kbd>UNSIGNED</kbd> giving the unsigned single-precision 
remainder <kbd>3RD</kbd> and the unsigned single-precision 
quotient <kbd>1ST</kbd>. An ambiguous condition exists if the 
third <kbd>UNSIGNED</kbd> is zero or if the quotient <kbd>1ST</kbd> lies 
outside the range of an unsigned single-precision number.</p>
<hr><p><pre><b>*/MOD ( SIGNED SIGNED SIGNED -- 3RD 1ST )</b></pre></p>
<p>Multiply the first <kbd>SIGNED</kbd> by the second <kbd>SIGNED</kbd> producing 
an intermediate signed double-precision result. Divide the intermediate result 
by the third <kbd>SIGNED</kbd> giving the signed single-precision 
remainder <kbd>3RD</kbd> and the signed single-precision 
quotient <kbd>1ST</kbd>. An ambiguous condition exists if the 
third <kbd>SIGNED</kbd> is zero or if the quotient <kbd>1ST</kbd> lies 
outside the range of a signed single-precision number.</p>
<hr><p><pre><b>*/MOD ( UNSIGNED-DOUBLE UNSIGNED UNSIGNED -- 3RD 1ST )</b></pre></p>
<p>Multiply <kbd>UNSIGNED-DOUBLE</kbd> by the first <kbd>UNSIGNED</kbd> producing 
an intermediate unsigned triple-precision result. Divide the intermediate result 
by the second <kbd>UNSIGNED</kbd> giving the unsigned single-precision 
remainder <kbd>3RD</kbd> and the unsigned double-precision 
quotient <kbd>1ST</kbd>. An ambiguous condition exists if the 
second <kbd>UNSIGNED</kbd> is zero or if the quotient <kbd>1ST</kbd> lies 
outside of the range of an unsigned double-precision number.</p>
<hr><p><pre><b>+ ( INTEGER INTEGER -- 1ST )</b></pre></p>
<p>Add the second <kbd>INTEGER</kbd> to the first <kbd>INTEGER</kbd>, 
giving the sum <kbd>1ST</kbd>.</p>
<hr><p><pre><b>+ ( ADDRESS INTEGER -- 1ST )</b></pre></p>
<p>Add <kbd>INTEGER</kbd> to <kbd>ADDRESS</kbd>, giving the sum <kbd>1ST</kbd>.</p>
<hr><p><pre><b>+ ( ADDRESS -> SINGLE INTEGER -- 1ST )</b></pre></p>
<p>Add <kbd>INTEGER</kbd> to <kbd>ADDRESS -> SINGLE</kbd>, giving the 
sum <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 addition takes place.</p>
<hr><p><pre><b>+ ( ADDRESS -> DOUBLE INTEGER -- 1ST )</b></pre></p>
<p>Add <kbd>INTEGER</kbd> to <kbd>ADDRESS -> DOUBLE</kbd>, giving the 
sum <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 addition takes place.</p>
<hr><p><pre><b>+ ( CADDRESS INTEGER -- 1ST )</b></pre></p>
<p>Add <kbd>INTEGER</kbd> to address <kbd>CADDRESS</kbd>, giving the 
sum <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 addition takes place.</p>
<hr><p><pre><b>+ ( INTEGER-DOUBLE INTEGER-DOUBLE -- 1ST )</b></pre></p>
<p>Add the second <kbd>INTEGER-DOUBLE</kbd> to the first 
<kbd>INTEGER-DOUBLE</kbd>, giving the sum <kbd>1ST</kbd>.</p>
<hr><p><pre><b>+ ( INTEGER-DOUBLE INTEGER -- 1ST )</b></pre></p>
<p>Add <kbd>UNSIGNED</kbd> with zero extension to <kbd>INTEGER-DOUBLE</kbd>, 
giving the double-precision sum <kbd>1ST</kbd>.</p>
<hr><p><pre><b>+ ( INTEGER-DOUBLE SIGNED -- 1ST )</b></pre></p>
<p>Add <kbd>SIGNED</kbd> with sign extension to <kbd>INTEGER-DOUBLE</kbd>, 
giving the double-precision sum <kbd>1ST</kbd>.</p>
<hr><p><pre><b>+! ( INTEGER ADDRESS -> INTEGER -- )</b></pre></p>
<p>Add <kbd>INTEGER</kbd> to the integer at address <kbd>ADDRESS -> INTEGER</kbd>.</p>
<hr><p><pre><b>+! ( INTEGER-DOUBLE ADDRESS -> INTEGER-DOUBLE -- )</b></pre></p>
<p>Add <kbd>INTEGER-DOUBLE</kbd> to the double-precision integer at 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -