StrongForth Glossary


! ( 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 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 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 it is physically impossible to write into the CODE memory area.


! ( SINGLE PORT -> 1ST -- )

Store SINGLE at i/o address PORT.


! ( DOUBLE PORT -> 1ST -- )

Store DOUBLE at i/o address PORT.


! ( SINGLE CPORT -> 1ST -- )

Store SINGLE at i/o address CPORT. Only the number of low-order bits corresponding to character size are transferred.


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


(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 LOGICAL -- )

If bit 5 of LOGICAL is 0: ( CONST LOGICAL "<spaces>name" -- )
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. CONST is the token of the new definition. LOGICAL is the attribute field of the new definition.

If bit 5 of LOGICAL is 1: ( CONST LOGICAL -- )
Create a new definition with no name and link field in the dictionary and make it the latest definition. CONST is the token of the new definition. LOGICAL is the attribute field 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. The stack diagram is copied 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>.


(ENDOF) ( -- )

Unconditionally branch forward within the current definition. The branch destination is calculated in two steps by adding the offset from the current ENDOF to the first ENDOF and the offset from the first ENDOF to the branch destination.

(ENDOF) is an internal definition compiled by ENDOF.


(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. The branch destination is calculated in two steps by adding the offset from the current location to the beginning of the loop and the offset from the beginning of the loop to the branch destination.

(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!) ( SINGLE 1ST -- )

Store SINGLE onto the return stack, overwriting an already existing cell. 1ST is a dummy parameter indicating the data type of the destination on the return stack.

(R!) is an internal definition compiled by TO.


(R!) ( DOUBLE 1ST -- )

Store DOUBLE onto the return stack, overwriting two already existing cells. 1ST is a dummy parameter indicating the data type of the destination on the return stack.

(R!) is an internal definition compiled by TO.


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


) ( STACK-DIAGRAM MEMORY-SPACE FLAG STACK-DIAGRAM -- 1ST )

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. Return the second STACK-DIAGRAM as 1ST. An exception is thrown if the first STACK-DIAGRAM is not equal to zero or if the stack diagram is invalid.


) ( COLON-DIAGRAM 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. Return STACK-DIAGRAM as 1ST. An exception is thrown if COLON-DIAGRAM is not equal to zero or if the stack diagram is invalid.

Note: FLAG is assumed to be TRUE.


)' ( 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.


*/ ( 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 ambiguous condition exists if the third UNSIGNED is zero or 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 ambiguous condition exists if the third SIGNED is zero or 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 ambiguous condition exists if the second UNSIGNED is zero or the quotient 1ST lies outside of the range of an unsigned 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 ambiguous condition exists if the third UNSIGNED is zero or 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 ambiguous condition exists if the third SIGNED is zero or 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 ambiguous condition exists if the second UNSIGNED is zero or 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 by 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 by 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 by 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 UNSIGNED -- 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 by 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 by 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 by 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.


+! ( UNSIGNED DATA -> INTEGER-DOUBLE -- )

Add UNSIGNED 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 by 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 by 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 by 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 by 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 by 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 by 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 by 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 by 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 by 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.


, ( 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 by 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 by 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 by 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 UNSIGNED -- 1ST )

Subtract UNSIGNED 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 by 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 by 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 by 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 preceeded 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.


-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 SIGNED -- )

Display DOUBLE as an unsigned double-precision number right aligned in a field SIGNED characters wide. If SIGNED is not positive or the number of characters required to display DOUBLE is greater than SIGNED, all digits are displayed with no leading spaces in a field as wide as necessary.


.R ( SIGNED-DOUBLE SIGNED -- )

Display SIGNED-DOUBLE as a signed double-precision number right aligned in a field SIGNED characters wide. If SIGNED is not positive or the number of characters required to display SIGNED-DOUBLE is greater than SIGNED, all digits are displayed with no leading spaces in a field as wide as necessary.


.R ( SINGLE SIGNED -- )

Display SINGLE as an unsigned number right aligned in a field SIGNED characters wide. If SIGNED is not positive or the number of characters required to display SINGLE is greater than SIGNED, all digits are displayed with no leading spaces in a field as wide as necessary.


.R ( SIGNED SIGNED -- )

Display the first SIGNED as a signed number right aligned in a field SIGNED characters wide. If the second SIGNED is not positive or the number of characters required to display the first SIGNED is greater than the second SIGNED, 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 ambiguous condition exists if the second UNSIGNED is zero.


/ ( SIGNED SIGNED -- 1ST )

Divide the first SIGNED by the second SIGNED, giving the signed quotient 1ST. An ambiguous condition exists 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 ambiguous condition exists 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 ambiguous condition exists 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 ambiguous condition exists 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 ambiguous condition exists 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-DIAGRAM )

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-DIAGRAM. 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-DIAGRAM )

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-DIAGRAM. 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-DIAGRAM -- )

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-DIAGRAM. 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 -- )
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. Create a new token and reserve space for the definition's code field in the constant data space. 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 )

An exception is thrown if DATA-TYPE is not the data type of a qualified 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 qualified token of this definition. An exception is thrown if >TOKEN is executed in compilation state.

Note: >TOKEN subrtitutes its own output parameter with the data type of the 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.


?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.


?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.


?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.


?SMUDGE ( DEFINITION -- 1ST )

Checks if DEFINITION is finished. 1ST is equal to DEFINITION. An exception is thrown if DEFINITION is not finished.


?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.


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


@ ( PORT -> SINGLE -- 2ND )

2ND is the item stored at i/o address PORT -> SINGLE.


@ ( PORT -> DOUBLE -- 2ND )

2ND is the double-cell item stored at i/o address PORT -> DOUBLE.


@ ( CPORT -> SINGLE -- 2ND )

2ND is the item stored at i/o address CPORT -> 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.


@ ( CPORT -> SIGNED -- 2ND )

2ND is the signed number stored at i/o address CPORT -> SIGNED. Since the number stored at CPORT -> SIGNED is assumed to have character size, while 2ND has cell size, the number is sign extended.


@ ( CPORT -> FLAG -- 2ND )

2ND is the flag stored at i/o address CPORT -> FLAG. Since the flag stored at CPORT -> FLAG is assumed to have character size, while 2ND has cell size, it 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.

This is 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 ( -- )

Perform the function of -1 THROW.


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

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.


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" -- CODE STACK-DIAGRAM )

Skip leading space delimiters. Parse name1 delimited by a space. Create a definition for name1 with the same code field as DEFINITION. Produce CODE and STACK-DIAGRAM. An exception is thrown if ALIAS is executed in compilation state.

ALIAS is typically used in the form ' name2 ALIAS ( ... -- ... ) END-CODE 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. However, the semantics of the two definitions will be exactly the same. ALIAS only allocates memory in the name space.


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 -- )

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


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.

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.


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" -- CODE STACK-DIAGRAM )

Skip leading space delimiters. Parse name delimited by a space. Create a code definition for name. Start the current definition, producing CODE and STACK-DIAGRAM.

Subsequent words in the parse area typically represent source code in assembly language, generating machine code. The process continues, refilling the input buffer as needed, until END-CODE is executed.

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-SPACE ( -- )

Select the code space as current memory space.


COLON-DIAGRAM ( STACK-DIAGRAM -- 1ST )

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


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 CONST memory 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 CONST memory 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-CELL-ALLOT ( -- )

Reserve one cell in the constant data space. If the first unused address of the CONST memory space is aligned prior to execution of ALLOT, it will remain aligned when CONST-CELL-ALLOT finishes execution.


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 in the dictionary and make it the latest definition. Create a new token and reserve space for the definition's code field in the constant data space. An exception is thrown if CREATE is executed in compilation state.

Note that CREATE does not to create a complete definition.


CREATE-LOCAL ( CDATA -> CHARACTER UNSIGNED -- )

Create a new definition for a local 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.


CREATE-NONAME ( -- )

Create a new definition with no name and link field in the dictionary and make it the latest definition. Create a new token and reserve space for the definition's code field in the constant data space. An exception is thrown if CREATE-NONAME is executed in compilation 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-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).


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.


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.


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-DIAGRAM -- 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-DIAGRAM 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.


DOUBLE? ( DATA-TYPE -- FLAG )

FLAG is true if and only if DATA-TYPE is DOUBLE or a direct or indirect subtype of DOUBLE.


DROP ( SINGLE -- )

Remove SINGLE from the stack.


DROP ( DOUBLE -- )

Remove DOUBLE 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-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.


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 address of the first basic data type of a stack diagram STACK-DIAGRAM that has been compiled into the current memory space. The second DATA -> DATA-TYPE is the first unused address of 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 ( CODE STACK-DIAGRAM -- )

Finish a definition. Store CODE in the code field of the latest definition. Clear the smudge attribute in the attribute field. Discard STACK-DIAGRAM.


END-DEFINITION ( STACK-DIAGRAM CODE -- )

Finish a definition. Store the offset attribute of STACK-DIAGRAM in the attribute field and CODE in the code field of the latest definition. Clear the smudge attribute in the attribute field.


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 contoents 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? ( CDATA -> CHARACTER UNSIGNED -- DOUBLE 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, DOUBLE is zero and FLAG is FALSE. Otherwise, DOUBLE is 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 -- )

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 )

A variable 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 )

A variable that contains the number of characters to be displayed by ERROR if the error code is -2.


EVALUATE ( CDATA -> CHARACTER UNSIGNED -- )

Save the current input source specification. Store minus-one (-1) 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 minus-one (-1) 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.


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.


FIND ( CDATA -> CHARACTER UNSIGNED SINGLE UNSIGNED -- DEFINITION SIGNED )

Find 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.

If the second UNSIGNED is 0, FIND returns the latest definition that matches the name given in CDATA -> CHARACTER UNSIGNED. Additional matching criteria are considered if the second UNSIGNED has one of the values specified below. In some of these cases, SINGLE contains an additional parameter.

SINGLE UNSIGNED Matching criteria
- 0 The latest word in the dictionary with the given name is found.
code field 1 Only words whose code field contains the value of SINGLE can be found.
- 4 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.
code field 5 Only words that satisfy the matching criteria of both UNSIGNED = 1 and UNSIGNED = 4 are found.
- 6 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.
code field 7 Only word that satisfy the matching criteria of both UNSIGNED = 1 and UNSIGNED = 6 are found.
length 8 Only words whose stack diagram is exactly the same as the temporary stack diagram stored at the top of the local name space can be found. SINGLE is the length of the temporary stack diagram.
length 12 Only words that satisfy the matching criteria of both UNSIGNED = 4 and UNSIGNED = 8 are found.
length 14 Only words that satisfy the matching criteria of both UNSIGNED = 6 and UNSIGNED = 8 are found.
sample definition 20 The matching criteria for the input parameters are the same as for UNSIGNED = 4. Additionally, the output parameter list has to be identical to the output parameter list of the definition specified by SINGLE, after resolving all data type references to the input parameters. The value in single is the low word of a definition.
sample definition 22 The matching criteria for the input parameters are the same as for UNSIGNED = 6. Additionally, the output parameter list has to be identical to the output parameter list of the definition specified by SINGLE, after resolving all data type references to the input parameters. The value in single is the low word of a definition.


FIND-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.


FIND-TOKEN ( TOKEN -- DEFINITION SIGNED )

Find 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.


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 ambiguous condition exists if SIGNED is zero or if the quotient lies outside the range of a signed single-precision number.


FORGET-LOCAL ( SIGNED -- )

Remove the most recently defined local from the local name space. Subtract SIGNED from #LOCALS.


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.


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.


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.


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.


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.


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 definition.


LATEST! ( -- )

Update LATEST after compilation of the name and link fields of a new definition. This makes the new definition the latest definition.

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 ( -- DATA -> ADDRESS )

DATA -> ADDRESS is the address of a system variable containing the address of the name field of the latest definition in the current memory space, or zero if no definition exists yet. An ambiguous condition exists if the current memory space is not either the name space or the local name space.


LINK, ( ADDRESS -- )

Within the in current memory space, append a new definition to the dictionary by establishing a link to the latest definition. LINK, actually compiles the link field of the new definition and updates the system variable LINK. It is assumed that the name field of the new definition has already been compiled. ADDRESS is the address where the new definition starts.

LINK, is used by CREATE and CREATE-LOCAL.


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

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| ( "<spaces>name1<spaces>name2 ... <spaces>namen |" -- )

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 |. Append the runtime semantics given below to the current 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.


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 ambiguous condition exists 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 ambiguous condition exists 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 ambiguous condition exists 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 CCONST -> 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 CCONST -> 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 CCONST -> 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 CCONST -> 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.


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 both the forward and the backward reference 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.


NEXT ( DEFINITION -- 1ST )

1ST is the successor of DEFINITION in the dictionary, or null if DEFINITION is the latest definition. An exception is thrown if DEFINITION is unfinished.


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. An exception is thrown if the string does not contain any digits or if it contains other characters than digits and the optional sign character.

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.


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


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:

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.

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.


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.


RESTORE-INPUT ( INPUT-SOURCE -- FLAG )

Attempt to restore the input source specification to the state described by 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 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.


SIGN ( FLAG -- )

If FLAG is true, add a minus sign to the beginning of the pictured numeric output string.


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.


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 ambiguous condition exists if SIGNED is zero or if the quotient lies outside the range of a signed single-precision number.


SMUDGE? ( DEFINITION -- FLAG )

FLAG is true if and only if DEFINITION is unfinished.

FIND skips unfinished definitions in the dictionary.


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 0, the input buffer is the terminal input buffer. If SOURCE-ID is -1, the input buffer is the character string identified by SOURCE-ADDR and SOURCE-COUNT.


SOURCE-ADDR ( -- CDATA -> CHARACTER )

CDATA -> CHARACTER is the address of a string which serves as the current input source. If the current input source is not a string, CDATA -> CHARACTER is undefined.


SOURCE-COUNT ( -- UNSIGNED )

UNSIGNED is the length of a string which serves as the current input source. If the current input source is not a string, UNSIGNED is undefined.


SOURCE-ID ( -- SIGNED )

SIGNED is 0 if the user input device is the input source. SIGNED is -1 if a string is the input source.


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 ( SIGNED -- )

If SIGNED is greater than zero, display SIGNED spaces.


SPACES ( UNSIGNED -- )

If UNSIGNED is not equal to zero, display UNSIGNED spaces.


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.


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.

  1. 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.
  2. 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 -- )

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.


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. An exception is thrown if name was not defined by VALUE or if x has not exactly the same data type as the value used to initialize name.

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, or if x has not exactly the same data type as the value used to initialize name.

Runtime: ( x -- )
Store x in name.

Note: x can be either SINGLE or DOUBLE.

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.


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.


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.


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 ambiguous condition exists if UNSIGNED is zero or 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.


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 single 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 double 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. Finish a definition. Store the offset attribute of STACK-DIAGRAM in the attribute field and CODE in the code field of the latest definition. Clear the smudge attribute in the attribute field.

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


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.


WITHIN ( INTEGER 1ST 1ST -- FLAG )

Perform a comparison of a test value INTEGER with a lower limit 1ST (second parameter) and an upper limit 1ST (third parameter). FLAG is TRUE if and only if either (lower limit < upper limit and (lower limit <= test value and test value < upper limit)) or (lower limit > upper limit and (lower limit <= test value or test value < upper limit)) is true.


WITHIN ( ADDRESS 1ST 1ST -- FLAG )

Perform a comparison of a test value ADDRESS with a lower limit 1ST (second parameter) and an upper limit 1ST (third parameter). FLAG is TRUE if and only if either (lower limit < upper limit and (lower limit <= test value and test value < upper limit)) or (lower limit > upper limit and (lower limit <= test value or test value < upper limit)) is true.


XOR ( SINGLE LOGICAL -- 1ST )

1ST is the bit-by-bit exclusive-or of SINGLE with LOGICAL.


XOR ( DATA-TYPE DATA-TYPE -- 1ST )

1ST is the first DATA-TYPE with attributes that are the bit-by-bit exclusive-or of the attributes of both parameters DATA-TYPE.


[ ( -- )

Interpretation:
Stay in interpretation state.

Compilation:
Perform the execution semantics given below.

Execution: ( -- )
Enter interpretation state.

[ is an immediate word.


['] ( "<spaces>name" -- )

Interpretation:
An exception is thrown if ['] is interpreted.

Compilation:
Skip leading space delimiters. Parse name delimited by a space. Find name. Append the runtime semantics given below to the current definition. An exception is thrown if name is not found.

Runtime: ( -- DEFINITION )
Place DEFINITION, the definition identified by name, on the stack.

['] is an immediate word.


['CODE] ( "<spaces>name" -- )

Interpretation:
An exception is thrown if ['CODE] is interpreted.

Compilation:
Skip leading space delimiters. Parse name delimited by a space. Find name. Append the runtime semantics given below to the current definition. An exception is thrown if name is not found.

Runtime: ( -- CODE )
Place CODE, the address of the machine code of the definition identified by name, on the stack.

['CODE] is an immediate word.


['TOKEN] ( "<spaces>name" -- )

Interpretation:
An exception is thrown if ['TOKEN] is interpreted.

Compilation:
Skip leading space delimiters. Parse name delimited by a space. Find name. Append the runtime semantics given below to the current definition. An exception is thrown if name is not found.

Runtime: ( -- TOKEN )
Place TOKEN, the token of the definition identified by name, on the stack.

['TOKEN] is an immediate word.


[CHAR] ( -- )

Interpretation:
An exception is thrown if [CHAR] is interpreted.

Compilation: ( "<spaces>name" -- )
Skip leading space delimiters. Parse name delimited by a space. Append the runtime semantics given below to the current definition.

Runtime: ( -- CHARACTER )
Place CHARACTER, the value of the first character of name, on the stack. If the length of name is zero, CHARACTER is the space character.

[CHAR] is an immediate word.


[COMPILE] ( "<spaces>name" -- )

Interpretation:
An exception is thrown if [COMPILE] is interpreted.

Compilation:
Skip leading space delimiters. Parse name delimited by a space. Find name. Change the compiler data type heap according to the stack effect of name. If name has other than default compilation semantics, append them to the current definition. Otherwise append the execution semantics of name. An exception is thrown if name is not found.

[COMPILE] is an immediate word.


[DT] ( "<spaces>name" -- )

Interpretation:
An exception is thrown if [DT] is interpreted.

Compilation:
Skip leading space delimiters. Parse name delimited by a space. Append the runtime semantics given below to the current definition. An exception is thrown if name is not the name of a data type.

Runtime: ( -- DATA-TYPE )
Place DATA-TYPE, the data type identified by name, on the stack.

[DT] is an immediate word.


[LITERAL] ( -- )

Interpretation:
An exception is thrown if [LITERAL] is interpreted.

Compilation:
Append the runtime semantics given below to the current definition.

Runtime: ( x -- )
Compile virtual code t place x on the stack. x has the same data type as was supplied at compilation time.

[LITERAL] is an immediate word.


\ ( "ccc\" -- )

Compilation:
Perform the execution semantics given below.

Execution:
Parse and discard ccc delimited by a \ (backslash), but at most until the end the parse area.

The number of characters in ccc may be zero to the number of characters in the parse area.

\ is an immediate word.


] ( -- )

Enter compilation state.


Dr. Stephan Becher - November 20th, 2005