Go-Forth and Multi-Task

Reviewed by Peter Coates

 

Issue 25

Jan/Feb 87

Next Article >>

<< Prev Article

 

 

Bignose Software/S.E.C.S. 

24.99


Unlike the new ST series, there is a very limited choice of languages available for the older 8-bit Atari computers. Indeed, the main alternative to using the slow and unstructured BASIC is to resort to the complexities of Assembler - an unenviable choice!


Although considerable interest has been shown in the Forth language, and introductory articles have appeared in most computer magazines, it is surprising that so few programmers appear to have been converted to it. Disk drives are essential, of course, and I would agree that it does take some effort to become familiar with its stack-based operation and the reverse Polish notation, but it is a fast, powerful language, and, once bitten, most users become Forth enthusiasts if not fanatics.

 

Most versions of Forth available for the Atari 8-bit computers in Britain have had some weaknesses or have been rather expensive. Go-Forth is a multi-tasking version, needing a minimum of 32k RAM, produced and marketed in the UK by S.E.C.S. Ltd. under licence from the quaintly-named Bignose Software. It is approved by Atari, claimed to provide features normally only found on mini and main-frame computers, and is on sale at a very reasonable price (25). To see if this represents good value, we must look at the facilities provided.


First, I should perhaps remind you that a Forth system consists of a dictionary of compiled 'words'. A word is similar to a sub-routine; it carries out a particular function, and several may be combined together and given a descriptive name to define a more complex function. You can execute any function simply by entering its name from the keyboard. The language is usually provided in the form of a Forth nucleus, which is the part read into the computer on booting up, from the disk supplied, and several 'electives', that is, sets of definitions of words you may choose to add to the nucleus in order to carry out specific tasks. The electives are stored on the disk in screens or blocks which can either be read into buffers in the computer for inspection and modification, or compiled directly into the dictionary.


The nucleus provided in Go-Forth follows reasonably closely the Forth-79 standard, so if you copy code obeying this standard from another source into your system, it should compile without serious difficulties. The differences from the 79 standard are listed in the User Guide provided. The only one which might cause problems is the absence of the variable STATE, which indicates whether the system should compile or execute immediately the code presented to it. There are ways round this, but you need to know exactly what you are doing.

 

The electives include not one but two editors. I found the screen editor, which behaves rather like a text editor, particularly effective for entering new definitions. The line editor is of the conventional fig-Forth form, and more suited to the modification of existing screens. The block size in Go-Forth is 512 bytes, so each screen consists of 16 lines of 32 characters. It is more usual to have a block size of 1024 bytes (16 lines of 64 characters), but the smaller size fits more efficiently on the Atari text screen.


If you are accustomed to 6502 machine code, you should have few problems with any Forth assembler, once you have adapted to the reverse notation. In fact, because high level control words such as IF.. ELSE.. THEN and BEGIN.. UNTIL are available, and you can break the code into small sections, each of which can be tested and debugged separately, assembler in Forth is actually rather easy. The Go-Forth assembler does not, however, make use of the check digit normally included to ensure that the control words are correctly paired. In my opinion, this is a definite weakness; the time saved while loading is minimal, and certain to be exceeded by that required in checking the code and finding the mistakes.


The debugging utilities allow new Forth words to be checked by stepping through the definition, with the contents of the stack and any important variables shown after each step. This is a much more useful facility than the de-compiling utility normally provided, which merely lists the words present in the definition. It would have saved me many hours of frustration and reams of paper in the past.

 

The multi-tasking routines are perhaps the most prominent feature of Go-Forth, and it's unusual to find these features on an 8-bit micro. Some tasks are provided; one (TYPIST) enables you to continue using the computer while printing out long documents or listings. Another (TICKER) gives a digital clock on the GR.0 text screen, and supplements other time and date routines available. Whether you find the ability to run simultaneous tasks to be of great value depends very much on your applications. It is particularly useful for controlling external equipment - a sophisticated domestic control and burglar alarm system, for example.


Other electives cover disk and I/O operations, and sound and graphics. These on the whole correspond to the facilities available in BASIC. No attempt has been made to provide words to cover player-missile graphics and display list interrupts.


On the whole the package is neatly and effectively done. There are some minor points I didn't like; for example, the disk drives are, for no good reason, numbered 0 to 3 rather than the usual 1 to 4. Also, no warning is given if you define a word with the same name as one already present. This can be corrected by re-vectoring CREATE, but I feel that a warning should be the default option. There are no floating point routines; although the purist might claim that they are undesirable in Forth, which predominantly uses integer and fixed point arithmetic, I have found them very useful on occasion.


The one serious failing in Go-Forth is the documentation provided. The reader is assumed to be 'a competent Forth programmer experienced in the use of a standard 6502 assembly language'. A very small fraction of the potential customers will meet these requirements. Even if you do. the 80-page user guide is not well written or well organised, and some sections are heavy going indeed. It also has its fair share of errors; even the procedure on page 2 for backing up the system disk is faulty (the store word '!' has been replaced by a degree symbol). For a beginner, a copy of Brodie's 'Starting Forth' or of Winfield's 'The Complete Forth' is absolutely essential.
These will cover the fundamentals, of course, and not the functions specific to Go-Forth.


To sum up, then, I would say that this is a very good version of Forth for the Atari, with some really useful extensions, even if you don't make much use of the multi-tasking aspects. There are a few flaws which need correcting, and the documentation could be much improved; if you are a newcomer to Forth, you will certainly need an introductory text to get started. The price is very reasonable, and represents excellent value for money.

top