[net.lang.forth] Bug in NVSS Forth 83

toma@tekchips.UUCP (Tom Almy) (03/08/84)

I have found several bugs in No Visible Support Software's Forth 83
implementation (this is the one being distributed "public domain").
The problems exist for all versions.

1. In its enthusiastic approach, F83 implements two methods of printer control!
The actual technique is to vector the EMIT word (emit is defined as a DEFER
word) and then deposit (EMIT) (PRINT) or (PEMIT) into it as appropriate.
The system also maintains a user variable, PRINTING, which is ON if (PRINT)
is active.  Unfortunately, on error PRINTING gets reset, but not the
vector word, so error messages go to the printer!  The fix to this is to 
either get rid of PRINTING and have the error handler reset EMIT
or have PRINTING actually control the destination of output.   I feel
that the second technique is better for the multi-user environment (see
end of this posting).

2. I came across this problem when I had a background spooling task get 
an error.  It went back to the INTERPRET loop requesting a key along with 
my main task -- I had to reboot to get out of that one!  The fix seems to be
that background tasks must STOP when they enter INTERPRET. Perhaps add a
new user variable called "BACKGROUND". 

3. If you want to use the multitasker, be sure to execute MULTI before 
creating your tasks, otherwise the system will crash when you attempt to
WAKE the new task.  The solution is for MULTI to be executed automatically
upon Forth startup.  Having the multitasker active all the time involves
minimal overhead.

	I am attempting to make F83 into a multiuser Forth for the some
Forth classes that I teach.  To do that, just about every system variable 
must be a user variable.  The CP/M IOBYTE will also be made part of the 
task status-- by changing IOBYTE values I can have the OS vector KEY and 
EMIT among the keyboard/display, and the two RS-232 ports.  Each of the 
three users will be able to have over 8k of dictionary space and be able 
to use all the system utilities except for the debugger.  Since the 
identical code will work on my LOBO MAX-80 as well as the TRS-80 Model II,
I will be able to have 6 users active at once.

Tom Almy, Tektronix, Inc.  {many machines}!tektronix!tekchips!toma