The direct threading technique employed by UR/Forth compiles an execution token for each word that is the address of the native 8086 machine instruction to branch to in order to perform the action associated with that word. In the case of variables, the sequence of code loads the parameter field address into a register and then branches to the routine common to all variables. In the case of a colon definition, the sequence of code loads the parameter field address, which points to the compiled execution tokens for that word, into a register and branches to the code common to all colon definitions.
In both of these cases, the parameter field address is compiled into the immediate portion of a load immediate native machine instruction. This means that the address of the parameter field address may be determined from the execution token, which gives the code field address. This is fortunate, because we may always determine the address of the parameter field address from the execution token. Some similar situation should probably exist in other direct threaded Forth implementations.
In this Dreams implementation, the word
^pfa converts the
execution token of a word into a pointer to the parameter field
address of that word. The words pfa@ and pfa! fetch the
parameter field address, and store a new parameter field address,
respectively, when given the execution token of a word. These words
are tailored to the UR/Forth model. If a different direct threaded
Forth is to host Dreams, these words would need to be edited
The words new-bindings and old-bindings are not advertised as part of the interface to Dreams. They are used to implement PONDER. The word Find-Binding is used by IMAGINE to look up the element in a Dreams list of local objects so that the local understanding of that object may be changed. This look-up only occurs when IMAGINE is executed, not every time that the dream is activated. Typically the use of IMAGINE is infrequent when a program is running. The words bind-vision and unbind-vision perform a function for visions analogous to the functions performed by new-bindings and old-bindings for individual dreams. All other words in Appendix D (p ) have already been described.