StrongForth Programming-Tools Glossary


(;CODE) ( DEFINITION -- )

Finish a new definition by compiling its stack diagram, which is copied from DEFINITION. Copy the content of the code field of DEFINITION to the code field of the new definition.

(;CODE) is an internal definition compiled by ;CODE.


(SEE) ( STACK-DIAGRAM -- 1ST )

When used in a stack diagram, specifies an input or output parameter with data type (SEE). Data type (SEE) is a qualified token of a word with stack diagram ( CONST -> TOKEN TOKEN -- 1ST FLAG ).


(WORDS) ( WID "<spaces>name" -- )

List all names and stack diagrams of the definitions in the word list identified by WID, whose name are identical to name. If the parameter name is not provided, list all names and stack diagrams of all definitions in the word list identified by WID. Each definition is displayed on a separate line.


. ( DEFINITION -- )

Display the header of DEFINITION, consisting of the definition's name and its stack diagram, plus a trailing space character.


.ADDR ( SINGLE -- )

Display SINGLE in a four-digit hexadecimal format with a trailing colon.


.BYTE ( SINGLE -- )

Display the least significant byte of SINGLE in a two-digit hexadecimal format.


.DIAGRAM ( DEFINITION -- )

Display the stack diagram of DEFINITION in a user-readable format, plus a trailing space character.


.HEX ( SINGLE -- )

Display SINGLE in a four-digit hexadecimal format.


.HEX ( DOUBLE -- )

Display DOUBLE in an eight-digit hexadecimal format.


: .IMMEDIATE ( DEFINITION -- )

If DEFINITION is an immediate word, display "IMMEDIATE" and a trailing space character.


;CODE ( COLON-DEFINITION -- )

Interpretation:
An exception is thrown if ;CODE is interpreted.

Compilation:
Append the runtime semantics given below to the current definition. An exception is thrown if the contents of the compiler data type heap does not exactly match the output parameters of the current definition. Consume COLON-DEFINITION. End the current definition, allow it to be found in the dictionary, and enter interpretation state. Subsequent characters in the parse area typically represent source code in assembly language, generating machine code.

Runtime: ( R: nest-sys -- )
Specify the execution semantics of the most recent definition, referred to as name, as given below. Return control to the calling definition specified by nest-sys. An ambiguous condition exists if the most recent definition was not defined with CREATE or a user-defined word that calls CREATE.

name Execution: ( -- )
Perform the machine code sequence that was generated following ;CODE.

Note that new definitions do have no stack effects by default. Stack effects have to be specified separately if they are intended. By using a stack diagram phrase ( ... -- ... ) immediatly following ;CODE and the definition name, the new definition is modified to incorporate stack effects.

;CODE is an immediate word.


? ( -- )

Interpretation: ( ADDRESS -- )
Display the value stored at ADDRESS by performing the execution semantics of @ and ..

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

Runtime: ( ADDRESS -- )
Display the value stored at ADDRESS by performing the execution semantics of @ and ..

? is an immediate word.


?COLON ( CONST -> CODE -- )

An exception is thrown if CONST -> CODE is not the code field address of a colon definition.


DEFER? ( DEFINITION -- FLAG )

FLAG is TRUE if and only if DEFINITION was defined by DEFER.


DUMP ( DATA UNSIGNED -- )

Display the contents of UNSIGNED consecutive memory cells starting at address DATA. If necessary, multiple lines are displayed. Each line contains the hexadecimal starting address and the contents of up to eight memory cells.


DUMP ( CONST UNSIGNED -- )

Display the contents of UNSIGNED consecutive memory cells starting at address CONST. If necessary, multiple lines are displayed. Each line contains the hexadecimal starting address and the contents of up to eight memory cells.


DUMP ( CODE UNSIGNED -- )

Display the contents of UNSIGNED consecutive memory cells starting at address CODE. If necessary, multiple lines are displayed. Each line contains the hexadecimal starting address and the contents of up to eight memory cells.


DUMP ( FAR-ADDRESS UNSIGNED -- )

Display the contents of UNSIGNED consecutive memory cells starting at address FAR-ADDRESS. If necessary, multiple lines are displayed. Each line contains the hexadecimal starting address and the contents of up to eight memory cells.


DUMP ( DATA -> DOUBLE UNSIGNED -- )

Display the contents of UNSIGNED consecutive double memory cells starting at address DATA -> DOUBLE. If necessary, multiple lines are displayed. Each line contains the hexadecimal starting address and the contents of up to four double memory cells.


DUMP ( CONST -> DOUBLE UNSIGNED -- )

Display the contents of UNSIGNED consecutive double memory cells starting at address CONST -> DOUBLE. If necessary, multiple lines are displayed. Each line contains the hexadecimal starting address and the contents of up to four double memory cells.


DUMP ( CODE -> DOUBLE UNSIGNED -- )

Display the contents of UNSIGNED consecutive double memory cells starting at address CODE -> DOUBLE. If necessary, multiple lines are displayed. Each line contains the hexadecimal starting address and the contents of up to four double memory cells.


DUMP ( FAR-ADDRESS -> DOUBLE UNSIGNED -- )

Display the contents of UNSIGNED consecutive double memory cells starting at address FAR-ADDRESS -> DOUBLE. If necessary, multiple lines are displayed. Each line contains the hexadecimal starting address and the contents of up to four double memory cells.


DUMP ( CDATA UNSIGNED -- )

Display UNSIGNED consecutive characters starting at address CDATA. If necessary, multiple lines are displayed. Each line contains the hexadecimal starting address and the contents of up to 16 character size memory cells.


DUMP ( CCONST UNSIGNED -- )

Display UNSIGNED consecutive characters starting at address CCONST. If necessary, multiple lines are displayed. Each line contains the hexadecimal starting address and the contents of up to 16 character size memory cells.


DUMP ( CCODE UNSIGNED -- )

Display UNSIGNED consecutive characters starting at address CCODE. If necessary, multiple lines are displayed. Each line contains the hexadecimal starting address and the contents of up to 16 character size memory cells.


DUMP ( CFAR-ADDRESS UNSIGNED -- )

Display UNSIGNED consecutive characters starting at address CFAR-ADDRESS. If necessary, multiple lines are displayed. Each line contains the hexadecimal starting address and the contents of up to 16 character size memory cells.


FIRST ( WID -- DEFINITION )

DEFINITION is the first created definition of the word list identified by WID.


LAST ( WID -- DEFINITION )

DEFINITION is the most recently created definition of the word list identified by WID.


LOOKUP ( -- )

Compile the runtime part of SEE-LOOKUP.


SEE ( "<spaces>name" -- )

Skip leading space delimiters. Parse name delimited by a space. Find name. Display a human-readable representation of name's definition, including its stack diagram. An exception is thrown if name is not a colon definition.

Note that SEE can not display how immediate words like IF and THEN were used during compilation.


SEE, ( TOKEN CONST -> CODE -- )

Add one entry consisting of CONST -> CODE and TOKEN to the end of the lookup table SEE-LOOKUP. An exception is thrown if the lookup table is full.


SEE+EXIT ( CONST -> TOKEN TOKEN -- 1ST FLAG )

If CONST -> TOKEN is less than the value of SEE-LIMIT, execute the semantics of SEE-PARAM. Otherwise, discard TOKEN, display a semicolon with a trailing space, and return TRUE as FLAG. 1ST is equal to CONST -> TOKEN.


SEE-ALL ( CONST -> TOKEN -- )

Display a human-readable representation of the virtual machine code starting at CONST -> TOKEN and up to the first occurence of the token of either (EXIT) or (+EXIT) that is not skipped by a conditional or unconditional branch.

Note that SEE-ALL can not display how immediate words like IF and THEN were used during compilation.


SEE-BRANCH ( CONST -> TOKEN TOKEN -- 1ST FLAG )

Display the name of the definition whose token is equal to TOKEN. Display the constant parameter of the compiled execution token stored at address CONST -> TOKEN as a signed single-precision number. The constant parameter is assumed to be a branch offset and has the size of a single cell. If the branch destination is greater than the value of SEE-LIMIT, replace the value of SEE-LIMIT with the branch destination. 1ST is CONST -> TOKEN incremented by the size of one cell. FLAG is FALSE.


SEE-DEFAULT ( CONST -> TOKEN TOKEN -- 1ST FLAG )

Find the definition whose token is equal to TOKEN. If the definition is an immediate word, display "POSTPONE" and the name of the definition. Otherwise just display the name of the definition. Display "???" if TOKEN is not associated with a definition. 1ST is equal to CONST -> TOKEN. FLAG is FALSE.


SEE-DLIT ( CONST -> TOKEN TOKEN -- 1ST FLAG )

Discard TOKEN. Display the constant parameter of a compiled execution token stored at address CONST -> TOKEN as a signed double-precision number. The constant parameter has the size of two cells. 1ST is CONST -> TOKEN incremented by the size of the constant parameter. FLAG is FALSE.


SEE-EXIT ( CONST -> TOKEN TOKEN -- 1ST FLAG )

If CONST -> TOKEN is less than the value of SEE-LIMIT, execute the semantics of SEE-DEFAULT. Otherwise, discard TOKEN, display a semicolon with a trailing space, and return TRUE as FLAG. 1ST is equal to CONST -> TOKEN.


SEE-FLIT ( CONST -> TOKEN TOKEN -- 1ST FLAG )

Discard TOKEN. Display the constant parameter of a compiled execution token stored at address CONST -> TOKEN as a floating-point number. The constant parameter has the size of five cells. 1ST is CONST -> TOKEN incremented by the size of the constant parameter. FLAG is FALSE.


SEE-LIMIT ( -- DATA -> CONST -> TOKEN )

DATA -> CONST -> TOKEN is the address of a cell containing a virtual machine code address that is a part of the definition that is currently displayed by SEE. SEE may not stop displaying the virtual code of the definition before this address has been reached.


SEE-LIT ( CONST -> TOKEN TOKEN -- 1ST FLAG )

Discard TOKEN. Display the constant parameter of a compiled execution token stored at address CONST -> TOKEN as a signed single-precision number. The constant parameter has the size of a single cell. 1ST is CONST -> TOKEN incremented by the size of the constant parameter. FLAG is FALSE.


SEE-LOOKUP ( TOKEN -- (SEE) )

(SEE) is the qualified token of a word SEE can use for displaying the token TOKEN. SEE-LOOKUP uses a lookup table to determine the qualified token.


SEE-NEWLINE ( -- )

Cause subsequent output to appear at the third column of the next line.


SEE-PARAM ( CONST -> TOKEN TOKEN -- 1ST FLAG )

Display the name of the definition whose token is equal to TOKEN. Display the constant parameter of the compiled execution token stored at address CONST -> TOKEN as a signed single-precision number. The constant parameter has the size of a single cell. 1ST is CONST -> TOKEN incremented by the size of the constant parameter. FLAG is FALSE.


SEE-SLIT ( CONST -> TOKEN TOKEN -- 1ST FLAG )

Discard TOKEN. Display the string literal parameter of a compiled execution token stored as a counted string at address CONST -> TOKEN with a leading and a trailing quote ("). The string literal parameter has a variable size. 1ST is CONST -> TOKEN incremented by the size of the counted string. 1ST is cell-aligned. FLAG is FALSE.


SEEN-BY ( DEFINITION "<spaces>name" -- TOKEN CONST -> CODE )

Skip leading space delimiters. Parse name delimited by a space. Find a definition called name whose stack diagram matches ( CONST -> TOKEN TOKEN -- 1ST FLAG ) with respect to both input and output parameters, and return its execution token as TOKEN. CONST -> CODE is the address of the code field of DEFINITION. An exception is thrown if SEEN-BY is executed in compilation state.

Note: SEEN-BY calculates one entry of SEE-LOOKUP.


WORDS ( "<spaces>name" -- )

List all names and stack diagrams of the definitions in the FORTH-WORDLIST word list, whose name are identical to name. If the parameter name is not provided, list all names and stack diagrams of all definitions in the FORTH-WORDLIST word list. Each definition is displayed on a separate line.


[ELSE] ( -- )

Compilation:
Perform the execution semantics given below.

Execution: ( "<spaces>name" ... -- )
Skip leading spaces, parse and discard space-delimited words from the parse area, including nested occurrences of [IF] ... [THEN] and [IF] ... [ELSE] ... [THEN], until the word [THEN] has been parsed and discarded. If the parse area becomes exhausted, it is refilled as with REFILL.

[ELSE] is an immediate word.


[IF] ( SINGLE | SINGLE "<spaces>name" ... -- )

Compilation:
Perform the execution semantics given below.

Execution:
If any bit of SINGLE is not zero, continue execution. Otherwise, skip leading spaces, parse and discard space-delimited words from the parse area, including nested occurrences of [IF] ... [THEN] and [IF] ... [ELSE] ... [THEN], until either the word [ELSE] or the word [THEN] has been parsed and discarded. If the parse area becomes exhausted, it is refilled as with REFILL.

An ambiguous condition exists if [IF] is POSTPONEd, or if the end of the input buffer is reached and cannot be refilled before the terminating [ELSE] or [THEN] is parsed.

[IF] is an immediate word.


[THEN] ( -- )

Compilation:
Perform the execution semantics given below.

Execution:
Continue execution.

[THEN] is an immediate word.


Dr. Stephan Becher - November 26th, 2007