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

📄 gforth.htm

📁 strongForth: a strongly typed dialect of Forth implemented in ANS Forth.
💻 HTM
📖 第 1 页 / 共 5 页
字号:
<p><kbd>(CASE)</kbd> is an internal definition used by <kbd>CASE</kbd>.</p>
<hr><p><pre><b>(CAST) ( ADDRESS -> DATA-TYPE UNSIGNED FLAG -- )</b></pre></p>
<p>Change the contents of the interpreter or compiler data type heap 
according to the stack effect of the stack diagram stored at 
<kbd>ADDRESS -> DATA-TYPE</kbd>, which consists of <kbd>UNSIGNED</kbd> 
basic data types. If <kbd>FLAG</kbd> is <kbd>FALSE</kbd>, the interpreter 
data type heap is used. If <kbd>FLAG</kbd> is <kbd>TRUE</kbd>, the compiler 
data type heap is used.</p>
<hr><p><pre><b>(CATCH) ( TOKEN INTEGER -- SIGNED )</b></pre></p>
<p>Create an exception frame and then execute the 
execution token <kbd>TOKEN</kbd> in such a way that control can be 
transferred to a point just after <kbd>(CATCH)</kbd> if <kbd>THROW</kbd> is 
executed during the execution of <kbd>TOKEN</kbd>. <kbd>INTEGER</kbd> is 
the difference of the data stack depth (in cells) before and after normal 
execution of <kbd>TOKEN</kbd>. <kbd>INTEGER</kbd> is positive if 
executing <kbd>TOKEN</kbd> decreases the data stack size, negative if 
executing <kbd>TOKEN</kbd> increases the data stack size, and zero if 
executing <kbd>TOKEN</kbd> does not change the data stack size.</p>
<p>If the execution of <kbd>TOKEN</kbd> completes normally (i.e., the 
exception frame created by <kbd>(CATCH)</kbd> is not destroyed by an execution 
of <kbd>THROW</kbd>) destroy the exception frame and return zero 
as <kbd>SIGNED</kbd> on top of the data stack, above whatever stack items 
would have been returned by executing <kbd>TOKEN</kbd>. Otherwise, 
the remainder of the execution semantics are given by <kbd>THROW</kbd>.</p>
<p>Note: <kbd>(CATCH)</kbd> is a low-level word that is executed or compiled 
by <kbd>CATCH</kbd>.</p>
<hr><p><pre><b>(COMPILE,) ( TOKEN -- )</b></pre></p>
<p>Append the execution semantics of the definition represented by 
<kbd>TOKEN</kbd> to the execution semantics of the current definition.</p>
<hr><p><pre><b>(CONSTANT) ( STACK-DIAGRAM -- 1ST )</b></pre></p>
<p>Compile the stack diagram of a constant into the dictionary. Modify
<kbd>STACK-DIAGRAM</kbd>. The compiler data type heap pointer is assumed to point 
to the compound data type of the constant.</p>
<p><kbd>(CONSTANT)</kbd> is used by <kbd>CONSTANT</kbd> and <kbd>VALUE</kbd>.</p>
<hr><p><pre><b>(CREATE) ( TOKEN "&lt;spaces><em>name</em>" -- )</b></pre></p>
<p>Skip leading space delimiters. Parse <em>name</em> delimited by a space. 
Create a new definition for <em>name</em> with the link field containing 
the address of the name field,.and make it the latest definition. Set the 
immediate attribute in the new definition's attribute field. 
<kbd>TOKEN</kbd> is the execution token of the new definition.</p>
<hr><p><pre><b>(CREATE-NONAME) ( TOKEN -- )</b></pre></p>
<p>Create a new definition with no name and link field in the dictionary and 
make it the latest definition. Set the immediate attribute and the noname 
attribute in the new definition's attribute field. 
<kbd>TOKEN</kbd> is the execution token of the new definition.</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>Set up loop control parameters with index <kbd>1ST</kbd> and limit 
<kbd>SINGLE</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>(DOES) ( DEFINITION -- )</b></pre></p>
<p>Finish a new definition by compiling its stack diagram. If the new definition 
does not yet have a stack diagram, copy the stack diagram from an already 
existing definition <kbd>DEFINITION</kbd>, skipping the last input parameter.</p>
<p><kbd>(DOES)</kbd> is an internal definition compiled by <kbd>DOES></kbd>.</p>
<hr><p><pre><b>(DRDROP) ( -- )</b></pre></p>
<p>Pop <kbd>DOUBLE</kbd> from the return stack and discard it.</p>
<hr><p><pre><b>(DROP-S) ( SINGLE -- )</b></pre></p>
<p>Drop the condition <kbd>SINGLE</kbd>.</p>
<p><kbd>(DROP-S)</kbd> is an internal definition compiled by <kbd>IF</kbd>, 
<kbd>UNTIL</kbd> and <kbd>WHILE</kbd>.</p>
<hr><p><pre><b>(DROP-S') ( SINGLE 1ST -- 1ST )</b></pre></p>
<p>Drop the selector <kbd>1ST</kbd>.</p>
<p><kbd>(DROP-S')</kbd> is an internal definition compiled by <kbd>OF</kbd>.</p>
<hr><p><pre><b>(ELSE) ( ORIG -- 1ST )</b></pre></p>
<p>Interpretation:
<br>Interpretation semantics for this word are undefined.</p>
<p>Compilation: <kbd>( ORIG -- 1ST )</kbd>
<br>Put the location of a new unresolved forward reference <kbd>1ST</kbd> 
onto the stack. Append the runtime semantics given below to the current 
definition. The semantics will be incomplete until <kbd>1ST</kbd> is 
resolved (e.g., by <kbd>THEN</kbd>). Resolve the forward reference <kbd>ORIG</kbd> 
using the location following the appended runtime semantics.</p>
<p>Runtime: <b><kbd>( -- )</kbd></b>
<br>Continue execution at the location given by the resolution of 
<kbd>1ST</kbd>.</p>
<p><kbd>(ELSE)</kbd> is an internal definition used by <kbd>ELSE</kbd>.</p>
<hr><p><pre><b>(ENDCASE) ( 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 end of the <kbd>CASE ... OF ... ENDOF ... ENDCASE</kbd> structure. 
Use <kbd>CASE-SYS</kbd> to resolve the entire structure. Append the runtime 
semantics given below to the current definition.</p>
<p>Runtime: <b><kbd>( SINGLE -- )</kbd></b>
<br>Discard the case selector <kbd>SINGLE</kbd> and continue execution.</p>
<p><kbd>(ENDCASE)</kbd> is an internal definition used by <kbd>ENDCASE</kbd>.</p>
<hr><p><pre><b>(ENDOF) ( CASE-SYS OF-SYS -- 1ST )</b></pre></p>
<p>Interpretation:
<br>Interpretation semantics for this word are undefined.</p>
<p>Compilation: <kbd>( CASE-SYS OF-SYS -- 1ST )</kbd>
<br>Mark the end of the <kbd>OF ... ENDOF</kbd> part of the <kbd>CASE</kbd> 
structure. The next location for a transfer of control resolves the reference 
given by <kbd>OF-SYS</kbd>. Append the runtime semantics given below to the 
current definition. Replace <kbd>CASE-SYS</kbd> with <kbd>1ST</kbd>, to be 
resolved by <kbd>ENDCASE</kbd>.</p>
<p>Runtime: <b><kbd>( -- )</kbd></b>
<br>Continue execution at the location specified by the consumer of 
<kbd>1ST</kbd>.</p>
<p><kbd>(ENDOF)</kbd> is an internal definition used by <kbd>ENDOF</kbd>.</p>
<hr><p><pre><b>(EXECUTE) ( TOKEN -- )</b></pre></p>
<p>Remove <kbd>TOKEN</kbd> from the stack and perform the semantics 
identified by it.</p>
<p>Note that <kbd>(EXECUTE)</kbd> does not verify or update the data type heap 
according to the stack diagram of the word associated 
with <kbd>TOKEN</kbd>. <kbd>(EXECUTE)</kbd> is a low-level word that should be 
used carefully, because it may corrupt StrongForth's data type system. 
Especially, it should not be used in place of <kbd>EXECUTE</kbd>.</p>
<hr><p><pre><b>(IF) ( -- 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> or <kbd>ELSE</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 the resolution of <kbd>ORIG</kbd>.</p>
<p><kbd>(IF)</kbd> is an internal definition used by <kbd>IF</kbd>.</p>
<hr><p><pre><b>(LEAVE) ( -- )</b></pre></p>
<p>Discard the current loop control parameters. An ambiguous condition exists 
if they are unavailable. Continue execution immediately following the innermost 
syntactically enclosing <kbd>DO ... LOOP</kbd> or <kbd>DO ... +LOOP</kbd>.</p>
<p><kbd>(LEAVE)</kbd> is an internal definition used by <kbd>LEAVE</kbd>.</p>
<hr><p><pre><b>(LOCAL) ( CADDRESS -> CHARACTER UNSIGNED -- )</b></pre></p>
<p>Interpretation:
<br>An exception is thrown if <kbd>(LOCAL)</kbd> is interpreted.</p>
<p>Execution:
<br>When executed during compilation, <kbd>(LOCAL)</kbd> passes a message to the 
system that has one of two meanings. If <kbd>UNSIGNED</kbd> is non-zero, 
the message identifies a new local whose definition name is given by the 
string of characters identified by <kbd>CADDRESS -> CHARACTER UNSIGNED</kbd>. 
If <kbd>UNSIGNED</kbd> is zero, the message is <em>last local</em> and 
<kbd>CADDRESS -> CHARACTER</kbd> has no significance.</p>
<p>The result of executing <kbd>(LOCAL)</kbd> during compilation of a definition 
is creating a set of named local identifiers, each of which is a definition 
name, that only have execution semantics within the scope of that definition's 
source.</p>
<p>Runtime: <b><kbd>( -- x )</kbd></b>
<br>Push the local's value, <kbd>x</kbd>, onto the stack.</p>
<p>Note: <kbd>x</kbd> can be either <kbd>SINGLE</kbd> or <kbd>DOUBLE</kbd>.</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 the <kbd>(LOOP)</kbd>.</p>
<p>Runtime: <b><kbd>( -- ) ( R: loop-sys1 -- | loop-sys2 )</b></kbd>
<br>An ambiguous condition exists if the loop control parameters are unavailable. 
Add one to the loop index. If the loop index is then equal to the loop limit, 
discard the loop parameters and continue execution immediately following the loop. 
Otherwise continue execution at the beginning of the loop.</p>
<p><kbd>(LOOP)</kbd> is an internal definition used by <kbd>LOOP</kbd>.</p>
<hr><p><pre><b>(OF) ( -- OF-SYS )</b></pre></p>
<p>Interpretation:
<br>Interpretation semantics for this word are undefined.</p>
<p>Compilation: <kbd>( -- OF-SYS )</kbd>
<br>Put <kbd>OF-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>OF-SYS</kbd> such as <kbd>ENDOF</kbd>.</p>
<p>Runtime: <b><kbd>( SINGLE 1ST -- | 1ST )</kbd></b>
<br>If the two values on the stack are not equal, discard the top value and 
continue execution at the location specified by the consumer of <kbd>OF-SYS</kbd>, 
e.g., following the next <kbd>ENDOF</kbd>. Otherwise, discard both values and 
continue execution in line.</p>
<p><kbd>(OF)</kbd> is an internal definition used by <kbd>OF</kbd>.</p>
<hr><p><pre><b>(PARAM) ( STACK-DIAGRAM DATA-TYPE -- 1ST )</b></pre></p>
<p>If <kbd>STACK-DIAGRAM</kbd> does not contain a null data type, reserve two 
cells in the dictionary and store <kbd>STACK-DIAGRAM</kbd> without 
it's offset attribute in the cells. Add 1 to the offset attribute 
of <kbd>STACK-DIAGRAM</kbd>. <kbd>1ST</kbd> is a stack diagram with the 
identifier of <kbd>DATA-TYPE</kbd> and the input parameter, output parameter 
and offset attributes of <kbd>STACK-DIAGRAM</kbd>.</p>
<hr><p><pre><b>(RDROP) ( -- )</b></pre></p>
<p>Pop <kbd>SINGLE</kbd> from the return stack and discard it.</p>
<p><kbd>(RDROP)</kbd> is an internal definition compiled by <kbd>R></kbd>.</p>
<hr><p><pre><b>(REPEAT) ( ORIG DEST -- )</b></pre></p>
<p>Interpretation:
<br>Interpretation semantics for this word are undefined.</p>
<p>Compilation: <kbd>( ORIG DEST -- )</kbd>
<br>Append the runtime semantics given below to the current definition, 
resolving the backward reference <kbd>DEST</kbd>. Resolve the forward 
reference <kbd>ORIG</kbd> using the location following the appended 
runtime semantics.</p>
<p>Runtime: <b><kbd>( -- )</kbd></b>
<br>Continue execution at the location given by <kbd>DEST</kbd>.</p>
<p><kbd>(REPEAT)</kbd> is an internal definition used by <kbd>REPEAT</kbd>.</p>
<hr><p><pre><b>(STEP-S) ( 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) ( 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) ( ADDRESS -> SINGLE -- )</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 cell in address units onto the stack.</p>
<hr><p><pre><b>(STEP-S) ( ADDRESS -> DOUBLE -- )</b></pre></p>

⌨️ 快捷键说明

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