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 always represents more. In most implementations
words with a common implementation ( CREATE DOES> words)
hide that there are in fact two addresses involved, the code address
and the address immediately following the CALL instruction
that customarily follows the code address.

What we see is not greater simplicity than in the indirect
threaded model, where explicitly two addresses are involved. We
see less clean concepts, confusion and a loss of flexibility.
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.

(Reading that back, I see that in ciforth two addresses are involved
but for a CREATE DOES> words this same confusion reigns.
The DOES> execution is a single cell, its content is interpreted
by normal interpretation, however the next pointer is - I would
say - abused to get at the data content. The DOES> pointer must
reside in data space. (or does it, i am confused.)

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