(;CODE) ( DEFINITION -- )
Finish a new definition by compiling its stack diagram, which is copied from DEFINITION. Copy the content of the code field of DEFINITION to the code field of the new definition.
(;CODE) is an internal definition compiled by ;CODE.
. ( DEFINITION -- )
Display the header of definition, consisting of the definition's name and its stack diagram, plus a trailing space character.
.BYTE ( SINGLE -- )
Display the least significant byte of SINGLE in a two-digit hexadecimal format.
.HEX ( SINGLE -- )
Display SINGLE in a four-digit hexadecimal format.
.HEX ( DOUBLE -- )
Display DOUBLE in an eight-digit hexadecimal format.
;CODE ( COLON-DIAGRAM -- CODE STACK-DIAGRAM )
Interpretation:
An exception is thrown if ;CODE is interpreted.
Compilation:
Append the runtime semantics given below to the current definition.
An exception is thrown if the contents of the compiler data type heap
does not exactly match the output parameters of the current definition.
Consume COLON-DIAGRAM and
produce CODE and STACK-DIAGRAM.
End the current definition, allow it
to be found in the dictionary, and enter interpretation state.
Subsequent characters in the parse area typically represent source code in assembly language, generating machine code. The process continues, refilling the input buffer as needed, until END-CODE is executed.
Runtime: ( R: nest-sys -- )
Specify the execution semantics of the most recent definition,
referred to as name, as given below. Return control to
the calling definition specified by nest-sys.
An ambiguous condition exists if the most recent definition was
not defined with CREATE or a user-defined
word that calls CREATE.
name Execution: ( -- )
Perform the machine code sequence that was generated
following ;CODE.
Note that new definitions do have no stack effects by default. Stack effects have to be specified separately if they are intended. By using a stack diagram phrase ( ... -- ... ) immediatly following ;CODE and the definition name, the new definition is modified to incorporate stack effects.
? ( -- )
Interpretation: ( ADDRESS -- )
Display the value stored at ADDRESS by
performing the execution semantics of @ and
..
Compilation:
Append the runtime semantics given below to the current
definition.
Runtime: ( ADDRESS -- )
Display the value stored at ADDRESS by
performing the execution semantics of @ and
..
? is an immediate word.
?COLON ( DEFINITION -- )
An exception is thrown if definition is not a colon definition.
ASSEMBLER ( -- )
Compilation:
Perform the execution semantics given below.
Execution:
Continue execution.
ASSEMBLER is an immediate word.
Note: ASSEMBLER is provided for ANS compliance only. It has no semantics as long as the optional Search-Order word set is not present.
DUMP ( DATA UNSIGNED -- )
Display the contents of UNSIGNED consecutive memory cells starting at address DATA. If necessary, multiple lines are displayed. Each line contains the hexadecimal starting address and the contents of up to eight memory cells.
DUMP ( CONST UNSIGNED -- )
Display the contents of UNSIGNED consecutive memory cells starting at address CONST. If necessary, multiple lines are displayed. Each line contains the hexadecimal starting address and the contents of up to eight memory cells.
DUMP ( DATA -> DOUBLE UNSIGNED -- )
Display the contents of UNSIGNED consecutive double memory cells starting at address DATA -> DOUBLE. If necessary, multiple lines are displayed. Each line contains the hexadecimal starting address and the contents of up to four double memory cells.
DUMP ( CONST -> DOUBLE UNSIGNED -- )
Display the contents of UNSIGNED consecutive double memory cells starting at address CONST -> DOUBLE. If necessary, multiple lines are displayed. Each line contains the hexadecimal starting address and the contents of up to four double memory cells.
DUMP ( CDATA UNSIGNED -- )
Display UNSIGNED consecutive characters starting at address CDATA. If necessary, multiple lines are displayed. Each line contains the hexadecimal starting address and the contents of up to 16 character size memory cells.
DUMP ( CCONST UNSIGNED -- )
Display UNSIGNED consecutive characters starting at address CCONST. If necessary, multiple lines are displayed. Each line contains the hexadecimal starting address and the contents of up to 16 character size memory cells.
EDITOR ( -- )
Compilation:
Perform the execution semantics given below.
Execution:
Continue execution.
EDITOR is an immediate word.
Note: EDITOR is provided for ANS compliance only. It has no semantics as long as the optional Search-Order word set is not present.
HAS-PARAM? ( TOKEN -- FLAG )
FLAG is TRUE if and only if TOKEN is an execution token that requires a constant parameter in the virtual machine code. Examples are the tokens of LIT, BRANCH and (R@).
SEE ( "<spaces>name" -- )
Skip leading space delimiters. Parse name delimited by a space. Find name. Display a human-readable representation of the name's definition, including its stack diagram.
Note that SEE can not display how immediate words like IF and THEN were used during compilation. An ambigous condition exists if name is not a colon definition.
SEE-ANY ( CONST -> TOKEN TOKEN DEFINITION -- 1ST 3RD )
Display the name of DEFINITION and, if present, the constant parameter belonging to TOKEN. The constant parameter is always displayed as a signed single-precision number. It has the size of a single cell and is stored at address CONST -> TOKEN. 1ST is CONST -> TOKEN incremented by the size of the constant parameter, if one is present.
SEE-DLIT ( CONST -> TOKEN -- 1ST )
Display the constant parameter of a compiled execution token as a signed double-precision number. The constant parameter has the size of a double cell. It is stored at address CONST -> TOKEN. 1ST is CONST -> TOKEN incremented by the size of the constant parameter.
SEE-LIT ( CONST -> TOKEN -- 1ST )
Display the constant parameter of a compiled execution token as a signed single-precision number. The constant parameter has the size of a single cell. It is stored at address CONST -> TOKEN. 1ST is CONST -> TOKEN incremented by the size of the constant parameter.
SEE-SLIT ( CONST -> TOKEN -- 1ST )
Display the string literal parameter of a compiled execution token with a leading and a trailing quote ("). The string literal parameter has variable size. It is stored as a counted string at address CONST -> TOKEN. 1ST is CONST -> TOKEN incremented by the size of the string literal parameter. 1ST is cell-aligned.
WORDS ( "<spaces>name" -- )
List all names and stack diagrams of the definitions in the dictionary, whose name is identical to name. If the parameter name is not provided, list all names and stack diagrams of all definitions in the dictionary. Each definition is displayed on a separate line.
[ELSE] ( -- )
Compilation:
Perform the execution semantics given below.
Execution: ( "<spaces>name" ... -- )
Skip leading spaces, parse and discard space-delimited words
from the parse area, including nested occurrences of
[IF] ... [THEN]
and [IF] ... [ELSE] ... [THEN],
until the word [THEN] has been
parsed and discarded. If the parse area becomes exhausted, it is
refilled as with REFILL.
[ELSE] is an immediate word.
[IF] ( SINGLE | SINGLE "<spaces>name" ... -- )
Compilation:
Perform the execution semantics given below.
Execution:
If any bit of SINGLE is not zero, continue execution.
Otherwise, skip leading spaces, parse and discard space-delimited
words from the parse area, including nested occurrences of
[IF] ... [THEN]
and [IF] ... [ELSE] ... [THEN],
until either the word [ELSE] or
the word [THEN] has been parsed
and discarded. If the parse area becomes exhausted, it is
refilled as with REFILL.
An ambiguous condition exists if [IF] is POSTPONEd, or if the end of the input buffer is reached and cannot be refilled before the terminating [ELSE] or [THEN] is parsed.
[IF] is an immediate word.
[THEN] ( -- )
Compilation:
Perform the execution semantics given below.
Execution:
Continue execution.
[THEN] is an immediate word.
Dr. Stephan Becher - December 16th, 2005