figForth Concept - Code Field
Some parts of this page/site are currently incomplete & will be updated asap
Other parts will change continually so use “Refresh” in your browser !!
There is extensive use of “Tooltips” text to support learning which do not seem to render on a Smartphone. This site is best viewed via a computer’s HD monitor
Note:
There is extensive use of “Tooltips” text to support learning which do not seem to render on a Smartphone
Therefore this site is best viewed via a computer’s HD monitor
By default Forth contains a number of compilers to create new Forth words and in order to execute newly defined words, each compiler creates a pointer to its companion “Run-Time Machine Code”
A defining instruction must perform two different tasks when it is used to define a new user instruction. To create a new instruction, the defining instruction must compile the new instruction into the dictionary, constructing the name field, link field, code field which point to the appropriate interpreter, and the parameter field which contains pertinent data making up the body of this new instruction. The defining instruction must also contain an interpreter which will execute the new instruction at runtime. The address of this interpreter is inserted into the code field of all user instructions created by this defining instruction. The defining instruction is a combination of a compiler and an interpreter in conventional programming terminology. A defining instruction constructs new user instructions during compilation and executes the instructions it created at run-time. Because a user instruction uses the code field to point to its interpreter, no explicit syntax rule is necessary for different types of instructions. Each instruction can be called directly by its name. The user does not have to supply any more information except the names, separated by delimiters. Ting Page 9