Forth lecture 4.

The dea concept.



There is very little merit in considering the execution token as
representing a mere code address where to jump to.
This address usually represents more, e.g. it allows to recover the name
under which it is to be found. The execution token of noname words is an
exception.
It is advantageous to start from a DEA "dictionary entry address" that
allows to find all properties of a word. A name is also a property
of a word so that it can be inspected.
A precise analysis of CREATE DOES> words reveals that there are
two separate data items. The body of the word with regular data,
and the DOES> pointer that can be changed afterwards.
In an indirect implementation such as ciforth, the code pointer points
to DODOES or some such and the data pointer points to an area where
the first cell points to high level code.
Note that for a high level word the data pointer points directly to high
level code.

What we see is not a greater simplicity than in the direct
threaded model, where explicitly two addresses are involved. We
see less clean concepts, confusion and a loss of flexibility
and CREATE DOES> words are an exception.
Of course it is done in the name of efficiency. However, in the
end simplicity and clean concepts always wins the speed
contest. If it is simple maybe even an optimising compiler can
understand it.


  • Other Forth lectures
  • Go to the home page of Albert van der Horst