! ( 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.


Note that the stack diagram of the new definition has to be explicitly specified as ( -- CONST -> data-type ) or ( -- CCONST -> data-type ), where data-type is the data type of the item stored in the data field. The execution semantics may be extended by DOES> or ;CODE.


--------------------------------------------------------------------------------


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:

Accept a line from the input source into the input buffer, set >IN to zero, and interpret. 
When all processing has been completed and no exception is thrown, execute PROMPT. 
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.

If the compiler data type heap is locked, restore the contents of the compiler data type heap that was saved when CONTROL-FLOW was created, and unlock the compiler data type heap. 
If the compiler data type heap is not locked, check if the contents of the compiler data type heap exactly matches the one that was saved when CONTROL-FLOW was created. An exception is thrown if a difference is detected. 
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 ) 
Place SINGLE on the stack. The value of SINGLE is that given when name was created, until the phrase TO name is executed, causing a new value of SINGLE to be associated with name.

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 ) 
Place DOUBLE on the stack. The value of DOUBLE is that given when name was created, until the phrase TO name is executed, causing a new value of DOUBLE to be associated with name.

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 ) 
DATA -> SINGLE is the address of the reserved cell. SINGLE has the same data type as was supplied to VARIABLE.


--------------------------------------------------------------------------------


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 ) 
DATA -> DOUBLE is the address of the first one of the reserved two cells. DOUBLE has the same data type as was supplied to VARIABLE.


--------------------------------------------------------------------------------


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:

The content of the definition's code field is equal to the value stored at address CODE 2 +. 
The definition's stack diagram except for the last input parameter is exactly the same as the stack diagram of the sample definition whose address offset is passed in register BX. 
The last input parameter of the definition is either identical to the last input parameter of the sample definition, or a direct or indirect parent of it. 
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.


--------------------------------------------------------------------------------


#BLOCKS ( -- UNSIGNED )

UNSIGNED is the number of blocks available in the block file.


--------------------------------------------------------------------------------


(BLOCK) ( CDATA -> CHARACTER UNSIGNED FLAG -- SIGNED )

If FLAG is FALSE, read the contents of block UNSIGNED from the block file into the buffer with start address CDATA -> CHARACTER. If FLAG is TRUE, write the contents of the buffer starting at CDATA -> CHARACTER to block UNSIGNED of the block file. SIGNED is zero if and oly if the operation was successfully executed.

An ambiguous condition exists if UNSIGNED is not a valid block number.


--------------------------------------------------------------------------------


(CATCH) ( TOKEN INTEGER -- SIGNED )

Extend the execution semantics of (CATCH) with the following:

Consider BLK as part of the input source specification.


--------------------------------------------------------------------------------


?BLOCK ( UNSIGNED -- )

Checks whether UNSIGNED is a valid block number. An exception is thrown if UNSIGNED is zero or greater than the number of the last block.


--------------------------------------------------------------------------------


BLK ( -- DATA -> UNSIGNED )

DATA -> UNSIGNED is the address of a cell containing zero or the number of the block being interpreted. If BLK contains zero, the input source is not a block, and can be identified by SOURCE-ID. An ambiguous condition exists if a program directly alters the contents of BLK.


--------------------------------------------------------------------------------


BLK-BUFF ( -- CDATA -> CHARACTER )

CDATA -> CHARACTER is the address of a single buffer for C/B characters, called block buffer. This buffer is always used when transferring a block from or to the block file.


--------------------------------------------------------------------------------


BLK-STAT ( -- DATA -> SIGNED )

DATA -> SIGNED is the address of a cell containing a number that describes the status of the block buffer. If the number is zero, the block buffer is unassigned. Otherwise, the block buffer is assigned to the block whose number is the absolute value of the number. If the number is negative, the block buffer has been modified with respect to the block in the block file it is assigned to.


--------------------------------------------------------------------------------


BLOCK ( UNSIGNED -- CDATA -> CHARACTER )

If the block buffer is unassigned, transfer block UNSIGNED from the block file to the block buffer.

If block UNSIGNED is not already in the block buffer, and the block buffer is assigned but has not been modified, transfer block UNSIGNED from the block file to the block buffer.

If block UNSIGNED is not already in the block buffer, and the block buffer is assigned and has been modified, transfer the block to the block file and then transfer block UNSIGNED from the block file to the block buffer.

Assign block UNSIGNED to the block buffer. CDATA -> CHARACTER is the address of the block buffer.

Exceptions are thrown if UNSIGNED is not a valid block number or if a block buffer can not be written to or read from the block file.


--------------------------------------------------------------------------------


BUFFER ( UNSIGNED -- CDATA -> CHARACTER )

If block UNSIGNED is not already in the block buffer, and the block buffer is assigned and has been modified, transfer the block to the block file.

Assign block UNSIGNED to the block buffer. CDATA -> CHARACTER is the address of the block buffer.

Exceptions are thrown if UNSIGNED is not a valid block number or if a block buffer can not be written to or read from the block file.


--------------------------------------------------------------------------------


C/B ( -- UNSIGNED )

UNSIGNED is the number of characters in a block (1024).


--------------------------------------------------------------------------------


C/L ( -- UNSIGNED )

UNSIGNED is the number of characters in each line of text in a block (64).


--------------------------------------------------------------------------------


EMPTY-BUFFERS ( -- )

Unassign the block buffer. Do not transfer the contents of the block buffer to the block file.


--------------------------------------------------------------------------------


ERROR ( SIGNED -- )

If SIGNED is neither -1 nor -2, extend the execution semantics of ERROR with the following:

If the input source is a block, display the block number and the line number within the block. If SIGNED is between -3 and -303, display a user readable error message instead of an error number.


--------------------------------------------------------------------------------


EVALUATE ( CDATA -> CHARACTER UNSIGNED -- )

Save the content of BLK, store 0 in BLK, and perform EVALUATE. Then restore the content of BLK.


--------------------------------------------------------------------------------


FLUSH ( -- )

Perform the function of SAVE-BUFFERS, then unassign the block buffer.


--------------------------------------------------------------------------------


LIST ( UNSIGNED -- )

Display block UNSIGNED as 16 lines of text. Store UNSIGNED in SCR.


--------------------------------------------------------------------------------


LOAD ( UNSIGNED -- )

Save the current input source specification. Store UNSIGNED in BLK, thus making block UNSIGNED the input source and setting the input buffer to encompass its contents. Set >IN to zero and interpret. When the parse area is exhausted, restore the prior input source specification. Other stack effects are due to the words LOADed.

An exception is thrown if UNSIGNED is not a valid block number.


--------------------------------------------------------------------------------


QUIT ( -- )

Store 0 in BLK and perform QUIT.


--------------------------------------------------------------------------------


REFILL ( -- FLAG )

Extend the execution semantics of REFILL with the following:

When the input source is a block, make the next block the input source and current input buffer by adding one to the value of BLK and setting >IN to zero. Return TRUE if the new value of BLK is a valid block number, otherwise FALSE.

REFILL is a deferred definition.


--------------------------------------------------------------------------------


RESTORE-INPUT ( INPUT-SOURCE -- FLAG )

Attempt to restore the input source specification to the state described by the tuple INPUT-SOURCE. The input source specification may be the user input device, a character string, or a block. 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.


--------------------------------------------------------------------------------


SAVE-BUFFERS ( -- )

If the block buffer is marked as modified, transfer its contents to the block file. Mark the block buffer as not modified. An exception is thrown if the block buffer is assigned to an invalid block.


--------------------------------------------------------------------------------


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. The input source specification may be the user input device, a character string, or a block.


--------------------------------------------------------------------------------


SCR ( -- DATA -> UNSIGNED )

DATA -> UNSIGNED is the address of a cell containing the block number of the block most recently LISTed.


--------------------------------------------------------------------------------


SOURCE ( CDATA -> CHARACTER UNSIGNED -- )

Extend the execution semantics of SOURCE with the following:

When the input source is a block, CDATA -> CHARACTER is the address of the block buffer assigned to block BLK, and UNSIGNED is the number of characters in the block.

SOURCE is a deferred definition.


--------------------------------------------------------------------------------


THROW ( SIGNED -- )

Extend the execution semantics of THROW with the following:

Consider BLK as part of the input source specification.


--------------------------------------------------------------------------------


THRU ( UNSIGNED 1ST -- )

LOAD the blocks numbered UNSIGNED through 1ST in sequence. Other stack effects are due to the words LOADed.

An exception is thrown if UNSIGNED is greater than 1ST, or if either UNSIGNED or 1ST are no valid block numbers.


--------------------------------------------------------------------------------


UPDATE ( -- )

Mark the block buffer as modified.

Note: UPDATE does not immediately cause a transfer to the block file.


--------------------------------------------------------------------------------


\ ( "ccc\" -- )

Compilation: 
Perform the execution semantics given below.

Execution: 
If BLK contains zero, parse and discard ccc delimited by a second \ (backslash), but at most until the end the parse area. Otherwise parse and discard ccc delimited by a second \ (backslash), but at most the portion of the parse area corresponding to the remainder of the current line.

\ is an immediate word.


--------------------------------------------------------------------------------


(ABORT") ( SINGLE CCONST -> CHARACTER UNSIGNED -- )

If any bit of SINGLE is not zero, store CCONST -> CHARACTER in ERROR-ADDR, store UNSIGNED in ERROR-COUNT, and then perform the function of -2 THROW.

(ABORT") is an internal definition compiled by ABORT".


--------------------------------------------------------------------------------


(CATCH) ( TOKEN INTEGER -- SIGNED )

Push an exception frame onto the return stack and then execute the execution token TOKEN in such a way that control can be transferred to a point just after CATCH if THROW is executed during the execution of TOKEN. INTEGER is the difference of the data stack depth (in cells) before and after normal execution of TOKEN. INTEGER is positive if executing TOKEN decreases the data stack size, negative if executing TOKEN increases the data stack size, and zero if executing TOKEN does not change the data stack size.

If the execution of TOKEN completes normally (i.e., the exception frame pushed by CATCH is not popped by an execution of THROW) pop the exception frame and return zero as SIGNED on top of the data stack, above whatever stack items would have been returned by executing TOKEN. Otherwise, the remainder of the execution semantics are given by THROW.

Note: (CATCH) is a low-level word that is executed or compiled by CATCH.


--------------------------------------------------------------------------------


?SIZE ( DATA-TYPE -- UNSIGNED )

UNSIGNED is the size in cells of data type DATA-TYPE. An exception is thrown if the size of DATA-TYPE cannot be determined.


--------------------------------------------------------------------------------


ABORT ( -- )

Perform the function of -1 THROW.


--------------------------------------------------------------------------------


ABORT" ( "ccc" -- )

Extend the semantics of ABORT" as follows.

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, store the character string ccc in ERROR-ADDR and ERROR-COUNT, and then perform the function of -2 THROW.

ABORT" is an immediate word.


--------------------------------------------------------------------------------


CATCH ( -- )

Interpretation: ( TOKEN -- SIGNED ) 
An exception is thrown if TOKEN is not a qualified token, or if the stack diagram associated with the qualified token contains one or more parameters of data type TUPLE or its direct or indirect subtypes. Push an exception frame onto the return stack and then execute the execution token TOKEN in such a way that control can be transferred to a point just after CATCH if THROW is executed during the execution of TOKEN. Adjust the interpreter data type heap according to the stack diagram associated with TOKEN.

If the execution of TOKEN completes normally (i.e., the exception frame pushed by CATCH is not popped by an execution of THROW) pop the exception frame and return zero as SIGNED on top of the data stack, above whatever stack items would have been returned by executing TOKEN. Otherwise, the remainder of the execution semantics are given by THROW.

Compilation: 
An exception is thrown if the top of the compiler data type heap does not contain a qualified token, or if the stack diagram associated with the qualified token contains one or more parameters of data type TUPLE or its direct or indirect subtypes. Adjust the compiler data type heap according to the stack diagram associated with the qualified token. Append the runtime semantics given below to the current definition.

Runtime: ( TOKEN -- SIGNED ) 
Push an exception frame onto the return stack and then execute the execution token TOKEN in such a way that control can be transferred to a point just after CATCH if THROW is executed during the execution of TOKEN.

If the execution of TOKEN completes normally (i.e., the exception frame pushed by CATCH is not popped by an execution of THROW) pop the exception frame and return zero as SIGNED on top of the data stack, above whatever stack items would have been returned by executing TOKEN. Otherwise, the remainder of the execution semantics are given by THROW.

CATCH is an immediate word.


--------------------------------------------------------------------------------


DEPTH-SP ( -- UNSIGNED )

UNSIGNED is the depth of the data stack in cells, calculated from the contents of 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 depth of the data stack cannot be determined.

Note: In interpretation state, UNSIGNED includes the output parameters of the word that is currently being interpreted. UNSIGNED equals the actual number of cells on the data stack only if the data stack and the interpreter data type heap are aligned.

Note: In compilation state, UNSIGNED is zero if the compiler data type heap is locked.


--------------------------------------------------------------------------------


ERROR ( SIGNED -- )

If SIGNED is not equal to zero, display an error message depending on the value of SIGNED. Then perform the function of ABORT.

If SIGNED is -1, display no message at all.

If SIGNED is -2, display the error message that is specified by the contents of system variables ERROR-ADDR and ERROR-COUNT.

If SIGNED is neither -1 nor -2, 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.


--------------------------------------------------------------------------------


ERROR-ADDR ( -- DATA -> CCONST -> CHARACTER )

DATA -> CCONST -> CHARACTER is the address of a cell that contains the address of the character string, which is to be displayed by ERROR if the error code is -2.


--------------------------------------------------------------------------------


ERROR-COUNT ( -- DATA -> UNSIGNED )

DATA -> UNSIGNED is the address of a cell that contains the number of characters to be displayed by ERROR if the error code is -2.


--------------------------------------------------------------------------------


HANDLER ( -- DATA -> DATA )

A variable that contains a pointer to the location of the innermost exception frame on the return stack. HANDLER contains a null pointer if no exception frame is available.


--------------------------------------------------------------------------------


QUIT ( -- )

Empty the return stack. Store a null address in system variable HANDLER. 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:

Accept a line from the input source into the input buffer, set >IN to zero, and interpret. 
Display " OK" if in interpretation state, all processing has been completed, and no exception is thrown. 
After the end of the input source has exceeded, terminate StrongForth and return control to the operating system.


--------------------------------------------------------------------------------


THROW ( SIGNED -- )

If SIGNED is non-zero, pop the latest exception frame along with everything on the return stack above that frame. Then restore the input source specification in use before the CATCH that pushed that exception frame. Adjust the depth of the data stack so that it is the same as if the corresponding CATCH were executed normally, i. e., without THROW. Put SIGNED on top of the data stack, and transfer control to a point just after the corresponding CATCH.

If no exception frame is present, execute ERROR with SIGNED on top of the data stack.

Other than in ANS Forth, the depth of the data stack immediately after CATCH does not depend on whether THROW was executed or not. The data stack pointer always has the value it would have if the execution token provided to CATCH were executed normally.

THROW is a deferred definition.


--------------------------------------------------------------------------------


(GET-DATE) ( -- UNSIGNED UNSIGNED UNSIGNED UNSIGNED )

Get the current DOS system date. The first UNSIGNED is the day of the month (1 to 31). The second UNSIGNED is the month (1 to 12). The third UNSIGNED is the year (1980 to 2099). The fourth UNSIGNED indicates the day of the week (0 = Sunday, 1 = Monday, ..., 6 = Saturday).

(GET-DATE) corresponds to DOS interrupt 21 (hex), function 2A (hex).


--------------------------------------------------------------------------------


(GET-TIME) ( -- UNSIGNED UNSIGNED UNSIGNED UNSIGNED )

Get the current DOS system time. The first UNSIGNED is the number ot centiseconds (0 to 99). The second UNSIGNED is the seconds (0 to 99). The third UNSIGNED is the minutes (0 to 59). The fourth UNSIGNED is the hours (0 to 23).

(GET-TIME) corresponds to DOS interrupt 21 (hex), function 2C (hex).


--------------------------------------------------------------------------------


AT-XY ( UNSIGNED UNSIGNED -- )

Position the cursor of the user output device at the column specified by the first UNSIGNED and the row specified by the second UNSIGNED. The next character to be displayed will appear at this position. The upper left corner of the user output device is column zero, row zero. An ambiguous condition exists if the first UNSIGNED is not less than the number of columns, or if the second UNSIGNED is not less than the number of rows of the user output device.


--------------------------------------------------------------------------------


EKEY ( -- UNSIGNED )

Receive one keyboard event UNSIGNED from the user input device.


--------------------------------------------------------------------------------


EKEY>CHAR ( UNSIGNED -- 1ST FLAG )

If the keyboard event UNSIGNED corresponds to a character, return its ASCII value as 1ST and TRUE as FLAG. Otherwise, 1ST is equal to UNSIGNED and FLAG is FALSE.


--------------------------------------------------------------------------------


EKEY? ( -- FLAG )

FLAG is TRUE if and only if a character is available from the user input device. The character will be returned by the next execution of KEY or EKEY. After EKEY? returns with a value of TRUE, subsequent executions of KEY? or EKEY? prior to the execution of KEY or EKEY also return true, without discarding keyboard events.

Note: The semantics of EKEY? is identical to the semantics of KEY?.


--------------------------------------------------------------------------------


EMIT? ( -- FLAG )

FLAG is true if the user output device is ready to accept data and the execution of EMIT in place of EMIT? would not have suffered an indefinite delay.


--------------------------------------------------------------------------------


HOME ( -- )

Position the cursor of the user output device at upper left corner of the user output device. The next character to be displayed will appear at this position.


--------------------------------------------------------------------------------


KEY? ( -- FLAG )

FLAG is TRUE if and only if a character is available from the user input device. The character will be returned by the next execution of KEY or EKEY. After KEY? returns with a value of TRUE, subsequent executions of KEY? or EKEY? prior to the execution of KEY or EKEY also return true, without discarding keyboard events.


--------------------------------------------------------------------------------


MS ( UNSIGNED -- )

Wait at least UNSIGNED milliseconds.


--------------------------------------------------------------------------------


PAGE ( -- )

Clear the screen and reset the cursor position to the upper left corner.


--------------------------------------------------------------------------------


TICKS ( -- UNSIGNED-DOUBLE )

UNSIGNED-DOUBLE is the value of the system timer, which is incremented 18.2 times per second.


--------------------------------------------------------------------------------


TIME&DATE ( -- UNSIGNED UNSIGNED UNSIGNED UNSIGNED UNSIGNED UNSIGNED )

Return the current time and date represented by six unsigned numbers: second (0 to 59), minute (0 to 59), hour (0 to 23), day (1 to 31), month (1 to 12), year (e.g., 2007). The year in on top of the stack.


--------------------------------------------------------------------------------


" ( -- )

Extend the semantics of " to be:

Interpretation: ( "ccc<quote>" -- CDATA -> CHARACTER UNSIGNED ) 
Parse ccc delimited by " (double-quote). Store the resulting string at address STR. and return STR as CDATA -> CHARACTER. Store the length of the resulting string at #STR and return it as UNSIGNED. An ambiguous condition exists if the length of the string exceeds 80 characters.

Note: Subsequent uses of " will overwrite the buffer.

Compilation: ( "ccc<quote>" -- ) 
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.


--------------------------------------------------------------------------------


#FIB ( -- DATA -> UNSIGNED )

DATA -> UNSIGNED is the address of a cell containing the number of characters in the file input buffer.


--------------------------------------------------------------------------------


#STR ( -- DATA -> UNSIGNED )

DATA -> UNSIGNED is the address of a cell containing the number of characters in the string buffer.

Note: The string buffer is used by " in interpretation state, and by >STR.


--------------------------------------------------------------------------------


(ALLOCATE) ( UNSIGNED -- FAR-ADDRESS 1ST SIGNED )

Allocate UNSIGNED paragraphs of contiguous memory space. The initial content of the allocated space is undefined. If the allocation succeeds, FAR-ADDRESS is the aligned starting address of the allocated space, 1ST is the number of paragraphs allocated, and SIGNED is zero. If the operation fails, FAR-ADDRESS does not represent a valid address, 1ST is the number of paragraphs allocated, and SIGNED is the DOS error code.

(ALLOCATE) corresponds to DOS interrupt 21 (hex), function 48 (hex).


--------------------------------------------------------------------------------


(ALLOCATION-STRATEGY) ( UNSIGNED UNSIGNED -- 1ST SIGNED ) 

If the second UNSIGNED is equal to 0, 1ST indicates the currently selected memory allocation strategy. If the second UNSIGNED is equal to 1, select the memory allocation strategy indicated by the first UNSIGNED, and return it as 1ST. SIGNED is non-zero if either UNSIGNED has an undefined value.

Second UNSIGNED and 1ST Memory Allocation Strategy 
0 Reserve the first fitting block, starting from low addresses. 
1 Reserve the best fitting block. 
2 Reserve the first fitting block, starting from high addresses. 

(ALLOCATION-STRATEGY) corresponds to DOS interrupt 21 (hex), function 58 (hex).


--------------------------------------------------------------------------------


(ATTRIBUTES) ( CDATA -> CHARACTER LOGICAL UNSIGNED -- 3RD SIGNED )

If UNSIGNED is 0, return the attributes of the file identified by the null-terminated character string CDATA -> CHARACTER. If the operation succeeds, SIGNED is zero and 3RD indicates the file attributes as specified in the below table. Otherwise SIGNED is the DOS error code and 3RD is undefined. LOGICAL is ignored.

If UNSIGNED is 1, set the attributes of the file identified by the null-terminated character string CDATA -> CHARACTER to the value of LOGICAL according to the below table. If the operation succeeds, SIGNED is zero and 3RD indicates the new file attributes. Otherwise SIGNED is the DOS error code and 3RD is undefined.

If UNSIGNED is neither 0 nor 1, SIGNED is non-zero and 3RD is undefined.

Bits 15 to 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Attribute 
0 0 0 0 0 0 0 Unlimited access 
0 x x x x x 1 Read only file 
0 x x x x 1 x Hidden file 
0 x x x 1 x x System file 
0 0 0 1 0 0 0 Volume ID 
0 x 1 x x x x Subdirectory 
0 1 x x x x x File has not been archived 

x means don't care.

(ATTRIBUTES) corresponds to DOS interrupt 21 (hex), function 43 (hex).


--------------------------------------------------------------------------------


(CHANGE-DIR) ( CDATA -> CHARACTER -- SIGNED ) 

Change the current directory to the absolute or relative path identified by the null-terminated character string CDATA -> CHARACTER. SIGNED is non-zero if and only if the specified path is invalid.

(CHANGE-DIR) corresponds to DOS interrupt 21 (hex), function 3B (hex).


--------------------------------------------------------------------------------


(CLOSE) ( FILE -- SIGNED )

Close the file identified by FILE. SIGNED is the DOS error code.

(CLOSE) corresponds to DOS interrupt 21 (hex), function 3E (hex).


--------------------------------------------------------------------------------


(CONTROL-I/O) ( SINGLE UNSIGNED SINGLE UNSIGNED -- UNSIGNED LOGICAL SIGNED )

Queries or sets DOS channel information depending on the value of the second parameter UNSIGNED. The other input and output parameters have various meanings as specified in the below table. If the operation succeeds, SIGNED is zero. Otherwise, SIGNED is the DOS error code and the other two output parameters are undefined.

Input Parameters Output Parameters 
SINGLE UNSIGNED SINGLE UNSIGNED UNSIGNED LOGICAL SIGNED 
device handle (unused) (unused)  0 = get device data (undefined) channel info error code 
device handle (unused) device data  1 = set device data (undefined) device data error code 
device handle buffer size buffer address  2 = receive from character device byte count (undefined) error code 
device handle buffer size buffer address  3 = send to character device byte count (undefined) error code 
drive number buffer size buffer address  4 = receive from block device byte count (undefined) error code 
drive number buffer size buffer address  5 = send to block device byte count (undefined) error code 
device handle (unused) (unused)  6 = check input status 0 iff not ready (undefined) error code 
device handle (unused) (unused  7 = check output status 0 iff not ready (undefined) error code 
drive number (unused) (unused)  8 = check if changable 0 iff changable (undefined) error code 
drive number (unused) (unused)  9 = check if device redirected (undefined) channel info error code 
device handle (unused) (unused) 10 = check if handle redirected (undefined) channel info error code 
(unused) retry delay number of retries 11 = set number of retries (undefined) (undefined) error code 
device handle subfunction parameter address 12 = I/O control for character devices (undefined) (undefined) error code 
drive number subfunction parameter address 13 = I/O control for block devices (undefined) (undefined) error code 
drive number (unused) (unused) 14 = get logical drive map drive number (undefined) error code 
drive number (unused) (unused) 15 = set logical drive map drive number (undefined) error code 

(CONTROL-I/O) corresponds to DOS interrupt 21 (hex), function 44 (hex).


--------------------------------------------------------------------------------


(COUNTRY-DEPENDENT-INFORMATION) ( CDATA UNSIGNED -- 2ND SIGNED ) 

For the country code UNSIGNED, copy the country-dependent information to the 32 bytes long buffer starting at address CDATA. If CDATA is equal to FFFF (hex), make UNSIGNED as the current country code. 2ND is the current country code. SIGNED is non-zero if and only if UNSIGNED is an unknown country code.

Buffer Offset Contents 
0 Date and time format:
0 = hh:mm:ss mm/dd/yyyy
1 = hh:mm:ss dd/mm/yyyy
2 = hh:mm:ss yyyy/mm/dd. 
2 Null-terminated currency string 
7 Null-terminated thousand separator 
9 Null-terminated decimal separator 
11 Null-terminated date separator 
13 Null-terminated time separator 
15 Bit 0: Currency string succeeds the value
Bit 1: Currency string preceded by one space
Bit 2: Currency string replaces decimal separator 
16 Number of decimal places for currency 
17 Time format (0 = 12 hours, 1 = 24 hours) 
18 Address of a subroutine that converts country-specific umlauts from lower case to upper case 
22 Null-terminated list separator 
24 Reserved 

(COUNTRY-DEPENDENT-INFORMATION) corresponds to DOS interrupt 21 (hex), function 38 (hex).


--------------------------------------------------------------------------------


(CREATE) ( CDATA -> CHARACTER LOGICAL -- FILE SIGNED )

Create the file named in the null-terminated character string CDATA -> CHARACTER, and open it for read/write file access. If a file with the same name already exists, recreate it as an empty file. If the file was successfully created and opened, SIGNED is zero, FILE is its identifier, and the file has been positioned to the start of the file. Otherwise, SIGNED is the DOS error code and FILE is undefined.

The bits of LOGICAL determine the file attributes as specified in the below table. The operation fails if an undefined bit combination is specified as LOGICAL.

Bits 15 to 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Attribute 
0 0 0 0 0 0 0 Unlimited access 
0 x x x x x 1 Read only file 
0 x x x x 1 x Hidden file 
0 x x x 1 x x System file 
0 0 0 1 0 0 0 Volume ID 
0 x 1 x x x x Subdirectory 
0 1 x x x x x File has not been archived 

x means don't care.

(CREATE) corresponds to DOS interrupt 21 (hex), function 3C (hex).


--------------------------------------------------------------------------------


(CREATE-DIR) ( CDATA -> CHARACTER -- SIGNED ) 

Create a new subdirectory with the absolute or relative path identified by the null-terminated character string CDATA -> CHARACTER. SIGNED is the DOS error code.

(CREATE-DIR) corresponds to DOS interrupt 21 (hex), function 39 (hex).


--------------------------------------------------------------------------------


(CREATE-NEW) ( CDATA -> CHARACTER LOGICAL -- FILE SIGNED )

Create the file named in the null-terminated character string CDATA -> CHARACTER, and open it for read/write file access. If a file with the same name already exists, the operation fails. If the file was successfully created and opened, SIGNED is zero, FILE is its identifier, and the file has been positioned to the start of the file. Otherwise, SIGNED is the DOS error code and FILE is undefined.

The bits of LOGICAL determine the file attributes as specified in the below table. The operation fails if an undefined bit combination is specified as LOGICAL.

Bit 15 to 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Attribute 
0 0 0 0 0 0 0 Unlimited access 
0 x x x x x 1 Read only file 
0 x x x x 1 x Hidden file 
0 x x x 1 x x System file 
0 0 0 1 0 0 0 Volume ID 
0 x 1 x x x x Subdirectory 
0 1 x x x x x File has not been archived 

x means "don't care".

(CREATE-NEW) corresponds to DOS interrupt 21 (hex), function 5B (hex).


--------------------------------------------------------------------------------


(CREATE-TEMPORARY) ( CDATA -> CHARACTER LOGICAL -- FILE SIGNED )

Create a temporary file with a system-generated name in the directory whose path is named in the null-terminated character string CDATA -> CHARACTER, and open it for read/write file access. If the file was successfully created and opened, SIGNED is zero, FILE is its identifier, and the file has been positioned to the start of the file. Otherwise, SIGNED is the DOS error code and FILE is undefined.

The bits of LOGICAL determine the file attributes as specified in the below table. The operation fails if an undefined bit combination is specified as LOGICAL.

Bit 15 to 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Attribute 
0 0 0 0 0 0 0 Unlimited access 
0 x x x x x 1 Read only file 
0 x x x x 1 x Hidden file 
0 x x x 1 x x System file 
0 0 0 1 0 0 0 Volume ID 
0 x 1 x x x x Subdirectory 
0 1 x x x x x File has not been archived 

x means "don't care". 

(CREATE-TEMPORARY) corresponds to DOS interrupt 21 (hex), function 5A (hex).


--------------------------------------------------------------------------------


(CTRL-C-CHECK) ( SINGLE UNSIGNED -- FLAG FLAG ) 

If UNSIGNED is equal to 0, query the system's reaction to the entry of control-C. If UNSIGNED is equal to 1 and SIGNED is zero, turn control-C interrupts off. If UNSIGNED is equal to 1, and SIGNED is non-zero, turn control-C interrupts on. The first FLAG is FALSE if control-C interrupts are turned off, and TRUE if control-C interrupts are turned on. The second FLAG is TRUE if and only if UNSIGNED is either 0 or 1.

(CTRL-C-CHECK) corresponds to DOS interrupt 21 (hex), function 33 (hex).


--------------------------------------------------------------------------------


(CURRENT-DIR) ( CDATA -> CHARACTER UNSIGNED -- SIGNED ) 

For the drive indicated by UNSIGNED, copy the absolute path of the current directory to the buffer starting at CDATA -> CHARACTER. The buffer shall be at least 64 characters long. SIGNED is non-zero if and only if UNSIGNED does not indicate a valid drive.

UNSIGNED Drive 
0 Current drive 
1 A: 
2 B: 
3 C: 
... ... 

(CURRENT-DIR) corresponds to DOS interrupt 21 (hex), function 47 (hex).


--------------------------------------------------------------------------------


(DEALLOCATE) ( FAR-ADDRESS -- SIGNED )

Return the contiguous region of memory space indicated by FAR-ADDRESS to the system for later allocation. FAR-ADDRESS shall indicate a region of memory space that was previously obtained by (ALLOCATE) or (REALLOCATE). If the operation succeeds, SIGNED is zero. If the operation fails, SIGNED is the DOS error code.

(DEALLOCATE) corresponds to DOS interrupt 21 (hex), function 49 (hex).


--------------------------------------------------------------------------------


(DELETE) ( CDATA -> CHARACTER -- SIGNED )

Delete the file named in the null-terminated character string CDATA -> CHARACTER. SIGNED is the DOS error code.

(DELETE) corresponds to DOS interrupt 21 (hex), function 41 (hex).


--------------------------------------------------------------------------------


(DUPLICATE) ( FILE -- 1ST SIGNED )

Create a second access channel to the file FILE. 1ST is the second access channel. The file itself and all its attributes, like the value returned by POSITION, remain unique. SIGNED is the DOS error code.

(DUPLICATE) corresponds to DOS interrupt 21 (hex), function 45 (hex).


--------------------------------------------------------------------------------


(FLUSH) ( FILE -- SIGNED )

Attempt to force any buffered information written to the file referred to by FILE to be written to mass storage, and the size information for the file to be recorded in the storage directory if changed. SIGNED is the DOS error code.

(FLUSH) corresponds to DOS interrupt 21 (hex), function 68 (hex).


--------------------------------------------------------------------------------


(FORCED-DUPLICATE) ( FILE FILE -- SIGNED )

Create a second access channel to the file FILE. The second FILE is the predefined second access channel. The file itself and all its attributes, like the value returned by POSITION, remain unique. If the second access channel already exists, the channel previously associated with it is being closed. SIGNED is the DOS error code.

(FORCED-DUPLICATE) corresponds to DOS interrupt 21 (hex), function 46 (hex).


--------------------------------------------------------------------------------


(GET-DISK-FREE-SPACE) ( UNSIGNED -- UNSIGNED UNSIGNED UNSIGNED UNSIGNED ) 

Returns information about the drive specified by UNSIGNED:

Total number of clusters. 
Number of bytes per sector. 
Number of free clusters. 
Number of sectors per cluster, or FFFF (hex) if UNSIGNED is not a valid drive. 

UNSIGNED Drive 
0 Current drive 
1 A: 
2 B: 
3 C: 
... ... 

(GET-DISK-FREE-SPACE) corresponds to DOS interrupt 21 (hex), function 36 (hex).


--------------------------------------------------------------------------------


(GET-DOS-VERSION) ( -- UNSIGNED-DOUBLE UNSIGNED UNSIGNED ) 

UNSIGNED-DOUBLE is the DOS serial number. The first UNSIGNED is the minor DOS version number. The second UNSIGNED is the major DOS version number.

(GET-DOS-VERSION) corresponds to DOS interrupt 21 (hex), function 30 (hex).


--------------------------------------------------------------------------------


(GET-DRIVE) ( -- UNSIGNED ) 

UNSIGNED identifies the current drive.

UNSIGNED Drive 
0 A: 
1 B: 
2 C: 
... ... 

(GET-DRIVE) corresponds to DOS interrupt 21 (hex), function 19 (hex).


--------------------------------------------------------------------------------


(GET-DRIVE-DATA) ( UNSIGNED -- FAR-ADDRESS UNSIGNED UNSIGNED UNSIGNED ) 

Returns information about the drive specified by UNSIGNED:

Address of the identification byte of the file allocation table (FAT).. 
Number of bytes per sector. 
Total number of clusters. 
Number of sectors per cluster, or 00FF (hex) if UNSIGNED is not a valid drive. 

UNSIGNED Drive 
0 Current drive 
1 A: 
2 B: 
3 C: 
... ... 

(GET-DRIVE-DATA) corresponds to DOS interrupt 21 (hex), function 1C (hex).


--------------------------------------------------------------------------------


(GET-DTA) ( -- FAR-ADDRESS ) 

FAR-ADDRESS is the disk transfer address (DTA).

(GET-DTA) corresponds to DOS interrupt 21 (hex), function 2F (hex).


--------------------------------------------------------------------------------


(GET-INTERRUPT) ( UNSIGNED -- FAR-ADDRESS ) 

FAR-ADDRESS is the address of the interrupt service routine assigned to interrupt UNSIGNED.

(GET-INTERRUPT) corresponds to DOS interrupt 21 (hex), function 35 (hex).


--------------------------------------------------------------------------------


(GET-VERIFY-FLAG) ( -- FLAG ) 

FLAG is TRUE if and only if automatic verification of data written to mass storage is turned on.

(GET-VERIFY-FLAG) corresponds to DOS interrupt 21 (hex), function 54 (hex).


--------------------------------------------------------------------------------


(LAST-WRITE) ( FILE DOUBLE UNSIGNED -- 2ND SIGNED ) 

If UNSIGNED is equal to 0, query the time and date of the last access to the file FILE. If UNSIGNED is equal to 1, set the time and date of the last access to the file FILE to the value encoded in DOUBLE. SIGNED is non-zero if and only if either UNSIGNED or FILE are invalid. DOUBLE is divided into bit fields containing year, month, date, hours, minutes and seconds as binary numbers:

Year-1980 Month Day Hours Minutes Seconds/2 

Bits Content 
0 to 4  Seconds divided by 2 (0 to 29)  
5 to 10  Minutes (0 to 59)  
11 to 15  Hours (0 to 23)  
16 to 20  Date (1 to 31)  
21 to 24  Month (1 to 12)  
25 to 31  Year minus 1980  

(LAST-WRITE) corresponds to DOS interrupt 21 (hex), function 57 (hex).


--------------------------------------------------------------------------------


(LOAD/EXECUTE) ( CDATA -> CHARACTER FAR-ADDRESS UNSIGNED -- SIGNED ) 

If UNSIGNED is equal to 0, load and execute the DOS program whose path and file name is identified by the null-terminated character string CDATA -> CHARACTER. FAR-ADDRESS is the address of the parameter block. SIGNED is the DOS error code.

If UNSIGNED is equal to 3, load the DOS overlay whose path and file name is identified by the null-terminated character string CDATA -> CHARACTER. FAR-ADDRESS is the address of the parameter block. SIGNED is the DOS error code.

An ambiguous condition exists if UNSIGNED has any other value.

(LOAD/EXECUTE) corresponds to DOS interrupt 21 (hex), function 4B (hex).


--------------------------------------------------------------------------------


(LOCK/UNLOCK) ( FILE UNSIGNED-DOUBLE UNSIGNED-DOUBLE UNSIGNED -- SIGNED )

Lock or unlock any access to the whole or a part of the file FILE. The first UNSIGNED-DOUBLE is the position within the file where the locked part starts. The second UNSIGNED-DOUBLE is the length of the locked part. If UNSIGNED is 0, the specified part is locked. If UNSIGNED is 1, the specified part is unlocked. All other values of UNSIGNED will cause the operation to fail. SIGNED is the DOS error code.

(LOCK/UNLOCK) corresponds to DOS interrupt 21 (hex), function 5C (hex).


--------------------------------------------------------------------------------


(OPEN) ( CDATA -> CHARACTER FAM -- FILE SIGNED )

Open the file named in the null-terminated character string CDATA -> CHARACTER, with file access method FAM. If the file is successfully opened, SIGNED is zero, FILE is its identifier, and the file has been positioned to the start of the file. Otherwise, SIGNED is the DOS error code and FILE is undefined.

(OPEN) corresponds to DOS interrupt 21 (hex), function 3D (hex).


--------------------------------------------------------------------------------


(POSITION) ( FILE INTEGER-DOUBLE UNSIGNED -- UNSIGNED-DOUBLE SIGNED )

Reposition the file identified by FILE. If UNSIGNED is 0, the new position is the (unsigned) value of INTEGER-DOUBLE. If UNSIGNED is 1, the new position is the current position plus or minus the (signed) value of INTEGER-DOUBLE. If UNSIGNED is 2, the new position is the end of the file plus or minus the (signed) value of INTEGER-DOUBLE. The operation fails if UNSIGNED has any other value. UNSIGNED-DOUBLE is the new position of the file. SIGNED is the DOS error code.

(POSITION) corresponds to DOS interrupt 21 (hex), function 42 (hex).


--------------------------------------------------------------------------------


(PSP) ( -- FAR-ADDRESS ) 

FAR-ADDRESS is the address of the program segment prefix (PSP).

(PSP) corresponds to DOS interrupt 21 (hex), function 62 (hex).


--------------------------------------------------------------------------------


(READ) ( CDATA -> CHARACTER UNSIGNED FILE -- 3RD SIGNED )

Read UNSIGNED consecutive characters to address CDATA -> CHARACTER from the current position of the file identified by FILE. If UNSIGNED characters are read without an exception, SIGNED is zero and 3RD is equal to UNSIGNED. If the end of the file is reached before UNSIGNED characters are read, SIGNED is zero and 3RD is the number of characters actually read. If the operation is initiated when the value returned by POSITION is equal to the value returned by SIZE for the file identified by FILE, SIGNED is zero and 3RD is zero. If the operation fails, SIGNED is the DOS error code, and 3RD is zero. An ambiguous condition exists if the operation is initiated when the value returned by POSITION is greater than the value returned by SIZE for the file identified by FILE, or if the requested operation attempts to read portions of the file not written. At the conclusion of the operation, POSITION returns the next file position after the last character read.

(READ) corresponds to DOS interrupt 21 (hex), function 3F (hex).


--------------------------------------------------------------------------------


(REALLOCATE) ( FAR-ADDRESS UNSIGNED -- 2ND SIGNED )

Change the allocation of the contiguous memory space starting at the address FAR-ADDRESS, previously allocated by (ALLOCATE) or (REALLOCATE), to UNSIGNED paragraphs. UNSIGNED may be either larger or smaller than the current size of the region in paragraphs. If the operation succeeds, 2ND is the number of paragraphs allocated and SIGNED is zero. If the operation fails, the region of memory at FAR-ADDRESS is unaffected, 2ND is undefined, and SIGNED is the DOS error code.

(REALLOCATE) corresponds to DOS interrupt 21 (hex), function 4A (hex).


--------------------------------------------------------------------------------


(REMOVE-DIR) ( CDATA -> CHARACTER -- SIGNED ) 

Remove the subdirectory with the absolute or relative path identified by the null-terminated character string CDATA -> CHARACTER. It is not possible to remove the current directory, or a directory that is not empty. SIGNED is the DOS error code.

(REMOVE-DIR) corresponds to DOS interrupt 21 (hex), function 3A (hex).


--------------------------------------------------------------------------------


(RENAME) ( CDATA -> CHARACTER CDATA -> CHARACTER -- SIGNED )

Rename the file named by the first null-terminated character string CDATA -> CHARACTER to the name in the second null-terminated character string CDATA -> CHARACTER. SIGNED is the DOS error code.

(RENAME) corresponds to DOS interrupt 21 (hex), function 56 (hex).


--------------------------------------------------------------------------------


(RETURN-CODE) ( -- UNSIGNED UNSIGNED ) 

Returns the status of a terminated program. The first UNSIGNED is the program's return code if it terminated normally. The second UNSIGNED indicates the type of termination according to the below table.

Second UNSIGNED Type Of Termination 
0 Normal 
1 Control-C 
2 Fatal Device Error 
3 Terminate Stay Resident (TSR) 

(RETURN-CODE) corresponds to DOS interrupt 21 (hex), function 4D (hex).


--------------------------------------------------------------------------------


(SEARCH-DIR) ( CDATA -> CHARACTER LOGICAL -- SIGNED ) 

Search for a file whose name matches the pattern stored in the null-terminated character string CDATA -> CHARACTER. The pattern consists of an optional path and file name and may contain wildcards. LOGICAL provides attributes that allow finding additional entries in the target directory if the corresponding bits are set:

Bit Attribute 
1 Hidden file 
2 System file 
3 Volume ID 
4 Subdirectory 

SIGNED is zero if a file has been found whose name matches the pattern. Otherwise, SIGNED is the DOS error code. Information about the file is stored at the disk transfer address:

Address Contents 
DTA Reserved 
DTA+21 File attributes 
DTA+22 Date and time of last file access 
DTA+26 File size 
DTA+30 File name as null-terminated character string 

(SEARCH-DIR) corresponds to DOS interrupt 21 (hex), function 4E (hex).


--------------------------------------------------------------------------------


(SEARCH-DIR-NEXT) ( -- SIGNED ) 

Search for the next file with the same pattern and attributes as were provided in the previous execution of (SEARCH-DIR). 

SIGNED is zero if another file has been found whose name matches the pattern. Otherwise, SIGNED is the DOS error code. Information about the file is stored at the disk transfer address:

Address Contents 
DTA Reserved 
DTA+21 File attributes 
DTA+22 Date and time of last file access 
DTA+26 File size 
DTA+30 File name as null-terminated character string 

(SEARCH-DIR) corresponds to DOS interrupt 21 (hex), function 4F (hex).


--------------------------------------------------------------------------------


(SET-DATE) ( UNSIGNED UNSIGNED UNSIGNED -- FLAG ) 

Set the current DOS system date. The first UNSIGNED is the day of the month (1 to 31). The second UNSIGNED is the month (1 to 12). The third UNSIGNED is the year (1980 to 2099).

(SET-DATE) corresponds to DOS interrupt 21 (hex), function 2B (hex).


--------------------------------------------------------------------------------


(SET-DRIVE) ( UNSIGNED -- 1ST ) 

Make the drive identified by UNSIGNED the current drive. 1ST is the total number of drives specified by LASTDRIVE.

UNSIGNED Drive 
0 A: 
1 B: 
2 C: 
... ... 

(SET-DRIVE) corresponds to DOS interrupt 21 (hex), function 0E (hex).


--------------------------------------------------------------------------------


(SET-DTA) ( FAR-ADDRESS -- ) 

Make FAR-ADDRESS the disk transfer address (DTA).

(SET-DTA) corresponds to DOS interrupt 21 (hex), function 1A (hex).


--------------------------------------------------------------------------------


(SET-INTERRUPT) ( FAR-ADDRESS UNSIGNED -- ) 

Make FAR-ADDRESS the address of the interrupt service routine assigned to interrupt UNSIGNED.

(SET-INTERRUPT) corresponds to DOS interrupt 21 (hex), function 25 (hex).


--------------------------------------------------------------------------------


(SET-TIME) ( UNSIGNED UNSIGNED UNSIGNED UNSIGNED -- FLAG ) 

Set the current DOS system time. The first UNSIGNED is the number ot centiseconds (0 to 99). The second UNSIGNED is the seconds (0 to 99). The third UNSIGNED is the minutes (0 to 59). The fourth UNSIGNED is the hours (0 to 23).

(SET-TIME) corresponds to DOS interrupt 21 (hex), function 2D (hex).


--------------------------------------------------------------------------------


(SET-VERIFY-FLAG) ( SINGLE -- ) 

If SINGLE is non-zero, turn on automatic verification of data written to mass storage. If SINGLE is zero, turn off automatic verification of data written to mass storage.

(SET-VERIFY-FLAG) corresponds to DOS interrupt 21 (hex), function 2E (hex).


--------------------------------------------------------------------------------


(TERMINATE) ( UNSIGNED -- ) 

Terminate StrongForth and return control to DOS with return code UNSIGNED. Neither the block file nor any other open files are closed.

(TERMINATE) corresponds to DOS interrupt 21 (hex), function 4C (hex).


--------------------------------------------------------------------------------


(TSR) ( UNSIGNED UNSIGNED -- )

Terminate StrongForth and stay resident. The first UNSIGNED is the DOS return code. The second UNSIGNED is the number of paragraphs reserved for the resident program. Neither the block file nor any other open files are closed.

(TSR) corresponds to DOS interrupt 21 (hex), function 31 (hex).


--------------------------------------------------------------------------------


(WRITE) ( CCONST -> CHARACTER UNSIGNED FILE -- SIGNED )

Write UNSIGNED characters from address CDATA -> CHARACTER to the file identified by FILE starting at its current position. SIGNED is the DOS error code. At the conclusion of the operation, POSITION returns the next file position after the last character written to the file, and SIZE returns a value greater than or equal to the value returned by POSITION.

(WRITE) corresponds to DOS interrupt 21 (hex), function 40 (hex).


--------------------------------------------------------------------------------


(WRITE) ( CDATA -> CHARACTER UNSIGNED FILE -- SIGNED )

Write UNSIGNED characters from address CCONST -> CHARACTER to the file identified by FILE starting at its current position. SIGNED is the DOS error code. At the conclusion of the operation, POSITION returns the next file position after the last character written to the file, and SIZE returns a value greater than or equal to the value returned by POSITION.

(WRITE) corresponds to DOS interrupt 21 (hex), function 40 (hex).


--------------------------------------------------------------------------------


>IOR ( SIGNED -- 1ST )

1ST is the I/O result code corresponding to the DOS error code SIGNED.


--------------------------------------------------------------------------------


>PARAGRAPHS ( UNSIGNED -- 1ST )

1ST is the minimum number of paragraphs that are required to store a contiguous memory block of UNSIGNED address units.


--------------------------------------------------------------------------------


>STR ( CDATA -> CHARACTER UNSIGNED CDATA -> CHARACTER -- 4 TH )

Copy the character string CDATA -> CHARACTER UNSIGNED to address CDATA -> CHARACTER and append a trailing null character to make it a null-terminated string. 4 TH is equal to the second CDATA -> CHARACTER. An ambiguous condition exists if the buffer at address CDATA -> CHARACTER is less than UNSIGNED+1 characters long.

Note: Null-terminated strings are required as parameters for DOS interrupts.


--------------------------------------------------------------------------------


>STR ( CDATA -> CHARACTER UNSIGNED -- CDATA -> CHARACTER )

Copy the character string CDATA -> CHARACTER UNSIGNED to the string buffer and append a trailing null character to make it a null-terminated string. Return the address of the string buffer as CDATA -> CHARACTER. An ambiguous condition exists if UNSIGNED is greater than 79, which is the size of the string buffer minus 1.

Note: Null-terminated strings are required as parameters for DOS interrupts.


--------------------------------------------------------------------------------


>STR ( CCONST -> CHARACTER UNSIGNED CDATA -> CHARACTER -- 4 TH )

Copy the character string CCONST -> CHARACTER UNSIGNED to address CDATA -> CHARACTER and append a trailing null character to make it a null-terminated string. 4 TH is equal to CDATA -> CHARACTER. An ambiguous condition exists if the buffer at address CDATA -> CHARACTER is less than UNSIGNED+1 characters long.

Note: Null-terminated strings are required as parameters for DOS interrupts.


--------------------------------------------------------------------------------


>STR ( CCONST -> CHARACTER UNSIGNED -- CDATA -> CHARACTER )

Copy the character string CCONST -> CHARACTER UNSIGNED to the string buffer and append a trailing null character to make it a null-terminated string. Return the address of the string buffer as CDATA -> CHARACTER. An ambiguous condition exists if UNSIGNED is greater than 79, which is the size of the string buffer minus 1.

Note: Null-terminated strings are required as parameters for DOS interrupts.


--------------------------------------------------------------------------------


?REFILL ( -- )

When the input source is a text file, re-read the current line from the file to the file input buffer. >IN remains unchanged.

Note: ?REFILL is used by words like INCLUDE, EVALUATE and THROW, which restore the input source specification after the file input buffer might have been overwritten.


--------------------------------------------------------------------------------


BIN ( FAM -- 1ST )

Modify FAM to additionally select a binary, i.e., not line oriented, file access method, giving 1ST.


--------------------------------------------------------------------------------


CFAR-ALLOCATE ( UNSIGNED -- CFAR-ADDRESS SIGNED )

Allocate UNSIGNED address units of contiguous memory space. The initial content of the allocated memory space is undefined. If the allocation succeeds, CFAR-ADDRESS is the aligned starting address of the allocated memory space and SIGNED is zero. If the operation fails, CFAR-ADDRESS does not represent a valid address and SIGNED is the I/O result code.


--------------------------------------------------------------------------------


CLOSE ( FILE -- SIGNED )

Close the file identified by FILE. SIGNED is the I/O result code.


--------------------------------------------------------------------------------


CREATE ( CDATA -> CHARACTER FAM -- FILE SIGNED )

Create the file named in the null-terminated character string CDATA -> CHARACTER, and open it with file access method FAM. If a file with the same name already exists, recreate it as an empty file. If the file was successfully created and opened, SIGNED is zero, FILE is its identifier, and the file has been positioned to the start of the file. Otherwise, SIGNED is the I/O result code and FILE is undefined.


--------------------------------------------------------------------------------


CREATE ( CDATA -> CHARACTER UNSIGNED FAM -- FILE SIGNED )

Create the file named in the character string CDATA -> CHARACTER UNSIGNED, and open it with file access method FAM. If a file with the same name already exists, recreate it as an empty file. If the file was successfully created and opened, SIGNED is zero, FILE is its identifier, and the file has been positioned to the start of the file. Otherwise, SIGNED is the I/O result code and FILE is undefined.


--------------------------------------------------------------------------------


CREATE ( CCONST -> CHARACTER UNSIGNED FAM -- FILE SIGNED )

Create the file named in the character string CCONST -> CHARACTER UNSIGNED, and open it with file access method FAM. If a file with the same name already exists, recreate it as an empty file. If the file was successfully created and opened, SIGNED is zero, FILE is its identifier, and the file has been positioned to the start of the file. Otherwise, SIGNED is the I/O result code and FILE is undefined.


--------------------------------------------------------------------------------


DELETE ( CDATA -> CHARACTER UNSIGNED -- SIGNED )

Delete the file named in the character string CDATA -> CHARACTER UNSIGNED. SIGNED is the I/O result code.


--------------------------------------------------------------------------------


DELETE ( CCONST -> CHARACTER UNSIGNED -- SIGNED )

Delete the file named in the character string CCONST -> CHARACTER UNSIGNED. SIGNED is the I/O result code.


--------------------------------------------------------------------------------


FAM ( STACK-DIAGRAM -- 1ST )

When used in a stack diagram, specifies an input or output parameter with data type FAM.


--------------------------------------------------------------------------------


FAR-ALLOCATE ( UNSIGNED -- FAR-ADDRESS SIGNED )

Allocate UNSIGNED address units of contiguous memory space. The initial content of the allocated memory space is undefined. If the allocation succeeds, FAR-ADDRESS is the aligned starting address of the allocated memory space and SIGNED is zero. If the operation fails, FAR-ADDRESS does not represent a valid address and SIGNED is the I/O result code.


--------------------------------------------------------------------------------


FIB ( -- CDATA -> CHARACTER )

CDATA -> CHARACTER is the address of the file input buffer. The file input buffer is 1024 characters long.


--------------------------------------------------------------------------------


FLUSH ( FILE -- SIGNED )

Attempt to force any buffered information written to the file referred to by FILE to be written to mass storage, and the size information for the file to be recorded in the storage directory if changed. If the operation is successful, SIGNED is zero. Otherwise, it is the I/O result code.


--------------------------------------------------------------------------------


FREE ( FAR-ADDRESS -- SIGNED )

Return the contiguous region of memory space indicated by FAR-ADDRESS to the system for later allocation. FAR-ADDRESS shall indicate a region of memory space that was previously obtained by FAR-ALLOCATE or RESIZE. If the operation succeeds, or FAR-ADDRESS is null, SIGNED is zero. If the operation fails, SIGNED is the I/O result code.


--------------------------------------------------------------------------------


FREE ( CFAR-ADDRESS -- SIGNED )

Return the contiguous region of memory space indicated by CFAR-ADDRESS to the system for later allocation. CFAR-ADDRESS shall indicate a region of memory space that was previously obtained by CFAR-ALLOCATE or RESIZE. If the operation succeeds, or CFAR-ADDRESS is null, SIGNED is zero. If the operation fails, SIGNED is the I/O result code.


--------------------------------------------------------------------------------


INCLUDE ( CDATA -> CHARACTER UNSIGNED -- )

Remove CDATA -> CHARACTER UNSIGNED from the stack. Save the current input source specification, including the value of SOURCE-ID. Open the file specified by CDATA -> CHARACTER UNSIGNED, store the resulting file identifier in SOURCE-ID, and make it the input source. Store zero in BLK. Other stack effects are due to the words included.

Repeat until end of file: read a line from the file, fill the input buffer from the contents of that line, set >IN to zero, and interpret. Text interpretation begins at the file position where the next file read would occur. When the end of the file is reached, close the file and restore the input source specification to its saved value. An exception is thrown if the named file can not be opened, if an I/O exception occurs reading the file, or if an I/O exception occurs while closing the file. When an exception is thrown, the status (open or closed) of any files that were being interpreted is undefined.


--------------------------------------------------------------------------------


INCLUDE ( FILE -- )

Remove FILE from the stack. Save the current input source specification, including the value of SOURCE-ID. Store FILE in SOURCE-ID. Make the file specified by FILE the input source. Store zero in BLK. Other stack effects are due to the words included.

Repeat until end of file: read a line from the file, fill the input buffer from the contents of that line, set >IN to zero, and interpret. Text interpretation begins at the file position where the next file read would occur. When the end of the file is reached, close the file and restore the input source specification to its saved value. An exception is thrown if FILE is invalid, if there is an I/O exception reading FILE, or if an I/O exception occurs while closing FILE. When an exception is thrown, the status (open or closed) of any files that were being interpreted is undefined.


--------------------------------------------------------------------------------


OPEN ( CDATA -> CHARACTER UNSIGNED FAM -- FILE SIGNED )

Open the file named in the character string CDATA -> CHARACTER UNSIGNED, with file access method FAM. If the file is successfully opened, SIGNED is zero, FILE is its identifier, and the file has been positioned to the start of the file. Otherwise, SIGNED is the I/O result code and FILE is undefined.


--------------------------------------------------------------------------------


OPEN ( CCONST -> CHARACTER UNSIGNED FAM -- FILE SIGNED )

Open the file named in the character string CCONST -> CHARACTER UNSIGNED, with file access method FAM. If the file is successfully opened, SIGNED is zero, FILE is its identifier, and the file has been positioned to the start of the file. Otherwise, SIGNED is the I/O result code and FILE is undefined.


--------------------------------------------------------------------------------


POSITION ( FILE -- UNSIGNED-DOUBLE SIGNED )

UNSIGNED-DOUBLE is the current file position for the file identified by FILE. SIGNED is the I/O result code. UNSIGNED-DOUBLE is undefined if SIGNED is non-zero.


--------------------------------------------------------------------------------


R/O ( -- FAM )

FAM is the value for selecting the read only file access method.


--------------------------------------------------------------------------------


R/W ( -- FAM )

FAM is the value for selecting the read/write file access method.


--------------------------------------------------------------------------------


READ ( CDATA -> CHARACTER UNSIGNED FILE -- 3RD SIGNED )

Read UNSIGNED consecutive characters to address CDATA -> CHARACTER from the current position of the file identified by FILE. If UNSIGNED characters are read without an exception, SIGNED is zero and 3RD is equal to UNSIGNED. If the end of the file is reached before UNSIGNED characters are read, SIGNED is zero and 3RD is the number of characters actually read. If the operation is initiated when the value returned by POSITION is equal to the value returned by SIZE for the file identified by FILE, SIGNED is zero and 3RD is zero. If the operation fails, SIGNED is the I/O result code, and 3RD is zero. An ambiguous condition exists if the operation is initiated when the value returned by POSITION is greater than the value returned by SIZE for the file identified by FILE, or if the requested operation attempts to read portions of the file not written. At the conclusion of the operation, POSITION returns the next file position after the last character read.


--------------------------------------------------------------------------------


READ-LINE ( CDATA -> CHARACTER UNSIGNED FILE -- 3RD FLAG SIGNED )

Read the next line from the file specified by FILE into memory at the address CDATA -> CHARACTER. At most UNSIGNED characters are read. Up to two line-terminating characters (<CR> and <LF>) may be read into memory at the end of the line, but are not included in the count 3RD. The line buffer provided by CDATA -> CHARACTER should be at least UNSIGNED+2 characters long. If the operation succeeded, FLAG is true and SIGNED is zero. If a line terminator was received before UNSIGNED characters were read, then 3RD is the number of characters, not including the line terminator, actually read (0 <= 3RD <= UNSIGNED). When UNSIGNED = 3RD, the line terminator has yet to be reached. If the operation is initiated when the value returned by POSITION is equal to the value returned by SIZE for the file identified by FILE, FLAG is false, SIGNED is zero, and 3RD is zero. If SIGNED is non-zero, the operation failed and SIGNED is the I/O result code.

An ambiguous condition exists if the operation is initiated when the value returned by POSITION is greater than the value returned by SIZE for the file identified by FILE, or if the requested operation attempts to read portions of the file not written. At the conclusion of the operation, POSITION returns the next file position after the last character read. 


--------------------------------------------------------------------------------


REFILL ( -- FLAG )

Extend the execution semantics of REFILL with the following:

When the input source is a text file, attempt to read the next line from the file to the file input buffer. If successful, set >IN to zero, and return TRUE as FLAG. Otherwise return FALSE as FLAG.

REFILL is a deferred definition.


--------------------------------------------------------------------------------


RENAME ( CDATA -> CHARACTER UNSIGNED CDATA -> CHARACTER UNSIGNED -- SIGNED )

Rename the file named by the first character string CDATA -> CHARACTER UNSIGNED to the name in the second character string CDATA -> CHARACTER UNSIGNED. SIGNED is the I/O result code. 


--------------------------------------------------------------------------------


RENAME ( CDATA -> CHARACTER UNSIGNED CCONST -> CHARACTER UNSIGNED -- SIGNED )

Rename the file named by the character string CDATA -> CHARACTER UNSIGNED to the name in the character string CCONST -> CHARACTER UNSIGNED. SIGNED is the I/O result code. 


--------------------------------------------------------------------------------


RENAME ( CCONST -> CHARACTER UNSIGNED CDATA -> CHARACTER UNSIGNED -- SIGNED )

Rename the file named by the character string CCONST -> CHARACTER UNSIGNED to the name in the character string CDATA -> CHARACTER UNSIGNED. SIGNED is the I/O result code. 


--------------------------------------------------------------------------------


RENAME ( CCONST -> CHARACTER UNSIGNED CCONST -> CHARACTER UNSIGNED -- SIGNED )

Rename the file named by the first character string CCONST -> CHARACTER UNSIGNED to the name in the second character string CCONST -> CHARACTER UNSIGNED. SIGNED is the I/O result code. 


--------------------------------------------------------------------------------


REPOSITION ( UNSIGNED-DOUBLE FILE -- SIGNED )

Reposition the file identified by FILE to UNSIGNED-DOUBLE. SIGNED is the I/O result code. At the conclusion of the operation, POSITION returns the value UNSIGNED-DOUBLE.


--------------------------------------------------------------------------------


RESIZE ( UNSIGNED-DOUBLE FILE -- SIGNED )

Set the size of the file identified by FILE to UNSIGNED-DOUBLE. SIGNED is the I/O result code. If the resultant file is larger than the file before the operation, the portion of the file added as a result of the operation is undefined. At the conclusion of the operation, both SIZE and POSITION return the value UNSIGNED-DOUBLE.


--------------------------------------------------------------------------------


RESIZE ( FAR-ADDRESS UNSIGNED -- 1ST SIGNED )

Change the allocation of the contiguous memory space starting at the address FAR-ADDRESS, previously allocated by FAR-ALLOCATE or RESIZE, to UNSIGNED address units. UNSIGNED may be either larger or smaller than the current size of the region. If the operation succeeds, 1ST is the aligned starting address of UNSIGNED address units of allocated memory and SIGNED is zero. If the operation fails, the region of memory at FAR-ADDRESS is unaffected, and SIGNED is the I/O result code. 1ST is always the same as FAR-ADDRESS.

If FAR-ADDRESS is zero, RESIZE just performs the semantics of FAR-ALLOCATE.


--------------------------------------------------------------------------------


RESIZE ( CFAR-ADDRESS UNSIGNED -- 1ST SIGNED )

Change the allocation of the contiguous memory space starting at the address CFAR-ADDRESS, previously allocated by CFAR-ALLOCATE or RESIZE, to UNSIGNED address units. UNSIGNED may be either larger or smaller than the current size of the region. If the operation succeeds, 1ST is the aligned starting address of UNSIGNED address units of allocated memory and SIGNED is zero. If the operation fails, the region of memory at CFAR-ADDRESS is unaffected, and SIGNED is the I/O result code. 1ST is always the same as CFAR-ADDRESS.

If CFAR-ADDRESS is zero, RESIZE just performs the semantics of CFAR-ALLOCATE.


--------------------------------------------------------------------------------


RESTORE-INPUT ( INPUT-SOURCE -- FLAG )

Attempt to restore the input source specification to the state described by the tuple INPUT-SOURCE. The input source specification may be the user input device, a character string, a block or a file. 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.


--------------------------------------------------------------------------------


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. The input source specification may be the user input device, a character string, a block or a file.


--------------------------------------------------------------------------------


SIZE ( FILE -- UNSIGNED-DOUBLE SIGNED )

UNSIGNED-DOUBLE is the size, in characters, of the file identified by FILE. SIGNED is the I/O result code. This operation does not affect the value returned by POSITION. UNSIGNED-DOUBLE is undefined if SIGNED is non-zero.


--------------------------------------------------------------------------------


SIZE ( FAR-ADDRESS -- UNSIGNED-DOUBLE )

UNSIGNED-DOUBLE is the size in address units of the contiguous memory space starting at the address FAR-ADDRESS that has previously been obtained by FAR-ALLOCATE or RESIZE. UNSIGNED-DOUBLE is zero if FAR-ADDRESS is not the address of a contiguous memory space that has previously been obtained by FAR-ALLOCATE or RESIZE. 


--------------------------------------------------------------------------------


SIZE ( CFAR-ADDRESS -- UNSIGNED-DOUBLE )

UNSIGNED-DOUBLE is the size in address units of the contiguous memory space starting at the address CFAR-ADDRESS that has previously been obtained by CFAR-ALLOCATE or RESIZE. UNSIGNED-DOUBLE is zero if CFAR-ADDRESS is not the address of a contiguous memory space that has previously been obtained by CFAR-ALLOCATE or RESIZE.


--------------------------------------------------------------------------------


SOURCE ( -- CDATA -> CHARACTER UNSIGNED )

Extend the execution semantics of SOURCE with the following:

When the input source is a text file, CDATA -> CHARACTER is the address of the file input buffer, and UNSIGNED is the number of characters in the file input buffer.

SOURCE is a deferred definition.


--------------------------------------------------------------------------------


STATUS ( CDATA -> CHARACTER UNSIGNED -- LOGICAL SIGNED )

Return the status of the file named by the character string CDATA -> CHARACTER UNSIGNED. If the file exists, SIGNED is zero; otherwise SIGNED is the I/O result code. The bits of LOGICAL indicate file attributes as specified in the below table.

Bits 15 to 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Attribute 
0 0 0 0 0 0 0 Unlimited access 
0 x x x x x 1 Read only file 
0 x x x x 1 x Hidden file 
0 x x x 1 x x System file 
0 0 0 1 0 0 0 Volume ID 
0 x 1 x x x x Subdirectory 
0 1 x x x x x File has not been archived 

x means don't care.


--------------------------------------------------------------------------------


STATUS ( CCONST -> CHARACTER UNSIGNED -- LOGICAL SIGNED )

Return the status of the file named by the character string CCONST -> CHARACTER UNSIGNED. If the file exists, SIGNED is zero; otherwise SIGNED is the I/O result code. The bits of LOGICAL indicate file attributes as specified in the below table.

Bits 15 to 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Attribute 
0 0 0 0 0 0 0 Unlimited access 
0 x x x x x 1 Read only file 
0 x x x x 1 x Hidden file 
0 x x x 1 x x System file 
0 0 0 1 0 0 0 Volume ID 
0 x 1 x x x x Subdirectory 
0 1 x x x x x File has not been archived 

x means don't care.


--------------------------------------------------------------------------------


STR ( -- CDATA -> CHARACTER )

CDATA -> CHARACTER is the address of the string buffer. The string buffer is 80 characters long.

Note: The string buffer is used by " in interpretation state and by >STR.


--------------------------------------------------------------------------------


W/O ( -- FAM )

FAM is the value for selecting the write only file access method.


--------------------------------------------------------------------------------


WRITE ( CDATA -> CHARACTER UNSIGNED FILE -- SIGNED )

Write UNSIGNED characters from address CDATA -> CHARACTER to the file identified by FILE starting at its current position. SIGNED is the I/O result code. At the conclusion of the operation, POSITION returns the next file position after the last character written to the file, and SIZE returns a value greater than or equal to the value returned by POSITION.


--------------------------------------------------------------------------------


WRITE ( CCONST -> CHARACTER UNSIGNED FILE -- SIGNED )

Write UNSIGNED characters from address CCONST -> CHARACTER to the file identified by FILE starting at its current position. SIGNED is the I/O result code. At the conclusion of the operation, POSITION returns the next file position after the last character written to the file, and SIZE returns a value greater than or equal to the value returned by POSITION.


--------------------------------------------------------------------------------


WRITE-EOL ( FILE -- SIGNED )

Write a line terminator (<CR> and <LF>) to the file identified by FILE at its current position. SIGNED is the I/O result code. At the conclusion of the operation, POSITION returns the next file position after the second character written to the file, and SIZE returns a value greater than or equal to the value returned by POSITION.


--------------------------------------------------------------------------------


WRITE-LINE ( CDATA -> CHARACTER UNSIGNED FILE -- SIGNED )

Write UNSIGNED characters from address CDATA -> CHARACTER followed by a line terminator (<CR> and <LF>) to the file identified by FILE starting at its current position. SIGNED is the I/O result code. At the conclusion of the operation, POSITION returns the next file position after the last character written to the file, and SIZE returns a value greater than or equal to the value returned by POSITION.


--------------------------------------------------------------------------------


WRITE-LINE ( CCONST -> CHARACTER UNSIGNED FILE -- SIGNED )

Write UNSIGNED characters from address CCONST -> CHARACTER followed by a line terminator (<CR> and <LF>) to the file identified by FILE starting at its current position. SIGNED is the I/O result code. At the conclusion of the operation, POSITION returns the next file position after the last character written to the file, and SIZE returns a value greater than or equal to the value returned by POSITION.


--------------------------------------------------------------------------------


! ( FLOAT CODE -> 1ST -- )

Store FLOAT at address CODE as 64-bit floating-point number.


--------------------------------------------------------------------------------


! ( FLOAT CONST -> 1ST -- )

Store FLOAT at address CONST as 64-bit floating-point number.


--------------------------------------------------------------------------------


! ( FLOAT DATA -> 1ST -- )

Store FLOAT at address DATA as 64-bit floating-point number.


--------------------------------------------------------------------------------


! ( FLOAT DFCODE -> 1ST -- )

Store FLOAT at address DFCODE as 64-bit IEEE floating-point number.


--------------------------------------------------------------------------------


! ( FLOAT DFCONST -> 1ST -- )

Store FLOAT at address DFCONST as 64-bit IEEE floating-point number.


--------------------------------------------------------------------------------


! ( FLOAT DFDATA -> 1ST -- )

Store FLOAT at address DFDATA as 64-bit IEEE floating-point number.


--------------------------------------------------------------------------------


! ( FLOAT DFFAR-ADDRESS -> 1ST -- )

Store FLOAT at address DFFAR-ADDRESS as 64-bit IEEE floating-point number.


--------------------------------------------------------------------------------


! ( FLOAT FAR-ADDRESS -> 1ST -- )

Store FLOAT at address FAR-ADDRESS as 64-bit floating-point number.


--------------------------------------------------------------------------------


! ( FLOAT SFCODE -> 1ST -- )

Store FLOAT at address SFCODE as 32-bit IEEE floating-point number.


--------------------------------------------------------------------------------


! ( FLOAT SFCONST -> 1ST -- )

Store FLOAT at address SFCONST as 32-bit IEEE floating-point number.


--------------------------------------------------------------------------------


! ( FLOAT SFDATA -> 1ST -- )

Store FLOAT at address SFDATA as 32-bit IEEE floating-point number.


--------------------------------------------------------------------------------


! ( FLOAT SFFAR-ADDRESS -> 1ST -- )

Store FLOAT at address SFFAR-ADDRESS as 32-bit IEEE floating-point number.


--------------------------------------------------------------------------------


(+LOOP) ( INTEGER ADDRESS -> FLOAT -- )

An ambiguous condition exists if the loop control parameters are unavailable. Add INTEGER, multiplied by the size of a floating-point number 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 -> FLOAT is a dummy parameter indicating the data type of the loop index.

(+LOOP) is an internal definition compiled by +LOOP.


--------------------------------------------------------------------------------


(+LOOP) ( INTEGER DFADDRESS -- )

An ambiguous condition exists if the loop control parameters are unavailable. Add INTEGER, multiplied by the size of a 64-bit IEEE floating-point number 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. DFADDRESS is a dummy parameter indicating the data type of the loop index.

(+LOOP) is an internal definition compiled by +LOOP.


--------------------------------------------------------------------------------


(+LOOP) ( INTEGER SFADDRESS -- )

An ambiguous condition exists if the loop control parameters are unavailable. Add INTEGER, multiplied by the size of a 32-bit IEEE floating-point number 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. SFADDRESS is a dummy parameter indicating the data type of the loop index.

(+LOOP) is an internal definition compiled by +LOOP.


--------------------------------------------------------------------------------


(>R) ( FLOAT -- )

Push FLOAT onto the return stack.

(>R) is an internal definition compiled by >R and (LOCAL).


--------------------------------------------------------------------------------


(CATCH) ( TOKEN INTEGER INTEGER -- SIGNED )

Push an exception frame onto the return stack and then execute the execution token TOKEN in such a way that control can be transferred to a point just after CATCH if THROW is executed during the execution of TOKEN. The first INTEGER is the difference of the data stack depth (in cells) before and after normal execution of TOKEN. The second INTEGER is the difference of the hardware floating-point stack depth before and after normal execution of TOKEN. Both parameters INTEGER are positive if executing TOKEN decreases the stack size, negative if executing TOKEN increases the stack size, and zero if executing TOKEN does not change the stack size.

If the execution of TOKEN completes normally (i.e., the exception frame pushed by CATCH is not popped by an execution of THROW) pop the exception frame and return zero as SIGNED on top of the data stack, above whatever stack items would have been returned by executing TOKEN. Otherwise, the remainder of the execution semantics are given by THROW.

Note: (CATCH) is a low-level word that is executed or compiled by CATCH.


--------------------------------------------------------------------------------


(FR@) ( -- FLOAT )

Fetch FLOAT from the return stack. The return stack remains unchanged.

(FR@) is an internal definition compiled by LOCAL,.


--------------------------------------------------------------------------------


(FRDROP) ( -- )

Pop FLOAT from the return stack and discard it.

(FRDROP) is an internal definition compiled by R>.


--------------------------------------------------------------------------------


(LOOP) ( ADDRESS -> FLOAT -- )

An ambiguous condition exists if the loop control parameters are unavailable. Add the size of a floating-point number 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 -> FLOAT is a dummy parameter indicating the data type of the loop index.

(LOOP) is an internal definition compiled by LOOP.


--------------------------------------------------------------------------------


(LOOP) ( DFADDRESS -- )

An ambiguous condition exists if the loop control parameters are unavailable. Add the size of a 64-bit IEEE floating-point number 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. DFADDRESS is a dummy parameter indicating the data type of the loop index.

(LOOP) is an internal definition compiled by LOOP.


--------------------------------------------------------------------------------


(LOOP) ( SFADDRESS -- )

An ambiguous condition exists if the loop control parameters are unavailable. Add the size of a 32-bit IEEE floating-point number 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. SFADDRESS is a dummy parameter indicating the data type of the loop index.

(LOOP) is an internal definition compiled by LOOP.


--------------------------------------------------------------------------------


(REPRESENT) ( CDATA -> CHARACTER UNSIGNED FLOAT -- )

At CDATA -> CHARACTER, place the character-string external representation of the rounded integer part of the absolute value of the floating-point number FLOAT. The character string consists of UNSIGNED digits, extended by leading zeros as required. Rounding follows the round to nearest rule. An ambiguous condition exists if the absolute value of FLOAT is bigger than what can be represented with UNSIGNED digits, or if FLOAT is not a valid floating-point number.


--------------------------------------------------------------------------------


(SE.) ( FLOAT SIGNED -- )

Display FLOAT with a trailing space using exponential notation, where the significand is greater than or equal to 1.0 and less than 10.0 to the power SIGNED, and the decimal exponent is a multiple of SIGNED: 

Exponential notation := <significand><exponent>
<significand>        := [-]<digits>.<digits0>
<exponent>           := E[-]<digits>
<digits>             := <digit><digits0>
<digits0>            := <digit>*
<digit>              := { 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 }
An ambiguous condition exists if SIGNED is not greater than zero or if the value of the number-conversion radix BASE is not (decimal) ten.

(SE.) is an internal definition used by E. and S..


--------------------------------------------------------------------------------


* ( FLOAT FLOAT -- 1ST )

Multiply two floating-point numbers FLOAT giving the product 1ST. The result has the same data type as the multiplicand.


--------------------------------------------------------------------------------


* ( FLOAT SIGNED -- 1ST )

Multiply FLOAT by SIGNED giving the floating-point product 1ST. 


--------------------------------------------------------------------------------


* ( FLOAT SIGNED-DOUBLE -- 1ST )

Multiply FLOAT by SIGNED-DOUBLE giving the floating-point product 1ST. 


--------------------------------------------------------------------------------


* ( FLOAT UNSIGNED -- 1ST )

Multiply FLOAT by UNSIGNED giving the floating-point product 1ST. 


--------------------------------------------------------------------------------


** ( FLOAT FLOAT -- 1ST )

Raise the first FLOAT to the power given by the second FLOAT, giving the product 1ST. An ambiguous condition exists if the second FLOAT is negative, or if the quotient lies outside of the range of a floating-point number.


--------------------------------------------------------------------------------


*10^N ( FLOAT SIGNED -- 1ST )

1ST is equal to FLOAT multiplied by 10 raised to the power SIGNED. SIGNED may be positive, negative, or zero.


--------------------------------------------------------------------------------


+ ( ADDRESS -> FLOAT INTEGER -- 1ST )

Add INTEGER to ADDRESS -> FLOAT, giving the sum 1ST. Since ADDRESS points to a floating-point number, INTEGER is automatically multiplied by the number of address units per floating-point number before the actual addition takes place.


--------------------------------------------------------------------------------


+ ( DFADDRESS INTEGER -- 1ST )

Add INTEGER to DFADDRESS, giving the sum 1ST. Since DFADDRESS points to a 64-bit IEEE floating-point number, INTEGER is automatically multiplied by the number of address units per 64-bit IEEE floating-point number before the actual addition takes place.


--------------------------------------------------------------------------------


+ ( DFFAR-ADDRESS INTEGER -- 1ST )

Add INTEGER to DFFAR-ADDRESS, giving the sum 1ST. Since DFFAR-ADDRESS points to a 64-bit IEEE floating-point number, INTEGER is automatically multiplied by the number of address units per 64-bit IEEE floating-point number before the actual addition takes place.


--------------------------------------------------------------------------------


+ ( FAR-ADDRESS -> FLOAT INTEGER -- 1ST )

Add INTEGER to FAR-ADDRESS -> FLOAT, giving the sum 1ST. Since FAR-ADDRESS points to a floating-point number, INTEGER is automatically multiplied by the number of address units per floating-point number before the actual addition takes place.


--------------------------------------------------------------------------------


+ ( FLOAT FLOAT -- 1ST )

Add the second FLOAT to the first FLOAT, giving the sum 1ST. The result has the same data type as the first FLOAT.


--------------------------------------------------------------------------------


+ ( FLOAT SIGNED -- 1ST )

Add SIGNED to FLOAT, giving the floating-point sum 1ST.


--------------------------------------------------------------------------------


+ ( FLOAT SIGNED-DOUBLE -- 1ST )

Add SIGNED-DOUBLE to FLOAT, giving the floating-point sum 1ST.


--------------------------------------------------------------------------------


+ ( FLOAT INTEGER -- 1ST )

Add INTEGER to FLOAT, giving the floating-point sum 1ST. INTEGER is assumed to be an unsigned number.


--------------------------------------------------------------------------------


+ ( SFADDRESS INTEGER -- 1ST )

Add INTEGER to SFADDRESS, giving the sum 1ST. Since SFADDRESS points to a 32-bit IEEE floating-point number, INTEGER is automatically multiplied by the number of address units per 32-bit IEEE floating-point number before the actual addition takes place.


--------------------------------------------------------------------------------


+ ( SFFAR-ADDRESS INTEGER -- 1ST )

Add INTEGER to SFFAR-ADDRESS, giving the sum 1ST. Since SFFAR-ADDRESS points to a 32-bit IEEE floating-point number, INTEGER is automatically multiplied by the number of address units per 32-bit IEEE floating-point number before the actual addition takes place.


--------------------------------------------------------------------------------


+! ( FLOAT DATA -> FLOAT -- )

Add FLOAT to the floating-point number at address DATA -> FLOAT.


--------------------------------------------------------------------------------


+! ( FLOAT DFDATA -- )

Add FLOAT to the 64-bit IEEE floating-point number at address DFDATA.


--------------------------------------------------------------------------------


+! ( FLOAT SFDATA -- )

Add FLOAT to the 32-bit IEEE floating-point number at address SFDATA.


--------------------------------------------------------------------------------


+! ( INTEGER DATA -> ADDRESS -> FLOAT -- )

Add INTEGER to the address stored at address DATA -> ADDRESS -> FLOAT. Since ADDRESS points to a floating-point number, INTEGER is automatically multiplied by the number of address units per floating-point number before the actual addition takes place.


--------------------------------------------------------------------------------


+! ( INTEGER DATA -> DFADDRESS -- )

Add INTEGER to the address stored at address DATA -> DFADDRESS. Since DFADDRESS points to a 64-bit IEEE floating-point number, INTEGER is automatically multiplied by the number of address units per 64-bit IEEE floating-point number before the actual addition takes place.


--------------------------------------------------------------------------------


+! ( INTEGER DATA -> DFFAR-ADDRESS -- )

Add INTEGER to the address stored at address DATA -> DFFAR-ADDRESS. Since DFFAR-ADDRESS points to a 64-bit IEEE floating-point number, INTEGER is automatically multiplied by the number of address units per 64-bit IEEE floating-point number before the actual addition takes place.


--------------------------------------------------------------------------------


+! ( INTEGER DATA -> FAR-ADDRESS -> FLOAT -- )

Add INTEGER to the address stored at address DATA -> FAR-ADDRESS -> FLOAT. Since FAR-ADDRESS points to a floating-point number, INTEGER is automatically multiplied by the number of address units per floating-point number before the actual addition takes place.


--------------------------------------------------------------------------------


+! ( INTEGER DATA -> SFADDRESS -- )

Add INTEGER to the address stored at address DATA -> SFADDRESS. Since SFADDRESS points to a 32-bit IEEE floating-point number, INTEGER is automatically multiplied by the number of address units per 32-bit IEEE floating-point number before the actual addition takes place.


--------------------------------------------------------------------------------


+! ( INTEGER DATA -> SFFAR-ADDRESS -- )

Add INTEGER to the address stored at address DATA -> SFFAR-ADDRESS. Since SFFAR-ADDRESS points to a 32-bit IEEE floating-point number, INTEGER is automatically multiplied by the number of address units per 32-bit IEEE floating-point number before the actual addition takes place.


--------------------------------------------------------------------------------


+! ( SIGNED DATA -> FLOAT -- )

Add SIGNED to the floating-point number at address DATA -> FLOAT.


--------------------------------------------------------------------------------


+! ( SIGNED DFDATA -- )

Add SIGNED to the 64-bit IEEE floating-point number at address DFDATA.


--------------------------------------------------------------------------------


+! ( SIGNED SFDATA -- )

Add SIGNED to the 32-bit IEEE floating-point number at address SFDATA.


--------------------------------------------------------------------------------


+! ( SIGNED-DOUBLE DATA -> FLOAT -- )

Add SIGNED-DOUBLE to the floating-point number at address DATA -> FLOAT.


--------------------------------------------------------------------------------


+! ( SIGNED-DOUBLE DFDATA -- )

Add SIGNED-DOUBLE to the 64-bit IEEE floating-point number at address DFDATA.


--------------------------------------------------------------------------------


+! ( SIGNED-DOUBLE SFDATA -- )

Add SIGNED-DOUBLE to the 32-bit IEEE floating-point number at address SFDATA.


--------------------------------------------------------------------------------


+! ( INTEGER DATA -> FLOAT -- )

Add INTEGER to the floating-point number at address DATA -> FLOAT. INTEGER is assumed to be an unsigned number.


--------------------------------------------------------------------------------


+! ( INTEGER DFDATA -- )

Add INTEGER to the 64-bit IEEE floating-point number at address DFDATA. INTEGER is assumed to be an unsigned number.


--------------------------------------------------------------------------------


+! ( INTEGER SFDATA -- )

Add INTEGER to the 32-bit IEEE floating-point number at address SFDATA. INTEGER is assumed to be an unsigned number.


--------------------------------------------------------------------------------


, ( FLOAT -- )

Reserve space for a floating-point number in the current memory space and store FLOAT in it. 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.


--------------------------------------------------------------------------------


- ( ADDRESS -> FLOAT 1ST -- SIGNED )

Subtract 1ST from ADDRESS -> FLOAT, giving the intermediate difference n. Since ADDRESS points to a floating-point number, the result SIGNED is equal to n divided by the number of address units per floating-point number.


--------------------------------------------------------------------------------


- ( ADDRESS -> FLOAT INTEGER -- 1ST )

Subtract INTEGER from ADDRESS -> FLOAT, giving the difference 1ST. Since ADDRESS points to a floating-point number, INTEGER is automatically multiplied by the number of address units per floating-point number before the actual subtraction takes place.


--------------------------------------------------------------------------------


- ( DFADDRESS 1ST -- SIGNED )

Subtract 1ST from DFADDRESS, giving the intermediate difference n. Since DFADDRESS points to a 64-bit IEEE floating-point number, the result SIGNED is equal to n divided by the number of address units per floating-point number.


--------------------------------------------------------------------------------


- ( DFADDRESS INTEGER -- 1ST )

Subtract INTEGER from DFADDRESS, giving the difference 1ST. Since DFADDRESS points to a 64-bit IEEE floating-point number, INTEGER is automatically multiplied by the number of address units per 64-bit IEEE floating-point number before the actual subtraction takes place.


--------------------------------------------------------------------------------


- ( DFFAR-ADDRESS INTEGER -- 1ST )

Subtract INTEGER from DFFAR-ADDRESS, giving the difference 1ST. Since DFFAR-ADDRESS points to a 64-bit IEEE floating-point number, INTEGER is automatically multiplied by the number of address units per 64-bit IEEE floating-point number before the actual subtraction takes place.


--------------------------------------------------------------------------------


- ( FAR-ADDRESS -> FLOAT INTEGER -- 1ST )

Subtract INTEGER from FAR-ADDRESS -> FLOAT, giving the difference 1ST. Since FAR-ADDRESS points to a floating-point number, INTEGER is automatically multiplied by the number of address units per floating-point number before the actual subtraction takes place.


--------------------------------------------------------------------------------


- ( FLOAT FLOAT -- 1ST )

Subtract the second FLOAT from the first FLOAT, giving the difference 1ST. The result has the same data type as the first FLOAT.


--------------------------------------------------------------------------------


- ( FLOAT SIGNED -- 1ST )

Subtract SIGNED from FLOAT, giving the floating-point difference 1ST.


--------------------------------------------------------------------------------


- ( FLOAT SIGNED-DOUBLE -- 1ST )

Subtract SIGNED-DOUBLE from FLOAT, giving the floating-point difference 1ST.


--------------------------------------------------------------------------------


- ( FLOAT INTEGER -- 1ST )

Subtract INTEGER from FLOAT, giving the floating-point difference 1ST. INTEGER is assumed to be an unsigned number.


--------------------------------------------------------------------------------


- ( SFADDRESS 1ST -- SIGNED )

Subtract 1ST from SFADDRESS, giving the intermediate difference n. Since SFADDRESS points to a 32-bit IEEE floating-point number, the result SIGNED is equal to n divided by the number of address units per floating-point number.


--------------------------------------------------------------------------------


- ( SFADDRESS INTEGER -- 1ST )

Subtract INTEGER from SFADDRESS, giving the difference 1ST. Since SFADDRESS points to a 32-bit IEEE floating-point number, INTEGER is automatically multiplied by the number of address units per 32-bit IEEE floating-point number before the actual subtraction takes place.


--------------------------------------------------------------------------------


- ( SFFAR-ADDRESS INTEGER -- 1ST )

Subtract INTEGER from SFFAR-ADDRESS, giving the difference 1ST. Since SFFAR-ADDRESS points to a 32-bit IEEE floating-point number, INTEGER is automatically multiplied by the number of address units per 32-bit IEEE floating-point number before the actual subtraction takes place.


--------------------------------------------------------------------------------


-TRAILINGZEROS ( CDATA -> CHARACTER UNSIGNED -- 1ST 3RD )

If UNSIGNED is greater than zero, 3RD is equal to UNSIGNED less the number of zeros (characters "0") at the end of the character string specified by CDATA -> CHARACTER UNSIGNED. If UNSIGNED is zero or the entire string consists of zeros, 3RD is zero.


--------------------------------------------------------------------------------


. ( FLOAT -- )

Display FLOAT with a trailing space using fixed-point notation: 

Fixed-point notation := <significand>
<significant>        := [-]<digits>.<digits0>
<digits>             := <digit><digits0>
<digits0>            := <digit>*
<digit>              := { 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 }
An ambiguous condition exists if the value of the number-conversion radix BASE is not (decimal) ten or if the character string representation exceeds the size of the pictured numeric output string buffer.


--------------------------------------------------------------------------------


.EXPONENT ( SIGNED -- )

Display SIGNED as a floating point exponent in the format Esnnn, where s is the sign (+ or -) and nnn is the absolute value of SIGNED represented as a three-digit decimal value.


--------------------------------------------------------------------------------


.SIGN ( FLAG -- )

If FLAG is TRUE, display a minus sign (-).


--------------------------------------------------------------------------------


.SIGN+ ( FLAG -- )

If FLAG is TRUE, display a minus sign (-). Otherwise, display a plus sign (+).


--------------------------------------------------------------------------------


/ ( FLOAT FLOAT -- 1ST )

Divide the first FLOAT by the second FLOAT, giving the quotient 1ST. The result has the same data type as the dividend. An ambiguous condition exists if the second FLOAT is zero, or if the quotient lies outside of the range of a floating-point number.


--------------------------------------------------------------------------------


/ ( FLOAT SIGNED -- 1ST )

Divide FLOAT by SIGNED, giving the floating-point quotient 1ST. An ambiguous condition exists if SIGNED is zero, or if the quotient lies outside of the range of a floating-point number.


--------------------------------------------------------------------------------


/ ( FLOAT SIGNED-DOUBLE -- 1ST )

Divide FLOAT by SIGNED-DOUBLE, giving the floating-point quotient 1ST. An ambiguous condition exists if SIGNED-DOUBLE is zero, or if the quotient lies outside of the range of a floating-point number.


--------------------------------------------------------------------------------


/ ( FLOAT UNSIGNED -- 1ST )

Divide FLOAT by UNSIGNED, giving the floating-point quotient 1ST. An ambiguous condition exists if UNSIGNED is zero, or if the quotient lies outside of the range of a floating-point number.


--------------------------------------------------------------------------------


/10^N ( FLOAT SIGNED -- 1ST )

1ST is equal to FLOAT divided by 10 raised to the power SIGNED. An ambiguous condition exists if SIGNED is negative.


--------------------------------------------------------------------------------


0< ( FLOAT -- FLAG )

FLAG is true if and only if FLOAT is less than zero.


--------------------------------------------------------------------------------


0<> ( FLOAT -- FLAG )

FLAG is true if and only if FLOAT is not equal to zero.


--------------------------------------------------------------------------------


0= ( FLOAT -- FLAG )

FLAG is true if and only if FLOAT is equal to zero.


--------------------------------------------------------------------------------


0> ( FLOAT -- FLAG )

FLAG is true if and only if FLOAT is greater than zero.


--------------------------------------------------------------------------------


0E0 ( -- FLOAT )

FLOAT is 0.0E0.


--------------------------------------------------------------------------------


1+ ( ADDRESS -> FLOAT -- 1ST )

Add the number of address units per floating-point number to ADDRESS -> FLOAT giving 1ST.


--------------------------------------------------------------------------------


1+ ( DFADDRESS -- 1ST )

Add the number of address units per 64-bit IEEE floating-point number to DFADDRESS giving 1ST.


--------------------------------------------------------------------------------


1+ ( DFFAR-ADDRESS -- 1ST )

Add the number of address units per 64-bit IEEE floating-point number to DFFAR-ADDRESS giving 1ST.


--------------------------------------------------------------------------------


1+ ( FAR-ADDRESS -> FLOAT -- 1ST )

Add the number of address units per floating-point number to FAR-ADDRESS -> FLOAT giving 1ST.


--------------------------------------------------------------------------------


1+ ( SFADDRESS -- 1ST )

Add the number of address units per 32-bit IEEE floating-point number to SFADDRESS giving 1ST.


--------------------------------------------------------------------------------


1+ ( SFFAR-ADDRESS -- 1ST )

Add the number of address units per 32-bit IEEE floating-point number to SFFAR-ADDRESS giving 1ST.


--------------------------------------------------------------------------------


1- ( ADDRESS -> FLOAT -- 1ST )

Subtract the number of address units per floating-point number from ADDRESS -> FLOAT giving 1ST.


--------------------------------------------------------------------------------


1- ( DFADDRESS -- 1ST )

Subtract the number of address units per 64-bit IEEE floating-point number from DFADDRESS giving 1ST.


--------------------------------------------------------------------------------


1- ( DFFAR-ADDRESS -- 1ST )

Subtract the number of address units per 64-bit IEEE floating-point number from DFFAR-ADDRESS giving 1ST.


--------------------------------------------------------------------------------


1- ( FAR-ADDRESS -> FLOAT -- 1ST )

Subtract the number of address units per floating-point number from FAR-ADDRESS -> FLOAT giving 1ST.


--------------------------------------------------------------------------------


1- ( SFADDRESS -- 1ST )

Subtract the number of address units per 32-bit IEEE floating-point number from SFADDRESS giving 1ST.


--------------------------------------------------------------------------------


1- ( SFFAR-ADDRESS -- 1ST )

Subtract the number of address units per 32-bit IEEE floating-point number from SFFAR-ADDRESS giving 1ST.


--------------------------------------------------------------------------------


1E0 ( -- FLOAT )

FLOAT is 1.0E0.


--------------------------------------------------------------------------------


< ( FLOAT 1ST -- FLAG )

FLAG is true if and only if FLOAT is less than 1ST.


--------------------------------------------------------------------------------


<> ( FLOAT 1ST -- FLAG )

FLAG is true if and only if FLOAT is not numerically equal to 1ST.


--------------------------------------------------------------------------------


= ( FLOAT 1ST -- FLAG )

FLAG is true if and only if FLOAT is numerically equal to 1ST.


--------------------------------------------------------------------------------


> ( FLOAT 1ST -- FLAG )

FLAG is true if and only if FLOAT is greater than 1ST.


--------------------------------------------------------------------------------


>CHAR ( CDATA -> CHARACTER UNSIGNED 2ND -- 1ST 3RD FLAG )

If the character located at address CDATA -> CHARACTER is equal to 2ND, adjust the character string at CDATA -> CHARACTER with length UNSIGNED by one character and return TRUE as FLAG. The resulting character string, specified by 1ST 3RD, begins at CDATA -> CHARACTER plus one character and is UNSIGNED minus one characters long. Otherwise, do not adjust the character string and return FALSE as FLAG.


--------------------------------------------------------------------------------


>DIGITS ( FLOAT CDATA -> CHARACTER UNSIGNED -- 1ST 2ND 4 TH SIGNED )

1ST is the result of converting the characters within the string specified by CDATA -> CHARACTER UNSIGNED into digits, and adding each into FLOAT after multiplying FLOAT by (decimal) ten. 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. SIGNED is the number of converted characters.

An ambiguous condition exists if the value of the number-conversion radix BASE is not (decimal) ten.


--------------------------------------------------------------------------------


>E-CHAR ( CDATA -> CHARACTER UNSIGNED -- 1ST 3RD FLAG )

If the character located at address CDATA -> CHARACTER is any one of d, D, e or E, adjust the character string at CDATA -> CHARACTER with length UNSIGNED by one character and return TRUE as FLAG. The resulting character string, specified by 1ST 3RD, begins at CDATA -> CHARACTER plus one character and is UNSIGNED minus one characters long. Otherwise, do not adjust the character string and return FALSE as FLAG.


--------------------------------------------------------------------------------


>EXP ( CDATA -> CHARACTER UNSIGNED SIGNED -- 1ST 3RD 4 TH FLAG )

If SIGNED is zero, return zero as 4 TH and FALSE as FLAG.

Otherwise, 4 TH is the number represented by the decimal digits within the string specified by CDATA -> CHARACTER UNSIGNED, multiplied by SIGNED, or zero if the string is empty or its first character is not a decimal digit. Conversion continues left-to-right until encountering a character that is not a decimal digit 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. 3RD is the number of unconverted characters in the string. FLAG is TRUE.

An ambiguous condition exists if the value of the number-conversion radix BASE is not (decimal) ten.


--------------------------------------------------------------------------------


>FLOAT ( CDATA -> CHARACTER UNSIGNED -- FLOAT FLAG )

An attempt is made to convert the string specified by CDATA -> CHARACTER UNSIGNED to internal floating-point representation. If the string represents a valid floating-point number in the syntax below, its value FLOAT and TRUE as FLAG are returned. If the string does not represent a valid floating-point number, FLOAT is undefined and FLAG is FALSE.

A string of blanks is being treated as a special case representing zero.

Convertible string := <significand>[<exponent>] 
<significand>      := [<sign>]{<digits>[.<digits0>] | .<digits>}
<sign>             := { + | - }
<digits>           := <digit><digits0>
<digits0>          := <digit>*
<digit>            := { 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 }
<exponent>         := <marker><digits0>
<marker>           := {<e-form> | <sign-form>}
<e-form>           := <e-char>[<sign-form>]
<sign-form>        := { + | - }
<e-char>           := { D | d | E | e }

--------------------------------------------------------------------------------


>FLOAT' ( CDATA -> CHARACTER UNSIGNED -- FLOAT FLAG )

An attempt is made to convert the string specified by CDATA -> CHARACTER UNSIGNED to internal floating-point representation. If the string represents a valid floating-point number in the syntax below, its value FLOAT and TRUE as FLAG are returned. If the string does not represent a valid floating-point number, FLOAT is undefined and FLAG is FALSE.

Convertible string := <significand><exponent> 
<significand>      := [<sign>]<digits>[.<digits0>]
<exponent>         := E[<sign>]<digits0>
<sign>             := { + | - }
<digits>           := <digit><digits0>
<digits0>          := <digit>*
<digit>            := { 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 }

--------------------------------------------------------------------------------


>MARKER ( CDATA -> CHARACTER UNSIGNED -- 1ST 3RD SIGNED )

If the character string located at address CDATA -> CHARACTER with length UNSIGNED begins with an exponent marker, adjust the character string by the exponent marker and return its sign (+1 or -1) as SIGNED. 1ST 3RD is the adjusted character string. Otherwise, do not adjust the character string and return +0 as SIGNED.

Exponent marker 1  := {<e-form> | <sign-form>}
<e-form>           := <e-char>[<sign-form>]
<sign-form>        := { + | - }
<e-char>           := { D | d | E | e }

--------------------------------------------------------------------------------


>MARKER' ( CDATA -> CHARACTER UNSIGNED -- 1ST 3RD SIGNED )

If the character string located at address CDATA -> CHARACTER with length UNSIGNED begins with an exponent marker, adjust the character string by the exponent marker and return its sign (+1 or -1) as SIGNED. 1ST 3RD is the adjusted character string. Otherwise, do not adjust the character string and return +0 as SIGNED.

Exponent marker 2  := E[<sign>]
<sign>             := { + | - }

--------------------------------------------------------------------------------


>PERIOD ( CDATA -> CHARACTER UNSIGNED -- 1ST 3RD FLAG )

If the character located at address CDATA -> CHARACTER is a period (.), adjust the character string at CDATA -> CHARACTER with length UNSIGNED by one character and return TRUE as FLAG. The resulting character string, specified by 1ST 3RD, begins at CDATA -> CHARACTER plus one character and is UNSIGNED minus one characters long. Otherwise, do not adjust the character string and return FALSE as FLAG.


--------------------------------------------------------------------------------


>SIGN ( CDATA -> CHARACTER UNSIGNED -- 1ST 3RD SIGNED )

If the character located at address CDATA -> CHARACTER is either + or -, adjust the character string at CDATA -> CHARACTER with length UNSIGNED by one character and return +1 (for +) or -1 (for -) as SIGNED. The resulting character string, specified by 1ST 3RD, begins at CDATA -> CHARACTER plus one character and is UNSIGNED minus one characters long. Otherwise, do not adjust the character string and return +0 as SIGNED.


--------------------------------------------------------------------------------


>SIGNIFICAND ( FLOAT CDATA -> CHARACTER UNSIGNED -- 1ST 2ND 4 TH FLAG )

An attempt is made to convert the beginning of the string specified by CDATA -> CHARACTER UNSIGNED to internal floating-point representation. If the string represents a valid floating-point number in the syntax below, its value FLOAT and TRUE as FLAG are returned. If the string does not represent a valid floating-point number, FLOAT is undefined and FLAG is FALSE.

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.

Convertible string := <significand>
<significand>      := [<sign>]{<digits>[.<digits0>] | .<digits>}
<sign>             := { + | - }
<digits>           := <digit><digits0>
<digits0>          := <digit>*
<digit>            := { 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 }

--------------------------------------------------------------------------------


>SIGNIFICAND' ( FLOAT CDATA -> CHARACTER UNSIGNED -- 1ST 2ND 4 TH FLAG )

An attempt is made to convert the beginning of the string specified by CDATA -> CHARACTER UNSIGNED to internal floating-point representation. If the string represents a valid floating-point number in the syntax below, its value FLOAT and TRUE as FLAG are returned. If the string does not represent a valid floating-point number, FLOAT is undefined and FLAG is FALSE.

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.

Convertible string := <significand>
<significand>      := [<sign>]<digits>[.<digits0>]
<sign>             := { + | - }
<digits>           := <digit><digits0>
<digits0>          := <digit>*
<digit>            := { 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 }

--------------------------------------------------------------------------------


?DECIMAL ( -- )

An exception is thrown if the value of the number-conversion radix BASE is not (decimal) ten.


--------------------------------------------------------------------------------


?NEGATE ( FLOAT SIGNED -- 1ST )

If SIGNED is negative, change the sign of FLOAT.


--------------------------------------------------------------------------------


?VALUE ( CDATA -> CHARACTER UNSIGNED -- DEFINITION )

Extend the execution semantics of ?VALUE by considering floating-point values in addition to single-cell values and double-cell values.

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.


--------------------------------------------------------------------------------


@ ( CODE -> FLOAT -- 2ND )

2ND is the 64-bit floating-point number stored at address CODE.


--------------------------------------------------------------------------------


@ ( CONST -> FLOAT -- 2ND )

2ND is the 64-bit floating-point number stored at address CONST.


--------------------------------------------------------------------------------


@ ( DATA -> FLOAT -- 2ND )

2ND is the 64-bit floating-point number stored at address DATA.


--------------------------------------------------------------------------------


@ ( DFCODE -> FLOAT -- 2ND )

2ND is the 64-bit IEEE floating-point number stored at address DFCODE.


--------------------------------------------------------------------------------


@ ( DFCONST -> FLOAT -- 2ND )

2ND is the 64-bit IEEE floating-point number stored at address DFCONST.


--------------------------------------------------------------------------------


@ ( DFDATA -> FLOAT -- 2ND )

2ND is the 64-bit IEEE floating-point number stored at address DFDATA.


--------------------------------------------------------------------------------


@ ( DFFAR-ADDRESS -> FLOAT -- 2ND )

2ND is the 64-bit IEEE floating-point number stored at address DFFAR-ADDRESS.


--------------------------------------------------------------------------------


@ ( FAR-ADDRESS -> FLOAT -- 2ND )

2ND is the 64-bit floating-point number stored at address FAR-ADDRESS.


--------------------------------------------------------------------------------


@ ( SFCODE -> FLOAT -- 2ND )

2ND is the 32-bit IEEE floating-point number stored at address SFCODE.


--------------------------------------------------------------------------------


@ ( SFCONST -> FLOAT -- 2ND )

2ND is the 32-bit IEEE floating-point number stored at address SFCONST.


--------------------------------------------------------------------------------


@ ( SFDATA -> FLOAT -- 2ND )

2ND is the 32-bit IEEE floating-point number stored at address SFDATA.


--------------------------------------------------------------------------------


@ ( SFFAR-ADDRESS -> FLOAT -- 2ND )

2ND is the 32-bit IEEE floating-point number stored at address SFFAR-ADDRESS.


--------------------------------------------------------------------------------


ABORT ( -- )

Initialize the hardware floating-point unit. Empty the data stack and perform the function of QUIT, which.includes emptying the return stack without displaying a message.

This is an update of the Core version of ABORT. It is actually hidden by the version from the Exception word set. However, the Core version is used by ERROR.

ABORT is a deferred definition.


--------------------------------------------------------------------------------


ABS ( FLOAT -- 1ST )

1ST is the absolute value of FLOAT.


--------------------------------------------------------------------------------


ACOS ( FLOAT -- 1ST )

1ST is the principal radian angle whose cosine is FLOAT. An ambiguous condition exists if the absolute value of FLOAT is greater than one.


--------------------------------------------------------------------------------


ACOSH ( FLOAT -- 1ST )

1ST is the floating-point value whose hyperbolic cosine is FLOAT. An ambiguous condition exists if FLOAT is less than one.


--------------------------------------------------------------------------------


ALOG ( FLOAT -- 1ST )

Raise ten to the power FLOAT, giving 1ST.


--------------------------------------------------------------------------------


ASIN ( FLOAT -- 1ST )

1ST is the principal radian angle whose sine is FLOAT. An ambiguous condition exists if the absolute value of FLOAT is greater than one.


--------------------------------------------------------------------------------


ASINH ( FLOAT -- 1ST )

1ST is the floating-point value whose hyperbolic sine is FLOAT. An ambiguous condition exists if FLOAT is less than zero.


--------------------------------------------------------------------------------


ATAN ( FLOAT -- 1ST )

1ST is the principal radian angle whose tangent is FLOAT.


--------------------------------------------------------------------------------


ATAN2 ( FLOAT FLOAT -- 1ST )

1ST is the radian angle whose tangent is the first FLOAT divided by the second FLOAT. An ambiguous condition exists if both parameters FLOAT are zero.


--------------------------------------------------------------------------------


ATANH ( FLOAT -- 1ST )

1ST is the floating-point value whose hyperbolic tangent is FLOAT. An ambiguous condition exists if FLOAT is outside the range of -1E0 to 1E0.


--------------------------------------------------------------------------------


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 ancestor, the actual binary image is not changed. If x and y have different ancestors, CAST uses either one of the following conversion words to adjust the size of y:

S>D S>F D>S D>F F>S F>D
An exception is thrown if name is not the name of a data type.

CAST is an immediate word.


--------------------------------------------------------------------------------


CATCH ( -- )

Interpretation: ( TOKEN -- SIGNED ) 
An exception is thrown if TOKEN is not a qualified token. Push an exception frame onto the return stack and then execute the execution token TOKEN in such a way that control can be transferred to a point just after CATCH if THROW is executed during the execution of TOKEN. Adjust the interpreter data type heap according to the stack diagram associated with TOKEN.

If the execution of TOKEN completes normally (i.e., the exception frame pushed by CATCH is not popped by an execution of THROW) pop the exception frame and return zero as SIGNED on top of the data stack, above whatever stack items would have been returned by executing TOKEN. Otherwise, the remainder of the execution semantics are given by THROW.

Compilation: 
An exception is thrown if the top of the compiler data type heap does not contain a qualified token. Adjust the compiler data type heap according to the stack diagram associated with the qualified token. Append the runtime semantics given below to the current definition.

Runtime: ( TOKEN -- SIGNED ) 
Push an exception frame onto the return stack and then execute the execution token TOKEN in such a way that control can be transferred to a point just after CATCH if THROW is executed during the execution of TOKEN.

If the execution of TOKEN completes normally (i.e., the exception frame pushed by CATCH is not popped by an execution of THROW) pop the exception frame and return zero as SIGNED on top of the data stack, above whatever stack items would have been returned by executing TOKEN. Otherwise, the remainder of the execution semantics are given by THROW.

CATCH is an immediate word.


--------------------------------------------------------------------------------


CONST, ( FLOAT -- )

Reserve memory for one floating-point number in the constant data space and store FLOAT 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.


--------------------------------------------------------------------------------


CONSTANT ( FLOAT "<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: ( -- FLOAT ) 
Place FLOAT on the stack. FLOAT has the same data type as was supplied to CONSTANT.


--------------------------------------------------------------------------------


COS ( FLOAT -- 1ST )

1ST is the cosine of the radian angle FLOAT.


--------------------------------------------------------------------------------


COSH ( FLOAT -- 1ST )

1ST is the hyperbolic cosine of FLOAT.


--------------------------------------------------------------------------------


D>F ( DOUBLE -- FLOAT )

FLOAT is the numeric equivalent of DOUBLE, where DOUBLE is assumed to be an unsigned double-precision number. An ambiguous condition exists if DOUBLE is not a number.


--------------------------------------------------------------------------------


D>F ( SIGNED-DOUBLE -- FLOAT )

FLOAT is the numeric equivalent of SIGNED-DOUBLE.


--------------------------------------------------------------------------------


DEPTH-FP ( -- UNSIGNED )

UNSIGNED is the depth of the separate hardware floating-point stack, calculated from the contents of 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: Only floating-point numbers are counted. 


--------------------------------------------------------------------------------


DEPTH-SP ( -- UNSIGNED )

UNSIGNED is the depth of the data stack in cells, calculated from the contents of 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. UNSIGNED equals the actual number of cells on the data stack only if the data stack and the interpreter data type heap are aligned.

Note: In compilation state, UNSIGNED is zero if the compiler data type heap is locked.

Note: Floating-point numbers are not counted, because they are kept on a separate hardware floating-point stack.


--------------------------------------------------------------------------------


DFADDRESS ( STACK-DIAGRAM -- 1ST )

When used in a stack diagram, specifies an input or output parameter with data type DFADDRESS.


--------------------------------------------------------------------------------


DFALIGN ( -- )

If the first unused address of the current memory space is not aligned for 64-bit IEEE floating-point numbers, reserve the required number of address units to make it aligned.


--------------------------------------------------------------------------------


DFALIGNED ( ADDRESS -- 1ST )

1ST is the lowest address aligned for 64-bit IEEE floating-point numbers greater than or equal to ADDRESS.


--------------------------------------------------------------------------------


DFALIGNED ( FAR-ADDRESS -- 1ST )

1ST is the lowest address aligned for 64-bit IEEE floating-point numbers greater than or equal to FAR-ADDRESS.


--------------------------------------------------------------------------------


DFCODE ( STACK-DIAGRAM -- 1ST )

When used in a stack diagram, specifies an input or output parameter with data type DFCODE.


--------------------------------------------------------------------------------


DFCONST ( STACK-DIAGRAM -- 1ST )

When used in a stack diagram, specifies an input or output parameter with data type DFCONST.


--------------------------------------------------------------------------------


DFDATA ( STACK-DIAGRAM -- 1ST )

When used in a stack diagram, specifies an input or output parameter with data type DFDATA.


--------------------------------------------------------------------------------


DFFAR-ADDRESS ( STACK-DIAGRAM -- 1ST )

When used in a stack diagram, specifies an input or output parameter with data type DFFAR-ADDRESS.


--------------------------------------------------------------------------------


DFLOATS ( INTEGER -- 1ST )

1ST is the size in address units of INTEGER 64-bit IEEE floating-point numbers.


--------------------------------------------------------------------------------


DROP ( FLOAT -- )

Remove FLOAT from the stack.


--------------------------------------------------------------------------------


DUP ( FLOAT -- 1ST 1ST )

Duplicate FLOAT.


--------------------------------------------------------------------------------


E. ( FLOAT -- )

Display FLOAT with a trailing space using engineering notation, where the significand is greater than or equal to 1.0 and less than 1000.0, and the decimal exponent is a multiple of three: 

Engineering notation := <significand><exponent>
<significand>        := [-]<digits>.<digits>
<exponent>           := E<sign><digit><digit><digit>
<sign>               := { + | - }
<digits>             := <digit><digits0>
<digits0>            := <digit>*
<digit>              := { 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 }
An ambiguous condition exists if the value of the number-conversion radix BASE is not (decimal) ten or if the character string representation exceeds the size of the pictured numeric output string buffer.


--------------------------------------------------------------------------------


ERASE ( DATA -> FLOAT UNSIGNED -- )

If UNSIGNED is not equal to zero, store zero (0E0) in each of UNSIGNED consecutive memory locations for floating-point numbers beginning at DATA -> FLOAT. An ambiguous condition exists if DATA -> FLOAT is not aligned for floating-point numbers.


--------------------------------------------------------------------------------


ERASE ( DFDATA UNSIGNED -- )

If UNSIGNED is not equal to zero, store zero (0E0) in each of UNSIGNED consecutive memory locations for 64-bit IEEE floating-point numbers beginning at DFDATA. An ambiguous condition exists if DFDATA is not aligned for 64-bit IEEE floating-point numbers.


--------------------------------------------------------------------------------


ERASE ( SFDATA UNSIGNED -- )

If UNSIGNED is not equal to zero, store zero (0E0) in each of UNSIGNED consecutive memory locations for 32-bit IEEE floating-point numbers beginning at SFDATA. An ambiguous condition exists if SFDATA is not aligned for 32-bit IEEE floating-point numbers.


--------------------------------------------------------------------------------


EXP ( FLOAT -- 1ST )

Raise e to the power FLOAT, giving 1ST.


--------------------------------------------------------------------------------


EXPM1 ( FLOAT -- 1ST )

Raise e to the power FLOAT and subtract one, giving 1ST.


--------------------------------------------------------------------------------


F! ( FLOAT CONST -> 1ST -- )

Store FLOAT at address CONST as 80-bit floating-point number.


--------------------------------------------------------------------------------


F, ( FLOAT -- )

Reserve memory for one 80-bit floating-point number in the constant data space and store FLOAT in it. If the first unused address of the constant data space is aligned prior to execution of F,, it will remain aligned when F, finishes execution. An exception is thrown if the constant data space overflows.


--------------------------------------------------------------------------------


F@ ( CONST -> FLOAT -- 2ND )

2ND is the 80-bit floating-point number stored at address CONST.


--------------------------------------------------------------------------------


F>D ( FLOAT -- SIGNED-DOUBLE )

Convert FLOAT to the signed double-precision number SIGNED-DOUBLE with the same numerical value. An ambiguous condition exists if FLOAT lies outside the range of a signed double-precision number.


--------------------------------------------------------------------------------


F>S ( FLOAT -- SIGNED )

Convert FLOAT to the signed single-precision number SIGNED with the same numerical value. An ambiguous condition exists if FLOAT lies outside the range of a signed single-precision number.


--------------------------------------------------------------------------------


FALIGN ( -- )

If the first unused address of the current memory space is not aligned for floating-point numbers, reserve the required number of address units to make it aligned.


--------------------------------------------------------------------------------


FALIGNED ( ADDRESS -- 1ST )

1ST is the lowest address aligned for floating-point numbers greater than or equal to ADDRESS.


--------------------------------------------------------------------------------


FALIGNED ( FAR-ADDRESS -- 1ST )

1ST is the lowest address aligned for floating-point numbers greater than or equal to FAR-ADDRESS.


--------------------------------------------------------------------------------


FILL ( DATA -> FLOAT UNSIGNED 2ND -- )

If UNSIGNED is not equal to zero, store 2ND in each of UNSIGNED consecutive memory locations for floating-point numbers beginning at DATA -> FLOAT. An ambiguous condition exists if DATA -> FLOAT is not aligned for floating-point numbers.


--------------------------------------------------------------------------------


FILL ( DFDATA -> FLOAT UNSIGNED 2ND -- )

If UNSIGNED is not equal to zero, store 2ND in each of UNSIGNED consecutive memory locations for 64-bit IEEE floating-point numbers beginning at DFDATA -> FLOAT. An ambiguous condition exists if DFDATA -> FLOAT is not aligned for 64-bit IEEE floating-point numbers.


--------------------------------------------------------------------------------


FILL ( SFDATA -> FLOAT UNSIGNED 2ND -- )

If UNSIGNED is not equal to zero, store 2ND in each of UNSIGNED consecutive memory locations for 32-bit IEEE floating-point numbers beginning at SFDATA -> FLOAT. An ambiguous condition exists if SFDATA -> FLOAT is not aligned for 32-bit IEEE floating-point numbers.


--------------------------------------------------------------------------------


FINIT ( -- )

Initialize the hardware floating-point unit and empty the hardware floating-point stack.


--------------------------------------------------------------------------------


FLIT ( -- FLOAT )

FLOAT is a constant 80-bit floating-point literal.

FLIT is an internal definition compiled by LITERAL,.


--------------------------------------------------------------------------------


FLOAT ( STACK-DIAGRAM -- 1ST )

When used in a stack diagram, specifies an input or output parameter with data type FLOAT.


--------------------------------------------------------------------------------


FLOAT? ( DATA-TYPE -- FLAG )

FLAG is TRUE if and only if the ancestor of DATA-TYPE if FLOAT.


--------------------------------------------------------------------------------


FLOATS ( INTEGER -- 1ST )

1ST is the size in address units of INTEGER floating-point numbers.


--------------------------------------------------------------------------------


FLOOR ( FLOAT -- 1ST )

Round FLOAT to an integral value using the round toward negative infinity rule, giving 1ST.


--------------------------------------------------------------------------------


FP! ( UNSIGNED -- )

Make UNSIGNED the current index of the hardware floating-point stack.


--------------------------------------------------------------------------------


FP@ ( -- UNSIGNED )

UNSIGNED is the index of the hardware floating-point stack.


--------------------------------------------------------------------------------


FXAM ( -- LOGICAL )

LOGICAL is the contents of the floating-point processor's status word register, after examining the number on top of the hardware floating-point stack. Bits 14, 10, 9 and 8 of LOGICAL are set depending on the number on top of the hardware floating-point stack:

Status Bit 14 Bit 10 Bit 9 Bit 8 
Unsupported 0 0 s 0 
NaN (Not a Number) 0 0 s 1 
Valid 0 1 s 0 
Infinity 0 1 s 1 
Zero 1 0 s 0 
Free 1 x x 1 
Denormalized 1 1 s 0 

x is undefined. s is 0 if the number on top of the hardware floating-point stack is positive, and 1 if it is negative.


--------------------------------------------------------------------------------


LITERAL ( FLOAT -- )

Interpretation: 
An exception is thrown if LITERAL is interpreted.

Compilation: 
Append the runtime semantics given below to the current definition.

Runtime: ( -- FLOAT ) 
Place FLOAT on the stack. FLOAT has the same data type as was supplied at compilation time.

LITERAL is an immediate word.


--------------------------------------------------------------------------------


LITERAL, ( FLOAT -- )

Append the runtime semantics given below to the current definition.

Runtime: ( -- FLOAT ) 
Place FLOAT on the stack.

Note: LITERAL, does not change the compiler data type heap.


--------------------------------------------------------------------------------


LN ( FLOAT -- 1ST )

1ST is the natural logarithm of FLOAT. An ambiguous condition exists if FLOAT is less than or equal to zero. 


--------------------------------------------------------------------------------


LNP1 ( FLOAT -- 1ST )

1ST is the natural logarithm of the quantity FLOAT plus one. An ambiguous condition exists if FLOAT is less than or equal to negative one.


--------------------------------------------------------------------------------


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, 2 or 4 cells.

LOCAL, actually compiles (R@), (DR@) or (FR@).

Note: x can be SINGLE, DOUBLE or FLOAT.


--------------------------------------------------------------------------------


LOG ( FLOAT -- 1ST )

1ST is the base-ten logarithm of FLOAT. An ambiguous condition exists if FLOAT is less than or equal to zero.


--------------------------------------------------------------------------------


MAX ( FLOAT 1ST -- 1ST )

1ST is the maximum of FLOAT and 1ST.


--------------------------------------------------------------------------------


MIN ( FLOAT 1ST -- 1ST )

1ST is the minimum of FLOAT and 1ST.


--------------------------------------------------------------------------------


MOVE ( CONST -> FLOAT DATA -> 2ND UNSIGNED -- )

If UNSIGNED is not equal to zero, copy UNSIGNED consecutive floating-point numbers starting at address CONST -> FLOAT to address DATA -> 2ND. After MOVE completes, the UNSIGNED consecutive floating-point numbers starting at address DATA -> 2ND contain exactly what the UNSIGNED consecutive floating-point numbers starting at address CONST -> SINGLE contained before the move.


--------------------------------------------------------------------------------


MOVE ( DATA -> FLOAT DATA -> 2ND UNSIGNED -- )

If UNSIGNED is not equal to zero, copy UNSIGNED consecutive floating-point numbers starting at address DATA -> FLOAT to address DATA -> 2ND. After MOVE completes, the UNSIGNED consecutive floating-point numbers starting at address DATA -> 2ND contain exactly what the UNSIGNED consecutive floating-point numbers starting at address DATA -> SINGLE contained before the move.


--------------------------------------------------------------------------------


MOVE ( DFCONST -> FLOAT DFDATA -> 2ND UNSIGNED -- )

If UNSIGNED is not equal to zero, copy UNSIGNED consecutive 64-bit IEEE floating-point numbers starting at address DFCONST -> FLOAT to address DFDATA -> 2ND. After MOVE completes, the UNSIGNED consecutive 64-bit IEEE floating-point numbers starting at address DFDATA -> 2ND contain exactly what the UNSIGNED consecutive 64-bit IEEE floating-point numbers starting at address DFCONST -> SINGLE contained before the move.


--------------------------------------------------------------------------------


MOVE ( DFDATA -> FLOAT DFDATA -> 2ND UNSIGNED -- )

If UNSIGNED is not equal to zero, copy UNSIGNED consecutive 64-bit IEEE floating-point numbers starting at address DFDATA -> FLOAT to address DFDATA -> 2ND. After MOVE completes, the UNSIGNED consecutive 64-bit IEEE floating-point numbers starting at address DFDATA -> 2ND contain exactly what the UNSIGNED consecutive 64-bit IEEE floating-point numbers starting at address DFDATA -> SINGLE contained before the move.


--------------------------------------------------------------------------------


MOVE ( SFCONST -> FLOAT SFDATA -> 2ND UNSIGNED -- )

If UNSIGNED is not equal to zero, copy UNSIGNED consecutive 32-bit IEEE floating-point numbers starting at address SFCONST -> FLOAT to address SFDATA -> 2ND. After MOVE completes, the UNSIGNED consecutive 32-bit IEEE floating-point numbers starting at address SFDATA -> 2ND contain exactly what the UNSIGNED consecutive 32-bit IEEE floating-point numbers starting at address SFCONST -> SINGLE contained before the move.


--------------------------------------------------------------------------------


MOVE ( SFDATA -> FLOAT SFDATA -> 2ND UNSIGNED -- )

If UNSIGNED is not equal to zero, copy UNSIGNED consecutive 32-bit IEEE floating-point numbers starting at address SFDATA -> FLOAT to address SFDATA -> 2ND. After MOVE completes, the UNSIGNED consecutive 32-bit IEEE floating-point numbers starting at address SFDATA -> 2ND contain exactly what the UNSIGNED consecutive 32-bit IEEE floating-point numbers starting at address SFDATA -> SINGLE contained before the move.


--------------------------------------------------------------------------------


NEGATE ( FLOAT -- 1ST )

Negate FLOAT, giving its arithmetic inverse 1ST.


--------------------------------------------------------------------------------


NIP ( DOUBLE FLOAT -- 2ND )

Remove the first item below the top of the stack.


--------------------------------------------------------------------------------


NIP ( FLOAT DOUBLE -- 2ND )

Remove the first item below the top of the stack.


--------------------------------------------------------------------------------


NIP ( FLOAT FLOAT -- 2ND )

Remove the first item below the top of the stack.


--------------------------------------------------------------------------------


NIP ( FLOAT SINGLE -- 2ND )

Remove the first item below the top of the stack.


--------------------------------------------------------------------------------


NIP ( SINGLE FLOAT -- 2ND )

Remove the first item below the top of the stack.


--------------------------------------------------------------------------------


NOT-DECIMAL? ( -- FLAG )

FLAG is TRUE if and only if the value of the number-conversion radix BASE is not (decimal) ten.


--------------------------------------------------------------------------------


NULL ( "<spaces>name" -- y )

Skip leading space delimiters. Parse name delimited by a space. Return y, which has the numerical value 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 item, a double-cell item, or a floating-point number.

NULL is an immediate word.


--------------------------------------------------------------------------------


OVER ( DOUBLE FLOAT -- 1ST 2ND 1ST )

Place a copy of the DOUBLE on top of the stack.


--------------------------------------------------------------------------------


OVER ( FLOAT DOUBLE -- 1ST 2ND 1ST )

Place a copy of FLOAT on top of the stack.


--------------------------------------------------------------------------------


OVER ( FLOAT FLOAT -- 1ST 2ND 1ST )

Place a copy of the first FLOAT on top of the stack.


--------------------------------------------------------------------------------


OVER ( FLOAT SINGLE -- 1ST 2ND 1ST )

Place a copy of FLOAT on top of the stack.


--------------------------------------------------------------------------------


OVER ( SINGLE FLOAT -- 1ST 2ND 1ST )

Place a copy of SINGLE on top of the stack.


--------------------------------------------------------------------------------


PERIOD ( -- )

Display a period (.).


--------------------------------------------------------------------------------


PI ( -- FLOAT )

FLOAT is p (3.14159265358979323846)


--------------------------------------------------------------------------------


PRECISION ( -- UNSIGNED )

UNSIGNED is the number of significant digits currently used by ., E., or S..


--------------------------------------------------------------------------------


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, 2 or 4.

Runtime: ( -- x ) 
x is the value of the local R@.

R> is an immediate word.


--------------------------------------------------------------------------------


REP-INVALID ( CDATA -> CHARACTER UNSIGNED UNSIGNED -- )

Depending on the value of the second UNSIGNED, place a character string at CDATA -> CHARACTER:

Second UNSIGNED Character String 
0000 (hex) UNSUPPORTED 
0100 (hex) NAN 
0500 (hex) INFINITY 
4400 (hex) DENORMALIZED 
otherwise FREE 

The character string is shortened to the number of characters corresponding to the first UNSIGNED, or extended by trailing spaces.


--------------------------------------------------------------------------------


REPRESENT ( FLOAT CDATA -> CHARACTER UNSIGNED -- SIGNED FLAG FLAG )

At CDATA -> CHARACTER, place the character-string external representation of the significand of the floating-point number FLOAT. Return the decimal-base exponent as SIGNED, the sign as as the first FLAG and valid result as the second FLAG. The character string consists of the UNSIGNED most significant digits of the significand represented as a decimal fraction with the implied decimal point to the left of the first digit, and the first digit zero only if all digits are zero. The significand is rounded to UNSIGNED digits following the round to nearest rule; SIGNED is adjusted, if necessary, to correspond to the rounded magnitude of the significand. If the second FLAG is TRUE then FLOAT was a valid floating-point number. If the first FLAG is TRUE then FLOAT is negative.

An exception is thrown if the value of BASE is not (decimal) ten.

When the second FLAG is FALSE, SIGNED is always zero, and the string at CDATA -> CHARACTER contains one of the following, cut off to UNSIGNED characters or extended by trailing spaces:

UNSUPPORTED
NAN
INFINITY
DENORMALIZED
FREE

--------------------------------------------------------------------------------


REP-VALID ( CDATA -> CHARACTER UNSIGNED FLOAT -- SIGNED )

At CDATA -> CHARACTER, place the character-string external representation of the significand of the absolute value of the floating-point number FLOAT. Return the decimal-base exponent as SIGNED. The character string consists of the UNSIGNED most significant digits of the significand represented as a decimal fraction with the implied decimal point to the left of the first digit, and the first digit zero only if all digits are zero. The significand is rounded to UNSIGNED digits following the round to nearest rule; SIGNED is adjusted, if necessary, to correspond to the rounded magnitude of the significand.

An ambiguous condition exists if FLOAT is not a valid floating-point number, or if the value of BASE is not decimal ten.


--------------------------------------------------------------------------------


ROT ( DOUBLE DOUBLE FLOAT -- 2ND 3RD 1ST )

Rotate the top three stack items.


--------------------------------------------------------------------------------


ROT ( DOUBLE FLOAT DOUBLE -- 2ND 3RD 1ST )

Rotate the top three stack items.


--------------------------------------------------------------------------------


ROT ( DOUBLE FLOAT FLOAT -- 2ND 3RD 1ST )

Rotate the top three stack items.


--------------------------------------------------------------------------------


ROT ( DOUBLE FLOAT SINGLE -- 2ND 3RD 1ST )

Rotate the top three stack items.


--------------------------------------------------------------------------------


ROT ( DOUBLE SINGLE FLOAT -- 2ND 3RD 1ST )

Rotate the top three stack items.


--------------------------------------------------------------------------------


ROT ( FLOAT DOUBLE DOUBLE -- 2ND 3RD 1ST )

Rotate the top three stack items.


--------------------------------------------------------------------------------


ROT ( FLOAT DOUBLE FLOAT -- 2ND 3RD 1ST )

Rotate the top three stack items.


--------------------------------------------------------------------------------


ROT ( FLOAT DOUBLE SINGLE -- 2ND 3RD 1ST )

Rotate the top three stack items.


--------------------------------------------------------------------------------


ROT ( FLOAT FLOAT DOUBLE -- 2ND 3RD 1ST )

Rotate the top three stack items.


--------------------------------------------------------------------------------


ROT ( FLOAT FLOAT FLOAT -- 2ND 3RD 1ST )

Rotate the top three stack items.


--------------------------------------------------------------------------------


ROT ( FLOAT FLOAT SINGLE -- 2ND 3RD 1ST )

Rotate the top three stack items.


--------------------------------------------------------------------------------


ROT ( FLOAT SINGLE DOUBLE -- 2ND 3RD 1ST )

Rotate the top three stack items.


--------------------------------------------------------------------------------


ROT ( FLOAT SINGLE FLOAT -- 2ND 3RD 1ST )

Rotate the top three stack items.


--------------------------------------------------------------------------------


ROT ( FLOAT SINGLE SINGLE -- 2ND 3RD 1ST )

Rotate the top three stack items.


--------------------------------------------------------------------------------


ROT ( SINGLE DOUBLE FLOAT -- 2ND 3RD 1ST )

Rotate the top three stack items.


--------------------------------------------------------------------------------


ROT ( SINGLE FLOAT DOUBLE -- 2ND 3RD 1ST )

Rotate the top three stack items.


--------------------------------------------------------------------------------


ROT ( SINGLE FLOAT FLOAT -- 2ND 3RD 1ST )

Rotate the top three stack items.


--------------------------------------------------------------------------------


ROT ( SINGLE FLOAT SINGLE -- 2ND 3RD 1ST )

Rotate the top three stack items.


--------------------------------------------------------------------------------


ROT ( SINGLE SINGLE FLOAT -- 2ND 3RD 1ST )

Rotate the top three stack items.


--------------------------------------------------------------------------------


ROUND ( FLOAT -- 1ST )

Round FLOAT to an integral value using the round to nearest rule, giving 1ST.


--------------------------------------------------------------------------------


S. ( FLOAT -- )

Display FLOAT with a trailing space using scientific notation: 

Scientific notation  := <significand><exponent>
<significand>        := [-]<digit>.<digits>
<exponent>           := E<sign><digit><digit><digit>
<sign>               := { + | - }
<digits>             := <digit><digits0>
<digits0>            := <digit>*
<digit>              := { 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 }
An ambiguous condition exists if the value of the number-conversion radix BASE is not (decimal) ten or if the character string representation exceeds the size of the pictured numeric output string buffer.


--------------------------------------------------------------------------------


S>F ( SIGNED -- FLOAT )

FLOAT is the numeric equivalent of SIGNED.


--------------------------------------------------------------------------------


S>F ( SINGLE -- FLOAT )

FLOAT is the numeric equivalent of SINGLE, where SINGLE is assumed to be an unsigned single-precision number. An ambiguous condition exists if SINGLE is not a number.


--------------------------------------------------------------------------------


SET-PRECISION ( UNSIGNED -- )

Set the number of significant digits currently used by ., E., or S. to the minimum of 18 and UNSIGNED.


--------------------------------------------------------------------------------


SFADDRESS ( STACK-DIAGRAM -- 1ST )

When used in a stack diagram, specifies an input or output parameter with data type SFADDRESS.


--------------------------------------------------------------------------------


SFALIGN ( -- )

If the first unused address of the current memory space is not aligned for 32-bit IEEE floating-point numbers, reserve the required number of address units to make it aligned.


--------------------------------------------------------------------------------


SFALIGNED ( ADDRESS -- 1ST )

1ST is the lowest address aligned for 32-bit IEEE floating-point numbers greater than or equal to ADDRESS.


--------------------------------------------------------------------------------


SFALIGNED ( FAR-ADDRESS -- 1ST )

1ST is the lowest address aligned for 32-bit IEEE floating-point numbers greater than or equal to FAR-ADDRESS.


--------------------------------------------------------------------------------


SFCODE ( STACK-DIAGRAM -- 1ST )

When used in a stack diagram, specifies an input or output parameter with data type SFCODE.


--------------------------------------------------------------------------------


SFCONST ( STACK-DIAGRAM -- 1ST )

When used in a stack diagram, specifies an input or output parameter with data type SFCONST.


--------------------------------------------------------------------------------


SFDATA ( STACK-DIAGRAM -- 1ST )

When used in a stack diagram, specifies an input or output parameter with data type SFDATA.


--------------------------------------------------------------------------------


SFFAR-ADDRESS ( STACK-DIAGRAM -- 1ST )

When used in a stack diagram, specifies an input or output parameter with data type SFFAR-ADDRESS.


--------------------------------------------------------------------------------


SFLOATS ( INTEGER -- 1ST )

1ST is the size in address units of INTEGER 32-bit IEEE floating-point numbers.


--------------------------------------------------------------------------------


SIN ( FLOAT -- 1ST )

1ST is the sine of the radian angle FLOAT.


--------------------------------------------------------------------------------


SINCOS ( FLOAT -- 1ST 1ST )

The first 1ST is the sine of the radian angle FLOAT. The second 1ST is the cosine of the radian angle FLOAT.


--------------------------------------------------------------------------------


SINH ( FLOAT -- 1ST )

1ST is the hyperbolic sine of FLOAT.


--------------------------------------------------------------------------------


SQRT ( FLOAT -- 1ST )

1ST is the square root of FLOAT. An ambiguous condition exists if FLOAT is less than zero.


--------------------------------------------------------------------------------


SWAP ( DOUBLE FLOAT -- 2ND 1ST )

Exchange the two items on top of the stack.


--------------------------------------------------------------------------------


SWAP ( FLOAT DOUBLE -- 2ND 1ST )

Exchange the two items on top of the stack.


--------------------------------------------------------------------------------


SWAP ( FLOAT FLOAT -- 2ND 1ST )

Exchange the two items on top of the stack.


--------------------------------------------------------------------------------


SWAP ( FLOAT SINGLE -- 2ND 1ST )

Exchange the two items on top of the stack.


--------------------------------------------------------------------------------


SWAP ( SINGLE FLOAT -- 2ND 1ST )

Exchange the two items on top of the stack.


--------------------------------------------------------------------------------


TAN ( FLOAT -- 1ST )

1ST is the tangent of the radian angle FLOAT. An ambiguous condition exists if cos(FLOAT) is zero.


--------------------------------------------------------------------------------


TANH ( FLOAT -- 1ST )

1ST is the hyperbolic tangent of FLOAT


--------------------------------------------------------------------------------


THROW ( SIGNED -- )

If SIGNED is non-zero, pop the latest exception frame along with everything on the return stack above that frame. Then restore the input source specification in use before the CATCH that pushed that exception frame. Adjust the depth of the data stack and the hardware floating-point stack so that they are the same as if the corresponding CATCH were executed normally, i. e., without THROW. Put SIGNED on top of the data stack, and transfer control to a point just after the corresponding CATCH.

If no exception frame is present, execute ERROR with SIGNED on top of the data stack.

Other than in ANS Forth, the depth of the data stack and of the hardware floating-point stack immediately after CATCH do not depend on whether THROW was executed or not. The data stack pointer and the hardware floating-point stack pointer always have the value they would have if the execution token provided to CATCH were executed normally.

THROW is a deferred definition.


--------------------------------------------------------------------------------


TUCK ( DOUBLE FLOAT -- 2ND 1ST 2ND )

Copy the first (top) stack item below the second stack item.


--------------------------------------------------------------------------------


TUCK ( FLOAT DOUBLE -- 2ND 1ST 2ND )

Copy the first (top) stack item below the second stack item.


--------------------------------------------------------------------------------


TUCK ( FLOAT FLOAT -- 2ND 1ST 2ND )

Copy the first (top) stack item below the second stack item.


--------------------------------------------------------------------------------


TUCK ( FLOAT SINGLE -- 2ND 1ST 2ND )

Copy the first (top) stack item below the second stack item.


--------------------------------------------------------------------------------


TUCK ( SINGLE FLOAT -- 2ND 1ST 2ND )

Copy the first (top) stack item below the second stack item.


--------------------------------------------------------------------------------


VALUE ( FLOAT -- )

Skip leading space delimiters. Parse name delimited by a space. Create a definition for name with the execution semantics defined below. Reserve memory for one floating-point number in the data space at an aligned address and store FLOAT at the address.

name is referred to as a value.

Execution: ( -- FLOAT ) 
Place FLOAT on the stack. The value of FLOAT is that given when name was created, until the phrase TO name is executed, causing a new value of FLOAT to be associated with name.

FLOAT has the same data type as was supplied to VALUE.


--------------------------------------------------------------------------------


VARIABLE ( FLOAT -- )

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 FLOAT at the address.

name is referred to as a variable.

Execution: ( -- DATA -> FLOAT ) 
DATA -> FLOAT is the address of the floating-point number. FLOAT has the same data type as was supplied to VARIABLE.


--------------------------------------------------------------------------------


ZERO ( -- )

Display a zero character (0).


--------------------------------------------------------------------------------


ZEROS ( INTEGER -- )

If INTEGER is greater than zero, display INTEGER zero characters (0).

Note: INTEGER is assumed to be a signed number.


--------------------------------------------------------------------------------


~ ( FLOAT FLOAT FLOAT -- FLAG )

If the third FLOAT is positive, FLAG is TRUE if the absolute value of (first FLOAT minus second FLOAT) is less than the third FLOAT.

If the third FLOAT is zero, FLAG is TRUE if the first FLOAT and the second FLOAT are exactly identical.

If the third FLOAT is negative, FLAG is TRUE if the absolute value of (first FLOAT minus second FLOAT) is less than the absolute value of the third FLOAT times the sum of the absolute values of the first FLOAT and the second FLOAT.


--------------------------------------------------------------------------------


(;CODE) ( DEFINITION -- )

Finish a new definition by compiling its stack diagram, which is copied from DEFINITION. Copy the content of the code field of DEFINITION to the code field of the new definition.

(;CODE) is an internal definition compiled by ;CODE.


--------------------------------------------------------------------------------


(SEE) ( STACK-DIAGRAM -- 1ST )

When used in a stack diagram, specifies an input or output parameter with data type (SEE). Data type (SEE) is a qualified token of a word with stack diagram ( CONST -> TOKEN TOKEN -- 1ST FLAG ).


--------------------------------------------------------------------------------


(WORDS) ( WID "<spaces>name" -- )

List all names and stack diagrams of the definitions in the word list identified by WID, whose name are identical to name. If the parameter name is not provided, list all names and stack diagrams of all definitions in the word list identified by WID. Each definition is displayed on a separate line.


--------------------------------------------------------------------------------


. ( DEFINITION -- )

Display the header of DEFINITION, consisting of the definition's name and its stack diagram, plus a trailing space character.


--------------------------------------------------------------------------------


.ADDR ( SINGLE -- )

Display SINGLE in a four-digit hexadecimal format with a trailing colon.


--------------------------------------------------------------------------------


.BYTE ( SINGLE -- )

Display the least significant byte of SINGLE in a two-digit hexadecimal format.


--------------------------------------------------------------------------------


.DIAGRAM ( DEFINITION -- )

Display the stack diagram of DEFINITION in a user-readable format, plus a trailing space character.


--------------------------------------------------------------------------------


.HEX ( SINGLE -- )

Display SINGLE in a four-digit hexadecimal format.


--------------------------------------------------------------------------------


.HEX ( DOUBLE -- )

Display DOUBLE in an eight-digit hexadecimal format.


--------------------------------------------------------------------------------


: .IMMEDIATE ( DEFINITION -- )

If DEFINITION is an immediate word, display "IMMEDIATE" and a trailing space character.


--------------------------------------------------------------------------------


;CODE ( COLON-DEFINITION -- )

Interpretation: 
An exception is thrown if ;CODE 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. End the current definition, allow it to be found in the dictionary, and enter interpretation state. Subsequent characters in the parse area typically represent source code in assembly language, generating machine code.

Runtime: ( R: nest-sys -- ) 
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-sys. An ambiguous condition exists if the most recent definition was not defined with CREATE or a user-defined word that calls CREATE.

name Execution: ( -- ) 
Perform the machine code sequence that was generated following ;CODE.

Note that new definitions do have no stack effects by default. Stack effects have to be specified separately if they are intended. By using a stack diagram phrase ( ... -- ... ) immediatly following ;CODE and the definition name, the new definition is modified to incorporate stack effects.

;CODE is an immediate word.


--------------------------------------------------------------------------------


? ( -- )

Interpretation: ( ADDRESS -- ) 
Display the value stored at ADDRESS by performing the execution semantics of @ and ..

Compilation: 
Append the runtime semantics given below to the current definition.

Runtime: ( ADDRESS -- ) 
Display the value stored at ADDRESS by performing the execution semantics of @ and ..

? is an immediate word.


--------------------------------------------------------------------------------


?COLON ( CONST -> CODE -- )

An exception is thrown if CONST -> CODE is not the code field address of a colon definition.


--------------------------------------------------------------------------------


DEFER? ( DEFINITION -- FLAG )

FLAG is TRUE if and only if DEFINITION was defined by DEFER.


--------------------------------------------------------------------------------


DUMP ( DATA UNSIGNED -- )

Display the contents of UNSIGNED consecutive memory cells starting at address DATA. If necessary, multiple lines are displayed. Each line contains the hexadecimal starting address and the contents of up to eight memory cells.


--------------------------------------------------------------------------------


DUMP ( CONST UNSIGNED -- )

Display the contents of UNSIGNED consecutive memory cells starting at address CONST. If necessary, multiple lines are displayed. Each line contains the hexadecimal starting address and the contents of up to eight memory cells.


--------------------------------------------------------------------------------


DUMP ( CODE UNSIGNED -- )

Display the contents of UNSIGNED consecutive memory cells starting at address CODE. If necessary, multiple lines are displayed. Each line contains the hexadecimal starting address and the contents of up to eight memory cells.


--------------------------------------------------------------------------------


DUMP ( FAR-ADDRESS UNSIGNED -- )

Display the contents of UNSIGNED consecutive memory cells starting at address FAR-ADDRESS. If necessary, multiple lines are displayed. Each line contains the hexadecimal starting address and the contents of up to eight memory cells.


--------------------------------------------------------------------------------


DUMP ( DATA -> DOUBLE UNSIGNED -- )

Display the contents of UNSIGNED consecutive double memory cells starting at address DATA -> DOUBLE. If necessary, multiple lines are displayed. Each line contains the hexadecimal starting address and the contents of up to four double memory cells.


--------------------------------------------------------------------------------


DUMP ( CONST -> DOUBLE UNSIGNED -- )

Display the contents of UNSIGNED consecutive double memory cells starting at address CONST -> DOUBLE. If necessary, multiple lines are displayed. Each line contains the hexadecimal starting address and the contents of up to four double memory cells.


--------------------------------------------------------------------------------


DUMP ( CODE -> DOUBLE UNSIGNED -- )

Display the contents of UNSIGNED consecutive double memory cells starting at address CODE -> DOUBLE. If necessary, multiple lines are displayed. Each line contains the hexadecimal starting address and the contents of up to four double memory cells.


--------------------------------------------------------------------------------


DUMP ( FAR-ADDRESS -> DOUBLE UNSIGNED -- )

Display the contents of UNSIGNED consecutive double memory cells starting at address FAR-ADDRESS -> DOUBLE. If necessary, multiple lines are displayed. Each line contains the hexadecimal starting address and the contents of up to four double memory cells.


--------------------------------------------------------------------------------


DUMP ( CDATA UNSIGNED -- )

Display UNSIGNED consecutive characters starting at address CDATA. If necessary, multiple lines are displayed. Each line contains the hexadecimal starting address and the contents of up to 16 character size memory cells.


--------------------------------------------------------------------------------


DUMP ( CCONST UNSIGNED -- )

Display UNSIGNED consecutive characters starting at address CCONST. If necessary, multiple lines are displayed. Each line contains the hexadecimal starting address and the contents of up to 16 character size memory cells.


--------------------------------------------------------------------------------


DUMP ( CCODE UNSIGNED -- )

Display UNSIGNED consecutive characters starting at address CCODE. If necessary, multiple lines are displayed. Each line contains the hexadecimal starting address and the contents of up to 16 character size memory cells.


--------------------------------------------------------------------------------


DUMP ( CFAR-ADDRESS UNSIGNED -- )

Display UNSIGNED consecutive characters starting at address CFAR-ADDRESS. If necessary, multiple lines are displayed. Each line contains the hexadecimal starting address and the contents of up to 16 character size memory cells.


--------------------------------------------------------------------------------


FIRST ( WID -- DEFINITION )

DEFINITION is the first created definition of the word list identified by WID.


--------------------------------------------------------------------------------


LAST ( WID -- DEFINITION )

DEFINITION is the most recently created definition of the word list identified by WID.


--------------------------------------------------------------------------------


LOOKUP ( -- )

Compile the runtime part of SEE-LOOKUP.


--------------------------------------------------------------------------------


SEE ( "<spaces>name" -- )

Skip leading space delimiters. Parse name delimited by a space. Find name. Display a human-readable representation of name's definition, including its stack diagram. An exception is thrown if name is not a colon definition.

Note that SEE can not display how immediate words like IF and THEN were used during compilation.


--------------------------------------------------------------------------------


SEE, ( TOKEN CONST -> CODE -- )

Add one entry consisting of CONST -> CODE and TOKEN to the end of the lookup table SEE-LOOKUP. An exception is thrown if the lookup table is full.


--------------------------------------------------------------------------------


SEE+EXIT ( CONST -> TOKEN TOKEN -- 1ST FLAG )

If CONST -> TOKEN is less than the value of SEE-LIMIT, execute the semantics of SEE-PARAM. Otherwise, discard TOKEN, display a semicolon with a trailing space, and return TRUE as FLAG. 1ST is equal to CONST -> TOKEN.


--------------------------------------------------------------------------------


SEE-ALL ( CONST -> TOKEN -- )

Display a human-readable representation of the virtual machine code starting at CONST -> TOKEN and up to the first occurence of the token of either (EXIT) or (+EXIT) that is not skipped by a conditional or unconditional branch.

Note that SEE-ALL can not display how immediate words like IF and THEN were used during compilation.


--------------------------------------------------------------------------------


SEE-BRANCH ( CONST -> TOKEN TOKEN -- 1ST FLAG )

Display the name of the definition whose token is equal to TOKEN. Display the constant parameter of the compiled execution token stored at address CONST -> TOKEN as a signed single-precision number. The constant parameter is assumed to be a branch offset and has the size of a single cell. If the branch destination is greater than the value of SEE-LIMIT, replace the value of SEE-LIMIT with the branch destination. 1ST is CONST -> TOKEN incremented by the size of one cell. FLAG is FALSE.


--------------------------------------------------------------------------------


SEE-DEFAULT ( CONST -> TOKEN TOKEN -- 1ST FLAG )

Find the definition whose token is equal to TOKEN. If the definition is an immediate word, display "POSTPONE" and the name of the definition. Otherwise just display the name of the definition. Display "???" if TOKEN is not associated with a definition. 1ST is equal to CONST -> TOKEN. FLAG is FALSE.


--------------------------------------------------------------------------------


SEE-DLIT ( CONST -> TOKEN TOKEN -- 1ST FLAG )

Discard TOKEN. Display the constant parameter of a compiled execution token stored at address CONST -> TOKEN as a signed double-precision number. The constant parameter has the size of two cells. 1ST is CONST -> TOKEN incremented by the size of the constant parameter. FLAG is FALSE.


--------------------------------------------------------------------------------


SEE-EXIT ( CONST -> TOKEN TOKEN -- 1ST FLAG )

If CONST -> TOKEN is less than the value of SEE-LIMIT, execute the semantics of SEE-DEFAULT. Otherwise, discard TOKEN, display a semicolon with a trailing space, and return TRUE as FLAG. 1ST is equal to CONST -> TOKEN.


--------------------------------------------------------------------------------


SEE-FLIT ( CONST -> TOKEN TOKEN -- 1ST FLAG )

Discard TOKEN. Display the constant parameter of a compiled execution token stored at address CONST -> TOKEN as a floating-point number. The constant parameter has the size of five cells. 1ST is CONST -> TOKEN incremented by the size of the constant parameter. FLAG is FALSE.


--------------------------------------------------------------------------------


SEE-LIMIT ( -- DATA -> CONST -> TOKEN )

DATA -> CONST -> TOKEN is the address of a cell containing a virtual machine code address that is a part of the definition that is currently displayed by SEE. SEE may not stop displaying the virtual code of the definition before this address has been reached.


--------------------------------------------------------------------------------


SEE-LIT ( CONST -> TOKEN TOKEN -- 1ST FLAG )

Discard TOKEN. Display the constant parameter of a compiled execution token stored at address CONST -> TOKEN as a signed single-precision number. The constant parameter has the size of a single cell. 1ST is CONST -> TOKEN incremented by the size of the constant parameter. FLAG is FALSE.


--------------------------------------------------------------------------------


SEE-LOOKUP ( TOKEN -- (SEE) )

(SEE) is the qualified token of a word SEE can use for displaying the token TOKEN. SEE-LOOKUP uses a lookup table to determine the qualified token.


--------------------------------------------------------------------------------


SEE-NEWLINE ( -- )

Cause subsequent output to appear at the third column of the next line.


--------------------------------------------------------------------------------


SEE-PARAM ( CONST -> TOKEN TOKEN -- 1ST FLAG )

Display the name of the definition whose token is equal to TOKEN. Display the constant parameter of the compiled execution token stored at address CONST -> TOKEN as a signed single-precision number. The constant parameter has the size of a single cell. 1ST is CONST -> TOKEN incremented by the size of the constant parameter. FLAG is FALSE.


--------------------------------------------------------------------------------


SEE-SLIT ( CONST -> TOKEN TOKEN -- 1ST FLAG )

Discard TOKEN. Display the string literal parameter of a compiled execution token stored as a counted string at address CONST -> TOKEN with a leading and a trailing quote ("). The string literal parameter has a variable size. 1ST is CONST -> TOKEN incremented by the size of the counted string. 1ST is cell-aligned. FLAG is FALSE.


--------------------------------------------------------------------------------


SEEN-BY ( DEFINITION "<spaces>name" -- TOKEN CONST -> CODE )

Skip leading space delimiters. Parse name delimited by a space. Find a definition called name whose stack diagram matches ( CONST -> TOKEN TOKEN -- 1ST FLAG ) with respect to both input and output parameters, and return its execution token as TOKEN. CONST -> CODE is the address of the code field of DEFINITION. An exception is thrown if SEEN-BY is executed in compilation state.

Note: SEEN-BY calculates one entry of SEE-LOOKUP.


--------------------------------------------------------------------------------


WORDS ( "<spaces>name" -- )

List all names and stack diagrams of the definitions in the FORTH-WORDLIST word list, whose name are identical to name. If the parameter name is not provided, list all names and stack diagrams of all definitions in the FORTH-WORDLIST word list. Each definition is displayed on a separate line.


--------------------------------------------------------------------------------


[ELSE] ( -- )

Compilation: 
Perform the execution semantics given below.

Execution: ( "<spaces>name" ... -- ) 
Skip leading spaces, parse and discard space-delimited words from the parse area, including nested occurrences of [IF] ... [THEN] and [IF] ... [ELSE] ... [THEN], until the word [THEN] has been parsed and discarded. If the parse area becomes exhausted, it is refilled as with REFILL.

[ELSE] is an immediate word.


--------------------------------------------------------------------------------


[IF] ( SINGLE | SINGLE "<spaces>name" ... -- )

Compilation: 
Perform the execution semantics given below.

Execution: 
If any bit of SINGLE is not zero, continue execution. Otherwise, skip leading spaces, parse and discard space-delimited words from the parse area, including nested occurrences of [IF] ... [THEN] and [IF] ... [ELSE] ... [THEN], until either the word [ELSE] or the word [THEN] has been parsed and discarded. If the parse area becomes exhausted, it is refilled as with REFILL.

An ambiguous condition exists if [IF] is POSTPONEd, or if the end of the input buffer is reached and cannot be refilled before the terminating [ELSE] or [THEN] is parsed.

[IF] is an immediate word.


--------------------------------------------------------------------------------


[THEN] ( -- )

Compilation: 
Perform the execution semantics given below.

Execution: 
Continue execution.

[THEN] is an immediate word.


--------------------------------------------------------------------------------


ADJACENT-CHUNK ( DATA -> UNSIGNED -- 1ST )

1ST is the address of the chunk that is adjacent towards higher memory addresses to the chunk starting at DATA -> UNSIGNED. An ambiguous condition exists if DATA -> UNSIGNED is not the address of a chunk in the dynamic memory space.


--------------------------------------------------------------------------------


ALLOCATE ( UNSIGNED -- DATA SIGNED )

Allocate UNSIGNED address units of contiguous memory space. The initial content of the allocated memory space is undefined. If the allocation succeeds, DATA is the aligned starting address of the allocated memory space and SIGNED is zero. If the operation fails, DATA does not represent a valid address and SIGNED is the I/O result code.


--------------------------------------------------------------------------------


CALLOCATE ( UNSIGNED -- CDATA SIGNED )

Allocate UNSIGNED address units of contiguous memory space. The initial content of the allocated memory space is undefined. If the allocation succeeds, CDATA is the aligned starting address of the allocated memory space and SIGNED is zero. If the operation fails, CDATA does not represent a valid address and SIGNED is the I/O result code.


--------------------------------------------------------------------------------


CLOBBER ( -- )

Return all chunks of dynamic memory that were previously obtained by ALLOCATE, CALLOCATE or RESIZE to the system for later allocation.


--------------------------------------------------------------------------------


UNITS>CELLS ( UNSIGNED -- 1ST )

1ST is the minimum number of cells that can hold a memory space that spans UNSIGNED address units.


--------------------------------------------------------------------------------


ENCLOSE-CHUNK ( DATA -> UNSIGNED -- 1ST 1ST )

1ST and 1ST are addresses of free chunks of dynamic memory. They enclose address DATA -> UNSIGNED in such a way that the first 1ST is lower than DATA -> UNSIGNED, the second 1ST is higher than DATA -> UNSIGNED, and no other free chunk exists between them. If no free chunk is available after DATA -> UNSIGNED, the second 1ST is zero.


--------------------------------------------------------------------------------


FIND-CHUNK ( UNSIGNED -- DATA -> 1ST )

DATA -> 1ST is the address of a free chunk of dynamic memory that is at least UNSIGNED plus 2 cells long, or zero if no sufficiently long free chunk can be obtained.

Note: FIND-CHUNK does not allocate any dynamic memory.


--------------------------------------------------------------------------------


FREE ( DATA -- SIGNED )

Return the contiguous memory space starting at DATA to the system for later allocation. DATA shall indicate a memory space that was previously obtained by ALLOCATE or RESIZE. If the operation succeeds, or DATA is null, SIGNED is zero. If the operation fails, SIGNED is the I/O result code.


--------------------------------------------------------------------------------


FREE ( CDATA -- SIGNED )

Return the contiguous memory space starting at CDATA to the system for later allocation. CDATA shall indicate a memory space that was previously obtained by CALLOCATE or RESIZE. If the operation succeeds, or CDATA is null, SIGNED is zero. If the operation fails, SIGNED is the I/O result code.


--------------------------------------------------------------------------------


FREELIST ( -- DATA -> UNSIGNED )

DATA -> UNSIGNED is the constant address of the first free chunk of memory that is reserved for dynamic memory allocation.


--------------------------------------------------------------------------------


MERGE-CHUNKS ( DATA -> UNSIGNED 1ST -- )

Merge two succeeding chunks of dynamic memory starting at addresses DATA -> UNSIGNED and 1ST by increasing the size attribute of the first one by the size of the second one.


--------------------------------------------------------------------------------


MERGE-FREE-CHUNKS ( DATA -> UNSIGNED 1ST -- )

Merge two succeeding free chunks of dynamic memory starting at addresses DATA -> UNSIGNED and 1ST by increasing the size attribute of the first one by the size of the second one. Remove the second free chunk from the linked list of free chunks.


--------------------------------------------------------------------------------


NEXT-CHUNK ( DATA -> UNSIGNED -- DATA -> 1ST )

DATA -> 1ST is the address of a cell containing the address of the next free chunk of dynamic memory, or zero if DATA -> UNSIGNED has no successor. An ambiguous condition exists if DATA -> UNSIGNED is not the address of a free chunk.


--------------------------------------------------------------------------------


RESIZE ( DATA UNSIGNED -- 1ST SIGNED )

Change the allocation of the contiguous memory space starting at the address DATA, previously allocated by ALLOCATE or RESIZE, to UNSIGNED address units. UNSIGNED may be either larger or smaller than the current size of the memory space. If the operation succeeds, 1ST is the aligned starting address of UNSIGNED address units of allocated memory and SIGNED is zero. 1ST may be, but need not be, the same as DATA. If they are not the same, the values contained in the memory space at DATA are copied to 1ST, up to the minimum size of either of the two memory spaces. If they are the same, the values contained in the memory space are preserved. If 1ST is not the same as DATA, the memory space at DATA is returned to the system according to the operation of FREE.

If the operation fails, 1ST equals DATA, the memory space at DATA is unaffected, and SIGNED is the I/O result code.

If DATA is zero, RESIZE just performs the semantics of ALLOCATE.


--------------------------------------------------------------------------------


RESIZE ( CDATA UNSIGNED -- 1ST SIGNED )

Change the allocation of the contiguous memory space starting at the address CDATA, previously allocated by CALLOCATE or RESIZE, to UNSIGNED address units. UNSIGNED may be either larger or smaller than the current size of the memory space. If the operation succeeds, 1ST is the aligned starting address of UNSIGNED address units of allocated memory and SIGNED is zero. 1ST may be, but need not be, the same as CDATA. If they are not the same, the values contained in the memory space at CDATA are copied to 1ST, up to the minimum size of either of the two memory spaces. If they are the same, the values contained in the memory space are preserved. If 1ST is not the same as CDATA, the memory space at CDATA is returned to the system according to the operation of FREE.

If the operation fails, 1ST equals CDATA, the memory space at CDATA is unaffected, and SIGNED is the I/O result code.

If CDATA is zero, RESIZE just performs the semantics of CALLOCATE.


--------------------------------------------------------------------------------


SIZE ( DATA -- UNSIGNED )

UNSIGNED is the size in address units of the contiguous memory space starting at DATA that has previously been obtained by ALLOCATE or RESIZE.


--------------------------------------------------------------------------------


SIZE ( CDATA -- UNSIGNED )

UNSIGNED is the size in address units of the contiguous memory space starting at CDATA that has previously been obtained by CALLOCATE or RESIZE.


--------------------------------------------------------------------------------


SIZE-FREELIST ( -- UNSIGNED )

UNSIGNED is size in cells of a region of memory that is reserved for dynamic memory allocation.


--------------------------------------------------------------------------------


SPLIT-CHUNK ( DATA -> UNSIGNED 2ND -- 1ST )

Split a chunk of dynamic memory starting at address DATA -> UNSIGNED into two parts. The first part starts at DATA -> UNSIGNED, and its size in cells is the size of the original chunk minus 2ND. The second part starts at address 1ST, and its size in cells is equal to 2ND. An ambiguous condition exists if DATA -> UNSIGNED is not the address of a chunk or if 2ND is not lower than the size of the original chunk.


--------------------------------------------------------------------------------


SPLIT-CHUNK' ( DATA -> UNSIGNED 2ND -- 1ST )

Split a chunk of dynamic memory starting at address DATA -> UNSIGNED into two parts. The first part starts at DATA -> UNSIGNED, and its size in cells is equal to 2ND. The second part starts at address 1ST, and its size in cells is the size of the original chunk minus 2ND. An ambiguous condition exists if DATA -> UNSIGNED is not the address of a chunk or if 2ND is not lower than the size of the original chunk.


--------------------------------------------------------------------------------


#ORDER ( -- DATA -> UNSIGNED )

DATA -> UNSIGNED is the address of a cell containing the number of word lists in the present search order.


--------------------------------------------------------------------------------


#VOCS ( -- UNSIGNED )

UNSIGNED is the maximum number of word lists in the search order.


--------------------------------------------------------------------------------


. ( WID -- )

Display the name of the vocabulary that corresponds to the word list identified by WID as a character string, followed by a space. If the word list is invalid or is not associated with a vocabulary, display ??? instead.


--------------------------------------------------------------------------------


?DEFINITION ( WID -- DEFINITION )

DEFINITION is the vocabulary that corresponds to the word list identified by WID. If WID is not a valid word list, DEFINITION is the null definition.


--------------------------------------------------------------------------------


ALSO ( -- )

Transform the search order consisting of wid1, wid2, ... widn (where wid1 is searched first) into wid1, wid1, wid2, ... widn. An exception is thrown if the search order is empty, or if there are too many word lists in the search order.


--------------------------------------------------------------------------------


ASSEMBLER ( -- )

Replace the first word list in the search order with a word list that is reserved for the assembler.

ASSEMBLER is a vocabulary.


--------------------------------------------------------------------------------


CONTEXT ( -- DATA -> WID )

DATA -> WID is the address of a number of cells that contain the identifiers of the word lists that constititute the search order. The first word list to be searched is the one whose identifier is stored at DATA -> WID.


--------------------------------------------------------------------------------


DEFINITIONS ( -- )

Make the compilation word list the same as the first word list in the search order. Specifies that the names of subsequent definitions will be placed in the compilation word list. Subsequent changes in the search order will not affect the compilation word list.


--------------------------------------------------------------------------------


DO-VOCABULARY ( -- )

Append the runtime semantics given below to the current definition.

Replace the first word list in the search order with the word list whose identifier is stored in the data field of the current definition.


--------------------------------------------------------------------------------


EDITOR ( -- )

Replace the first word list in the search order with a word list that is reserved for the block editor.

EDITOR is a vocabulary.


--------------------------------------------------------------------------------


ENVIRONMENT ( -- )

Replace the first word list in the search order with the ENVIRONMENT-WORDLIST word list.

ENVIRONMENT is a vocabulary.


--------------------------------------------------------------------------------


FORTH ( -- )

Replace the first word list in the search order with the FORTH-WORDLIST word list.

FORTH is a vocabulary.


--------------------------------------------------------------------------------


GET-ORDER ( -- TUPLE -> WID )

TUPLE -> WID is a tuple containing the identifiers of the word lists in the search order. The first identifier in the tuple identifies the word list that is searched first. The search order is unaffected.


--------------------------------------------------------------------------------


LOCAL ( -- )

Replace the first word list in the search order with the LOCAL-WORDLIST word list.

LOCAL is a vocabulary.


--------------------------------------------------------------------------------


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 pointers, memory space pointers, and word lists 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.


--------------------------------------------------------------------------------


ONLY ( -- )

Set the search order to the minimum search order, which consists only of the FORTH-WORDLIST word list.


--------------------------------------------------------------------------------


ORDER ( -- )

Display the names of the vocabularies that correspnd to the word lists in the search order in their search order sequence, from first searched to last searched. Also display the name of the vocabulary that corresponds to the compilation word list.


--------------------------------------------------------------------------------


PREVIOUS ( -- )

Transform the search order consisting of wid1, wid2, ... widn (where wid1 is searched first) into wid2, ... widn. An exception is thrown if the search order was empty before PREVIOUS was executed.


--------------------------------------------------------------------------------


SEARCH-ALL ( CDATA -> CHARACTER UNSIGNED SINGLE CODE -- DEFINITION SIGNED )

Extend the semantics of SEARCH-ALL to be:

Search all word lists in the search order 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.


--------------------------------------------------------------------------------


SET-ORDER ( -- )

Set the search order to the minimum search order, which consists only of the FORTH-WORDLIST word list.


--------------------------------------------------------------------------------


SET-ORDER ( TUPLE -> WID -- )

Set the search order to the word lists whose identifiers are contained in the tuple TUPLE -> WID. Subsequently, the first word list of the tuple will be searched first. If the tuple is empty, empty the search order. An exception is thrown if the size of the tuple is greater than the maximum number of word lists in the search order.


--------------------------------------------------------------------------------


VOCABULARY ( "<spaces>name" -- )

Skip leading space delimiters. Parse name delimited by a space. Create a new empty word list. Create a definition for name with the execution semantics defined below. Store the identifier of the new word list and a link to the previous definition defined by VOCUBULARY in the data field of the new definition.

name Execution: ( -- ) 

Replace the first word list in the search order with the new word list.

Note: Words defined by VOCABULARY are called vocabularies. 


--------------------------------------------------------------------------------


VOC-LINK ( -- DATA -> DEFINITION )

DATA -> DEFINITION is the address of a double cell containing the most recently defined vocabulary.


--------------------------------------------------------------------------------


WORDLIST ( -- WID ) 

Create a new empty word list, returning its word list identifier WID.


--------------------------------------------------------------------------------


WORDS ( "<spaces>name" -- )

List all names and stack diagrams of the definitions in the first word list of the search order, whose name are identical to name. If the parameter name is not provided, list all names and stack diagrams of all definitions in the first word list of the search order. Each definition is displayed on a separate line.


--------------------------------------------------------------------------------


#LAG ( -- CDATA -> CHARACTER UNSIGNED )

CDATA -> CHARACTER is the address of the character stored at the editing cursor. UNSIGNED is the number of characters in the current line after the editing cursor.


--------------------------------------------------------------------------------


#LEAD ( -- CDATA -> CHARACTER UNSIGNED )

CDATA -> CHARACTER is the starting address of the current line. UNSIGNED is the number of characters in the current line before the editing cursor.


--------------------------------------------------------------------------------


#LOCATE ( -- UNSIGNED UNSIGNED )

From the editing cursor, determine the line number as the second UNSIGNED and the offset into the line as the first UNSIGNED.


--------------------------------------------------------------------------------


-MOVE ( CDATA -> CHARACTER UNSIGNED-- )

Copy C/L characters starting at address CDATA -> CHARACTER to line UNSIGNED of the current screen. Mark the current screen as updated.


--------------------------------------------------------------------------------


1LINE ( -- FLAG )

Scan the current line for a match to the text in PAD. If a match is found, update the editing cursor to the end of the matching text and return TRUE as FLAG. Otherwise update the editing cursor to the start of the next line and return FALSE as FLAG.


--------------------------------------------------------------------------------


?FIND ( -- )

Search for a match to the text in PAD, from the editing cursor to the end of the current screen. If a match is found, update the editing cursor to the end of the matching text. Otherwise issue an error message and update the editing cursor to the top of the screen.


--------------------------------------------------------------------------------


B ( -- )

Move the editing cursor back by the number in COUNT. Then display the current line, inserting an underscore character at the cursor position.


--------------------------------------------------------------------------------


C ( "ccc" -- )

Initialize PAD with spaces. Parse ccc delimited by the end of the line. Copy ccc to PAD and store the number of characters copied in COUNT. Insert ccc at the editing cursor, moving the rest of the current line to the right. Then display the current line, inserting an underscore character at the cursor position.


--------------------------------------------------------------------------------


CLEAR ( UNSIGNED -- )

Clear block UNSIGNED. Store UNSIGNED in SCR. Move the editing cursor to the top of the screen.


--------------------------------------------------------------------------------


COPY ( unsigned 1ST -- )

Copy the contents of block UNSIGNED to block 1ST. 


--------------------------------------------------------------------------------


COUNT ( -- DATA -> UNSIGNED )

DATA -> UNSIGNED is the address of a cell containing the length of the character string stored in PAD.


--------------------------------------------------------------------------------


D ( UNSIGNED -- )

Copy the contents of line UNSIGNED into PAD. Delete line UNSIGNED. All following lines move one line up.


--------------------------------------------------------------------------------


DEL ( UNSIGNED -- )

Delete UNSIGNED characters prior to the editing cursor.


--------------------------------------------------------------------------------


E ( UNSIGNED -- )

Erase line UNSIGNED with spaces.


--------------------------------------------------------------------------------


F ( "ccc" -- )

Initialize PAD with spaces. Parse ccc delimited by the end of the line. Copy ccc to PAD and store the number of characters copied in COUNT. Search for a match to ccc, from the editing cursor to the end of the current screen. If a match is found, update the editing cursor to the end of the matching text. Then display the current line, inserting an underscore character at the cursor position. Otherwise issue an error message and update the editing cursor to the top of the screen.


--------------------------------------------------------------------------------


H ( UNSIGNED -- )

Copy the contents of line UNSIGNED into PAD.


--------------------------------------------------------------------------------


I ( UNSIGNED -- )

Insert the contents of PAD in line UNSIGNED. The original line UNSIGNED and all following lines move one line down.


--------------------------------------------------------------------------------


INDEX ( UNSIGNED 1ST -- )

Display the first line of each block starting with block UNSIGNED up to and including block 1ST.


--------------------------------------------------------------------------------


L ( -- )

Display the contents of the current screen. Then display the current line, inserting an underscore character at the cursor position.


--------------------------------------------------------------------------------


LINE ( UNSIGNED -- CDATA -> CHARACTER )

CDATA -> CHARACTER is the address of line UNSIGNED of the current screen. An ambigous condition exists if UNSIGNED is not within the allowed range for line numbers (0 to 15).


--------------------------------------------------------------------------------


LIST ( UNSIGNED -- )

Display the contents of block UNSIGNED. Store UNSIGNED in SCR. Move the editing cursor to the top of the screen.


--------------------------------------------------------------------------------


M ( integer -- )

Move the editing cursor by the signed amount INTEGER. Then display the current line, inserting an underscore character at the cursor position.


--------------------------------------------------------------------------------


N ( -- )

Search for a match to the text in PAD, from the editing cursor to the end of the current screen. If a match is found, update the editing cursor to the end of the matching text. Then display the current line, inserting an underscore character at the cursor position. Otherwise issue an error message and update the editing cursor to the top of the screen.


--------------------------------------------------------------------------------


P ( UNSIGNED "ccc" -- )

Initialize PAD with spaces. Parse ccc delimited by the end of the line. Copy ccc to PAD and store the number of characters copied in COUNT. Copy ccc to line UNSIGNED.


--------------------------------------------------------------------------------


R ( UNSIGNED -- )

Replace line UNSIGNED with the contents of PAD.


--------------------------------------------------------------------------------


R# ( -- DATA -> UNSIGNED )

DATA -> UNSIGNED is the address of a cell containing the offset of the editing cursor from the top of the screen.


--------------------------------------------------------------------------------


S ( UNSIGNED -- )

Insert an empty line at line UNSIGNED. The original line UNSIGNED and all following lines move one line down. This editor command is called spread.


--------------------------------------------------------------------------------


T ( UNSIGNED -- )

Move the editing cursor to the start of line UNSIGNED. Copy the contents of line UNSIGNED into PAD and display it.


--------------------------------------------------------------------------------


TOP ( -- )

Move the editing cursor to the top of the screen.


--------------------------------------------------------------------------------


TEXT ( CHARACTER "ccc" -- )

Initialize PAD with spaces. Parse ccc delimited by the delimiter CHARACTER. Copy ccc to PAD and store the number of characters copied in COUNT.


--------------------------------------------------------------------------------


TILL ( "ccc" -- )

Initialize PAD with spaces. Parse ccc delimited by the end of the line. Copy ccc to PAD and store the number of characters copied in COUNT. Search for a match to ccc, from the editing cursor to the end of the current line. If a match is found, delete all character between the editing cursor and the end of the matching text. Then display the current line, inserting an underscore character at the cursor position. Otherwise issue an error message and update the editing cursor to the start of the next line.


--------------------------------------------------------------------------------


X ( "ccc" -- )

Initialize PAD with spaces. Parse ccc delimited by the end of the line. Copy ccc to PAD and store the number of characters copied in COUNT. Search for a match to ccc, from the editing cursor to the end of the current screen. If a match is found, delete it. Then display the current line, inserting an underscore character at the cursor position. Otherwise issue an error message and update the editing cursor to the top of the screen.


--------------------------------------------------------------------------------


! ( SINGLE BDATA -> 1ST -- )

Store SINGLE in the bit field specified by BDATA. Only the number of low-order bits corresponding to the length of the bit field are transferred.


--------------------------------------------------------------------------------


(BIND) ( DATA-TYPE "<spaces>name" -- )

Skip leading space delimiters. Parse name delimited by a space. Find name. Statically bind name to class DATA-TYPE and compile it. An exception is thrown if the system is in interpretation state, if DATA-TYPE is not a class, or if name is not a virtual member. An ambiguous condition exists if name is not a virtual member of class DATA-TYPE.


--------------------------------------------------------------------------------


(BVARIABLE) ( STACK-DIAGRAM -- 1ST )

Compile the stack diagram of a bit field 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.


--------------------------------------------------------------------------------


(CVARIABLE) ( STACK-DIAGRAM -- 1ST )

Compile the stack diagram of a character size 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.


--------------------------------------------------------------------------------


(DELETE) ( OBJECT -- )

Return the chunk of contiguous memory space occupied by the object OBJECT to the system for later allocation. An ambiguous condition exists if OBJECT was not previously created by (NEW) ( CONST -> OBJECT -- 2ND ). An exception is thrown if the memory space canot be returned.


--------------------------------------------------------------------------------


(MEMBER) ( STRUCT-SIZE UNSIGNED "<spaces>name" -- 1ST )

Perform the semantics of AUTOTHIS if THIS-CLASS is a class.

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. 1ST is equal to STRUCT-SIZE aligned to cell size, plus UNSIGNED times the number of bits in one address unit.

name is referred to as a data member.

Execution: ( x -- DATA -> y ) 
DATA -> y is the address of the data member of the structure or object x, whose offset is equal to STRUCT-SIZE divided by the number of bits in one address unit. x is a structure or object of the data type THIS-CLASS at the time name was created. y is the data type of the data member, which is obtained from the data type heap at the time name was created.


--------------------------------------------------------------------------------


(NEW) ( DATA CONST -> STRUCTURE -- 3RD )

3RD is the structure that starts at address DATA.


--------------------------------------------------------------------------------


(NEW) ( CDATA CONST -> STRUCTURE -- 3RD )

3RD is the structure that starts at address CDATA.


--------------------------------------------------------------------------------


(NEW) ( CONST -> STRUCTURE -- 2ND )

Allocate a chunk of contiguous memory space for a structure STRUCTURE, and return the allocated structure as 2ND. The initial contents of the allocated structure's members are undefined. An exception is thrown if memory allocation fails. An ambiguous condition exists if CONST -> STRUCTURE is not the address of a cell that contains the size in address units of the structure STRUCTURE.

Note: CONST -> STRUCTURE is not the address of an item of data type STRUCTURE.


--------------------------------------------------------------------------------


(NEW) ( DATA CONST -> OBJECT -- 3RD )

Initialize the virtual member table pointer of an object with data type OBJECT starting at address DATA with CONST -> OBJECT, and return the object as 3RD. An ambiguous condition exists if CONST -> OBJECT is not the address of the virtual member table of the class OBJECT.

Note: CONST -> OBJECT is not the address of an item of data type OBJECT.


--------------------------------------------------------------------------------


(NEW) ( CDATA CONST -> OBJECT -- 3RD )

Initialize the virtual member table pointer of an object with data type OBJECT starting at address CDATA with CONST -> OBJECT, and return the object as 3RD. An ambiguous condition exists if CONST -> OBJECT is not the address of the virtual member table of the class OBJECT.

Note: CONST -> OBJECT is not the address of an item of data type OBJECT.


--------------------------------------------------------------------------------


(NEW) ( CONST -> OBJECT -- 2ND )

Allocate a chunk of contiguous memory space for an object OBJECT. Initialize the virtual member table pointer of the object with CONST -> OBJECT, and return the object as 2ND. The initial contents of the allocated object's members are undefined. An exception is thrown if memory allocation fails. An ambiguous condition exists if CONST -> OBJECT is not the address of the virtual member table of the object OBJECT. 

Note: CONST -> OBJECT is not the address of an item of data type OBJECT.


--------------------------------------------------------------------------------


+ ( BADDRESS INTEGER -- 1ST )

Add INTEGER to the bit field address BADDRESS, giving the new bit field address 1ST. INTEGER is automatically multiplied with the length of the bit field before the actual addition takes place. The result typically specifies a bit field that starts at a different bit position.


--------------------------------------------------------------------------------


+! ( INTEGER BDATA -> INTEGER -- )

Add INTEGER to the content of the bit field specified by BDATA -> INTEGER. Only the number of low-order bits corresponding to the length of the bit field are transferred.


--------------------------------------------------------------------------------


+! ( INTEGER DATA -> BADDRESS -- )

Add INTEGER to the bit field address stored at address DATA -> BADDRESS. INTEGER is automatically multiplied with the length of the bit field before the actual addition takes place. The result typically specifies a bit field that starts at a different bit position.


--------------------------------------------------------------------------------


- ( BADDRESS INTEGER -- 1ST )

Subtract INTEGER from the bit field address BADDRESS, giving the new bit field address 1ST. INTEGER is automatically multiplied with the length of the bit field before the actual subtraction takes place. The result typically specifies a bit field that starts at a different bit position.


--------------------------------------------------------------------------------


1+ ( BADDRESS -- 1ST )

1ST is the address of a bit field that starts one bit after the most significant bit of the bit field specified by BADDRESS. Both bit fields have the same length.


--------------------------------------------------------------------------------


1- ( BADDRESS -- 1ST )

1ST is the address of a bit field that ends one bit before the least significant bit of the bit field specified by BADDRESS. Both bit fields have the same length


--------------------------------------------------------------------------------


:MEMBER ( OBJ-SIZE "<spaces>name" -- 1ST COLON-DEFINITION )

Skip leading space delimiters. Parse name delimited by a space. Find name in the AUTOTHIS word list. If name is not found, create an immediate definition with this name and the semantics given below in the AUTOTHIS word list. Create another definition for name in the current compilation word list, 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 (current compilation word list): ( -- ) 
Execute the definition name.

name Execution (AUTOTHIS word list): ( -- ) 
Evaluate THIS. Remove the AUTOTHIS word list from the search order, evaluate name and reappend the AUTOTHIS word list to the search order.

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. An ambiguous condition exists if no input parameters are specified, or if the last input parameter does not have the data type of the current class.


--------------------------------------------------------------------------------


>LAST ( DATA-TYPE -- CONST -> ADDRESS )

CONST -> ADDRESS is the address of the first of two cells. The first cell contains the address offset of the latest definition of the AUTOTHIS word list that belongs to the class DATA-TYPE. The second cell contains the address offset of the latest definition of the PROTECTED word list that belongs to the class DATA-TYPE. An exception is thrown if DATA-TYPE is not a class.


--------------------------------------------------------------------------------


>THIS ( -- )

Interpretation: 
An exception is thrown if >THIS is interpreted.

Compilation: 
Create a local with name THIS. Append the runtime semantics given below to the current definition.

Runtime: ( SINGLE -- ) 
Store SINGLE into the local THIS.

>THIS is an immediate word.


--------------------------------------------------------------------------------


>VTABLE ( DATA-TYPE -- CONST -> CONST )

CONST -> CONST is the address of the first of two cells. The first cell contains the address of the virtual member table of the class DATA-TYPE. The second cell contains the address of the friends table of the class DATA-TYPE. An exception is thrown if DATA-TYPE is not a class.


--------------------------------------------------------------------------------


?AUTOTHIS ( "<spaces>name" -- "<spaces>name" )

Perform the semantics of AUTOTHIS if THIS-CLASS is equal to OBJECT or a direct or indirect subtype of OBJECT.


--------------------------------------------------------------------------------


?OBJECT ( DATA-TYPE -- CONST )

CONST is the address of the code field of the definition that is associated with DATA-TYPE. An exception is thrown if DATA-TYPE is not a class.


--------------------------------------------------------------------------------


?STRUCTURE ( DATA-TYPE -- CONST )

CONST is the address of a cell that contains the size in address units of structures with data type DATA-TYPE. An exception is thrown if DATA-TYPE is not a structure.


--------------------------------------------------------------------------------


?VIRTUAL ( DEFINITION -- UNSIGNED )

UNSIGNED is the offset in address units of the virtual member DEFINITION into the virtual member table of the class in which is has been defined. An exception is thrown if DEFINITION is not a virtual member.


--------------------------------------------------------------------------------


@ ( BDATA -> SINGLE -- 2ND )

2ND is the content of the bit field stored at address BDATA -> SINGLE. If the length of the bit field is lower that the size of a cell, its value is extended with leading zero bits.


--------------------------------------------------------------------------------


@ ( BDATA -> SIGNED -- 2ND )

2ND is the content of the bit field stored at address BDATA -> SIGNED. If the length of the bit field is lower that the size of a cell, its value is sign extended.


--------------------------------------------------------------------------------


@ ( BDATA -> FLAG -- 2ND )

2ND is the content of the bit field stored at address BDATA -> FLAG. If the length of the bit field is lower that the size of a cell, its value is extended to either FALSE or TRUE.


--------------------------------------------------------------------------------


ACCESS ( OBJ-SIZE "<spaces>name" -- 1ST )

Skip leading space delimiters. Parse name delimited by a space. Find name. Replace the first word list in the search order with the word list that combines the PRIVATE and PROTECTED word lists of the class name. An exception is thrown if name is not the name of a class THIS-CLASS is a friend to.


--------------------------------------------------------------------------------


ALIGNED ( STRUCT-SIZE -- 1ST )

1ST is the lowest value greater than or equal to STRUCT-SIZE that can be divided by the number of bits in a single cell.

Using ALIGNED in a class or structure definition causes the next data member to be cell aligned.


--------------------------------------------------------------------------------


APPEND-WORDLIST ( WID -- )

Append the word list identified by WID to the end of the search order. An exception is thrown if there are too many word lists in the search order.


--------------------------------------------------------------------------------


AND ( STRUCT-SIZE STRUCT-SIZE STRUCT-SIZE -- 1ST 2ND 3RD )

Terminate a block of a union of data members within a structure or class definition, and start a new one. 1ST and 3RD are equal to the first STRUCT-SIZE. 2ND is the maximum of the second and the third STRUCT-SIZE.


--------------------------------------------------------------------------------


AUTOTHIS ( "<spaces>name" -- "<spaces>name" )

Save the input source specification. Skip leading space delimiters. Parse name delimited by a space. Find name in the AUTOTHIS word list. Restore the input source specification. If name is not found, create a definition with this name and the semantics given below in the AUTOTHIS word list.

name Execution: ( -- ) 
Evaluate THIS. Remove the AUTOTHIS word list from the search order, evaluate name and reappend the AUTOTHIS word list to the search order.


--------------------------------------------------------------------------------


AUTOTHIS ( -- )

Replace the first word list in the search order with the AUTOTHIS word list. An ambiguous condition exists if the AUTOTHIS word list is used outside of a class definition.

AUTOTHIS is a vocabulary.

Note: AUTOTHIS cannot be found by an ordinary dictionary search, because it is hidden by a word with the same name and stack diagram.


--------------------------------------------------------------------------------


AUTOTHIS-LAST ( -- DATA -> ADDRESS )

DATA -> ADDRESS is the address of a cell that contains the address offset of the most recent definition in the AUTOTHIS word list.


--------------------------------------------------------------------------------


AUTOTHIS-WORDLIST ( -- WID )

WID is the identifier of the word list that contains the AUTOTHIS definitions of all classes.


--------------------------------------------------------------------------------


BADDRESS ( STACK-DIAGRAM -- 1ST )

When used in a stack diagram, specifies an input or output parameter with data type BADDRESS.


--------------------------------------------------------------------------------


BDATA ( STACK-DIAGRAM -- 1ST )

When used in a stack diagram, specifies an input or output parameter with data type BDATA.


--------------------------------------------------------------------------------


BIT-FIELD ( DATA -> SINGLE UNSIGNED UNSIGNED -- BDATA -> 2ND )

BDATA -> 2ND is the address of a bit field starting at the bit position specified by the first UNSIGNED, of memory address DATA -> SINGLE. The length of the bit field is specified by the second UNSIGNED.


--------------------------------------------------------------------------------


BMEMBER ( STRUCT-SIZE SINGLE UNSIGNED "<spaces>name" -- 1ST )

Perform the semantics of AUTOTHIS if THIS-CLASS is a class.

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. 1ST is equal to STRUCT-SIZE plus UNSIGNED.

name is referred to as a data member. BMEMBER allocates a bit field of data type SINGLE with UNSIGNED bits in the structure or class THIS-CLASS.

Execution: ( x -- BDATA -> SINGLE ) 
BDATA -> SINGLE is the address of the bit field of the structure or object x, that was allocated at the time name was created.


--------------------------------------------------------------------------------


BMEMBERS ( STRUCT-SIZE SINGLE UNSIGNED UNSIGNED "<spaces>name" -- 1ST )

Perform the semantics of AUTOTHIS if THIS-CLASS is a class.

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. 1ST is equal to STRUCT-SIZE plus the product of the first UNSIGNED and the second UNSIGNED.

name is referred to as a data member. BMEMBERS allocates UNSIGNED (second UNSIGNED) bit fields of data type SINGLE with UNSIGNED (first UNSIGNED) bits in the structure or class THIS-CLASS.

Execution: ( x -- BDATA -> SINGLE ) 
BDATA -> SINGLE is the address of the first of UNSIGNED (second UNSIGNED) bit fields of the structure or object x, that were allocated at the time name was created.


--------------------------------------------------------------------------------


BODY ( VTABLE-SIZE -- OBJ-SIZE )

Create a virtual member table with a size of VTABLE-SIZE address units for the class THIS-CLASS. Copy the tokens of the virtual members from the virtual member table of the parent of THIS-CLASS, and initialize all additional virtual members with the token of the dummy word PURE-VIRTUAL. OBJ-SIZE is the size in bits of objects of the parent of THIS-CLASS.

BODY is used in the form CLASS name ... BODY ... ENDCLASS to mark the beginning of the body of a class definition. The body of a class definition starts after the definition of the virtual members.


--------------------------------------------------------------------------------


CALIGNED ( STRUCT-SIZE -- 1ST )

1ST is the lowest value greater than or equal to STRUCT-SIZE that can be divided by the number of bits in a character.

Using CALIGNED in a class or structure definition causes the next data member to be character aligned.


--------------------------------------------------------------------------------


CLASS ( "<spaces>name" -- WID TUPLE -> WID VTABLE-SIZE )

Skip leading space delimiters. Parse name delimited by a space. Find name and assign the data type with the name name to THIS-CLASS. An exception is thrown if name is not a class, or if the parent of name has not yet been defined. Initialize the AUTOTHIS and the PROTECTED word lists to their status at the end of the class definition of the parent of name, and empty the PRIVATE word list. Append the AUTOTHIS word list to the end of the search order. WID is the identifier of the compilation word list. TUPLE -> WID is a tuple containing the identifiers of the word lists in the search order before AUTOTHIS was appended. VTABLE-SIZE is the size in address units of the virtual member table of the parent of name.

CLASS is used in the form CLASS name ... BODY ... ENDCLASS to start a class definition.


--------------------------------------------------------------------------------


CMEMBER ( STRUCT-SIZE SINGLE "<spaces>name" -- 1ST )

Perform the semantics of AUTOTHIS if THIS-CLASS is a class.

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. 1ST is equal to STRUCT-SIZE aligned to cell size, plus the number of bits in one cell.

name is referred to as a data member. CMEMBER allocates one character for a data member of data type SINGLE in the structure or class THIS-CLASS.

Execution: ( x -- CDATA -> SINGLE ) 
CDATA -> SINGLE is the address of the character size data member of the structure or object x, that was allocated at the time name was created.


--------------------------------------------------------------------------------


CMEMBERS ( STRUCT-SIZE SINGLE UNSIGNED "<spaces>name" -- 1ST )

Perform the semantics of AUTOTHIS if THIS-CLASS is a class.

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. 1ST is equal to STRUCT-SIZE aligned to character size, plus UNSIGNED times the number of bits in one character.

name is referred to as a data member. CMEMBERS allocates UNSIGNED consecutive characters for data members of data type SINGLE in the structure or class THIS-CLASS.

Execution: ( x -- CDATA -> SINGLE ) 
CDATA -> SINGLE is the address of the first of UNSIGNED character size data members of the structure or object x, that were allocated at the time name was created.


--------------------------------------------------------------------------------


COPY ( OBJECT 1ST -- )

Copy the contents of all data members of OBJECT to the data members of 1ST.


--------------------------------------------------------------------------------


DELETE ( -- )

Execution: ( OBJECT -- ) 
Execute the destructor of OBJECT. Return the chunk of contiguous memory space occupied by OBJECT to the system for later allocation. An ambiguous condition exists if OBJECT was not previously created by (NEW) ( CONST -> OBJECT -- 2ND ). An exception is thrown if the memory space canot be returned.

DELETE is an immediate word.


--------------------------------------------------------------------------------


DELETE ( STRUCTURE -- )

Return the chunk of contiguous memory space occupied by the structure STRUCTURE to the system for later allocation. An ambiguous condition exists if STRUCTURE was not previously created by (NEW) ( CONST -> STRUCTURE -- 2ND ). An exception is thrown if the memory space canot be returned.


--------------------------------------------------------------------------------


DESTRUCTOR ( OBJECT -- 1ST )

Do nothing.

DESTRUCTOR is the destructor of class OBJECT.


--------------------------------------------------------------------------------


DFMEMBER ( STRUCT-SIZE FLOAT "<spaces>name" -- 1ST )

Perform the semantics of AUTOTHIS if THIS-CLASS is a class.

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. 1ST is equal to STRUCT-SIZE aligned to cell size, plus 64.

name is referred to as a data member. DFMEMBER allocates space for one 64-bit IEEE floating-point number of data type FLOAT in the structure or class THIS-CLASS.

Execution: ( x -- DFDATA -> FLOAT ) 
DFDATA -> FLOAT is the address of the data member of the structure or object x, that was allocated at the time name was created.


--------------------------------------------------------------------------------


DFMEMBERS ( STRUCT-SIZE FLOAT UNSIGNED "<spaces>name" -- 1ST )

Perform the semantics of AUTOTHIS if THIS-CLASS is a class.

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. 1ST is equal to STRUCT-SIZE aligned to cell size, plus UNSIGNED times 64.

name is referred to as a data member. DFMEMBERS allocates space for UNSIGNED 64-bit IEEE floating-point numbers of data type FLOAT in the structure or class THIS-CLASS.

Execution: ( x -- DFDATA -> FLOAT ) 
DFDATA -> FLOAT is the address of the first of UNSIGNED data members of the structure or object x, that were allocated at the time name was created.


--------------------------------------------------------------------------------


ENCLOSE-VTABLE ( CONST -- VTABLE-SIZE CONST -> TOKEN CONST -> TOKEN )

VTABLE-SIZE is the size in address units of the virtual member table of the class identified by CONST. An ambiguous condition exists if CONST is not the address of the virtual member table of a class. The first CONST -> TOKEN is the address of the first token in the virtual member table. The second CONST -> TOKEN is the address of the cell after the last token in the virtual member table.


--------------------------------------------------------------------------------


ENDCLASS ( WID TUPLE -> WID OBJ-SIZE -- )

With OBJ-SIZE being the number of bits occupied by the data members of the class THIS-CLASS, calculate the number of cells of the class and store the corresponding number of address units in its virtual member table. Restore the compilation word list to WID. Restore the search order to the one saved in TUPLE -> WID. If class THIS-CLASS has friends, make the PRIVATE and PROTECTED word lists available as one combined word list.

ENDCLASS is used in the form CLASS name ... BODY ... ENDCLASS to terminate the definition of a class.


--------------------------------------------------------------------------------


ENDSTRUCT ( STRUCT-SIZE -- )

With STRUCT-SIZE being the number of bits occupied by the data members of the structure THIS-CLASS, calculate the number of cells of the structure and store the corresponding number of address units as an attribute of the structure. 

ENDSTRUCT is used in the form STRUCT name ... ENDSTRUCT to terminate the definition of a structure.


--------------------------------------------------------------------------------


ENDUNION ( STRUCT-SIZE STRUCT-SIZE STRUCT-SIZE -- 3RD )

Terminate a union of data members within a structure or class definition. 3RD is the maximum of the second and the third STRUCT-SIZE.


--------------------------------------------------------------------------------


ERASE ( BDATA -> SINGLE UNSIGNED -- )

If UNSIGNED is not equal to zero, clear all bits in each of UNSIGNED consecutive bit fields beginning at BDATA -> SINGLE. Only the number of low-order bits corresponding to length of the bit fields are transferred.


--------------------------------------------------------------------------------


ERASE ( OBJECT -- )

Clear all bits in all data members of OBJECT.


--------------------------------------------------------------------------------


FILL ( BDATA -> SINGLE UNSIGNED 2ND -- )

If UNSIGNED is not equal to zero, store 2ND in each of UNSIGNED consecutive bit fields beginning at BDATA -> SINGLE. Only the number of low-order bits corresponding to length of the bit fields are transferred.


--------------------------------------------------------------------------------


FRIENDS( ( OBJ-SIZE "<spaces>name1<spaces>name2 ... <spaces>namen )" -- 1ST )


Create a list of n friend classes of the class THIS-CLASS by repeatedly skipping leading spaces, parsing name, and adding the class identified by name to the list of friends of class THIS-CLASS. The list of friend classes is terminated by ). OBJ-SIZE is a dummy parameter that ensures that FRIENDS( is always used within the body of a class definition. 1ST is equal to OBJ-SIZE.

FRIENDS( may be used zero or one time within the body of a class definition. An exception is thrown if FRIENDS( is executed more than once within the body of a class definition, or if a name is parsed that does not identify a class.

The friend classes of class THIS-CLASS may be granted access to the PRIVATE and PROTECTED word lists of class THIS-CLASS by using ACCESS within the class definitions of the friend classes


--------------------------------------------------------------------------------


IS ( OBJ-SIZE DEFINITION "<spaces>name" -- 1ST )

Skip leading space delimiters. Parse name delimited by a space. Find a virtual member name whose stack diagram is identical to the one of DEFINITION, except for the last input parameter, which may also be a direct or indirect parent type of the last input parameter of DEFINITION. In the virtual member table of class THIS-CLASS, assign the execution semantics of DEFINITION to name. An exception is thrown if no virtual member with name name exists whose stack diagram is identical to the one of DEFINITION, if DEFINITION is unfinished, or if name is unfinished.

Virtual members are words defined by VIRTUAL.

OBJ-SIZE is a dummy parameter that ensures that IS is always used within the body of a class definition. 1ST is equal to OBJ-SIZE.


--------------------------------------------------------------------------------


LSB ( BADDRESS -- UNSIGNED )

UNSIGNED is the bit position (0 to 15) of the least significant bit of the bit field specified by BADDRESS.


--------------------------------------------------------------------------------


MEMBER ( STRUCT-SIZE SINGLE "<spaces>name" -- 1ST )

Perform the semantics of AUTOTHIS if THIS-CLASS is a class.

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. 1ST is equal to STRUCT-SIZE aligned to cell size, plus the number of bits in one cell.

name is referred to as a data member. MEMBER allocates one cell for a data member of data type SINGLE in the structure or class THIS-CLASS.

Execution: ( x -- DATA -> SINGLE ) 
DATA -> SINGLE is the address of the data member of the structure or object x, that was allocated at the time name was created.


--------------------------------------------------------------------------------


MEMBER ( STRUCT-SIZE DOUBLE "<spaces>name" -- 1ST )

Perform the semantics of AUTOTHIS if THIS-CLASS is a class.

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. 1ST is equal to STRUCT-SIZE aligned to cell size, plus the number of bits in two cells.

name is referred to as a data member. MEMBER allocates two cells for a data member of data type DOUBLE in the structure or class THIS-CLASS.

Execution: ( x -- DATA -> DOUBLE ) 
DATA -> DOUBLE is the address of the data member of the structure or object x, that was allocated at the time name was created.


--------------------------------------------------------------------------------


MEMBER ( STRUCT-SIZE FLOAT "<spaces>name" -- 1ST )

Perform the semantics of AUTOTHIS if THIS-CLASS is a class.

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. 1ST is equal to STRUCT-SIZE aligned to cell size, plus the number of bits occupied by a floating-point number.

name is referred to as a data member. MEMBER allocates space for a data member of data type FLOAT in the structure or class THIS-CLASS.

Execution: ( x -- DATA -> FLOAT ) 
DATA -> FLOAT is the address of the data member of the structure or object x, that was allocated at the time name was created.


--------------------------------------------------------------------------------


MEMBERS ( STRUCT-SIZE SINGLE UNSIGNED "<spaces>name" -- 1ST )

Perform the semantics of AUTOTHIS if THIS-CLASS is a class.

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. 1ST is equal to STRUCT-SIZE aligned to cell size, plus UNSIGNED times the number of bits in one cell.

name is referred to as a data member. MEMBERS allocates UNSIGNED consecutive cells for data members of data type SINGLE in the structure or class THIS-CLASS.

Execution: ( x -- DATA -> SINGLE ) 
DATA -> SINGLE is the address of the first of UNSIGNED data members of the structure or object x, that were allocated at the time name was created.


--------------------------------------------------------------------------------


MEMBERS ( STRUCT-SIZE DOUBLE UNSIGNED "<spaces>name" -- 1ST )

Perform the semantics of AUTOTHIS if THIS-CLASS is a class.

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. 1ST is equal to STRUCT-SIZE aligned to cell size, plus UNSIGNED times the number of bits in two cells.

name is referred to as a data member. MEMBERS allocates UNSIGNED consecutive double cells for data members of data type DOUBLE in the structure or class THIS-CLASS.

Execution: ( x -- DATA -> DOUBLE ) 
DATA -> DOUBLE is the address of the first of UNSIGNED data members of the structure or object x, that were allocated at the time name was created.


--------------------------------------------------------------------------------


MEMBERS ( STRUCT-SIZE FLOAT UNSIGNED "<spaces>name" -- 1ST )

Perform the semantics of AUTOTHIS if THIS-CLASS is a class.

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. 1ST is equal to STRUCT-SIZE aligned to cell size, plus UNSIGNED times the number of bits occupied by a floating-point number.

name is referred to as a data member. MEMBERS allocates space for UNSIGNED data members of data type FLOAT in the structure or class THIS-CLASS.

Execution: ( x -- DATA -> FLOAT ) 
DATA -> FLOAT is the address of the first of UNSIGNED data members of the structure or object x, that were allocated at the time name was created.


--------------------------------------------------------------------------------


MSB ( BADDRESS -- UNSIGNED )

UNSIGNED is the bit position of the most significant bit (0 to 30) of the bit field specified by BADDRESS. If the bit field crosses a cell boundary, the value of UNSIGNED is 16 or greater.


--------------------------------------------------------------------------------


NEW ( "<spaces>name" -- )

Execution: ( -- STRUCTUR ) or ( -- OBJECT ) 
Save the input source specification. Skip leading space delimiters. Parse name delimited by a space. Find name and determine the data type with the name name. If name is a structure, discard the saved input source specification and evaluate (NEW) together with a literal of data type CONST -> name to create a new structure with data type name. If name is an object, restore the input source specification and evaluate (NEW) together with a literal of data type CONST -> name to create a new object with data type name. An exception is thrown if the given data type is neither a structure nor an object.

NEW is an immediate word.


--------------------------------------------------------------------------------


OBJ-SIZE ( STACK-DIAGRAM -- 1ST )

When used in a stack diagram, specifies an input or output parameter with data type OBJ-SIZE.


--------------------------------------------------------------------------------


OBJECT ( STACK-DIAGRAM -- 1ST )

When used in a stack diagram, specifies an input or output parameter with data type OBJECT. All classes are direct or indirect subtypes of data type OBJECT.


--------------------------------------------------------------------------------


OBJECT? ( DATA-TYPE -- CONST )

If DATA-TYPE is a class, CONST is the address of the code field of the definition that is associated with DATA-TYPE. Otherwise, CONST is zero.


--------------------------------------------------------------------------------


PARENT? ( DATA-TYPE DATA-TYPE -- CONST )

If the second DATA-TYPE is a direct or indirect subtype of the first DATA-TYPE, or if the first DATA-TYPE is equal to the second DATA-TYPE, CONST is the address of the code field of the definition that is associated with the first DATA-TYPE. Otherwise, CONST is zero.


--------------------------------------------------------------------------------


PRIVATE ( -- )

Replace the first word list in the search order with the PRIVATE word list. An ambiguous condition exists if the PRIVATE word list is used outside of a class definition.

PRIVATE is a vocabulary.


--------------------------------------------------------------------------------


PRIVATE-LAST ( -- DATA -> ADDRESS )

DATA -> ADDRESS is the address of a cell that contains the address offset of the most recent definition in the PRIVATE word list.


--------------------------------------------------------------------------------


PROCREATES ( DATA-TYPE "<spaces>name" -- )

Extend the semantics of PROCREATES as follows. If DATA-TYPE is a structure, allocate one additional cell in the data field of the definition that is associated with the new data type. If DATA-TYPE is a class, allocate four additional cells in the data field of the definition that is associated with the new data type.


--------------------------------------------------------------------------------


PROTECTED ( -- )

Replace the first word list in the search order with the PROTECTED word list. An ambiguous condition exists if the PROTECTED word list is used outside of a class definition.

PROTECTED is a vocabulary.


--------------------------------------------------------------------------------


PROTECTED-LAST ( -- DATA -> ADDRESS )

DATA -> ADDRESS is the address of a cell that contains the address offset of the most recent definition in the PROTECTED word list.


--------------------------------------------------------------------------------


PURE-VIRTUAL ( -- )

Throw an exception.

PURE-VIRTUAL is a dummy word to be executed in the place of pure virtual members.


--------------------------------------------------------------------------------


SFMEMBER ( STRUCT-SIZE FLOAT "<spaces>name" -- 1ST )

Perform the semantics of AUTOTHIS if THIS-CLASS is a class.

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. 1ST is equal to STRUCT-SIZE aligned to cell size, plus 32.

name is referred to as a data member. SFMEMBER allocates space for one 32-bit IEEE floating-point number of data type FLOAT in the structure or class THIS-CLASS.

Execution: ( x -- SFDATA -> FLOAT ) 
SFDATA -> FLOAT is the address of the data member of the structure or object x, that was allocated at the time name was created.


--------------------------------------------------------------------------------


SFMEMBERS ( STRUCT-SIZE FLOAT UNSIGNED "<spaces>name" -- 1ST )

Perform the semantics of AUTOTHIS if THIS-CLASS is a class.

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. 1ST is equal to STRUCT-SIZE aligned to cell size, plus UNSIGNED times 32.

name is referred to as a data member. SFMEMBERS allocates space for UNSIGNED 32-bit IEEE floating-point numbers of data type FLOAT in the structure or class THIS-CLASS.

Execution: ( x -- SFDATA -> FLOAT ) 
SFDATA -> FLOAT is the address of the first of UNSIGNED data members of the structure or object x, that were allocated at the time name was created.


--------------------------------------------------------------------------------


SIZE ( BADDRESS -- UNSIGNED )

UNSIGNED is the length of the bit field specified by BADDRESS.


--------------------------------------------------------------------------------


SIZE ( OBJECT -- UNSIGNED )

UNSIGNED is the size in cells of the data members of OBJECT.


--------------------------------------------------------------------------------


SIZE-OBJECT ( CONST -- UNSIGNED )

UNSIGNED is the size in address units of an object whose class is identified by CONST. An ambiguous condition exists if CONST is not the address of the virtual member table of a class.


--------------------------------------------------------------------------------


SIZE-OBJECT ( DATA-TYPE -- UNSIGNED )

UNSIGNED is the size in address units of objects of class DATA-TYPE. An exception is thrown if DATA-TYPE is not a class.


--------------------------------------------------------------------------------


SIZE-STRUCTURE ( CONST -- UNSIGNED )

UNSIGNED is the size in address units of the structure identified by CONST. An ambiguous condition exists if CONST was not produced by STRUCTURE? or ?STRUCTURE.


--------------------------------------------------------------------------------


SIZE-STRUCTURE ( DATA-TYPE -- UNSIGNED )

UNSIGNED is the size in address units of the structure DATA-TYPE. An exception is thrown if DATA-TYPE is not a structure.


--------------------------------------------------------------------------------


STRIP-WORDLIST ( -- )

Transform the search order consisting of wid1, ... widn-1, widn (where wid1 is searched first) into wid1, ... widn-1. An exception is thrown if the search order was empty before STRIP-WORDLIST was executed.


--------------------------------------------------------------------------------


STRUCT ( -- STRUCT-SIZE )

Skip leading space delimiters. Parse name delimited by a space. Find name and assign the data type with the name name to THIS-CLASS. An exception is thrown if name is not a structure, or if the parent of name has not yet been defined. STRUCT-SIZE is the size in bits of the parent of name.

STRUCT is used in the form STRUCT name ... ENDSTRUCT to define the data members of a structure name.


--------------------------------------------------------------------------------


STRUCT-SIZE ( STACK-DIAGRAM -- 1ST )

When used in a stack diagram, specifies an input or output parameter with data type STRUCT-SIZE.


--------------------------------------------------------------------------------


STRUCTURE ( STACK-DIAGRAM -- 1ST )

When used in a stack diagram, specifies an input or output parameter with data type STRUCTURE. All structures are direct or indirect subtypes of data type STRUCTURE.


--------------------------------------------------------------------------------


STRUCTURE? ( DATA-TYPE -- CONST )

If DATA-TYPE is a structure, CONST is the address of a cell that contains the size in address units of structures with data type DATA-TYPE. Otherwise, CONST is zero.


--------------------------------------------------------------------------------


THIS-CLASS ( -- DATA-TYPE )

DATA-TYPE is the data type whose class definition is currently being compiled. If no class is currently being compiled, DATA-TYPE is undefined.


--------------------------------------------------------------------------------


THIS-PARENT ( -- DATA-TYPE )

DATA-TYPE is the parent of the data type whose class definition is currently being compiled. An ambiguous condition exists if no class is currently being compiled.


--------------------------------------------------------------------------------


THIS-VTABLE ( -- CONST -> CONST )

CONST -> CONST is the address of the first of two cells. The first cell contains the address of the virtual member table of the class THIS-CLASS. The second cell contains the address of the friends table of the class THIS-CLASS. An ambiguous condition exists if THIS-CLASS is not a class.


--------------------------------------------------------------------------------


UNION ( STRUCT-SIZE -- 1ST 1ST 1ST )

Starts a union of data members within a structure or class definition. All parameters 1ST are equal to STRUCT-SIZE. The first 1ST marks the starting bit position of the union, the second 1ST marks the end bit position of the largest block so far, and the third 1ST is the current bit position of the current block.


--------------------------------------------------------------------------------


VTABLE-SIZE ( STACK-DIAGRAM -- 1ST )

When used in a stack diagram, specifies an input or output parameter with data type VTABLE-SIZE.


--------------------------------------------------------------------------------


VIRTUAL ( VTABLE-SIZE "<spaces>name" -- 1ST )

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. 1ST is equal to VTABLE-SIZE plus the size of a cell in address units. An exception is thrown if VIRTUAL is executed in compilation state.

If name is not yet in the AUTOTHIS word list, add a definition for name to the AUTOTHIS word list using AUTOTHIS.

Note that the new definition does have no stack effects by default. Stack effects have to be specified separately. By using a stack diagram phrase ( ... -- ... ) immediately following VIRTUAL and the definition name, the new definition is modified to incorporate stack effects. An ambiguous condition exists if the stack diagram does not contain at least one input parameter, or if the last input parameter is not a class.

name Execution: ( ... class -- ... ) 
Execute the definition whose token is stored in the virtual member table of class, the last input parameter of name. class is OBJECT or a direct or indirect subtype of OBJECT. The token is stored in the virtual member table by a succeeding execution of IS. name is called a virtual member. An ambiguous condition exists if name is executed before it is being assigned an execution semantics by IS.


--------------------------------------------------------------------------------


[BIND] ( "<spaces>name1" "<spaces>name2" -- )

Skip leading space delimiters. Parse name1 delimited by a space. Find name1 and determine the class with the name name1. Skip leading space delimiters. Parse name2 delimited by a space. Find name2. Statically bind name2 to the class with the name name1 and compile it. An exception is thrown if a class with the name name1 does not exist or if name2 is not a virtual member. An ambiguous condition exists if name2 is not a virtual member of the class with the name name1.


--------------------------------------------------------------------------------


[PARENT] ( "<spaces>name" -- )

Skip leading space delimiters. Parse name delimited by a space. Find name. Statically bind name to the parent of class THIS-CLASS and compile it. An exception is thrown if the parent of THIS-CLASS is not a class or if name is not a virtual member. An ambiguous condition exists if name is not a virtual member of the parent of THIS-CLASS.


--------------------------------------------------------------------------------

