Ace comes with a power pack, cassette leads, programming manual and demonstration tape.
FOR-NEXT. There is, however, no equivalent to the BASIC GOTO command. This seems at first like a serious omission to anyone used to programming in BASIC, but once you get used to FORTH you find you can always use IF-THEN-ELSE, BEGIN-UNTIL or BEGIN-WHILE-REPEAT to achieve the same result but in a much more elegant fashion.
Stack It
One area where FORTH differs considerably from most other computer languages is in its use of a 'stack' to hold the values being worked on. Most languages use named 'variables' to hold values, so that the BASIC statement:
LET A = 27 + 33
tells the computer to add 27 to 33, then store the result in an area of memory reserved for the variable named 'A'. You can also use named variables in FORTH, but the values actually being worked on at any time will usually be held in a special area of memory known as the 'Stack'. This is best thought of as a pile of values; a new value can be added to the top of the pile — making the pile higher — or a value can be taken off the top of the pile — making it shorter. All of FORTH's fundamental operations, like addition, multiplication etc., work on the values present on the top of the stack. The '+' operator, for example, takes the top two values off the stack, adds them together, then puts the result back onto the top of the stack.
When the computer sees a number in the line you have entered, it puts that value onto the top of the stack. For example, if you look back at our definition of the word HI, what it was really telling the computer to do was to first put the value 125 onto the stack, then put the value 100 on top of that, then execute the pre-defined word BEEP, which takes the top two numbers from the stack to give the frequency and length of the note to be produced.
Similarly, the line:
27 33 +
will place the values 27 and 33 onto the stack, then replace them by the single value 60. This way of writing may seem backwards at first (and -
indeed - it is known as 'reverse Polish') but you soon get used to it.
There are two main reasons why FORTH was designed around the use of a stack. The first is that it saves memory space because values are kept in RAM only as long as they are needed, and more importantly — because the program doesn't need to contain the names of the variables (at least as long as the values are being kept on the stack). The second advantage is that your programs run more quickly because the computer doesn't have to search through a 'variables storage area' to find the one you want.
DIY FORTH
FORTH is really a 'Do It Yourself' language. Although it has about 140 pre-defined words compared to the 90 or so keywords in most versions of BASIC, they nearly all correspond to very elementary operations, and you have to add your own definitions to do anything that is even slightly complex.
Take arrays for example. In BASIC, a simple DIM statement will set up an array so that you can then refer to an element of it by just using a subscripted variable such as A(27). But FORTH has no equivalent to the DIM statement or the subscripted variable; you have to write special words that will let you handle data in array form, or — more precisely — you have to define a routine that can be used to set up arrays, and another to let you refer to an individual element of an array. At the end of the day you will be able to handle arrays of data at least as well as you could in BASIC, but you will have taken longer to get there.
Similarly, if you want to handle strings, you must first define some string handling words.
Fast FORTH
Where FORTH really scores is in doing fairly simple tasks very quickly. And, because it is much nearer to machine code than BASIC, you have much more control over what the computer is actually doing. Indeed, to program successfully in FORTH you need to be much more aware of how the computer works than you do with most other languages, and pay much more attention to the possible side effects of what you are doing.
For example, FORTH arithmetic is usually done using 16-bit words that can take integer values from -32768 to 32767. But there is no check to see if a result has overflowed, so that it will quite happily add 30000 to 30000 and say that the result is -5536! FORTH enthusiasts will say, of course, that if you really want the + operator to .check for overflow then you can easily define a new version of the word that does just that.
ACE FORTH
There is a standard for the FORTH language, known as FORTH-79, and the version provided on the ACE sticks very close to it. The main differences are the addition of words to handle floating point numbers, plotting, the sound generator, and ports. There are also some differences in the way programs are entered and edited.
The Hardware
The ACE comes in a white vacuum-formed plastic box about the same width as the Spectrum but deeper, held together with plastic rivets along the sides and back. A label on the underside of the box warns that there are no 'user serviceable' parts inside, and indeed the case is fixed together in such a way that you can't take it apart without splitting the plastic. This is a pity, because I am sure that many people who would be attracted to the ACE would be enthusiastic (and knowledgeable) enough to want to get at the hardware to make minor 'improvements'.
On the model received for review, the quality of the case was poor. The edges where it had been cut from the mould were rough, there were a couple of noticeable dimples on the top surface, and the holes in the case for the TV, Ear, Mic and Power sockets did not line up properly. Worse, the bottom part of the case was bowed so that it flexed whenever you pressed on a key, and the keytops sometimes caught underneath the case top. Hopefully these were just teething problems with the first models.
Two PC board edge connectors are provided at the back for add-ons. One of these is to take memory extension and/or I/O ports. It is believed that the other is for a possible colour display add-on.
The keyboard has the same layout as on the Spectrum, even having the same awkwardly positioned Symbol Shift key, and also lacks a proper space bar. But, because FORTH doesn't use keywords in the same way that Spectrum BASIC does, there is a blessed simplicity about the key legends. Generally, each key is only used to give upper or lower case characters — governed by using the SHIFT key, or a special symbol such as '<', which is obtained with the Symbol Shift key. The keys are black with easily read white markings.
As on the Spectrum, the keytops are all formed from a single rubber moulding which collapses as you press on a key, but the ACE's keys feel much