! ( SINGLE DATA -> 1ST -- )
Store SINGLE at address DATA.
! ( DOUBLE DATA -> 1ST -- )
Store DOUBLE at address DATA.
! ( SINGLE CDATA -> 1ST -- )
Store SINGLE at address CDATA. Only the number of low-order bits corresponding to character size are transferred.
! ( SINGLE CONST -> 1ST -- )
Store SINGLE at address CONST. An ambiguous condition exists if it is physically impossible to write into the CONST memory area.
! ( DOUBLE CONST -> 1ST -- )
Store DOUBLE at address CONST. An ambiguous condition exists if it is physically impossible to write into the CONST memory area.
! ( SINGLE CCONST -> 1ST -- )
Store SINGLE at address CCONST. Only the number of low-order bits corresponding to character size are transferred. An ambiguous condition exists if it is physically impossible to write into the CONST memory area.
! ( SINGLE CODE -> 1ST -- )
Store SINGLE at address CODE. An ambiguous condition exists if it is physically impossible to write into the CODE memory area.
! ( DOUBLE CODE -> 1ST -- )
Store DOUBLE at address CODE. An ambiguous condition exists if it is physically impossible to write into the CODE memory area.
! ( SINGLE CCODE -> 1ST -- )
Store SINGLE at address CCODE. Only the number of low-order bits corresponding to character size are transferred. An ambiguous condition exists if it is physically impossible to write into the CODE memory area.
! ( SINGLE FAR-ADDRESS -> 1ST -- )
Store SINGLE at address FAR-ADDRESS.
! ( DOUBLE FAR-ADDRESS -> 1ST -- )
Store DOUBLE at address FAR-ADDRESS.
! ( SINGLE CFAR-ADDRESS -> 1ST -- )
Store SINGLE at address CFAR-ADDRESS. Only the number of low-order bits corresponding to character size are transferred.
" ( "ccc<quote>" -- )
Interpretation:
An exception is thrown if " is interpreted.
Compilation:
Parse ccc delimited by " (double-quote).
Append the runtime semantics given below to the current definition.
Runtime: ( -- CCONST -> CHARACTER UNSIGNED )
Return CCONST -> CHARACTER as the address and
UNSIGNED as the character count of a character string
consisting of the characters ccc that were parsed during
compilation. A program shall not alter the returned string.
" is an immediate word.
", ( CDATA -> CHARACTER UNSIGNED -- )
Reserve space for a counted string with UNSIGNED characters in the current memory space and store the string CDATA -> CHARACTER UNSIGNED in the memory space. If the current memory space pointer is character aligned when ", begins execution, it will remain character aligned when ", finishes execution. An ambiguous condition exists if the first unused address of the current memory space is not character aligned prior to execution of ",. An exception is thrown if UNSIGNED exceeds the maximum length of a counted string, or if the current memory space overflows.
# ( NUMBER-DOUBLE -- 1ST )
Divide NUMBER-DOUBLE by the current number-conversion radix giving the quotient 1ST and the remainder n (n is the least-significant digit of NUMBER-DOUBLE). Convert n to external form and add the resulting character to the beginning of the pictured numeric output string. An exception is thrown if the transient area used for storing the pictured numeric output overflows.
#> ( NUMBER-DOUBLE -- CDATA -> CHARACTER UNSIGNED )
Drop NUMBER-DOUBLE. Make the pictured numeric output string available as a character string CDATA -> CHARACTER UNSIGNED. A program may replace characters within the string.
#LOCALS ( -- DATA -> SIGNED )
DATA -> SIGNED is the address of a cell containing the number of cells reserved for locals on the return stack within the current definition.
#PARAMS ( DEFINITION -- UNSIGNED )
UNSIGNED is the length of the parameter list of DEFINITION, i. e. the total number of basic data types in DEFINITION's stack diagram.
#S ( NUMBER-DOUBLE -- 1ST )
Convert one digit of NUMBER-DOUBLE according to the rule for #. Continue conversion until the quotient is zero. 1ST is zero.
#TIB ( -- DATA -> UNSIGNED )
DATA -> UNSIGNED is the address of a cell containing the number of characters in the terminal input buffer.
' ( "<spaces>name" -- DEFINITION )
Skip leading space delimiters. Parse name delimited by a space. Find name and return DEFINITION, the latest definition in the dictionary with that name. An exception is thrown if name is not found.
'CODE ( "<spaces>name" -- CODE )
Skip leading space delimiters. Parse name delimited by a space. Find name and return CODE, the address of the code field of the latest definition in the dictionary with that name. An exception is thrown if name is not found.
'TOKEN ( "<spaces>name" -- TOKEN )
Skip leading space delimiters. Parse name delimited by a space. Find name and return TOKEN, the token of the latest definition in the dictionary with that name. An exception is thrown if name is not found.
( ( -- MEMORY-SPACE FLAG STACK-DIAGRAM )
Produce STACK-DIAGRAM with the input parameter attribute. FLAG is the current value of STATE. Enter interpretation state. Preserve the current memory space in MEMORY-SPACE and make the local name space the current memory space.
( starts a stack diagram.
Note that the semantics of ( is not the same as in ANS Forth.
( is an immediate word.
(+EXIT) ( -- ) ( R: nest-sys -- )
Remove all locals from the return stack and return to the calling definition specified by nest-sys.
(+EXIT) is an internal definition compiled by EXIT.
(+LOOP) ( INTEGER INTEGER -- )
An ambiguous condition exists if the loop control parameters are unavailable. Add the first INTEGER to the loop index. If the loop index crosses the boundary between the loop limit minus one and the loop limit, discard the loop control parameters and continue execution. Otherwise, branch to the beginning of the loop. The second INTEGER is a dummy parameter indicating the data type of the loop index.
(+LOOP) is an internal definition compiled by +LOOP.
(+LOOP) ( INTEGER ADDRESS -- )
An ambiguous condition exists if the loop control parameters are unavailable. Add INTEGER to the loop index. If the loop index crosses the boundary between the loop limit minus one and the loop limit, discard the loop control parameters and continue execution. Otherwise, branch to the beginning of the loop. ADDRESS is a dummy parameter indicating the data type of the loop index.
(+LOOP) is an internal definition compiled by +LOOP.
(+LOOP) ( INTEGER ADDRESS -> SINGLE -- )
An ambiguous condition exists if the loop control parameters are unavailable. Add INTEGER, multiplied with the size of a cell in address units, to the loop index. If the loop index crosses the boundary between the loop limit minus one and the loop limit, discard the loop control parameters and continue execution. Otherwise, branch to the beginning of the loop. ADDRESS -> SINGLE is a dummy parameter indicating the data type of the loop index.
(+LOOP) is an internal definition compiled by +LOOP.
(+LOOP) ( INTEGER ADDRESS -> DOUBLE -- )
An ambiguous condition exists if the loop control parameters are unavailable. Add INTEGER, multiplied with the size of a double cell in address units, to the loop index. If the loop index crosses the boundary between the loop limit minus one and the loop limit, discard the loop control parameters and continue execution. Otherwise, branch to the beginning of the loop. ADDRESS -> DOUBLE is a dummy parameter indicating the data type of the loop index.
(+LOOP) is an internal definition compiled by +LOOP.
(+LOOP) ( INTEGER CADDRESS -- )
An ambiguous condition exists if the loop control parameters are unavailable. Add INTEGER, multiplied with the size of a character in address units, to the loop index. If the loop index crosses the boundary between the loop limit minus one and the loop limit, discard the loop control parameters and continue execution. Otherwise, branch to the beginning of the loop. CADDRESS is a dummy parameter indicating the data type of the loop index.
(+LOOP) is an internal definition compiled by +LOOP.
(>R) ( SINGLE -- ) ( R: -- SINGLE )
Push SINGLE onto the return stack.
(>R) is an internal definition compiled by >R and (LOCAL).
(>R) ( DOUBLE -- ) ( R: -- DOUBLE )
Push DOUBLE onto the return stack.
(>R) is an internal definition compiled by >R and (LOCAL).
(?DO) ( INTEGER 1ST -- )
If the loop limit INTEGER and the loop index 1st are equal, branch forward within the current definition. Otherwise push INTEGER and 1ST onto the return stack and continue execution.
(?DO) is an internal definition compiled by ?DO.
(?DO) ( ADDRESS 1ST -- )
If the loop limit ADDRESS and the loop index 1st are equal, branch forward within the current definition. Otherwise push ADDRESS and 1ST onto the return stack and continue execution.
(?DO) is an internal definition compiled by ?DO.
(ABORT") ( SINGLE CCONST -> CHARACTER UNSIGNED -- )
If any bit of SINGLE is not zero, display the character string CCONST -> CHARACTER UNSIGNED and then perform the function of ABORT.
(ABORT") is an internal definition compiled by ABORT".
(CAST) ( FAR-ADDRESS -> DATA-TYPE UNSIGNED FLAG -- )
Change the contents of the interpreter or compiler data type heap according to the stack effect of the stack diagram stored at FAR-ADDRESS -> DATA-TYPE, which consists of UNSIGNED basic data types. If FLAG is FALSE, the interpreter data type heap is used. If FLAG is TRUE, the compiler data type heap is used.
(CONSTANT) ( STACK-DIAGRAM -- 1ST )
Compile the stack diagram of a constant into the current memory space. Modify STACK-DIAGRAM. The compiler data type heap pointer is assumed to point to the compound data type of the constant.
(CONSTANT) is used by CONSTANT and VALUE.
(CREATE) ( CONST "<spaces>name" -- )
Skip leading space delimiters. Parse name delimited by a space. Create a new definition for name 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. CONST is the token of the new definition.
(CREATE-NONAME) ( CONST -- )
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. CONST is the token of the new definition.
(DO) ( INTEGER 1ST -- )
Push the loop limit INTEGER and the loop index 1ST onto the return stack.
(DO) is an internal definition compiled by DO.
(DO) ( ADDRESS 1ST -- )
Push the loop limit ADDRESS and the loop index 1ST onto the return stack.
(DO) is an internal definition compiled by DO.
(DOES) ( CODE -> DEFINITION -- )
Finish a new definition by compiling its stack diagram and its code field. If the new definition does not yet have a stack diagram, copy the stack diagram from an already existing definition stored at CODE -> DEFINITION, skipping the last input parameter. The code field of the new definition is equal to CODE -> DEFINITION plus the size of an item of data type DEFINITION.
(DOES) is an internal definition compiled by DOES>.
(DR@) ( -- DOUBLE )
Fetch DOUBLE from the return stack. The return stack remains unchanged.
(DR@) is an internal definition compiled by LOCAL,.
(DRDROP) ( R: DOUBLE -- )
Pop DOUBLE from the return stack and discard it.
(DRDROP) is an internal definition compiled by R>.
(EXECUTE) ( TOKEN -- )
Remove TOKEN from the stack and perform the semantics identified by it.
Note that (EXECUTE) does not verify or update the data type heap according to the stack diagram of the word associated with TOKEN. (EXECUTE) 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 EXECUTE.
(EXIT) ( -- ) ( R: nest-sys -- )
Return to the calling definition specified by nest-sys.
(EXIT) is an internal definition compiled by EXIT.
(LEAVE) ( -- )
Discard the current loop control parameters. An ambiguous condition exists if they are unavailable. Unconditionally branch forward within the current definition.
(LEAVE) is an internal definition compiled by LEAVE.
(LOCAL) ( CDATA -> CHARACTER UNSIGNED -- )
Interpretation:
An exception is thrown if (LOCAL) is interpreted.
Execution:
When executed during compilation, (LOCAL) passes a message to the
system that has one of two meanings. If UNSIGNED is non-zero,
the message identifies a new local whose definition name is given by the
string of characters identified by CDATA -> CHARACTER UNSIGNED.
If UNSIGNED is zero, the message is last local and
CDATA -> CHARACTER has no significance.
The result of executing (LOCAL) 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.
Runtime: ( -- x )
Push the local's value, x, onto the stack.
Note: x can be either SINGLE or DOUBLE.
(LOOP) ( INTEGER -- )
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 control parameters and continue execution. Otherwise, branch to the beginning of the loop. INTEGER is a dummy parameter indicating the data type of the loop index.
(LOOP) is an internal definition compiled by LOOP.
(LOOP) ( ADDRESS -- )
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 control parameters and continue execution. Otherwise, branch to the beginning of the loop. ADDRESS is a dummy parameter indicating the data type of the loop index.
(LOOP) is an internal definition compiled by LOOP.
(LOOP) ( ADDRESS -> SINGLE -- )
An ambiguous condition exists if the loop control parameters are unavailable. Add the size of a cell in address units to the loop index. If the loop index is then equal to the loop limit, discard the loop control parameters and continue execution. Otherwise, branch to the beginning of the loop. ADDRESS -> SINGLE is a dummy parameter indicating the data type of the loop index.
(LOOP) is an internal definition compiled by LOOP.
(LOOP) ( ADDRESS -> DOUBLE -- )
An ambiguous condition exists if the loop control parameters are unavailable. Add the size of a double cell in address units to the loop index. If the loop index is then equal to the loop limit, discard the loop control parameters and continue execution. Otherwise, branch to the beginning of the loop. ADDRESS -> DOUBLE is a dummy parameter indicating the data type of the loop index.
(LOOP) is an internal definition compiled by LOOP.
(LOOP) ( CADDRESS -- )
An ambiguous condition exists if the loop control parameters are unavailable. Add the size of a character in address units to the loop index. If the loop index is then equal to the loop limit, discard the loop control parameters and continue execution. Otherwise, branch to the beginning of the loop. CADDRESS is a dummy parameter indicating the data type of the loop index.
(LOOP) is an internal definition compiled by LOOP.
(PARAM) ( STACK-DIAGRAM DATA-TYPE -- 1ST )
If STACK-DIAGRAM does not contain a null data type, reserve two cells in the current memory space and store STACK-DIAGRAM without it's offset attribute in the cells. Add 1 to the offset attribute of STACK-DIAGRAM. 1ST is a stack diagram with the identifier of DATA-TYPE and the input parameter, output parameter and offset attributes of STACK-DIAGRAM.
(R) ( -- DATA )
DATA is the address of a local on the return stack.
(R) is an internal definition compiled by ADDR.
(R@) ( -- SINGLE )
Fetch SINGLE from the return stack. The return stack remains unchanged.
(R@) is an internal definition compiled by LOCAL,.
(RDROP) ( R: SINGLE -- )
Pop SINGLE from the return stack and discard it.
(RDROP) is an internal definition compiled by R>.
(VARIABLE) ( STACK-DIAGRAM -- 1ST )
Compile the stack diagram of a variable into the current memory space. Modify STACK-DIAGRAM. The compiler data heap pointer is assumed to point to the compound data type of the variable.
(VARIABLE) is used by VARIABLE.
) ( MEMORY-SPACE FLAG STACK-DIAGRAM -- )
Mark the end of a definition's stack diagram. Compile the stack diagram into the name space of the current definition. Store FLAG in STATE. Restore MEMORY-SPACE as the current memory space. An exception is thrown if the current definition already has a stack diagram, or if the stack diagram is invalid.
) ( COLON-DEFINITION MEMORY-SPACE FLAG STACK-DIAGRAM -- 1ST )
Mark the end of a colon definition's stack diagram. Compile the stack diagram into the name space of the current definition and place a copy of the input parameter list onto the compiler data type heap. Re-enter compilation state. Restore MEMORY-SPACE as the current memory space. An exception is thrown if the current definition already has a stack diagram, or if the stack diagram is invalid.
Note: FLAG is assumed to be TRUE. COLON-DEFINITION is assumed to be the current definition.
)' ( MEMORY-SPACE FLAG STACK-DIAGRAM "<spaces>name" -- DEFINITION )
Mark the end of a definition's stack diagram. Store FLAG in STATE. Restore MEMORY-SPACE as the current memory space. Skip leading space delimiters. Parse name delimited by a space. Find name and return DEFINITION, 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.
)CAST ( MEMORY-SPACE FLAG STACK-DIAGRAM -- )
Mark the end of a stack diagram STACK-DIAGRAM. Restore the compilation state indicated by FLAG. Restore MEMORY-SPACE as the current memory space. If FLAG is false, change the interpreter data type heap according to the stack effect of STACK-DIAGRAM. If FLAG is true, change the compiler data type heap according to the stack effect of STACK-DIAGRAM. The data stack remains unchanged.
Note: )CAST is an immediate word. It does not compile any execution semantics if used in compilation state. )CAST 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.
)PROCREATES ( MEMORY-SPACE FLAG STACK-DIAGRAM "<spaces>name" -- )
Mark the end of a stack diagram STACK-DIAGRAM. Drop FLAG. Restore MEMORY-SPACE as the current memory space. Skip leading space delimiters. Parse name delimited by a space. Create a definition with name name that identifies a new data type. The new data type is a direct subtype of TOKEN. It is called a qualified token. Create another definition with name EXECUTE, whose stack diagram is a copy of STACK-DIAGRAM, supplemented with the just created qualified token as the last input parameter.
Execution: name ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter
with the data type of the qualified token.
Execution: EXECUTE ( x0 ... xm name -- y0 ... yn )
Execute the word specified by the qualified token
name. The word's stack diagram has to match the stack
diagram that was supplied to )PROCREATES.
x0 ... xm are the input parameters of the stack diagram.
y0 ... yn are the output parameters of the stack diagram.
* ( INTEGER UNSIGNED -- 1ST )
Multiply INTEGER by UNSIGNED giving the product 1ST. 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.
* ( SIGNED SIGNED -- 1ST )
Multiply two SIGNED numbers giving the product 1ST. Note that the multiplicand as well as the multiplicator are signed. The result has the same data type as the multiplicand.
* ( INTEGER-DOUBLE UNSIGNED -- 1ST )
Multiply INTEGER-DOUBLE by UNSIGNED giving the double-precision product 1ST. Note that the multiplicand can be any integer (signed or unsigned), while the multiplicator is unsigned.
* ( SIGNED-DOUBLE SIGNED -- 1ST )
Multiply SIGNED-DOUBLE by SIGNED giving the double-precision product 1ST. Note that the multiplicand as well as the multiplicator are signed. The result has the same data type as the multiplicand.
*/ ( UNSIGNED UNSIGNED UNSIGNED -- 1ST )
Multiply the first UNSIGNED by the second UNSIGNED producing an intermediate unsigned double-precision result. Divide the intermediate result by the third UNSIGNED giving the unsigned single-precision quotient 1ST. An exception is thrown if the third UNSIGNED is zero. An ambiguous condition exists if the quotient 1ST lies outside the range of an unsigned single-precision number.
*/ ( SIGNED SIGNED SIGNED -- 1ST )
Multiply the first SIGNED by the second SIGNED producing an intermediate signed double-precision result. Divide the intermediate result by the third SIGNED giving the signed single-precision quotient 1ST. An exception is thrown if the third SIGNED is zero. An ambiguous condition exists if the quotient 1ST lies outside the range of a signed single-precision number.
*/ ( UNSIGNED-DOUBLE UNSIGNED UNSIGNED -- 1ST )
Multiply UNSIGNED-DOUBLE by the first UNSIGNED producing an intermediate unsigned triple-precision result. Divide the intermediate result by the second UNSIGNED giving the unsigned double-precision quotient 1ST. An exception is thrown if the second UNSIGNED is zero. An ambiguous condition exists if the quotient 1ST lies outside of the range of an unsigned double-precision number.
*/ ( SIGNED-DOUBLE SIGNED SIGNED -- 1ST )
Multiply SIGNED-DOUBLE by the first SIGNED producing an intermediate unsigned triple-precision result. Divide the intermediate result by the second SIGNED giving the signed double-precision quotient 1ST. An exception is thrown if the second SIGNED is zero. An ambiguous condition exists if the second SIGNED is negative, or if the quotient 1ST lies outside of the range of a signed double-precision number.
*/MOD ( UNSIGNED UNSIGNED UNSIGNED -- 3RD 1ST )
Multiply the first UNSIGNED by the second UNSIGNED producing an intermediate unsigned double-precision result. Divide the intermediate result by the third UNSIGNED giving the unsigned single-precision remainder 3RD and the unsigned single-precision quotient 1ST. An exception is thrown if the third UNSIGNED is zero. An ambiguous condition exists if the quotient 1ST lies outside the range of an unsigned single-precision number.
*/MOD ( SIGNED SIGNED SIGNED -- 3RD 1ST )
Multiply the first SIGNED by the second SIGNED producing an intermediate signed double-precision result. Divide the intermediate result by the third SIGNED giving the signed single-precision remainder 3RD and the signed single-precision quotient 1ST. An exception is thrown if the third SIGNED is zero. An ambiguous condition exists if the quotient 1ST lies outside the range of a signed single-precision number.
*/MOD ( UNSIGNED-DOUBLE UNSIGNED UNSIGNED -- 3RD 1ST )
Multiply UNSIGNED-DOUBLE by the first UNSIGNED producing an intermediate unsigned triple-precision result. Divide the intermediate result by the second UNSIGNED giving the unsigned single-precision remainder 3RD and the unsigned double-precision quotient 1ST. An exception is thrown if the second UNSIGNED is zero. An ambiguous condition exists if the quotient 1ST lies outside of the range of an unsigned double-precision number.
+ ( INTEGER INTEGER -- 1ST )
Add the second INTEGER to the first INTEGER, giving the sum 1ST.
+ ( ADDRESS INTEGER -- 1ST )
Add INTEGER to ADDRESS, giving the sum 1ST.
+ ( ADDRESS -> SINGLE INTEGER -- 1ST )
Add INTEGER to ADDRESS -> SINGLE, giving the sum 1ST. Since ADDRESS points to a cell, INTEGER is automatically multiplied with the number of address units per cell before the actual addition takes place.
+ ( ADDRESS -> DOUBLE INTEGER -- 1ST )
Add INTEGER to ADDRESS -> DOUBLE, giving the sum 1ST. Since ADDRESS points to a double cell, INTEGER is automatically multiplied with the number of address units per double cell before the actual addition takes place.
+ ( CADDRESS INTEGER -- 1ST )
Add INTEGER to address CADDRESS, giving the sum 1ST. Since CADDRESS points to an item of character size, INTEGER is automatically multiplied with the number of address units per character before the actual addition takes place.
+ ( INTEGER-DOUBLE INTEGER-DOUBLE -- 1ST )
Add the second INTEGER-DOUBLE to the first INTEGER-DOUBLE, giving the sum 1ST.
+ ( INTEGER-DOUBLE INTEGER -- 1ST )
Add UNSIGNED with zero extension to INTEGER-DOUBLE, giving the double-precision sum 1ST.
+ ( INTEGER-DOUBLE SIGNED -- 1ST )
Add SIGNED with sign extension to INTEGER-DOUBLE, giving the double-precision sum 1ST.
+ ( FAR-ADDRESS INTEGER -- 1ST )
Add INTEGER to FAR-ADDRESS, giving the sum 1ST.
+ ( FAR-ADDRESS -> SINGLE INTEGER -- 1ST )
Add INTEGER to FAR-ADDRESS -> SINGLE, giving the sum 1ST. Since FAR-ADDRESS points to a cell, INTEGER is automatically multiplied with the number of address units per cell before the actual addition takes place.
+ ( FAR-ADDRESS -> DOUBLE INTEGER -- 1ST )
Add INTEGER to FAR-ADDRESS -> DOUBLE, giving the sum 1ST. Since FAR-ADDRESS points to a double cell, INTEGER is automatically multiplied with the number of address units per double cell before the actual addition takes place.
+ ( CFAR-ADDRESS INTEGER -- 1ST )
Add INTEGER to CFAR-ADDRESS, giving the sum 1ST. Since CFAR-ADDRESS points to an item of character size, INTEGER is automatically multiplied with the number of address units per character before the actual addition takes place.
+! ( INTEGER DATA -> INTEGER -- )
Add INTEGER to the integer at address DATA -> INTEGER.
+! ( INTEGER-DOUBLE DATA -> INTEGER-DOUBLE -- )
Add INTEGER-DOUBLE to the double-precision integer at address DATA -> INTEGER-DOUBLE.
+! ( INTEGER DATA -> INTEGER-DOUBLE -- )
Add INTEGER with zero extension to the double-precision integer at address DATA -> INTEGER-DOUBLE.
+! ( SIGNED DATA -> INTEGER-DOUBLE -- )
Add SIGNED with sign extension to the double-precision integer at address DATA -> INTEGER-DOUBLE.
+! ( INTEGER CDATA -> INTEGER -- )
Add INTEGER to the character size integer at address CDATA -> INTEGER.
+! ( INTEGER DATA -> ADDRESS -- )
Add INTEGER to the address stored at address DATA -> ADDRESS.
+! ( INTEGER DATA -> ADDRESS -> SINGLE -- )
Add INTEGER to the address stored at address DATA -> ADDRESS -> SINGLE. Since ADDRESS points to a cell, INTEGER is automatically multiplied with the number of address units per cell before the actual addition takes place.
+! ( INTEGER DATA -> ADDRESS -> DOUBLE -- )
Add INTEGER to the address stored at address DATA -> ADDRESS -> DOUBLE. Since ADDRESS points to a double cell, INTEGER is automatically multiplied with the number of address units per double cell before the actual addition takes place.
+! ( INTEGER DATA -> CADDRESS -- )
Add INTEGER to the address stored at address DATA -> CADDRESS. Since CADDRESS points to an item of character size, INTEGER is automatically multiplied with the number of address units per character before the actual addition takes place.
+! ( INTEGER DATA -> FAR-ADDRESS -- )
Add INTEGER to the address stored at address DATA -> FAR-ADDRESS.
+! ( INTEGER DATA -> FAR-ADDRESS -> SINGLE -- )
Add INTEGER to the address stored at address DATA -> FAR-ADDRESS -> SINGLE. Since FAR-ADDRESS points to a cell, INTEGER is automatically multiplied with the number of address units per cell before the actual addition takes place.
+! ( INTEGER DATA -> FAR-ADDRESS -> DOUBLE -- )
Add INTEGER to the address stored at address DATA -> FAR-ADDRESS -> DOUBLE. Since FAR-ADDRESS points to a double cell, INTEGER is automatically multiplied with the number of address units per double cell before the actual addition takes place.
+! ( INTEGER DATA -> FAR-CADDRESS -- )
Add INTEGER to the address stored at address DATA -> CFAR-ADDRESS. Since CFAR-ADDRESS points to an item of character size, INTEGER is automatically multiplied with the number of address units per character before the actual addition takes place.
+LOOP ( LOOP-ORIGIN -- )
Interpretation:
An exception is thrown if +LOOP is interpreted.
Compilation:
Append the runtime semantics given below to the current definition.
Resolve both the forward and the backward reference
of LOOP-ORIGIN. 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 LOOP-ORIGIN was created.
Runtime: ( INTEGER -- ) ( R: loop-sys1 -- | loop-sys2 )
An ambiguous condition exists if the loop control parameters are unavailable.
Add INTEGER* 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.
* Note: +LOOP takes regard of the data type of the loop index. If the loop index is an address of a cell, INTEGER 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, INTEGER 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, INTEGER is multiplied with the size of a character in address units before it is added to the loop index.
+LOOP is an immediate word.
+PARAM ( DEFINITION UNSIGNED -- 1ST 2ND )
Starting at the basic data type with index UNSIGNED, find the beginning of the next compound data type, or the end of the parameter list of DEFINITION. Return this index as 2ND. All indexes start with 0. An ambiguous condition exists if UNSIGNED is greater than the length of the parameter list.
+TO ( "<spaces>name" -- )
Interpretation: ( x "<spaces>name" -- )
Skip leading spaces. Parse name delimited by a space.
Add x to name using a suitable version of +!.
An exception is thrown if name was not defined by
VALUE.
Compilation:
Skip leading spaces. Parse name delimited by a space.
Append the runtime semantics given below to the current definition.
An exception is thrown if name was not defined by
either VALUE or LOCAL,.
Runtime: ( x -- )
Add x to name using a suitable version of
+!.
Note: x can be any data type for which an overloaded version of +! exists.
+TO is an immediate word.
, ( SINGLE -- )
Reserve one cell in the current memory space and store SINGLE in the cell. If the first unused address of the current memory space is aligned prior to execution of ,, it will remain aligned when , finishes execution. An ambiguous condition exists if the first unused address of the current memory space is not aligned prior to execution of ,. An exception is thrown if the current memory space overflows.
, ( DOUBLE -- )
Reserve two cells in the current memory space and store DOUBLE in the cells. If the first unused address of the current memory space is aligned prior to execution of ,, it will remain aligned when , finishes execution. An ambiguous condition exists if the first unused address of the current memory space is not aligned prior to execution of ,. An exception is thrown if the current memory space overflows.
- ( INTEGER INTEGER -- 1ST )
Subtract the second INTEGER from the first INTEGER, giving the difference 1ST.
- ( ADDRESS INTEGER -- 1ST )
Subtract INTEGER from ADDRESS, giving the difference 1ST.
- ( ADDRESS -> SINGLE INTEGER -- 1ST )
Subtract INTEGER from ADDRESS -> SINGLE, giving the difference 1ST. Since ADDRESS points to a cell, INTEGER is automatically multiplied with the number of address units per cell before the actual subtraction takes place.
- ( ADDRESS -> DOUBLE INTEGER -- 1ST )
Subtract INTEGER from ADDRESS -> DOUBLE, giving the difference 1ST. Since ADDRESS points to a double cell, INTEGER is automatically multiplied with the number of address units per double cell before the actual subtraction takes place.
- ( CADDRESS INTEGER -- 1ST )
Subtract INTEGER from CADDRESS, giving the difference 1ST. Since CADDRESS points to an item of character size, INTEGER is automatically multiplied with the number of address units per character before the actual subtraction takes place.
- ( INTEGER-DOUBLE INTEGER-DOUBLE -- 1ST )
Subtract the second INTEGER-DOUBLE from the first INTEGER-DOUBLE, giving the difference 1ST.
- ( INTEGER-DOUBLE INTEGER -- 1ST )
Subtract INTEGER with zero extension from INTEGER-DOUBLE, giving the double-precision difference 1ST.
- ( INTEGER-DOUBLE SIGNED -- 1ST )
Subtract SIGNED with sign extension from INTEGER-DOUBLE, giving the double-precision difference 1ST.
- ( FAR-ADDRESS INTEGER -- 1ST )
Subtract INTEGER from FAR-ADDRESS, giving the difference 1ST.
- ( FAR-ADDRESS -> SINGLE INTEGER -- 1ST )
Subtract INTEGER from FAR-ADDRESS -> SINGLE, giving the difference 1ST. Since FAR-ADDRESS points to a cell, INTEGER is automatically multiplied with the number of address units per cell before the actual subtraction takes place.
- ( FAR-ADDRESS -> DOUBLE INTEGER -- 1ST )
Subtract INTEGER from FAR-ADDRESS -> DOUBLE, giving the difference 1ST. Since FAR-ADDRESS points to a double cell, INTEGER is automatically multiplied with the number of address units per double cell before the actual subtraction takes place.
- ( CFAR-ADDRESS INTEGER -- 1ST )
Subtract INTEGER from CFAR-ADDRESS, giving the difference 1ST. Since CFAR-ADDRESS points to an item of character size, INTEGER is automatically multiplied with the number of address units per character before the actual subtraction takes place.
- ( ADDRESS 1ST -- SIGNED )
Subtract 1ST from ADDRESS, giving the difference SIGNED.
- ( ADDRESS -> SINGLE 1ST -- SIGNED )
Subtract 1ST from ADDRESS -> SINGLE, giving the intermediate difference n. Since ADDRESS points to a cell, the result SIGNED is equal to n divided by the number of address units per cell.
- ( ADDRESS -> DOUBLE 1ST -- SIGNED )
Subtract 1ST from ADDRESS -> DOUBLE, giving the intermediate difference n. Since ADDRESS points to a double cell, the result SIGNED is equal to n divided by the number of address units per double cell.
- ( CADDRESS 1ST -- SIGNED )
Subtract 1ST from address CADDRESS, giving the intermediate difference n. Since CADDRESS points to an item of character size, the result SIGNED is equal to n divided by the number of address units per character.
-- ( STACK-DIAGRAM -- 1ST )
Remove the input parameter attribute and add the output parameter attribute of STACK-DIAGRAM, giving 1ST.
-- is used in a stack diagram to separate input and output parameters. An exception is thrown if -- is preceded by -> or if it is used more than once within the same stack diagram.
-> ( "<spaces>name" x -- y )
Skip leading space delimiters. Parse name delimited by a space. Convert x to y, where x is any data type and y is a compound data type created by appending the basic data type identified by name to the data type of x. An exception is thrown if name is not the name of a data type.
-> is an immediate word.
-> ( STACK-DIAGRAM -- 1ST )
Add the prefix attribute to STACK-DIAGRAM, giving 1ST. An exception is thrown if STACK-DIAGRAM is a null data type or if it's prefix attribute is already set.
-> is used in a stack diagram to create compound data types as input or output parameters.
-BRANCH ( SINGLE 1ST -- 1ST )
If SINGLE is not equal to 1ST, branch forward or backward within the current definition. Otherwise continue execution. Return SINGLE as 1ST.
-BRANCH is an internal definition compiled by OF.
-RESOLVE ( CONST -- )
Resolve a backward reference in virtual machine code by compiling the (negative) offset in address units from the first unused address of the constant data space to CONST. An exception is thrown if the constant data space overflows.
-TRAILING ( CDATA -> CHARACTER UNSIGNED -- 1ST 3RD )
If UNSIGNED is greater than zero, 3RD is equal to UNSIGNED less the number of spaces at the end of the character string specified by CDATA -> CHARACTER UNSIGNED. If UNSIGNED is zero or the entire string consists of spaces, 3RD is zero.
. ( DOUBLE -- )
Display DOUBLE as an unsigned double-precision number in free field format.
. ( SIGNED-DOUBLE -- )
Display SIGNED-DOUBLE as a signed double-precision number in free field format.
. ( SINGLE -- )
Display SINGLE as an unsigned number in free field format.
. ( SIGNED -- )
Display SIGNED as a signed number in free field format.
. ( CHARACTER -- )
If CHARACTER is a graphic character in the ASCII character set, display CHARACTER. The effect of . for all other values of CHARACTER is undefined.
. ( FLAG -- )
Display TRUE and a trailing space if FLAG is true. Display FALSE and a trailing space if FLAG is false.
. ( DATA-TYPE -- )
Display the name of DATA-TYPE as a character string, followed by a space.
." ( -- )
Interpretation: ( "ccc<quote>" -- )
Parse ccc delimited by " (double-quote).
Display ccc.
Compilation: ( "ccc<quote>" -- )
Parse ccc delimited by " (double-quote).
Append the runtime semantics given below to the current definition.
Runtime: ( -- )
Display ccc.
." is an immediate word.
.( ( -- )
Interpretation: ( "ccc<right-paren>" -- )
Parse ccc delimited by ) (right parenthesis).
Display ccc.
Compilation: ( "ccc<right-paren>" -- )
Parse ccc delimited by ) (right parenthesis).
Append the runtime semantics given below to the current definition.
Runtime: ( -- )
Display ccc.
.( is an immediate word.
.R ( DOUBLE INTEGER -- )
Display DOUBLE as an unsigned double-precision number right aligned in a field INTEGER characters wide. INTEGER is assumed to be a signed number. If INTEGER is not positive or the number of characters required to display DOUBLE is greater than INTEGER, all digits are displayed with no leading spaces in a field as wide as necessary.
.R ( SIGNED-DOUBLE INTEGER -- )
Display SIGNED-DOUBLE as a signed double-precision number right aligned in a field INTEGER characters wide. INTEGER is assumed to be a signed number. If INTEGER is not positive or the number of characters required to display SIGNED-DOUBLE is greater than INTEGER, all digits are displayed with no leading spaces in a field as wide as necessary.
.R ( SINGLE INTEGER -- )
Display SINGLE as an unsigned number right aligned in a field INTEGER characters wide. INTEGER is assumed to be a signed number. If INTEGER is not positive or the number of characters required to display SINGLE is greater than INTEGER, all digits are displayed with no leading spaces in a field as wide as necessary.
.R ( SIGNED INTEGER -- )
Display SIGNED as a signed number right aligned in a field INTEGER characters wide. INTEGER is assumed to be a signed number. If INTEGER is not positive or the number of characters required to display SIGNED is greater than INTEGER, all digits are displayed with no leading spaces in a field as wide as necessary.
.S ( -- )
Display the data types on the data type heap. In interpretation state, the interpreter data type heap is used. In compilation state, the compiler data type heap is used.
Other than ANS Forth, .S does not display the values of the items on the data stack.
.S is an immediate word.
/ ( UNSIGNED UNSIGNED -- 1ST )
Divide the first UNSIGNED by the second UNSIGNED, giving the unsigned quotient 1ST. An exception is thrown if the second UNSIGNED is zero.
/ ( SIGNED SIGNED -- 1ST )
Divide the first SIGNED by the second SIGNED, giving the signed quotient 1ST. An exception is thrown if the second SIGNED is zero. If both operands differ in sign, the result returned will be the same as that returned by the phrase SWAP S>D SWAP SM/REM SWAP DROP.
/ ( UNSIGNED-DOUBLE UNSIGNED -- 1ST )
Divide UNSIGNED-DOUBLE by UNSIGNED, giving the unsigned double-precision quotient 1ST. An exception is thrown if UNSIGNED is zero.
/MOD ( UNSIGNED UNSIGNED -- 2ND 1ST )
Divide the first UNSIGNED by the second UNSIGNED, giving the unsigned remainder 2ND and the unsigned quotient 1ST. An exception is thrown if the second UNSIGNED is zero.
/MOD ( SIGNED SIGNED -- 2ND 1ST )
Divide the first SIGNED by the second SIGNED, giving the signed remainder 2ND and the signed quotient 1ST. An exception is thrown if the second UNSIGNED is zero. If both operands differ in sign, the result returned will be the same as that returned by the phrase SWAP S>D SWAP SM/REM.
/MOD ( UNSIGNED-DOUBLE UNSIGNED -- 2ND 1ST )
Divide UNSIGNED-DOUBLE by UNSIGNED, giving the unsigned single-precision remainder 2ND and the unsigned double-precision quotient 1ST. An exception is thrown if UNSIGNED is zero.
/STRING ( CDATA -> CHARACTER UNSIGNED INTEGER -- 1ST 3RD )
Adjust the character string at CDATA -> CHARACTER with length UNSIGNED by INTEGER characters. The resulting character string, specified by 1ST 3RD, begins at CDATA -> CHARACTER plus INTEGER characters and is UNSIGNED minus INTEGER characters long.
/STRING ( CDATA -> CHARACTER UNSIGNED -- 1ST 3RD )
Adjust the character string at CDATA -> CHARACTER with length UNSIGNED by one character. The resulting character string, specified by 1ST 3RD, begins at CDATA -> CHARACTER plus one character and is UNSIGNED minus one characters long.
0 ( -- UNSIGNED )
UNSIGNED is 0.
0< ( SIGNED -- FLAG )
FLAG is true if and only if SIGNED is less than zero.
0< ( SIGNED-DOUBLE -- FLAG )
FLAG is true if and only if SIGNED-DOUBLE is less than zero.
0<> ( SINGLE -- FLAG )
FLAG is true if and only if SINGLE is not equal to zero.
0<> ( DOUBLE -- FLAG )
FLAG is true if and only if DOUBLE is not equal to zero.
0= ( SINGLE -- FLAG )
FLAG is true if and only if SINGLE is equal to zero.
0= ( DOUBLE -- FLAG )
FLAG is true if and only if DOUBLE is equal to zero.
0> ( SIGNED -- FLAG )
FLAG is true if and only if SIGNED is greater than zero.
0> ( SIGNED-DOUBLE -- FLAG )
FLAG is true if and only if SIGNED-DOUBLE is greater than zero.
0BRANCH ( SINGLE -- )
If SINGLE is zero, branch forward or backward within the current definition. Otherwise continue execution.
0BRANCH is an internal definition compiled by IF and UNTIL.
1 ( -- UNSIGNED )
UNSIGNED is 1.
1+ ( INTEGER -- 1ST )
Add one (1) to INTEGER giving 1ST.
1+ ( ADDRESS -- 1ST )
Add one (1) to ADDRESS giving 1ST.
1+ ( ADDRESS -> SINGLE -- 1ST )
Add the number of address units per cell to ADDRESS -> SINGLE giving 1ST.
1+ ( ADDRESS -> DOUBLE -- 1ST )
Add the number of address units per double cell to ADDRESS -> DOUBLE giving 1ST.
1+ ( CADDRESS -- 1ST )
Add the number of address units per character to CADDRESS giving 1ST.
1+ ( FAR-ADDRESS -- 1ST )
Add one (1) to FAR-ADDRESS giving 1ST.
1+ ( FAR-ADDRESS -> SINGLE -- 1ST )
Add the number of address units per cell to FAR-ADDRESS -> SINGLE giving 1ST.
1+ ( FAR-ADDRESS -> DOUBLE -- 1ST )
Add the number of address units per double cell to FAR-ADDRESS -> DOUBLE giving 1ST.
1+ ( CFAR-ADDRESS -- 1ST )
Add the number of address units per character to CFAR-ADDRESS giving 1ST.
1+ ( INTEGER-DOUBLE -- 1ST )
Add one (1) to INTEGER-DOUBLE giving 1ST.
1- ( INTEGER -- 1ST )
Subtract one (1) from INTEGER giving 1ST.
1- ( ADDRESS -- 1ST )
Subtract one (1) from ADDRESS giving 1ST.
1- ( ADDRESS -> SINGLE -- 1ST )
Subtract the number of address units per cell from ADDRESS -> SINGLE giving 1ST.
1- ( ADDRESS -> DOUBLE -- 1ST )
Subtract the number of address units per double cell from ADDRESS -> DOUBLE giving 1ST.
1- ( CADDRESS -- 1ST )
Subtract the number of address units per character from CADDRESS giving 1ST.
1- ( FAR-ADDRESS -- 1ST )
Subtract one (1) from FAR-ADDRESS giving 1ST.
1- ( FAR-ADDRESS -> SINGLE -- 1ST )
Subtract the number of address units per cell from FAR-ADDRESS -> SINGLE giving 1ST.
1- ( FAR-ADDRESS -> DOUBLE -- 1ST )
Subtract the number of address units per double cell from FAR-ADDRESS -> DOUBLE giving 1ST.
1- ( CFAR-ADDRESS -- 1ST )
Subtract the number of address units per character from CFAR-ADDRESS giving 1ST.
1- ( INTEGER-DOUBLE -- 1ST )
Subtract one (1) from INTEGER-DOUBLE giving 1ST.
1ST ( STACK-DIAGRAM -- 1ST )
1ST is used in a stack diagram to specify input or output parameters which should have exactly the same data type as the first data type in the input parameter list of the same definition.
An exception is thrown if the input parameter list is empty.
2* ( INTEGER -- 1ST )
Multiply INTEGER by 2 giving the product 1ST. Note that 2* may only be used on integer values. Use LSHIFT for shifting bits to the left.
2* ( INTEGER-DOUBLE -- 1ST )
Multiply INTEGER-DOUBLE by 2 giving the product 1ST.
2/ ( UNSIGNED -- 1ST )
Divide UNSIGNED by 2 giving the quotient 1ST. Note that 2/ may only be used on unsigned numbers. Use RSHIFT for shifting bits to the right.
2/ ( SIGNED -- 1ST )
Divide SIGNED by 2 giving the quotient 1ST. Note that 2/ may only be used on signed numbers. Use RSHIFT for shifting bits to the right.
2/ ( UNSIGNED-DOUBLE -- 1ST )
Divide UNSIGNED-DOUBLE by 2 giving the quotient 1ST.
2/ ( SIGNED-DOUBLE -- 1ST )
Divide SIGNED-DOUBLE by 2 giving the quotient 1ST.
2ND ( STACK-DIAGRAM -- 1ST )
2ND is used in a stack diagram to specify input or output parameters which should have exactly the same data type as the second data type in the input parameter list of the same definition. Since the second basic data type of the input parameter list can be a part of the first input parameter, it is possible to build a reference to the tail of a compound data type representing the first input parameter.
An exception is thrown if the input parameter list contains less than two basic data types or if the second basic data type is itself a reference.
3RD ( STACK-DIAGRAM -- 1ST )
3RD is used in a stack diagram to specify input or output parameters which should have exactly the same data type as the third data type in the input parameter list of the same definition. Since the third basic data type of the input parameter list can be a part of the first or second input parameter, it is possible to build a reference to only the tail of a compound data type representing the first or second input parameter.
An exception is thrown if the input parameter list contains less than three basic data types or if the third basic data type is itself a reference.
: ( "<spaces>name" -- COLON-DEFINITION )
Skip leading space delimiters. Parse name delimited by a space. Create a definition for name, called a colon definition. Enter compilation state and initialize the compiler data type heap and the local name space. Start the current definition, producing COLON-DEFINITION. Append the initiation semantics given below to the current definition.
The execution semantics of name will be determined by the words compiled into the body of the definition. The current definition can not be found in the dictionary until it is finished or until the execution of DOES> or ;CODE.
Initiation: ( -- ) ( R: -- nest-sys )
Save information nest-sys about the calling definition.
name Execution: ( -- )
Execute the definition name.
Note that the new definition does have no stack effects by default. Stack effects have to be specified separately if they are intended. By using a stack diagram phrase ( ... -- ... ) immediately following : and the definition name, the new definition is modified to incorporate stack effects.
:NONAME ( -- DEFINITION COLON-DEFINITION )
Create a definition DEFINITION, called a colon definition. Enter compilation state and initialize the compiler data type heap and the local name space. Start the current definition, producing COLON-DEFINITION. Append the initiation semantics given below to the current definition.
The execution semantics of DEFINITION will be determined by the words compiled into the body of the definition.
Initiation: ( -- ) ( R: -- nest-sys )
Save information nest-sys about the calling definition.
Execution: ( -- )
Execute the definition specified by definition.
Note that the new definition does have no stack effects by default. Stack effects have to be specified separately if they are intended. By using a stack diagram phrase ( ... -- ... ) immediately following :NONAME, the new definition is modified to incorporate stack effects.
; ( COLON-DEFINITION -- )
Interpretation:
An exception is thrown if ; is interpreted.
Compilation:
Append the runtime semantics given below to the current definition.
End the current definition and enter interpretation state,
consuming COLON-DEFINITION. Re-initialize the local name space.
Lock the compiler data type heap.
An exception is thrown if the contents of the compiler data type heap
does not exactly match the output parameters of the current definition.
Runtime: ( -- ) ( R: nest-sys -- )
If the compiler data type heap is not locked, return to the calling
definition specified by nest-sys.
; is an immediate word.
< ( INTEGER 1ST -- FLAG )
FLAG is true if and only if INTEGER is less than 1ST.
< ( SIGNED 1ST -- FLAG )
FLAG is true if and only if SIGNED is less than 1ST.
< ( ADDRESS 1ST -- FLAG )
FLAG is true if and only if ADDRESS is less than 1ST.
< ( INTEGER-DOUBLE 1ST -- FLAG )
FLAG is true if and only if INTEGER-DOUBLE is less than 1ST.
< ( SIGNED-DOUBLE 1ST -- FLAG )
FLAG is true if and only if SIGNED-DOUBLE is less than 1ST.
<# ( DOUBLE -- NUMBER-DOUBLE )
Initialize pictured numeric output conversion.
<> ( SINGLE 1ST -- FLAG )
FLAG is true if and only if SINGLE is not bit-for-bit identical with 1ST.
<> ( DOUBLE 1ST -- FLAG )
FLAG is true if and only if DOUBLE is not bit-for-bit identical with 1ST.
<DIAGRAM ( FLAG STACK-DIAGRAM -- 2ND )
Finish the creation of a stack diagram STACK-DIAGRAM and begin processing it. Store FLAG in STATE. An exception is thrown if the stack diagram is invalid.
<VALUE ( "<spaces>name" -- MEMORY-SPACE STACK-DIAGRAM )
Skip leading space delimiters. Parse name delimited by a space. Create a new definition for name in the dictionary and make it the latest definition.An exception is thrown if <VALUE is executed in compilation state. Save the current memory space as MEMORY-SPACE and make the name space the current memory space. STACK-DIAGRAM is a null stack diagram.
Note that <VALUE does not to create a complete definition.
<VALUE and VALUE> are used by CONSTANT, VARIABLE and VALUE.
= ( SINGLE 1ST -- FLAG )
FLAG is true if and only if SINGLE is bit-for-bit identical with 1ST.
= ( DOUBLE 1ST -- FLAG )
FLAG is true if and only if DOUBLE is bit-for-bit identical with 1ST.
> ( INTEGER 1ST -- FLAG )
FLAG is true if and only if INTEGER is greater than 1ST.
> ( SIGNED 1ST -- FLAG )
FLAG is true if and only if SIGNED is greater than 1ST.
> ( ADDRESS 1ST -- FLAG )
FLAG is true if and only if ADDRESS is greater than 1ST.
> ( INTEGER-DOUBLE 1ST -- FLAG )
FLAG is true if and only if INTEGER-DOUBLE is greater than 1ST.
> ( SIGNED-DOUBLE 1ST -- FLAG )
FLAG is true if and only if SIGNED-DOUBLE is greater than 1ST.
>BODY ( DEFINITION -- CONST )
CONST is the address of the data field of DEFINITION.
>CODE ( DEFINITION -- CONST -> CODE )
CONST -> CODE is the address of the code field of DEFINITION.
>DT ( DATA-TYPE -- )
Move the basic data type DATA-TYPE onto the data type heap. In interpretation state, the interpreter data type heap is used. In compilation state, the compiler data type heap is used. An exception is thrown if the data type heap overflows.
>IN ( -- DATA -> UNSIGNED )
DATA -> UNSIGNED is the address of a cell containing the offset in characters from the start of the input buffer to the start of the parse area.
>NUMBER ( INTEGER-DOUBLE CDATA -> CHARACTER UNSIGNED -- 1ST 2ND 4 TH )
1ST is the unsigned result of converting the characters within the string specified by CDATA -> CHARACTER UNSIGNED into digits, and adding each into INTEGER-DOUBLE after multiplying INTEGER-DOUBLE by the number-conversion radix in BASE. Conversion continues left-to-right until a character that is not convertible, including any + or -, is encountered or the string is entirely converted. 2ND is the location of the first unconverted character or the first character past the end of the string if the string was entirely converted. 4 TH is the number of unconverted characters in the string.
>R ( -- R-SIZE )
Interpretation:
An exception is thrown if >R is interpreted.
Compilation:
Create a local with name R@. Append the runtime
semantics given below to the current definition.
Return R-SIZE, the size of the local in cells.
Runtime: ( SINGLE -- ) or ( DOUBLE -- )
Store SINGLE or DOUBLE into the
local R@.
>R is an immediate word.
>SIGN ( CHARACTER -- SIGNED )
SIGNED is +1 if CHARACTER is equal to '+', and -1 if CHARACTER is equal to '-'. For all other values of CHARACTER, SIGNED is 0.
?TOKEN ( DATA-TYPE "<spaces>name" -- TOKEN )
Skip leading space delimiters. Parse name delimited by a space. Find a definition called name whose stack diagram matches the stack diagram of the qualified token with respect to both input and output parameters, and return the token of this definition as TOKEN. An exception is thrown if DATA-TYPE is not the data type of a qualified token.
>TRANS ( -- DATA -> CDATA -> CHARACTER )
DATA -> CDATA -> CHARACTER is the address of a cell containing a pointer into a 34 characters long transient area. This pointer is used during pictured numeric output.
?CHECK-REFERENCES ( DEFINITION UNSIGNED 2ND -- 1ST 2ND 2ND )
Checks the references in the parameter list of DEFINITION. An exception is thrown if one of the parameters starting at the zero-based offset 2ND contains a reference to a parameter starting at the zero-based offset UNSIGNED. The values of the output parameters 1ST, 2ND and 2ND are identical to those of the respective input parameters DEFINITION, UNSIGNED and 2ND.
?CHECK-REFERENCES is used by (DOES) to ensure that the output parameter list of DEFINITION does not contain a reference to the last compound data type of the input parameter list.
?COMPILE ( -- )
Checks if in compilation state. An exception is thrown if the system is in interpretation state.
?CONGRUENT ( DEFINITION DATA -> DATA-TYPE -- )
Checks if the contents of a part of the data type heap, starting at address DATA -> DATA-TYPE and extending to the top of the heap, exactly match the output parameters of DEFINITION. The part is then removed from the data type heap. In compilation state, the compiler data type heap is used. In interpretation state, the interpreter data type heap is used. An exception is thrown if a difference is detected. ?CONGRUENT resolves data type references to the input parameters of DEFINITION.
?DATA-TYPE ( DEFINITION -- DATA-TYPE )
DATA-TYPE is the data type DEFINITION is associated with. If DEFINITION is not associated with any data type, DATA-TYPE is the null data type.
?DEFINITION ( DATA-TYPE -- DEFINITION )
DEFINITION is the definition that is associated with DATA-TYPE in the sense that DEFINITION is used in stack diagrams to specify the data type. If DATA-TYPE is not a data type, return zero as DEFINITION.
?DO ( -- LOOP-ORIGIN )
Interpretation:
An exception is thrown if ?DO is interpreted.
Compilation:
Place LOOP-ORIGIN onto the stack and save a copy of
the compiler data type heap in the local name space. Rename the loop
index I into J, if it already exists, and
define a new local I as loop index.
Append the runtime semantics given below to the current definition.
The semantics are incomplete until resolved by a consumer
of LOOP-ORIGIN such as LOOP.
Runtime: ( INTEGER 1ST -- ) ( R: -- loop-sys ) or ( ADDRESS 1ST -- ) ( R: -- loop-sys )
If the limit INTEGER or ADDRESS is equal
to the index 1ST, branch to the location given
by the consumer of LOOP-ORIGIN. Otherwise set up loop control
parameters with limit INTEGER or ADDRESS and
index 1ST, and continue execution.
?DO is an immediate word.
?EXECUTE ( -- )
Checks if in interpretation state. An exception is thrown if the system is in compilation state.
?HAS-INPUT-PARAMS ( DEFINITION -- )
Throws an exception if DEFINITION does not have any input parameters.
?IS-EXECUTE ( DEFINITION -- )
Checks whether the name of DEFINITION is "EXECUTE". An exception is thrown if DEFINITION has a different name.
?IS-EXECUTE is used by ?TOKEN.
?LOOP ( -- DATA -> DATA-TYPE )
Check whether loop control parameters are available and return the address DATA -> DATA-TYPE of the data type of the loop index of the innermost loop. An exception is thrown if ?LOOP is interpreted or if the loop control parameters are unavailable.
?NONAME ( DEFINITION -- 1ST )
Checks if DEFINITION has a name and a link field. 1ST is equal to DEFINITION. An exception is thrown if DEFINITION was defined by :NONAME.
?PARAMS ( -- )
If the data type heap is not locked, checks whether the contents of the data type heap exactly matches the output parameters of the latest definition, and then empties the data type heap. In compilation state, the compiler data type heap is used. In interpretation state, the interpreter data type heap is used. An exception is thrown if a difference is detected. ?PARAMS resolves references to the input parameters of the latest definition.
?PARAMS is used by EXIT.
?REFILL ( -- )
A dummy word to be used at the end of words that restore the input source specification, like EVALUATE and THROW.
?REFILL is a deferred definition.
?SAME-DATA-TYPE ( DATA-TYPE -- )
Remove one basic data type from the data type heap. In interpretation state, the interpreter data type heap is used. In compilation state, the compiler data type heap is used. An exception is thrown if the data type heap is empty, if the data type is the tail of a compound data type, or if the data type is not equal to DATA-TYPE.
?SAME-DATA-TYPE is used by ?TOKEN.
?SUBTOKEN ( DATA-TYPE -- )
Checks whether DATA-TYPE is a direct subtype of TOKEN. An exception is thrown if DATA-TYPE is not a direct subtype of TOKEN.
?SUBTOKEN is used by ?TOKEN.
?VALUE ( CDATA -> CHARACTER UNSIGNED -- DEFINITION )
DEFINITION is the most recent word with the name specified by the character string CDATA -> CHARACTER UNSIGNED that was defined by VALUE. An exception is thrown if the dictionary does not contain such a word.
?VALUE is a deferred definition.
@ ( DATA -> SINGLE -- 2ND )
2ND is the item stored at address DATA -> SINGLE.
@ ( DATA -> DOUBLE -- 2ND )
2ND is the double-cell item stored at address DATA -> DOUBLE.
@ ( CDATA -> SINGLE -- 2ND )
2ND is the item stored at address CDATA -> SINGLE. Since the item is assumed to have character size, while 2ND has cell size, the value of the item is extended with leading zero bits.
@ ( CDATA -> SIGNED -- 2ND )
2ND is the signed number stored at address CDATA -> SIGNED. Since the number stored at CDATA -> SIGNED is assumed to have the character size, while 2ND has cell size, the number is sign extended.
@ ( CDATA -> FLAG -- 2ND )
2ND is the flag stored at address CDATA -> FLAG. Since the flag stored at CDATA -> FLAG is assumed to have character size, while 2ND has cell size, it is extended to either FALSE or TRUE.
@ ( CONST -> SINGLE -- 2ND )
2ND is the item stored at address CCONST -> SINGLE.
@ ( CONST -> DOUBLE -- 2ND )
2ND is the double-cell item stored at address CCONST -> DOUBLE.
@ ( CCONST -> SINGLE -- 2ND )
2ND is the item stored at address CCONST -> SINGLE. Since the item is assumed to have character size, while 2ND has cell size, the value of the item is extended with leading zero bits.
@ ( CCONST -> SIGNED -- 2ND )
2ND is the signed number stored at address CCONST -> SIGNED. Since the number stored at CCONST -> SIGNED is assumed to have character size, while 2ND has cell size, the number is sign extended.
@ ( CCONST -> FLAG -- 2ND )
2ND is the flag stored at address CCONST -> FLAG. Since the flag stored at CCONST -> FLAG is assumed to have character size, while 2ND has cell size, it is extended to either FALSE or TRUE.
@ ( CODE -> SINGLE -- 2ND )
2ND is the item stored at address CODE -> SINGLE.
@ ( CODE -> DOUBLE -- 2ND )
2ND is the double-cell item stored at address CODE -> DOUBLE.
@ ( CCODE -> SINGLE -- 2ND )
2ND is the item stored at address CCODE -> SINGLE. Since the item is assumed to have character size, while 2ND has cell size, the value of the item is extended with leading zero bits.
@ ( CCODE -> SIGNED -- 2ND )
2ND is the signed number stored at address CCODE -> SIGNED. Since the number stored at CCODE -> SIGNED is assumed to have character size, while 2ND has cell size, the number is sign extended.
@ ( CCODE -> FLAG -- 2ND )
2ND is the flag stored at address CCODE -> FLAG. Since the flag stored at CCODE -> FLAG is assumed to have character size, while 2ND has cell size, the value is extended to either FALSE or TRUE.
@ ( FAR-ADDRESS -> SINGLE -- 2ND )
2ND is the item stored at address FAR-ADDRESS -> SINGLE.
@ ( FAR-ADDRESS -> DOUBLE -- 2ND )
2ND is the double-cell item stored at address FAR-ADDRESS -> DOUBLE.
@ ( CFAR-ADDRESS -> SINGLE -- 2ND )
2ND is the item stored at address CFAR-ADDRESS -> SINGLE. Since the item is assumed to have character size, while 2ND has cell size, the value of the item is extended with leading zero bits.
@ ( CFAR-ADDRESS -> SIGNED -- 2ND )
2ND is the signed number stored at address CFAR-ADDRESS -> SIGNED. Since the number stored at CFAR-ADDRESS -> SIGNED is assumed to have character size, while 2ND has cell size, the number is sign extended.
@ ( CFAR-ADDRESS -> FLAG -- 2ND )
2ND is the flag stored at address CFAR-ADDRESS -> FLAG. Since the flag stored at CFAR-ADDRESS -> FLAG is assumed to have character size, while 2ND has cell size, it is extended to either FALSE or TRUE.
@>DT ( DATA -> DATA-TYPE -- )
Place the compound data type stored at DATA -> DATA-TYPE onto the data type heap. In interpretation state, the interpreter data type heap is used. In compilation state, the compiler data type heap is used. An exception is thrown if there is not enough space on the data type heap.
ABORT ( -- )
Empty the data stack and perform the function of QUIT, which.includes emptying the return stack without displaying a message.
ABORT is a deferred definition.
ABORT" ( "ccc" -- )
Interpretation:
An exception is thrown if ABORT" is interpreted.
Compilation:
Parse ccc delimited by " (double-quote).
Append the runtime semantics given below to the current definition.
Runtime: ( SINGLE -- )
Remove SINGLE from the stack. If any bit of
SINGLE is not zero, display the character
string CCONST -> CHARACTER UNSIGNED and then perform the
function of ABORT.
ABORT" is an immediate word.
ABS ( SIGNED -- 1ST )
1ST is the absolute value of SIGNED.
ABS ( SIGNED-DOUBLE -- 1ST )
1ST is the absolute value of SIGNED-DOUBLE.
ACCEPT ( CDATA -> CHARACTER INTEGER -- 3RD )
Receive a character string of at most INTEGER characters at the address CDATA -> CHARACTER from the user input device. Display graphic characters as they are received. The usual editing functions that the system performs in order to construct the character string (backspace etc.), may be used.
Input terminates when a carriage return character is received. When input terminates, nothing is appended to the character string. The cursor advances to the beginning of the next line.
3RD is the length of the character string stored at CDATA -> CHARACTER.
ADDR ( "<spaces>name" -- )
Interpretation: ( "<spaces>name" -- DATA )
Skip leading spaces. Parse name delimited by a space.
Return the address DATA of the value of name.
An exception is thrown if name was not defined by
VALUE.
Compilation:
Skip leading spaces. Parse name delimited by a space.
Append the runtime semantics given below to the current definition.
An exception is thrown if name was not defined by
either VALUE or LOCAL,.
Runtime: ( -- DATA )
Return the address DATA of the value of name.
ADDR is an immediate word.
ADDRESS ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type ADDRESS.
AGAIN ( DESTINATION -- )
Interpretation:
An exception is thrown if AGAIN is interpreted.
Compilation:
Append the runtime semantics given below to the current definition,
resolving the backward reference DESTINATION. An exception is
thrown if the contents of the compiler data type heap do not
exactly match the copy that was saved when DESTINATION was
created.
Runtime: ( -- )
Continue execution at the location specified by DESTINATION.
If no other control flow words are used, any program code
after AGAIN will not be executed.
AGAIN is an immediate word.
AHEAD ( -- ORIGIN )
Interpretation:
An exception is thrown if AHEAD is interpreted.
Compilation:
Put the location of a new unresolved forward
reference ORIGIN onto the stack and save a copy of the
compiler data type heap in the local name space.
Append the runtime semantics given below to the current definition.
The semantics are incomplete until ORIGIN is resolved.
Runtime: ( -- )
Continue execution at the location specified by the resolution
of ORIGIN.
AHEAD is an immediate word.
ALIAS ( DEFINITION "<spaces>name1" -- )
Skip leading space delimiters. Parse name1 delimited by a space. Create a definition for name1 with the same execution semantics as DEFINITION. An exception is thrown if ALIAS is executed in compilation state.
ALIAS is typically used in the form ' name2 ALIAS ( ... -- ... ) to define an alias name or an overloaded version for an existing definition. The existing definition can be a colon-definition, a code definition or any other kind of definition. The stack diagrams of the existing definition and the alias definition may be different.
ALIGN ( -- )
If the first unused address of the current memory space is not aligned, reserve the required number of address units to make it aligned.
ALIGNED ( ADDRESS -- 1ST )
1ST is the lowest aligned address greater than or equal to ADDRESS.
ALIGNED ( FAR-ADDRESS -- 1ST )
1ST is the lowest aligned address greater than or equal to FAR-ADDRESS.
ALL-PARAMS>DT ( DEFINITION UNSIGNED -- 1ST )
Push up to UNSIGNED data types from the input parameter list of DEFINITION onto the data type heap, starting with the first input parameter. Data type references within the input parameter list are being resolved by recursively pushing the referenced data types onto the data type heap. 1ST is equal to DEFINITION. An exception is thrown if the data type heap overflows.
ALLOT ( INTEGER -- )
If INTEGER is greater than zero, reserve INTEGER address units of the current memory space. If INTEGER is less than zero, release |integer| address units of the current memory space. If INTEGER is zero, leave the current memory space unchanged.
If the first unused address of the current memory space is aligned and INTEGER is a multiple of cell size in address units prior to execution of ALLOT, it will remain aligned when ALLOT finishes execution.
If the first unused address of the current memory space is character aligned and INTEGER is a multiple of character size in address units prior to execution of ALLOT, it will remain character aligned when ALLOT finishes execution.
ANCESTOR ( DATA-TYPE -- 1ST )
If DATA-TYPE is the null data type, or has no parent data type, 1ST is equal to DATA-TYPE. Otherwise, 1ST is the data type with no parent, from which DATA-TYPE is a direct or indirect subtype.
AND ( SINGLE LOGICAL -- 1ST )
1ST is the bit-by-bit logical and of SINGLE with LOGICAL.
AND ( DATA-TYPE DATA-TYPE -- 1ST )
1ST is the first DATA-TYPE with attributes that are the bit-by-bit logical and of the attributes of both parameters DATA-TYPE.
ATTRIBUTE? ( DATA-TYPE DATA-TYPE -- FLAG )
FLAG is true if and only if the first DATA-TYPE has at least one of the attributes of the second DATA-TYPE.
BASE ( -- DATA -> UNSIGNED )
DATA -> UNSIGNED is the address of a cell containing the current number-conversion radix (2...36).
BEGIN ( -- DESTINATION )
Interpretation:
An exception is thrown if BEGIN is interpreted.
Compilation:
Place DESTINATION
onto the stack and save a copy of the compiler data type heap in the local
name space. Append the runtime semantics given below to the current
definition.
Runtime: ( -- )
Continue execution.
BEGIN is an immediate word.
BIT ( UNSIGNED -- LOGICAL )
Bit UNSIGNED of LOGICAL is 1. All other bits of LOGICAL are 0.
BL ( -- CHARACTER )
CHARACTER is the space character.
BLANK ( CDATA -> CHARACTER UNSIGNED -- )
If UNSIGNED is greater than zero, store the character value for space in UNSIGNED consecutive character positions beginning at CDATA -> CHARACTER.
BRANCH ( -- )
Unconditionally branch forward or backward within the current definition.
BRANCH is an internal definition compiled by AGAIN, AHEAD and ENDOF.
BYE ( -- )
Terminate StrongForth and return control to the operating system.
C, ( SINGLE -- )
Reserve space for one character in the current memory space and store SINGLE in the space. If the first unused address of the current memory space is character aligned prior to execution of C,, it will remain character aligned when C, finishes execution. An ambiguous condition exists if the first unused address of the current memory space is not character aligned prior to execution of C,. Only the number of low-order bits corresponding to character size are stored in the current memory space. An exception is thrown if the current memory space overflows.
CADDRESS ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type CADDRESS.
CASE ( -- ENDOF-ORIGIN OF-ORIGIN )
Interpretation:
An exception is thrown if CASE is interpreted.
Compilation:
Mark the start of a CASE ... OF ... ENDOF ... ENDCASE structure
by putting ENDOF-ORIGIN and OF-ORIGIN onto the stack,
and save a copy of the compiler data type heap in the local name space.
Append the runtime semantics given below to the current definition.
CASE is an immediate word.
Runtime: ( -- )
Continue execution.
CAST ( "<spaces>name" x -- y )
Skip leading space delimiters. Parse name delimited by a space. Convert x to y, where x is any data type and y is the data type identified by name. If x and y have the same size, the actual bit image is not changed. If x and y have different sizes, CAST uses S>D or D>S to adjust the size of y. An exception is thrown if name is not the name of a data type, if x is a tuple and y is not a tuple, or if y is a tuple and y is not a tuple.
CAST is an immediate word.
CCODE ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type CCODE.
CCONST ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type CCONST.
CDATA ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type CDATA.
CELLS ( INTEGER -- 1ST )
1ST is the size in address units of INTEGER cells.
CFAR-ADDRESS ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type CFAR-ADDRESS.
CHAR ( "<spaces>name" -- CHARACTER )
Skip leading space delimiters. Parse name delimited by a space. Put the value of name's first character onto the stack. If the length of the parsed area is zero, put a space character onto the stack.
CHARACTER ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type CHARACTER.
CHARS ( INTEGER -- 1ST )
1ST is the size in address units of INTEGER characters.
CODE ( "<spaces>name" -- )
Skip leading space delimiters. Parse name delimited by a space. Create a code definition for name with the execution semantics defined below, and make it the latest definition. The runtime code of the code definition begins at the first unused address of the code space. An exception is thrown if CODE is executed in compilation state.
Subsequent words in the parse area typically represent source code in assembly language, generating machine code. The new code definition is not automatically added to the current compilation word list, This can be achieved by executing END-CODE after the last machine code instruction.
name Execution: ( -- )
Execute the definition name.
Note that the new definition does have no stack effects by default. Stack effects have to be specified separately if they are intended. By specifying a stack diagram ( ... -- ... ) immediately following CODE and the definition name, the new definition is modified to incorporate stack effects.
CODE ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type CODE.
CODE-HERE ( -- CODE )
CODE is the first unused address of the code space.
CODE-FIELD ( -- CODE )
CODE is the address of a machine-code subroutine that implements additional matching criteria for SEARCH and SEARCH-ALL. If register BX is zero, all definitions match. If BX is not equal to zero, a definition matches only if the content of its code field is equal to BX.
CODE-SPACE ( -- )
Select the code space as current memory space.
COLON-DEFINITION ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type COLON-DEFINITION.
COMPARE ( CDATA -> CHARACTER UNSIGNED 1ST 3RD -- SIGNED )
Compare the string specified by CDATA -> CHARACTER UNSIGNED to the string specified by 1ST 3RD. The strings are compared, beginning at the given addresses, character by character, up to the length of the shorter string or until a difference is found. If the two strings are identical, SIGNED is zero. If the two strings are identical up to the length of the shorter string, SIGNED is -1 if UNSIGNED is less than 3RD, and 1 otherwise. If the two strings are not identical up to the length of the shorter string, SIGNED is -1 if the first non-matching character in the string specified by CDATA -> CHARACTER UNSIGNED has a lesser numeric value than the corresponding character in the string specified by 1ST 3RD, and 1 otherwise.
COMPARE ( CDATA -> CHARACTER UNSIGNED CCONST -> 2ND 3RD -- SIGNED )
Compare the string specified by CDATA -> CHARACTER UNSIGNED to the string specified by CCONST -> 2ND 3RD. The strings are compared, beginning at the given addresses, character by character, up to the length of the shorter string or until a difference is found. If the two strings are identical, SIGNED is zero. If the two strings are identical up to the length of the shorter string, SIGNED is -1 if UNSIGNED is less than 3RD, and 1 otherwise. If the two strings are not identical up to the length of the shorter string, SIGNED is -1 if the first non-matching character in the string specified by CDATA -> CHARACTER UNSIGNED has a lesser numeric value than the corresponding character in the string specified by CCONST -> 2ND 3RD, and 1 otherwise.
COMPARE ( CDATA -> CHARACTER UNSIGNED CFAR-ADDRESS -> 2ND 3RD -- SIGNED )
Compare the string specified by CDATA -> CHARACTER UNSIGNED to the string specified by CFAR-ADDRESS -> 2ND 3RD. The strings are compared, beginning at the given addresses, character by character, up to the length of the shorter string or until a difference is found. If the two strings are identical, SIGNED is zero. If the two strings are identical up to the length of the shorter string, SIGNED is -1 if UNSIGNED is less than 3RD, and 1 otherwise. If the two strings are not identical up to the length of the shorter string, SIGNED is -1 if the first non-matching character in the string specified by CDATA -> CHARACTER UNSIGNED has a lesser numeric value than the corresponding character in the string specified by CFAR-ADDRESS -> 2ND 3RD, and 1 otherwise.
COMPILE, ( DEFINITION -- )
Change the compiler data type heap according to the stack effect of DEFINITION. Append the execution semantics of DEFINITION to the execution semantics of the current definition.
CONST ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type CONST.
CONST, ( SINGLE -- )
Reserve one cell in the constant data space and store SINGLE in the cell. If the first unused address of the constant data space is aligned prior to execution of CONST,, it will remain aligned when CONST, finishes execution. An exception is thrown if the constant data space overflows.
CONST, ( DOUBLE -- )
Reserve two consecutive cells in the constant data space and store DOUBLE in the cells. If the first unused address of the constant data space is aligned prior to execution of CONST,, it will remain aligned when CONST, finishes execution. An exception is thrown if the constant data space overflows.
CONST-HERE ( -- CONST )
CONST is the first unused address of the constant data space.
CONST-SPACE ( -- )
Select the constant data space as current memory space.
CONSTANT ( SINGLE "<spaces>name" -- )
Skip leading space delimiters. Parse name delimited by a space. Create a definition for name with the execution semantics defined below.
name is referred to as a constant.
Execution: ( -- SINGLE )
Place SINGLE on the stack. SINGLE has the same
data type as was supplied to CONSTANT.
CONSTANT ( DOUBLE "<spaces>name" -- )
Skip leading space delimiters. Parse name delimited by a space. Create a definition for name with the execution semantics defined below.
nameis referred to as a constant.
Execution: ( -- DOUBLE )
Place DOUBLE on the stack.
DOUBLE has the same data type as was supplied
to CONSTANT.
CONTROL-FLOW ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type CONTROL-FLOW.
CPORT ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type CPORT.
CR ( -- )
Cause subsequent output to appear at the beginning of the next line.
CREATE ( "<spaces>name" -- )
Skip leading space delimiters. Parse name delimited by a space. Create a new definition for name with the execution semantics defined below, and make it the latest definition. CREATE does not allocate memory space in the definition's data field. An exception is thrown if CREATE is executed in compilation state.
name Execution: ( -- )
Execute the definition name. The default execution semantics
of the new definition is returning the address of its data field.
CREATE-LOCAL ( CDATA -> CHARACTER UNSIGNED INTEGER -- )
Add INTEGER to #LOCALS. Create a new definition for a local in the local word list with the name specified by the string CDATA -> CHARACTER UNSIGNED. CREATE-LOCAL does not allocate space on the return stack, but it expects the data type of the local to be present on top of the data type heap. An exception is thrown if CREATE-LOCAL is executed in interpretation state.
D>S ( DOUBLE -- SINGLE )
SINGLE is the numeric equivalent of DOUBLE. An ambiguous condition exists if DOUBLE lies outside the range of a single number.
DATA ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type DATA.
DATA-HERE ( -- DATA )
DATA is the first unused address of the data space.
DATA-SPACE ( -- )
Select the data space as current memory space.
DATA-TYPE ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type DATA-TYPE.
DECIMAL ( -- )
Set the number-conversion radix to 10 (decimal).
DEFER ( "<spaces>name" -- )
Skip leading space delimiters. Parse name delimited by a space. Create a new definition for name with the execution semantics defined below, and make it the latest definition. An exception is thrown if DEFER is executed in compilation state.
name Execution: ( -- )
Execute the definition that is being assigned to name by
a succeeding execution of IS. name is called a
deferred definition. An ambiguous condition exists
if name is executed before it is being assigned an execution
semantics by IS.
Note that the new definition does have no stack effects by default. Stack effects have to be specified separately if they are intended. By using a stack diagram phrase ( ... -- ... ) immediately following DEFER and the definition name, the new definition is modified to incorporate stack effects.
DEFERRED ( -- CODE )
CODE is the address of a machine-code subroutine that implements additional matching criteria for SEARCH and SEARCH-ALL. A definition matches only if it is a deferred definition and its stack diagram is exactly the same as the stack diagram of the sample definition whose address offset is passed in register BX.
DEFINITION ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type DEFINITION.
DEPTH ( -- UNSIGNED )
UNSIGNED is the number of basic data types on the data type heap. In interpretation state, the interpreter data type heap is used. In compilation state, the compiler data type heap is used.
Note: In interpretation state, UNSIGNED includes the output parameters of the word that is currently being interpreted.
Note: In compilation state, UNSIGNED is zero if the compiler data type heap is locked.
DESTINATION ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type DESTINATION.
DIAGRAM> ( MEMORY-SPACE STACK-DIAGRAM -- )
Finish processing a stack diagram STACK-DIAGRAM. Remove the stack diagram from the local name space. Restore the current memory space to the one saved in MEMORY-SPACE.
DIGIT? ( CHARACTER -- UNSIGNED FLAG )
Converts CHARACTER into a digit UNSIGNED. Characters 0 to 9 are converted into digits 0 to 9, and characters A to Z are converted into digits 10 to 35, respectively. FLAG is true if CHARACTER is alphanumeric and the conversion result is less than the number-conversion radix BASE. Otherwise FLAG is false and the value of UNSIGNED is undefined.
Note: DIGIT? is case-sensitive.
DLIT ( -- DOUBLE )
DOUBLE is a constant double-cell literal.
DLIT is an internal definition compiled by LITERAL,.
DO ( -- LOOP-ORIGIN )
Interpretation:
An exception is thrown if DO is interpreted.
Compilation:
Place LOOP-ORIGIN onto the stack and save a copy of
the compiler data type heap in the local name space. Rename the loop
index I into J, if it already exists,
and define a new local I as loop index.
Append the runtime semantics given below to the current definition.
The semantics are incomplete until resolved by a consumer
of LOOP-ORIGIN such as LOOP.
Runtime: ( INTEGER 1ST -- ) ( R: -- loop-sys ) or ( ADDRESS 1ST -- ) ( R: -- loop-sys )
Set up loop control parameters with
limit INTEGER or ADDRESS and
index 1ST.
DO is an immediate word.
DOES, ( CONST -- )
Compile the machine code for a word created by a defining word. CONST is the data field address of the defining word's runtime part.
DOES, is used by DOES>.
DOES> ( COLON-DEFINITION -- 1ST )
Interpretation:
An exception is thrown if DOES> is interpreted.
Compilation:
Append the runtime semantics given below to the current definition.
An exception is thrown if the contents of the compiler data type heap
does not exactly match the output parameters of the current definition.
Consume COLON-DEFINITION and produce 1ST.
Append the initiation semantics given below to the current definition.
Runtime: ( R: nest-sys1 -- )
Specify the execution semantics of the most recent definition,
referred to as name, as given below. Return control to the
calling definition specified by nest-sys1.
Initiation: ( -- CONST ) ( R: -- nest-sys2 )
Save information nest-sys2 about
the calling definition. Place name's data field
address CONST on the stack.
name Execution: ( -- )
Execute the portion of the definition that begins with the initiation
semantics appended by the DOES> which modified name.
Note that name does have no stack effects by default. Stack effects have to be specified separately. By using a stack diagram phrase ( ... -- ... ) immediately following DOES>, name is modified to incorporate stack effects. Specifying a stack diagram is mandatory, because at least the data type of name's data field address has to be present. The data field address is always the last input parameter. The stack effect of name is defined by the stack diagram following DOES>, while omitting the data field address.
DOES> is an immediate word.
DOUBLE ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type DOUBLE. TUPLE is an ancestor data type.
DROP ( SINGLE -- )
Remove SINGLE from the stack.
DROP ( DOUBLE -- )
Remove DOUBLE from the stack.
DROP ( TUPLE -- )
Remove TUPLE from the stack.
DT ( "<spaces>name" -- DATA-TYPE )
Skip leading space delimiters. Parse name delimited by a space. Find name and return DATA-TYPE, the data type with the name name. An exception is thrown if name is not the name of a data type
DT+ ( DATA -> DATA-TYPE -- 1ST )
1ST is the address of the location immediately succeeding the compound data type starting at DATA -> DATA-TYPE.
DT-INPUT ( -- DATA-TYPE )
DATA-TYPE is a null data type with the input parameter attribute.
DT-OFFSET ( -- DATA-TYPE )
DATA-TYPE is a null data type containing a bit mask for the offset attribute field.
DT-OUTPUT ( -- DATA-TYPE )
DATA-TYPE is a null data type with the output parameter attribute.
DT-PREFIX ( -- DATA-TYPE )
DATA-TYPE is a null data type with the prefix attribute.
DT> ( -- DATA-TYPE FLAG )
Move the topmost basic data type DATA-TYPE of the data type heap onto the stack. In interpretation state, the interpreter data type heap is used. In compilation state, the compiler data type heap is used. FLAG is true if DATA-TYPE is the tail of a compound data type that is still on the data type heap. An exception is thrown if the data type heap is empty prior to the execution of DT>.
DT>DT ( DEFINITION FLAG -- TOKEN )
If FLAG is false, change the interpreter data type heap according to the stack effect of DEFINITION. If FLAG is true, change the compiler data type heap according to the stack effect of DEFINITION. Return TOKEN, which is the execution token of DEFINITION. An exception is thrown if the compiler data type heap is locked.
Note: DT>DT works correctly even if DEFINITION is unfinished.
DTDROP ( -- DATA-TYPE )
Remove the topmost compound data type from the data type heap. In interpretation state, the interpreter data type heap is used. In compilation state, the compiler data type heap is used. DATA-TYPE is the head of the removed compound data type. An exception is thrown if the data type heap is empty prior to the execution of DTDROP.
DTP! ( -- )
In interpretation state, empty the interpreter data type heap. In compilation state, empty and unlock the compiler data type heap.
DTP@ ( -- DATA -> DATA-TYPE )
In interpretation state, DATA -> DATA-TYPE is the interpreter data type heap pointer. In compilation state, DATA -> DATA-TYPE is the compiler data type heap pointer, or zero if the compiler data type heap is locked.
DTP| ( -- )
If in compilation state, lock the compiler data type heap. The compiler data type heap can not be used until it is unlocked by executing DTP!.
Note: DTP| is typically used after compiling BRANCH or EXIT, because these words break the continuous flow of execution.
DUP ( SINGLE -- 1ST 1ST )
Duplicate SINGLE.
DUP ( DOUBLE -- 1ST 1ST )
Duplicate DOUBLE.
ELSE ( ORIGIN -- 1ST )
Interpretation:
An exception is thrown if ELSE is interpreted.
Compilation:
Put the location of a new unresolved forward
reference 1ST onto the stack and save a copy of the compiler
data type heap in the local name space. Append the runtime semantics
given below to the current definition. The semantics are incomplete
until 1ST is resolved (e. g., by THEN).
Resolve the forward reference ORIGIN using the location
following the appended runtime semantics. Restore the compiler data
type heap to the state that was saved in the local name space
when ORIGIN was created.
Runtime: ( -- )
Continue execution at the location given by the resolution
of 1ST.
ELSE is an immediate word.
EMIT ( INTEGER -- )
If INTEGER is the ASCII code of a graphic character, display this graphic character. The effect of EMIT for all other values of INTEGER is undefined.
ENCLOSE ( CHARACTER CDATA -> 1ST UNSIGNED 4 TH -- 2ND 4 TH 4 TH 4 TH )
Parse the character string CDATA -> 1ST of length 4 TH starting at offset UNSIGNED. Return the address of the original character string 2ND, the original start offset 4 TH, the offset 4 TH of the character after the last non-delimiter character in sequence and the offset 4 TH of the first character not included in parsing.
CHARACTER is the delimiter.
ENCLOSE is used by PARSE.
ENCLOSE-DIAGRAM ( STACK-DIAGRAM --- 1ST DATA -> DATA-TYPE DATA -> DATA-TYPE )
The first DATA -> DATA-TYPE is the first unused address of the current memory space. The second DATA -> DATA-TYPE is the address of the first basic data type of a stack diagram STACK-DIAGRAM that has been compiled into the current memory space. STACK-DIAGRAM remains unchanged.
ENCLOSE-DIAGRAM is typically used immediately after DIAGRAM>, for calculating the loop limit and the loop index of a DO loop which processes the stack diagram.
ENCLOSE-PARAMS ( DEFINITION UNSIGNED -- 1ST 2ND 2ND )
Scan the parameter list of DEFINITION, starting with the basic data type with index UNSIGNED. Indexes start with 0. The first 2ND is the maximum of UNSIGNED and the index of the last compound data type in the input parameter list. The second 2ND is the index of the first compound data type of the output parameter list. If the output parameter list is empty, the second 2ND is equal to the length of the parameter list. An ambiguous condition exists if UNSIGNED is greater than the length of the parameter list.
ENCLOSE-WORD ( CDATA -> CHARACTER UNSIGNED 3RD -- 1ST 3RD 3RD 3RD )
Parse the character string CDATA -> CHARACTER of length 3RD starting at offset UNSIGNED. Return the address of the original character string 1ST, the offset 3RD to the first non-delimiter character which is greater than or equal to UNSIGNED, the offset 3RD of the character after the last non-delimiter character in sequence and the offset 3RD of the first character not included in parsing.
Delimiters are the space character and any character with an ASCII value less than that of a space character.
ENCLOSE-WORD is used by PARSE-WORD.
END-CODE ( -- )
Make the latest definition visible for SEARCH and SEARCH-ALL by linking it to the current compilation word list.
END-DIAGRAM ( STACK-DIAGRAM -- )
Finish the creation of a stack diagram by storing the offset attribute of STACK-DIAGRAM in the attribute field of the latest definition.
ENDCASE ( ENDOF-ORIGIN OF-ORIGIN -- )
Interpretation:
An exception is thrown if ENDCASE is interpreted.
Compilation:
Mark the end of a CASE ... OF ... ENDOF ... ENDCASE structure.
Drop OF-ORIGIN. Use ENDOF-ORIGIN to resolve the entire
structure. Compare the current contents of the compiler data type heap with
the one that was saved by the first ENDOF. An exception is thrown
if a difference is detected. Append the runtime semantics given below to
the current definition.
Runtime: ( SINGLE -- )
Discard the case selector SINGLE and continue execution.
ENDCASE is an immediate word.
ENDOF ( OF-ORIGIN ENDOF-ORIGIN -- 2ND 1ST )
Interpretation:
An exception is thrown if ENDOF is interpreted.
Compilation:
Resolve the reference given by OF-ORIGIN.
Append the runtime semantics given below to the current definition.
If this is the first occurrence of ENDOF within
a CASE structure, save the contents of the compiler data type
heap in the local name space. Otherwise, compare the current contents of
the compiler data type heap with the one that was saved by the
first ENDOF. An exception is thrown
if a difference is detected.
Runtime: ( -- )
Continue execution at the location specified by the consumer
of 2ND.
ENDOF is an immediate word.
ENDOF-ORIGIN ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type ENDOF-ORIGIN.
ENVIRONMENT-WORDLIST ( -- WID )
WID is the identifier of the word list that includes all environment query keywords and their corresponding values.
ENVIRONMENT? ( CDATA -> CHARACTER UNSIGNED -- CONST FLAG )
CDATA -> CHARACTER is the address of a character string and UNSIGNED is the string's character count. UNSIGNED may have a value in the range from zero to 31. The character string should contain an ANS Forth environment query keyword to be checked for correspondence with an attribute of the present environment. If the system treats the attribute as unknown, CONST is undefined and FLAG is FALSE. Otherwise, CONST is address of the attribute value and FLAG is TRUE.
ENVIRONMENT? ( CCONST -> CHARACTER UNSIGNED -- CONST FLAG )
CCONST -> CHARACTER is the address of a character string and UNSIGNED is the string's character count. UNSIGNED may have a value in the range from zero to 31. The character string should contain an ANS Forth environment query keyword to be checked for correspondence with an attribute of the present environment. If the system treats the attribute as unknown, CONST is undefined and FLAG is FALSE. Otherwise, CONST is address of the attribute value and FLAG is TRUE.
ERASE ( DATA -> SINGLE UNSIGNED -- )
If UNSIGNED is not equal to zero, clear all bits in each of UNSIGNED consecutive cells of memory beginning at DATA -> SINGLE. An ambiguous condition exists if DATA -> SINGLE is not aligned.
ERASE ( DATA -> DOUBLE UNSIGNED -- )
If UNSIGNED is not equal to zero, clear all bits in each of UNSIGNED consecutive double cells of memory beginning at DATA -> DOUBLE. An ambiguous condition exists if DATA -> DOUBLE is not aligned.
ERASE ( CDATA -> SINGLE UNSIGNED -- )
If UNSIGNED is not equal to zero, clear all bits in each of UNSIGNED consecutive characters beginning at CDATA -> SINGLE.
ERROR ( SIGNED -- )
If SIGNED is not equal to zero, display an error message depending on the value of SIGNED, and perform the function of ABORT.
Display the current line of the input source up to and including the most recently parsed word, plus an error message associated with the error code SIGNED. Display the data types of the items currently on the data stack on a second line.
EVALUATE ( CDATA -> CHARACTER UNSIGNED -- )
Save the current input source specification. Store STRING-ID in SOURCE-ID. Make the string CDATA -> CHARACTER UNSIGNED both the input source and input buffer, set >IN to zero, and interpret. When the parse area is empty, restore the prior input source specification. Other stack effects are due to the words evaluated.
EVALUATE ( CCONST -> CHARACTER UNSIGNED -- )
Save the current input source specification. Store STRING-ID in SOURCE-ID. Copy the string CCONST -> CHARACTER UNSIGNED into a transient area in the data space and make this transient area both the input source and input buffer. Set >IN to zero and interpret. When the parse area is empty, restore the prior input source specification. Other stack effects are due to the words evaluated.
EXIT ( -- )
Interpretation:
An exception is thrown if EXIT is interpreted.
Compilation:
Append the runtime semantics given below to the current definition.
An exception is thrown if the contents of the compiler data type heap
does not exactly match the output parameters of the current definition.
Runtime: ( -- ) ( R: nest-sys -- )
Return to the calling definition specified by nest-sys.
EXIT is an immediate word.
FALSE ( -- FLAG )
FLAG is a false flag, a single-cell item with all bits set to 0.
FAR-ADDRESS ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type FAR-ADDRESS.
FAR-HERE ( -- FAR-ADDRESS )
FAR-ADDRESS is the first unused address of the current memory space.
FILE ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type FILE.
FILL ( DATA -> SINGLE UNSIGNED 2ND -- )
If UNSIGNED is not equal to zero, store 2ND in each of UNSIGNED consecutive cells of memory beginning at DATA -> SINGLE. An ambiguous condition exists if DATA -> SINGLE is not aligned.
FILL ( DATA -> DOUBLE UNSIGNED 2ND -- )
If UNSIGNED is not equal to zero, store 2ND in each of UNSIGNED consecutive double cells of memory beginning at DATA -> DOUBLE. An ambiguous condition exists if DATA -> DOUBLE is not aligned.
FILL ( CDATA -> SINGLE UNSIGNED 2ND -- )
If UNSIGNED is not equal to zero, store 2ND in each of UNSIGNED consecutive characters beginning at CDATA -> SINGLE. Only the number of low-order bits corresponding to character size are transferred.
FLAG ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type FLAG.
FM/MOD ( SIGNED-DOUBLE SIGNED -- 2ND SIGNED )
Divide SIGNED-DOUBLE by SIGNED, giving the floored quotient SIGNED and the remainder 2ND. An exception is thrown if SIGNED is zero. An ambiguous condition exists if the quotient lies outside the range of a signed single-precision number.
FORGET-LOCAL ( INTEGER -- )
Remove the most recently defined local from the local wordset. Subtract INTEGER from #LOCALS.
FORTH-WORDLIST ( -- WID )
WID is the identifier of the word list that includes all standard words provided by StrongForth. This word list is initially the compilation word list and is part of the initial search order.
FREEZE ( -- CONTROL-FLOW )
Create a structure CONTROL-FLOW, which contains a pointer to a copy of the present compiler data type heap in the local name space, and the present value of the constant data space pointer. An exception is thrown if the local name space overflows.
Note: CONTROL-FLOW includes information about whether the compiler data type heap is locked.
GET-CURRENT ( -- WID )
WID is the identifier of the compilation word list.
Note: By default, the compilation word list is identical to the FORTH-WORDLIST word list.
HERE ( -- ADDRESS )
ADDRESS is the first unused address of the current memory space.
HEX ( -- )
Set the number-conversion radix to 16 (hexadecimal).
HOLD ( CHARACTER -- )
Add CHARACTER to the beginning of the pictured numeric output string. An ambiguous condition exists if HOLD executes outside of a <# ... #> delimited pictured numeric output conversion. An exception is thrown if the transient area used for storing the pictured numeric output overflows.
IDENTITY ( -- CODE )
CODE is the address of a machine-code subroutine that implements additional matching criteria for SEARCH and SEARCH-ALL. A definition matches only if its stack diagram is exactly the same as the temporary stack diagram stored at the top of the local name space. Register BX contains the length of the temporary stack diagram in basic data types.
IF ( -- ORIGIN )
Interpretation:
An exception is thrown if IF is interpreted.
Compilation:
Put the location of a new unresolved forward
reference ORIGIN onto the stack and save a copy of the
compiler data type heap in the local name space. Append the
runtime semantics given below to the current definition.
The semantics are incomplete until ORIGIN is resolved,
e. g., by THEN or ELSE.
Runtime: ( SINGLE -- )
If SINGLE is zero, continue execution at the
location specified by the resolution of ORIGIN.
IF is an immediate word.
IMMEDIATE ( -- )
Make the latest definition an immediate word.
IMMEDIATE? ( DEFINITION -- FLAG )
FLAG is true if and only if DEFINITION is an immediate word.
INPUT-SOURCE ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type INPUT-SOURCE.
INTEGER ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type INTEGER.
INTEGER-DOUBLE ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type INTEGER-DOUBLE.
INTERPRET ( -- )
Interpret the contents of the parse area.
INTERPRET is a deferred definition.
INVERT ( LOGICAL -- 1ST )
Invert all bits of LOGICAL, giving its logical inverse 1ST.
INVERT ( DATA-TYPE -- 1ST )
1ST is DATA-TYPE with attributes that are the logical inverse of the attributes of DATA-TYPE.
IS ( DEFINITION "<spaces>name" -- )
Skip leading space delimiters. Parse name delimited by a space. Find a deferred definition name whose stack diagram is identical to the one of DEFINITION. Assign the execution semantics of DEFINITION to name. An exception is thrown if no deferred definition with name name exists whose stack diagram is identical to the one of DEFINITION, if DEFINITION is unfinished, or if name is unfinished.
Deferred definitions are words defined by DEFER.
KEY ( -- CHARACTER )
Receive one character CHARACTER from the user input device.
All standard characters can be received. Characters received by KEY are not displayed.
LATEST ( -- DEFINITION )
DEFINITION is the latest compiled definition.
LATEST! ( -- )
Update LATEST after compilation of the name and link fields of a new definition. This makes the new definition the latest definition. An ambiguous condition exists if the current memory space has changed between the compilation of the name and link fields and the execution of LATEST!.
LATEST! is used by (CREATE) and (CREATE-NONAME).
LEAVE ( -- )
Interpretation:
An exception is thrown if LEAVE is interpreted.
Compilation:
An exception is thrown
if the contents of the compiler data type heap do not exactly match
the copy that was saved when the current loop control parameters were
created. Lock the compiler data type heap. Append the runtime semantics
given below to the current definition.
Runtime: ( -- ) ( R: loop-sys -- )
Discard the current loop control parameters. An ambiguous condition
exists if they are unavailable. Continue execution immediately following
the innermost syntactically
enclosing DO ... LOOP or DO ... +LOOP.
LEAVE is an immediate word.
LINK ( WID -- DATA -> ADDRESS )
DATA -> ADDRESS is the address of a system variable containing the address offset of the name field of the latest definition that has been linked to word list WID, or zero if the word list is empty.
LIT ( -- SINGLE )
SINGLE is a constant single-cell literal.
LIT is an internal definition compiled by LITERAL,.
LITERAL ( SINGLE -- )
Interpretation:
An exception is thrown if LITERAL is interpreted.
Compilation:
Append the runtime semantics given below to the current definition.
Runtime: ( -- SINGLE )
Place SINGLE on the stack. SINGLE has the
same data type as was supplied at compilation time.
LITERAL is an immediate word.
LITERAL ( DOUBLE -- )
Interpretation:
An exception is thrown if LITERAL is interpreted.
Compilation:
Append the runtime semantics given below to the current definition.
Runtime: ( -- DOUBLE )
Place DOUBLE on the stack. DOUBLE has the
same data type as was supplied at compilation time.
LITERAL is an immediate word.
LITERAL, ( SINGLE -- )
Append the runtime semantics given below to the current definition.
Runtime: ( -- SINGLE )
Place SINGLE on the stack.
Note: LITERAL, does not change the compiler data type heap.
LITERAL, ( DOUBLE -- )
Append the runtime semantics given below to the current definition.
Runtime: ( -- DOUBLE )
Place DOUBLE on the stack.
Note: LITERAL, does not change the compiler data type heap.
LOCAL-WORDLIST ( -- WID )
WID is the identifier of the local word list. This word list contains all locals that are temporarily defined during compilation of a word.
LOCAL, ( DATA -> DATA-TYPE SIGNED -- )
Interpretation:
An exception is thrown if LOCAL, is interpreted.
Compilation:
Append the runtime semantics given below to the current definition.
Runtime: ( -- x )
Get x from the return stack and push it onto the data stack.
The return stack remains unchanged.
During compilation, DATA -> DATA-TYPE is the address of
the data type of x, while SIGNED is the offset
to the return stack pointer. An exception is thrown if SIGNED
is an invalid offset or if the size of the data type is not equal to
1 or 2 cells.
LOCAL, actually compiles (R@) or (DR@).
Note: x can be either SINGLE or DOUBLE.
LOCAL-SPACE ( -- )
Select the local name space as current memory space.
LOCALS! ( -- )
Initialise the local name space and store zero in #LOCALS.
LOCALS| ( COLON-DEFINITION "<spaces>name1<spaces>name2 ... <spaces>namen |" -- 1ST )
Interpretation:
An exception is thrown if LOCALS| is interpreted.
Compilation:
Create n local identifiers by repeatedly skipping leading spaces,
parsing name, and executing (LOCAL).
The list of locals to be defined is terminated by |. An exception
is thrown if the list of locals is not terminated by |.
Append the runtime semantics given below to the current definition.
LOCALS| may be used multiple times within the definition of a word in order to define more than one set of locals. COLON-DEFINITION is a dummy parameter that prevents LOCALS| to be used within loops, in conditional clauses, or between >R and R>. 1ST is equal to COLON-DEFINITION.
Runtime: ( xn ... x2 x1 -- )
Initialize n local identifiers, each of which takes as its
initial value the top stack item, removing it from the stack.
Identifier name1 is initialized with x1,
identifier name2 with x2, etc. When invoked, each
local will return its value. The value of a local may be changed
using TO.
Note: xn ... x2 x1 can be either SINGLE or DOUBLE.
LOCALS| is an immediate word.
LOGICAL ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type LOGICAL.
LOOP ( LOOP-ORIGIN -- )
Interpretation:
An exception is thrown if LOOP is interpreted.
Compilation:
Append the runtime semantics given below to the current
definition. Resolve both the forward and the backward reference
of LOOP-ORIGIN. 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 LOOP-ORIGIN was created.
Runtime: ( -- ) ( R: loop-sys1 -- | loop-sys2 )
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 control parameters
and continue execution. Otherwise, branch to
the beginning of the loop.
* Note: LOOP takes regard of the data type of the loop index. If the loop index is an address of a single cell, the size of a single cell in address units is added to the loop index. If the loop index is an address of a double cell, the size of a double cell in address units is added to the loop index. If the loop index is a character address, the size of a character in address units is added to the loop index.
LOOP is an immediate word.
LOOP-ORIGIN ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type LOOP-ORIGIN.
LSHIFT ( LOGICAL -- 1ST )
Perform a logical left shift of one bit-place on LOGICAL, giving 1ST. Put zero into the least significant bit vacated by the shift.
LSHIFT ( LOGICAL UNSIGNED -- 1ST )
Perform a logical left shift of UNSIGNED bit-places on LOGICAL, giving 1ST. Put zeroes into the least significant bits vacated by the shift.
M* ( UNSIGNED UNSIGNED -- UNSIGNED-DOUBLE )
UNSIGNED-DOUBLE is the product of the first UNSIGNED and the second UNSIGNED. All numbers and arithmetic are unsigned.
M* ( SIGNED SIGNED -- SIGNED-DOUBLE )
SIGNED-DOUBLE is the product of the first SIGNED and the second SIGNED. All numbers and arithmetic are signed.
MARKER ( "<spaces>name" -- )
Skip leading space delimiters. Parse name delimited by a space. Create a definition for name with the execution semantics defined below.
name Execution: ( -- )
Restore all dictionary allocation and memory space pointers to
the state they had just prior to the definition of name.
Remove the definition of name and all subsequent definitions.
Restoration of any structures still existing that could refer to deleted
definitions or deallocated data space is not necessarily provided.
No other contextual information such as the number-conversion radix is affected.
MATCH ( -- CODE )
CODE is the address of a machine-code subroutine that implements additional matching criteria for SEARCH and SEARCH-ALL. The matching algorithm depends on the content of register BX.
BX = 0:
In interpretation state, only words whose input parameters match the
data types on the interpreter data type heap can be found. In compilation
state, only non-immediate words whose input parameters match the data types
on the compiler data type heap, and immediate words whose input parameters
match the data types on the interpreter data type heap can be found.
BX = -1:
Only words whose input parameters match the data types on the compiler
data type heap can be found. An ambiguous condition exists if executed in
interpretation state.
BX = address offset of sample definition:
Only words whose input parameters match the data types on the compiler
data type heap can be found. Additionally, the output parameter list,
after resolving all data type references to the input parameters, has
to be identical to the output parameter list of the definition whose
address offset is passed in register BX.
MAX ( INTEGER 1ST -- 1ST )
1ST is the unsigned maximum of INTEGER and 1ST.
MAX ( SIGNED 1ST -- 1ST )
1ST is the signed maximum of SIGNED and 1ST.
MAX ( ADDRESS 1ST -- 1ST )
1ST is the unsigned maximum of ADDRESS and 1ST.
MAX ( INTEGER-DOUBLE 1ST -- 1ST )
1ST is the unsigned maximum of INTEGER-DOUBLE and 1ST.
MAX ( SIGNED-DOUBLE 1ST -- 1ST )
1ST is the signed maximum of SIGNED-DOUBLE and 1ST.
MEMORY-SPACE ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type MEMORY-SPACE.
MERGE ( SINGLE SINGLE -- DOUBLE )
Merges two single-cell items SINGLE into a double-cell item DOUBLE. The most significant part is expected on top of the stack.
MIN ( INTEGER 1ST -- 1ST )
1ST is the unsigned minimum of INTEGER and 1ST.
MIN ( SIGNED 1ST -- 1ST )
1ST is the signed minimum of SIGNED and 1ST.
MIN ( ADDRESS 1ST -- 1ST )
1ST is the unsigned minimum of ADDRESS and 1ST.
MIN ( INTEGER-DOUBLE 1ST -- 1ST )
1ST is the unsigned minimum of INTEGER-DOUBLE and 1ST.
MIN ( SIGNED-DOUBLE 1ST -- 1ST )
1ST is the signed minimum of SIGNED-DOUBLE and 1ST.
MOD ( UNSIGNED UNSIGNED -- 2ND )
Divide the first UNSIGNED by the second UNSIGNED, giving the remainder 2ND. Note that the result has the same data type as the divisor. An exception is thrown if the second UNSIGNED is zero.
MOD ( SIGNED SIGNED -- 2ND )
Divide the first SIGNED by the second SIGNED, giving the remainder 2ND. Note that the result has the same data type as the divisor. An exception is thrown if the second SIGNED is zero. If the first SIGNED and the second SIGNED differ in sign, the result returned will be the same as that returned by the phrase SWAP S>D SWAP SM/REM DROP.
MOD ( UNSIGNED-DOUBLE UNSIGNED -- 2ND )
Divide UNSIGNED-DOUBLE by UNSIGNED, giving the single-precision remainder 2ND. An exception is thrown if UNSIGNED is zero.
MOVE ( DATA -> SINGLE DATA -> 2ND UNSIGNED -- )
If UNSIGNED is not equal to zero, copy the contents of UNSIGNED consecutive cells starting at address DATA -> SINGLE to the UNSIGNED consecutive cells starting at address DATA -> 2ND. After MOVE completes, the UNSIGNED consecutive cells starting at address DATA -> 2ND contain exactly what the UNSIGNED consecutive cells starting at address DATA -> SINGLE contained before the move.
MOVE ( DATA -> DOUBLE DATA -> 2ND UNSIGNED -- )
If UNSIGNED is not equal to zero, copy the contents of UNSIGNED consecutive double cells starting at DATA -> DOUBLE to the UNSIGNED consecutive double cells starting at address DATA -> 2ND. After MOVE completes, the UNSIGNED consecutive double cells starting at address DATA -> 2ND contain exactly what the UNSIGNED consecutive double cells starting at address DATA -> DOUBLE contained before the move.
MOVE ( CDATA -> SINGLE CDATA -> 2ND UNSIGNED -- )
If UNSIGNED is not equal to zero, copy the contents of UNSIGNED consecutive characters starting at address CDATA -> SINGLE to the UNSIGNED consecutive characters starting at address CDATA -> 2ND. After MOVE completes, the UNSIGNED consecutive characters starting at address CDATA -> 2ND contain exactly what the UNSIGNED consecutive characters starting at address CDATA -> SINGLE contained before the move.
MOVE ( CONST -> SINGLE DATA -> 2ND UNSIGNED -- )
If UNSIGNED is not equal to zero, copy the contents of UNSIGNED consecutive cells starting at address CONST -> SINGLE to the UNSIGNED consecutive cells starting at address DATA -> 2ND. After MOVE completes, the UNSIGNED consecutive cells starting at address DATA -> 2ND contain exactly what the UNSIGNED consecutive cells starting at address CONST -> SINGLE contained before the move.
MOVE ( CONST -> DOUBLE DATA -> 2ND UNSIGNED -- )
If UNSIGNED is not equal to zero, copy the contents of UNSIGNED consecutive double cells starting at address CONST -> DOUBLE to the UNSIGNED consecutive double cells starting at address DATA -> 2ND. After MOVE completes, the UNSIGNED consecutive double cells starting at address DATA -> 2ND contain exactly what the UNSIGNED consecutive double cells starting at address CONST -> DOUBLE contained before the move.
MOVE ( CCONST -> SINGLE CDATA -> 2ND UNSIGNED -- )
If UNSIGNED is not equal to zero, copy the contents of UNSIGNED consecutive characters starting at address CCONST -> SINGLE to the UNSIGNED consecutive characters starting at address CDATA -> 2ND. After MOVE completes, the UNSIGNED consecutive characters starting at address CDATA -> 2ND contain exactly what the UNSIGNED consecutive characters starting at address CCONST -> SINGLE contained before the move.
MOVE ( FAR-ADDRESS -> SINGLE DATA -> 2ND UNSIGNED -- )
If UNSIGNED is not equal to zero, copy the contents of UNSIGNED consecutive cells starting at address FAR-ADDRESS -> SINGLE to the UNSIGNED consecutive cells starting at address DATA -> 2ND. After MOVE completes, the UNSIGNED consecutive cells starting at address DATA -> 2ND contain exactly what the UNSIGNED consecutive cells starting at address FAR-ADDRESS -> SINGLE contained before the move.
MOVE ( FAR-ADDRESS -> DOUBLE DATA -> 2ND UNSIGNED -- )
If UNSIGNED is not equal to zero, copy the contents of UNSIGNED consecutive double cells starting at address FAR-ADDRESS -> DOUBLE to the UNSIGNED consecutive double cells starting at address DATA -> 2ND. After MOVE completes, the UNSIGNED consecutive double cells starting at address DATA -> 2ND contain exactly what the UNSIGNED consecutive double cells starting at address FAR-ADDRESS -> DOUBLE contained before the move.
MOVE ( CFAR-ADDRESS -> SINGLE CDATA -> 2ND UNSIGNED -- )
If UNSIGNED is not equal to zero, copy the contents of UNSIGNED consecutive characters starting at address CFAR-ADDRESS -> SINGLE to the UNSIGNED consecutive characters starting at address CDATA -> 2ND. After MOVE completes, the UNSIGNED consecutive characters starting at address CDATA -> 2ND contain exactly what the UNSIGNED consecutive characters starting at address CFAR-ADDRESS -> SINGLE contained before the move.
NAME ( DEFINITION -- CFAR-ADDRESS -> CHARACTER UNSIGNED )
CFAR-ADDRESS -> CHARACTER UNSIGNED is a character string containing the name of DEFINITION. An exception is thrown if DEFINITION was defined by :NONAME.
NAME-SPACE ( -- )
Select the name space as current memory space.
NAME>DEFINITION ( CFAR-ADDRESS -> UNSIGNED -- DEFINITION )
DEFINITION is the definition whose name field address is CFAR-ADDRESS -> UNSIGNED, or the definition defined by :NONAME whose attribute field address is CFAR-ADDRESS -> UNSIGNED. An ambiguous condition exists if CFAR-ADDRESS -> UNSIGNED is neither the address of a definition's name field, nor the attribute field field address of a definition defined by :NONAME.
NEGATE ( INTEGER -- 1ST )
Negate INTEGER, giving its arithmetic inverse 1ST.
NEGATE ( INTEGER-DOUBLE -- 1ST )
Negate INTEGER-DOUBLE, giving its arithmetic inverse 1ST.
NEST-DO ( -- LOOP-ORIGIN )
An exception is thrown if NEST-DO is interpreted.
Put the location of a new unresolved forward reference LOOP-ORIGIN onto the stack and save a copy of the compiler data type heap in the local name space. Rename the loop index I into J, if it already exists, and define a new local I as loop index. The semantics are incomplete until resolved by a consumer of LOOP-ORIGIN such as LOOP.
NEST-DO is used by DO and ?DO.
NEST-LOOP ( LOOP-ORIGIN -- )
An exception is thrown if NEST-LOOP is interpreted.
Resolve all forward and backward references of LOOP-ORIGIN. An exception is thrown if the contents of the compiler data type heap do not exactly match the copy that was saved when LOOP-ORIGIN was created. Forget the loop index I, which is assumed to be the latest local. Rename the loop index J, if it exists, into I.
NEST-LOOP is used by LOOP and +LOOP.
NESTING ( DATA -> DATA-TYPE INTEGER -- )
Change the name of a local, which is identified by the address of its output parameter DATA -> DATA-TYPE, by adding INTEGER to the first character of it's name. If the name consists of more than one character, it remains unchanged.
Note: NESTING is used internally by NEST-DO and NEST-LOOP to rename the loop index I to J and vice versa.
NEW-TUPLE ( -- TUPLE )
TUPLE is an empty tuple.
NEXT ( DEFINITION -- 1ST )
1ST is the successor of DEFINITION in the dictionary. An exception is thrown if DEFINITION is unfinished. An ambiguous condition exists if DEFINITION is the latest definition.
NIP ( SINGLE SINGLE -- 2ND )
Remove the first item below the top of the stack.
NIP ( SINGLE DOUBLE -- 2ND )
Remove the first item below the top of the stack.
NIP ( DOUBLE SINGLE -- 2ND )
Remove the first item below the top of the stack.
NIP ( DOUBLE DOUBLE -- 2ND )
Remove the first item below the top of the stack.
NONAME? ( DEFINITION -- FLAG )
FLAG is true if and only if DEFINITION was created by :NONAME.
NOOP ( -- )
Interpretation:
No operation.
Compilation:
No operation.
NULL ( "<spaces>name" -- y )
Skip leading space delimiters. Parse name delimited by a space. Return y, which has the numerical value 0 (all bits are zero) and the data type identified by name. An exception is thrown if name is not the name of a data type. y can be a single-cell or a double-cell item.
NULL is an immediate word.
NULL? ( DATA-TYPE -- FLAG )
FLAG is true if and only if DATA-TYPE is a null data type. A null data type can have one or more attributes.
NUMBER ( CDATA -> CHARACTER UNSIGNED -- INTEGER-DOUBLE DATA-TYPE )
Convert the string CDATA -> CHARACTER UNSIGNED into an unsigned double-precision number INTEGER-DOUBLE, using the number-conversion radix in BASE. DATA-TYPE is UNSIGNED if the string consists only of digits. If the string is preceded by the character +, DATA-TYPE is SIGNED. If the string is preceded by the character -, DATA-TYPE is SIGNED, and INTEGER-DOUBLE is negated.
The character . may be appended to the character string as described above, resulting in DATA-TYPE being UNSIGNED-DOUBLE if no sign character is present or SIGNED-DOUBLE with a leading sign character.
DATA-TYPE is null if the content of the string does not comply with the representation of a valid single-precision or double-precision number.
NUMBER-DOUBLE ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type NUMBER-DOUBLE.
OF ( ENDOF-ORIGIN OF-ORIGIN -- 2ND 1ST )
Interpretation:
An exception is thrown if OF is interpreted.
Compilation:
Check if the contents of the compiler data type heap exactly matches
the one that was saved when OF-ORIGIN was created. An exception
is thrown if a difference is detected.
Put the location of a new unresolved forward reference 2ND onto
the stack, and save a copy of the compiler data type heap in the local
name space. Append the runtime semantics given below to the current
definition. The semantics are incomplete until resolved by a consumer
of 2ND and 1ST such as ENDOF.
Runtime: ( SINGLE 1ST -- | 1ST )
If SINGLE and 1ST are equal, discard both items and
continue execution. Otherwise, discard the top value and continue
execution at the location specified by the consumer
of 2ND and 1ST.
OF is an immediate word.
OF-ORIGIN ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type OF-ORIGIN.
OFFSET ( DATA-TYPE -- UNSIGNED )
UNSIGNED is the numerical value of the offset attribute of DATA-TYPE.
OFFSET+ ( DATA-TYPE INTEGER -- 1ST )
Add INTEGER to the offset attribute of DATA-TYPE. An exception is thrown if the resulting offset attribute is outside the range 0 to 31.
OR ( SINGLE LOGICAL -- 1ST )
1ST is the bit-by-bit inclusive-or of SINGLE with LOGICAL.
OR ( DATA-TYPE DATA-TYPE -- 1ST )
1ST is the first DATA-TYPE with attributes that are the bit-by-bit logical or of the attributes of both parameters DATA-TYPE.
ORIGIN ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type ORIGIN.
OVER ( SINGLE SINGLE -- 1ST 2ND 1ST )
Place a copy of the first SINGLE on top of the stack.
OVER ( SINGLE DOUBLE -- 1ST 2ND 1ST )
Place a copy of SINGLE on top of the stack.
OVER ( DOUBLE SINGLE -- 1ST 2ND 1ST )
Place a copy of DOUBLE on top of the stack.
OVER ( DOUBLE DOUBLE -- 1ST 2ND 1ST )
Place a copy of the first DOUBLE on top of the stack.
PAD ( -- CDATA -> CHARACTER )
CDATA -> CHARACTER is the address of a transient area that can be used to hold data for intermediate character string processing.
Note: This transient area is reserved for applications. It will not be used by the system.
PARAM, ( STACK-DIAGRAM DATA-TYPE -- 1ST )
Reserve two cells in the current memory space and store DATA-TYPE in the cells. Add 1 to the offset attribute of STACK-DIAGRAM. An ambiguous condition exists if the first unused address of the current memory space is not aligned prior to execution of PARAM,. An exception is thrown if the current memory space overflows.
PARAM@ ( DEFINITION UNSIGNED -- DATA-TYPE )
DATA-TYPE is the basic data type with index UNSIGNED from the parameter list of DEFINITION. The index is zero based. An ambiguous condition exists if UNSIGNED is greater than or equal to the length of the parameter list.
PARAM@, ( DEFINITION STACK-DIAGRAM UNSIGNED 3RD -- 1ST 2ND )
Read a number of basic data types from the parameter list of DEFINITION, starting at the parameter with index 3RD up to and not including the parameter with index UNSIGNED. Indexes start with 0. For each data type read, reserve two cells of memory space, store the data type in the cells, and modify STACK-DIAGRAM by adding 1 to its offset attribute. An ambiguous condition exists if the memory space pointer is not aligned prior to execution of PARAM@,, or if UNSIGNED is greater than the length of the parameter list. An exception is thrown if the memory space overflows.
PARAMS ( DEFINITION -- FAR-ADDRESS -> DATA-TYPE )
FAR-ADDRESS -> DATA-TYPE is the address of the input parameter field of DEFINITION.
PARAMS>DT ( DEFINITION DATA-TYPE -- )
If DATA-TYPE has no offset attribute, push DATA-TYPE onto the data type heap and finish execution. Otherwise, push a compound data type corresponding to an input parameter of DEFINITION onto the data type heap. The offset attribute of DATA-TYPE is the index to the basic data type of the input parameter list of DEFINITION, starting with 1. If the selected compound data type contains a reference to another data type in the parameter list, the tail of the compound data type is recursively substituted by the referenced data type. An exception is thrown if the data type heap overflows.
PARENT ( DATA-TYPE -- 1ST )
1ST is the parent data type of DATA-TYPE. If DATA-TYPE does not have a parent data type, 1ST is the null data type.
PARSE ( CHARACTER "ccc<char>" -- CDATA -> CHARACTER UNSIGNED )
Parse ccc delimited by the delimiter CHARACTER.
CDATA -> CHARACTER is the address (within the input buffer) and UNSIGNED is the length of the parsed string. If the parse area was empty, the resulting string has a zero length.
PARSE-WORD ( "<spaces>name" -- CDATA -> CHARACTER UNSIGNED )
Skip leading spaces. Parse name delimited by a space. An exception is thrown if the length of name is greater than 31.
CDATA -> CHARACTER is the address (within the input buffer) and UNSIGNED is the length of name. If the parse area was empty, the resulting string has a zero length.
Delimiters are the space character and any character with an ASCII value less than that of a space character.
PORT ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type PORT.
POSTPONE ( "<spaces>name" -- )
Interpretation:
An exception is thrown if POSTPONE is interpreted.
Compilation:
Skip leading space delimiters. Parse name delimited by a space.
Find name. Append the compilation semantics of name to
the current definition. An exception is thrown if name is
not found.
POSTPONE is an immediate word.
PREV ( DEFINITION -- 1ST )
1ST is the predecessor of DEFINITION in the dictionary, or null if DEFINITION is the first definition. An exception is thrown if DEFINITION was defined by :NONAME.
PROCREATES ( DATA-TYPE "<spaces>name" -- )
Skip leading space delimiters. Parse name delimited by a space. Create a definition with name name that identifies a new data type. The new data type is a direct subtype of DATA-TYPE. An exception is thrown if PROCREATES is executed in compilation state.
PROMPT ( -- )
If in interpretation state, display " OK" and cause subsequent output to appear at the beginning of the next line.
PROMPT is a deferred definition.
QUIT ( -- )
Empty the return stack. Make the user input device the input source. Enter interpretation state and re-initialize the local name space. Do not display a message. Repeat the following until the end of the input source:
After the end of the input source has exceeded, terminate StrongForth and return control to the operating system.
R-SIZE ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type R-SIZE.
R> ( R-SIZE -- )
Interpretation:
An exception is thrown if R> is interpreted.
Compilation:
Append the runtime semantics given below to the current definition.
Consume R-SIZE, the size of the local R@ in cells,
and remove the local R@ from the local dictionary. An
exception is thrown if R@ does not exist or if R-SIZE
is not equal to 1 or 2.
Runtime: ( -- x )
x is the value of the local R@.
R> is an immediate word.
RECURSE ( -- )
Interpretation:
An exception is thrown if RECURSE is
interpreted.
Compilation:
Change the compiler data type heap according to the stack effect of
the current definition. Append the execution semantics of the current
definition to the execution semantics of current definition.
An ambiguous condition exists if RECURSE appears in a
definition after DOES>.
RECURSE is an immediate word.
REFILL ( -- FLAG )
Attempt to fill the input buffer from the input source, returning a true flag if successful.
When the input source is the user input device, attempt to receive input into the terminal input buffer. If successful, make the result the input buffer, set >IN to zero, and return true. Receipt of a line containing no characters is considered successful. If there is no input available from the current input source, return false.
When the input source is a string from EVALUATE, return false and perform no other action.
REFILL is a deferred definition.
REFREEZE ( CONTROL-FLOW -- 1ST )
Update CONTROL-FLOW by replacing the stored value of the constant data space pointer with its present value.
REPEAT ( ORIGIN DESTINATION -- )
Interpretation:
An exception is thrown if REPEAT is interpreted.
Compilation:
Append the runtime semantics given below to the current definition,
resolving the backward reference DESTINATION. An exception is
thrown if the contents of the compiler data type heap do not
exactly match the copy that was saved when DESTINATION was
created. Resolve the forward reference ORIGIN using the
location following the appended runtime semantics. Restore the compiler
data type heap to the state that was saved when ORIGIN was
created.
Runtime: ( -- )
Continue execution at the location given by DESTINATION.
REPEAT is an immediate word.
RESOLVE ( CONST -- )
Resolve a forward reference in virtual machine code by storing the (positive) offset in address units from CONST to the first unused address of the constant data space in CONST.
RESOLVE-ALL ( ORIGIN -- )
Resolve zero or more forward references in virtual machine code by storing the (positive) offset in address units from the origin to the first unused address of the constant data space in the origin. The origin contained in ORIGIN is the first of a linked list of origins for which forward references are to be resolved. Each origin contains a pointer to the previous origin, or zero if it is the last one.
RESTORE-INPUT ( INPUT-SOURCE -- FLAG )
Attempt to restore the input source specification to the state described by the tuple INPUT-SOURCE. FLAG is true if the input source specification cannot be restored.
An ambiguous condition exists if the input source represented by the arguments is not the same as the current input source.
ROT ( SINGLE SINGLE SINGLE -- 2ND 3RD 1ST )
Rotate the top three stack items.
ROT ( SINGLE SINGLE DOUBLE -- 2ND 3RD 1ST )
Rotate the top three stack items.
ROT ( SINGLE DOUBLE SINGLE -- 2ND 3RD 1ST )
Rotate the top three stack items.
ROT ( SINGLE DOUBLE DOUBLE -- 2ND 3RD 1ST )
Rotate the top three stack items.
ROT ( DOUBLE SINGLE SINGLE -- 2ND 3RD 1ST )
Rotate the top three stack items.
ROT ( DOUBLE SINGLE DOUBLE -- 2ND 3RD 1ST )
Rotate the top three stack items.
ROT ( DOUBLE DOUBLE SINGLE -- 2ND 3RD 1ST )
Rotate the top three stack items.
ROT ( DOUBLE DOUBLE DOUBLE -- 2ND 3RD 1ST )
Rotate the top three stack items.
RP! ( DATA -- )
Make DATA the current value of the return stack pointer.
RP0 ( -- DATA )
DATA is the value of the return stack pointer when the return stack is empty.
Note: RP0 RP! empties the return stack.
RP@ ( -- DATA )
DATA is the current value of the return stack pointer.
RSHIFT ( LOGICAL -- 1ST )
Perform a logical right shift of one bit-place on LOGICAL, giving 1ST. Put zero into the most significant bit vacated by the shift.
RSHIFT ( LOGICAL UNSIGNED -- 1ST )
Perform a logical right shift of UNSIGNED bit-places on LOGICAL, giving 1ST. Put zeroes into the most significant bits vacated by the shift.
S>D ( SINGLE -- DOUBLE )
Convert SINGLE to the unsigned double number DOUBLE with the same numerical value.
S>D ( SIGNED -- SIGNED-DOUBLE )
Convert the signed single number SIGNED to the signed double number SIGNED-DOUBLE with the same numerical value.
SAVE-INPUT ( -- INPUT-SOURCE )
INPUT-SOURCE is a tuple that describes the current state of the input source specification for later use by RESTORE-INPUT.
SEARCH ( CDATA -> CHARACTER UNSIGNED 1ST 3RD -- 1ST 3RD FLAG )
Search the string specified by CDATA -> CHARACTER UNSIGNED for the sub-string specified by 1ST 3RD. If FLAG is true, a match was found at 1ST with 3RD characters remaining. If FLAG is false there was no match and 1ST is CDATA -> CHARACTER and 3RD is UNSIGNED.
SEARCH ( CDATA -> CHARACTER UNSIGNED SINGLE CODE WID -- DEFINITION SIGNED )
Search word list WID for the definition whose name is given by the character string CDATA -> CHARACTER UNSIGNED. If the definition is not found, return zero as DEFINITION and zero as SIGNED. If the definition is found, return it as DEFINITION. If the definition is an immediate word, also return one (+1), otherwise also return minus one (-1) as SIGNED.
CODE is the address of a machine code subroutine that applies additional matching criteria. If those matching criteria require a parameter, the parameter is passed by SINGLE. The subroutine expects register CX to contain either one or minus one, depending on whether the definition is an immediate word, BX to contain the value of SINGLE, and register pair ES:DI to contain the address of the definition's attribute field. If the definition matches the criterion, the register set remains unchanged. Otherwise, register CX becomes zero.
If UNSIGNED is zero, the definition's name is not considered by SEARCH. In this case, only the matching criteria specified by SINGLE and CODE matter.
SEARCH-ALL ( CDATA -> CHARACTER UNSIGNED SINGLE CODE -- DEFINITION SIGNED )
Search the FORTH-WORDLIST word list for the definition whose name is given by the character string CDATA -> CHARACTER UNSIGNED. If the definition is not found, return zero as DEFINITION and zero as SIGNED. If the definition is found, return it as DEFINITION. If the definition is an immediate word, also return one (+1), otherwise also return minus one (-1) as SIGNED.
CODE is the address of a machine code subroutine that applies additional matching criteria. If those matching criteria require a parameter, the parameter is passed by SINGLE. The subroutine expects register CX to contain either one or minus one, depending on whether the definition is an immediate word, BX to contain the value of SINGLE, and register pair ES:DI to contain the address of the definition's attribute field. If the definition matches the criterion, the register set remains unchanged. Otherwise, register CX becomes zero.
If UNSIGNED is zero, the definition's name is not considered by SEARCH-ALL. In this case, only the matching criteria specified by SINGLE and CODE matter.
SEARCH-ALL is a deferred definition.
SEARCH-LOCAL ( CDATA -> CHARACTER UNSIGNED -- DATA -> DATA-TYPE SIGNED )
Find the local whose name is stored in the string CDATA -> CHARACTER UNSIGNED. If the local is not found, return zero as DATA -> DATA-TYPE and zero as SIGNED. If the local is found, return the address of its output parameter DATA -> DATA-TYPE, and the content SIGNED of its index field.
SEARCH-TOKEN ( TOKEN -- DEFINITION SIGNED )
Search the definition whose token is equal to TOKEN. If the definition is not found, return zero as DEFINITION and zero as SIGNED. If the definition is found, return it as DEFINITION. If the definition is immediate, also return one (+1), otherwise also return minus one (-1) as SIGNED.
SET-CURRENT ( WID -- )
Make the word list identified by WID the current compilation word list.
Note: By default, the compilation word list is identical to the FORTH-WORDLIST word list.
SIGN ( FLAG -- )
If FLAG is true, add a minus sign to the beginning of the pictured numeric output string.
>T ( TUPLE -> SINGLE 2ND -- 1ST )
Add 2ND to the tuple TUPLE -> SINGLE, increasing the size of TUPLE -> SINGLE by one cell.
>T ( TUPLE -> DOUBLE 2ND -- 1ST )
Add 2ND to the tuple TUPLE -> DOUBLE, increasing the size of TUPLE -> DOUBLE by two cells.
SIGNED ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type SIGNED.
SIGNED-DOUBLE ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type SIGNED-DOUBLE.
SINGLE ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type SINGLE. SINGLE is an ancestor data type.
SIZE ( DATA-TYPE -- UNSIGNED )
UNSIGNED is the size in cells of data type DATA-TYPE, or zero if the size of DATA-TYPE cannot be determined.
SIZE ( TUPLE -- 1ST UNSIGNED )
UNSIGNED is the size in cells of TUPLE. If TUPLE is empty, UNSIGNED is zero.
SLIT ( -- CCONST -> CHARACTER UNSIGNED )
CCONST -> CHARACTER is the address of a constant character string literal. UNSIGNED is the size of the character string.
SLIT is an internal definition compiled by SLITERAL.
SLITERAL ( CDATA -> CHARACTER UNSIGNED -- )
Interpretation:
An exception is thrown
if SLITERAL is interpreted.
Compilation:
Append the runtime semantics given below to the current definition.
Runtime: ( -- CCONST -> CHARACTER UNSIGNED )
Return CCONST -> CHARACTER as the address
and UNSIGNED as the character count of a character
string consisting of the characters specified
by CDATA -> CHARACTER UNSIGNED during compilation.
A program shall not alter the returned character string.
SLITERAL is an immediate word.
SM/REM ( SIGNED-DOUBLE SIGNED -- 2ND SIGNED )
Divide SIGNED-DOUBLE by SIGNED, giving the symmetric quotient SIGNED and the remainder 2ND. An exception is thrown if SIGNED is zero. An ambiguous condition exists if the quotient lies outside the range of a signed single-precision number.
SOURCE ( -- CDATA -> CHARACTER UNSIGNED )
CDATA -> CHARACTER is the address of the input buffer. UNSIGNED is the number of characters in the input buffer. If SOURCE-ID is zero, the input buffer is the terminal input buffer. If SOURCE-ID is equal to STRING-ID, the input buffer is the character string identified by SOURCE-SPEC.
SOURCE is a deferred definition.
SOURCE-ID ( -- FILE )
FILE is zero if the user input device is the input source. FILE is equal to STRING-ID if a string is the input source.
STRING-ID ( -- FILE )
FILE is the constant value SOURCE-ID returns if the input source is a string.
SOURCE-SPEC ( -- DOUBLE )
DOUBLE identifies the string that serves as the current input source. If the current input source is not a string, DOUBLE is undefined.
SOURCE-SPEC is a low-level value that is used by SOURCE, EVALUATE, SAVE-INPUT and RESTORE-INPUT.
SP! ( DATA -- )
Make DATA the current value of the data stack pointer.
SP0 ( -- DATA )
DATA is the value of the data stack pointer when the data stack is empty.
Note: SP0 SP! empties the data stack.
SP@ ( -- DATA )
DATA is the value of the data stack pointer before DATA was pushed on the stack.
SPACE ( -- )
Display one space.
SPACE! ( MEMORY-SPACE -- )
Select MEMORY-SPACE as current memory space.
SPACE@ ( -- MEMORY-SPACE )
MEMORY-SPACE is the current memory space.
SPACES ( INTEGER -- )
If INTEGER is greater than zero, display INTEGER spaces.
Note: INTEGER is assumed to be a signed number.
SPLIT ( DOUBLE -- SINGLE SINGLE )
Splits a double-cell item DOUBLE into two single-cell items SINGLE. The most significant part is on top of the stack.
STACK-DIAGRAM ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type STACK-DIAGRAM.
STATE ( -- DATA -> FLAG )
DATA -> FLAG is the address of a cell indicating compilation state. STATE is true when in compilation state, and false when in interpretation state.
SWAP ( SINGLE SINGLE -- 2ND 1ST )
Exchange the two items on top of the stack.
SWAP ( SINGLE DOUBLE -- 2ND 1ST )
Exchange the two items on top of the stack.
SWAP ( DOUBLE SINGLE -- 2ND 1ST )
Exchange the two items on top of the stack.
SWAP ( DOUBLE DOUBLE -- 2ND 1ST )
Exchange the two items on top of the stack.
SYNONYM ( DEFINITION -- )
Assign the execution semantics of DEFINITION to the latest definition by copying the content of DEFINITION's code field to the code field of the latest definition. Add the latest definition to the current compilation word list, An exception is thrown if SYNONYM is executed in compilation state, or if the latest definition is not a code definition. An ambiguous condition exists if DEFINITION is not a code definition.
SYNONYM is typically used in the form CODE name1 ( ... -- ... ) ' name2 SYNONYM to define a synonym for an existing definition. The stack diagrams of the existing definition and the synonym definition may be different.
Note: SYNONYM is often used instead of ALIAS if the two definitions have different names, because the separate code fields allow SEE to distinguish the two words and display the correct name.
T> ( TUPLE -> SINGLE -- 1ST 2ND )
Extract 2ND from the tuple TUPLE -> SINGLE, decreasing the size of TUPLE -> SINGLE by one cell. An exception is thrown if TUPLE -> SINGLE is empty.
T> ( TUPLE -> DOUBLE -- 1ST 2ND )
Extract 2ND from the tuple TUPLE -> DOUBLE, decreasing the size of TUPLE -> DOUBLE by two cells. An exception is thrown if TUPLE -> DOUBLE is empty.
TH ( STACK-DIAGRAM UNSIGNED -- 1ST )
TH is used in a stack diagram to specify input or output parameters which should have exactly the same data type as the data type at the position UNSIGNED in the input parameter list of the same definition. Since the index refers to the basic data types in the input parameter list, it is possible to build a reference to the tail of a compound data type representing an input parameter.
An exception is thrown if UNSIGNED is 0, if UNSIGNED is greater than the length of the input parameter list, or if the referenced data type is itself a reference.
THAW ( CONTROL-FLOW -- CONST )
If the compiler data type heap that was locked when CONTROL-FLOW was created, lock the compiler data type heap. Otherwise, perform either of the following actions depending on the current status of the compiler data type heap.
CONST is the value of the constant data space pointer at the time CONTROL-FLOW was created.
THEN ( ORIGIN -- )
Interpretation:
An exception is thrown if THEN is interpreted.
Compilation:
Append the runtime semantics given below to the current
definition. Resolve the forward reference ORIGIN using
the current location. An exception is
thrown if the contents of the compiler data type heap
does not match the copy that was saved when ORIGIN was
created.
Runtime: ( -- )
Continue execution.
THEN is an immediate word.
THROW ( SIGNED -- )
Perform the function of ERROR.
THROW is a deferred definition.
TIB ( -- CDATA -> CHARACTER )
CDATA -> CHARACTER is the address of the first character of the terminal input buffer.
TO ( "<spaces>name" -- )
Interpretation: ( x "<spaces>name" -- )
Skip leading spaces. Parse name delimited by a space.
Store x in name using a suitable version of !.
An exception is thrown if name was not defined by
VALUE.
Compilation:
Skip leading spaces. Parse name delimited by a space.
Append the runtime semantics given below to the current definition.
An exception is thrown if name was not defined by
either VALUE or LOCAL,.
Runtime: ( x -- )
Store x in name using a suitable version of
!.
Note: x can be any data type for which an overloaded version of ! exists.
TO is an immediate word.
TOKEN ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type TOKEN.
TOKEN-FIELD ( -- CODE )
CODE is the address of a machine-code subroutine that implements additional matching criteria for SEARCH and SEARCH-ALL. If register BX is zero, all definitions match. If BX is not equal to zero, a definition matches only if the content of its token field is equal to BX.
TRANS-BOTTOM ( -- CDATA -> CHARACTER )
CDATA -> CHARACTER is the address of the first character of a 34 characters long transient area. This transient area is used as pictured numeric output string buffer and as name buffer.
TRANS-TOP ( -- CDATA -> CHARACTER )
CDATA -> CHARACTER is the address of the last plus 1 character of a 34 characters long transient area. This transient area is used as pictured numeric output string buffer and as name buffer.
TRANSIENT ( CCONST -> CHARACTER UNSIGNED -- CDATA -> 2ND 3RD )
Copy the constant character string CCONST -> CHARACTER UNSIGNED into the transient area. CDATA -> 2ND 3RD is a copy of the character string in the transient area.
Note that the size of the transient area is limited. However, its size is big enough to contain the name of a word. Note also that the transient area is used by other words as well, e. g., for pictured numeric output.
TRANSIENT ( CFAR-ADDRESS -> CHARACTER UNSIGNED -- CDATA -> 2ND 3RD )
Copy the constant character string CFAR-ADDRESS -> CHARACTER UNSIGNED into the transient area. CDATA -> 2ND 3RD is a copy of the character string in the transient area.
Note that the size of the transient area is limited. However, its size is big enough to contain the name of a word. Note also that the transient area is used by other words as well, e. g., for pictured numeric output.
TRUE ( -- FLAG )
FLAG is a true flag, a single-cell item with all bits set to 1.
TUCK ( SINGLE SINGLE -- 2ND 1ST 2ND )
Copy the first (top) stack item below the second stack item.
TUCK ( SINGLE DOUBLE -- 2ND 1ST 2ND )
Copy the first (top) stack item below the second stack item.
TUCK ( DOUBLE SINGLE -- 2ND 1ST 2ND )
Copy the first (top) stack item below the second stack item.
TUCK ( DOUBLE DOUBLE -- 2ND 1ST 2ND )
Copy the first (top) stack item below the second stack item.
TUPLE ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type TUPLE. TUPLE is an ancestor data type.
TYPE ( CDATA -> CHARACTER UNSIGNED -- )
If UNSIGNED is not zero, display the character string CDATA -> CHARACTER UNSIGNED.
TYPE ( CCONST -> CHARACTER UNSIGNED -- )
If UNSIGNED is not zero, display the constant character string CCONST -> CHARACTER UNSIGNED.
TYPE ( CFAR-ADDRESS -> CHARACTER UNSIGNED -- )
If UNSIGNED is not zero, display the character string CFAR-ADDRESS -> CHARACTER UNSIGNED.
UM/MOD ( UNSIGNED-DOUBLE UNSIGNED -- 2ND UNSIGNED )
Divide UNSIGNED-DOUBLE by UNSIGNED, giving the quotient UNSIGNED and the remainder 2ND. An exception is thrown if UNSIGNED is zero. An ambiguous condition exists if the quotient lies outside the range of an unsigned single-precision number.
UNSIGNED ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type UNSIGNED.
UNSIGNED-DOUBLE ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type UNSIGNED-DOUBLE.
IMMEDIATE? ( DEFINITION -- FLAG )
FLAG is true if and only if DEFINITION is an immediate word.
UNTIL ( DESTINATION -- )
Interpretation:
An exception is thrown if UNTIL is interpreted.
Compilation:
Append the runtime semantics given below to the current
definition, resolving the backward reference DESTINATION.
An exception is thrown if the contents of the compiler data
type heap do not exactly match the copy that was saved
when DESTINATION was created.
Runtime: ( SINGLE -- )
If SINGLE is zero, continue execution at the
location specified by DESTINATION. SINGLE is
not taken into consideration when comparing the contents of the
compiler data type heap with the copy that was saved
when DESTINATION was created.
UNTIL is an immediate word.
UNUSED ( -- UNSIGNED )
UNSIGNED is the number of address units remaining in the current memory space, starting at HERE.
VALUE ( SINGLE "<spaces>name" -- )
Skip leading space delimiters. Parse name delimited by a space. Create a definition for name with the execution semantics defined below. Reserve one cell of data space at an aligned address and store SINGLE at the address.
name is referred to as a value.
Execution: ( -- SINGLE )SINGLE has the same data type as was supplied to VALUE.
VALUE ( DOUBLE "<spaces>name" -- )
Skip leading space delimiters. Parse name delimited by a space. Create a definition for name with the execution semantics defined below. Reserve one cell of data space at an aligned address and store SINGLE at the address.
name is referred to as a value.
Execution: ( -- DOUBLE )DOUBLE has the same data type as was supplied to VALUE.
VALUE> ( MEMORY-SPACE STACK-DIAGRAM CODE -- )
Restore the current memory space from MEMORY-SPACE. Store the offset attribute of STACK-DIAGRAM in the attribute field of the latest definition. Make the latest definition visible for SEARCH and SEARCH-ALL by linking it to the current compilation word list.
<VALUE and VALUE> are used by CONSTANT, VARIABLE and VALUE.
VARIABLE ( SINGLE "<spaces>name" -- )
Skip leading space delimiters. Parse name delimited by a space. Create a definition for name with the execution semantics defined below. Reserve one cell of data space at an aligned address and store SINGLE at the address.
name is referred to as a variable.
Execution: ( -- DATA -> SINGLE )VARIABLE ( DOUBLE "<spaces>name" -- )
Skip leading space delimiters. Parse name delimited by a space. Create a definition for name with the execution semantics defined below. Reserve two cells of data space at an aligned address and store DOUBLE at the address.
name is referred to as a variable.
Execution: ( -- DATA -> DOUBLE )VIRTUAL ( -- CODE )
CODE is the address of a machine-code subroutine that implements additional matching criteria for SEARCH and SEARCH-ALL. A definition matches only if the following three conditions are met:
These additional search criteria are intended to be used when assigning class member functions to virtual member functions in the OOP word set.
WHILE ( DESTINATION -- ORIGIN 1ST )
Interpretation:
An exception is thrown if WHILE is interpreted.
Compilation:
Put the location of a new unresolved forward
reference ORIGIN onto the stack, under the
existing DESTINATION, and save a copy of the compiler
data type heap in the local name space. Append the runtime
semantics given below to the current definition. The semantics
are incomplete untilORIGIN and 1ST are
resolved (e.g., by REPEAT).
Runtime: ( SINGLE -- )
If SINGLE is zero, continue execution at the
location specified by the resolution of ORIGIN.
WHILE is an immediate word.
WID ( STACK-DIAGRAM -- 1ST )
When used in a stack diagram, specifies an input or output parameter with data type WID.
WITHIN ( INTEGER 1ST 1ST -- FLAG )
Perform a comparison of a test value INTEGER with a lower limit 1ST (second parameter) and an upper limit 1ST (third parameter). FLAG is TRUE if and only if either (lower limit < upper limit and (lower limit <= test value and test value < upper limit)) or (lower limit > upper limit and (lower limit <= test value or test value < upper limit)) is true.
WITHIN ( ADDRESS 1ST 1ST -- FLAG )
Perform a comparison of a test value ADDRESS with a lower limit 1ST (second parameter) and an upper limit 1ST (third parameter). FLAG is TRUE if and only if either (lower limit < upper limit and (lower limit <= test value and test value < upper limit)) or (lower limit > upper limit and (lower limit <= test value or test value < upper limit)) is true.
XOR ( SINGLE LOGICAL -- 1ST )
1ST is the bit-by-bit exclusive-or of SINGLE with LOGICAL.
XOR ( DATA-TYPE DATA-TYPE -- 1ST )
1ST is the first DATA-TYPE with attributes that are the bit-by-bit exclusive-or of the attributes of both parameters DATA-TYPE.
[ ( -- )
Interpretation:
Stay in interpretation state.
Compilation:
Perform the execution semantics given below.
Execution: ( -- )
Enter interpretation state.
[ is an immediate word.
['] ( "<spaces>name" -- )
Interpretation:
An exception is thrown if ['] is interpreted.
Compilation:
Skip leading space delimiters. Parse name delimited
by a space. Find name. Append the runtime semantics given
below to the current definition. An exception is thrown
if name is not found.
Runtime: ( -- DEFINITION )
Place DEFINITION, the definition identified by
name, on the stack.
['] is an immediate word.
['CODE] ( "<spaces>name" -- )
Interpretation:
An exception is thrown if ['CODE] is interpreted.
Compilation:
Skip leading space delimiters. Parse name delimited by
a space. Find name. Append the runtime semantics given
below to the current definition. An exception is thrown
if name is not found.
Runtime: ( -- CODE )
Place CODE, the address of the machine code of the
definition identified by name, on the stack.
['CODE] is an immediate word.
['TOKEN] ( "<spaces>name" -- )
Interpretation:
An exception is thrown if ['TOKEN] is interpreted.
Compilation:
Skip leading space delimiters. Parse name delimited by
a space. Find name. Append the runtime semantics given
below to the current definition. An exception is thrown
if name is not found.
Runtime: ( -- TOKEN )
Place TOKEN, the token of the definition identified
by name, on the stack.
['TOKEN] is an immediate word.
[CHAR] ( -- )
Interpretation:
An exception is thrown if [CHAR] is interpreted.
Compilation: ( "<spaces>name" -- )
Skip leading space delimiters. Parse name delimited by
a space. Append the runtime semantics given below to the current
definition.
Runtime: ( -- CHARACTER )
Place CHARACTER, the value of the first character
of name, on the stack. If the length of name is zero,
CHARACTER is the space character.
[CHAR] is an immediate word.
[COMPILE] ( "<spaces>name" -- )
Interpretation:
An exception is thrown if [COMPILE] is interpreted.
Compilation:
Skip leading space delimiters. Parse name delimited by
a space. Find name. Change the compiler data type heap
according to the stack effect of name. If name has
other than default compilation semantics, append them to the current
definition. Otherwise append the execution semantics of name.
An exception is thrown if name is not found.
[COMPILE] is an immediate word.
[DT] ( "<spaces>name" -- )
Interpretation:
An exception is thrown if [DT] is interpreted.
Compilation:
Skip leading space delimiters. Parse name delimited by
a space. Append the runtime semantics given below to the current
definition. An exception is thrown if name is not
the name of a data type.
Runtime: ( -- DATA-TYPE )
Place DATA-TYPE, the data type identified by name,
on the stack.
[DT] is an immediate word.
[LITERAL] ( -- )
Interpretation:
An exception is thrown if [LITERAL] is interpreted.
Compilation:
Append the runtime semantics given below to the current definition.
Runtime: ( x -- )
Compile virtual code t place x on the stack.
x has the same data type as was supplied at compilation time.
[LITERAL] is an immediate word.
\ ( "ccc\" -- )
Compilation:
Perform the execution semantics given below.
Execution:
Parse and discard ccc delimited by a \ (backslash),
but at most until the end the parse area.
The number of characters in ccc may be zero to the number of characters in the parse area.
\ is an immediate word.
] ( -- )
Enter compilation state.
Dr. Stephan Becher - February 4th, 2008