Both! After packaging the nasty details in macro definitions we
realized that we could switch between direct and indirect threading by
simply setting a compilation flag (-DDIRECT_THREADED
) and
defining a few machine-specific macros for the direct-threading case.
On the Forth level we also offer access words that hide the
differences between the threading methods (see section Threading Words).
Indirect threading is implemented completely machine-independently. Direct threading needs routines for creating jumps to the executable code (e.g. to docol or dodoes). These routines are inherently machine-dependent, but they do not amount to many source lines. I.e., even porting direct threading to a new machine is a small effort.