Hi Enoch,
> Suppose we want to duplicate all output.
> Can anyone please show a simple working example?
> The following does not work.
It generates a endless recursion (emit calls
itself), until the whole system crashes.
You read the two recipes
http://amforth.sourceforge.net/recipes/disable-echo.html
and
http://amforth.sourceforge.net/recipes/redirect-io.html
didn't you?
> but how can I call XT_TX_POLL
XT_TX_POLL is a internal assembler label, that is
not exposed to the forth interpreter. What you probably
want to use is ' tx-poll . One of the above links has a
table, which lowlevel words are included (depends on
your settings for two WANT options).
> from myemit ??? Read it via "up@ 14 + @" ???
Well, this may work (did not check the number). I'd
strongly recommend using ' emit defer@ for that however.
That works regardless of the WANT-Settings.
You should not repeat the line
' emit defer@ tmpemit ! ' myemit is emit
command and hope that tmpemit keeps the right
information ;)
Matthias
PS: USER deferred words are besides the definition
normal deferred words. They work with DEFER@, DEFER!
and IS as specified in the forth200x spec.
|