whartung wrote:
But if you look at the code, it's not actually invoked anywhere.
nyef wrote:
IIRC, it's produced as result of calling WORD on an empty input buffer.
That's right. The terminal buffer and each of the disk buffers has the mystery word appended to it as a terminator. Thus, interpreting the contents of a buffer guarantees that the mystery word will eventually execute --and that's how it's intended to be invoked. (BTW, because the mystery word is unprintable the FIG glossary refers to it as
X, and I'll do the same.)
It's an odd approach, but it works. What's odd is how the interpreter doesn't know how large the buffer is, and contains no code to detect reaching the end! It's just a matter of letting loose and allowing things to sort themselves out.
X is at the end of the buffer, and it does what needs to be done when the buffer end is reached! Simple.
Slightly OT: did you notice how
X contains the sequence
R> DROP ?
An unusual bit of flow control, that. It allows an escape from the otherwise inescapable
BEGIN ...
AGAIN construct in
INTERPRET.
( more on that, based on notes penciled in my old FIG-Forth manual: )
QUIT is the outer loop, which includes a call to
INTERPRET.
INTERPRET is also a loop -- a
BEGIN ...
AGAIN, as noted. It includes a call to
-FIND which calls
WORD, and eventually the PFA of
X is returned to the loop. The loop will execute
X.
X is a colon definition, so it commences by nesting and concludes by un-nesting. Normally an un-nest returns you to your caller, but among other things
X has done an
R> DROP, which means the un-nest returns us to
the caller's caller,
QUIT.
_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html