SINCLAIR ZX80

Written by David Tebbutt, Personal Computer World 04/80 - scanned

Clive Sinclair has surprised the world with the launch of his attractive, hand-held personal computer. Costing less than a hundred pounds, and plugging into the domestic TV and cassette recorder, some now suggest the ZX80 to represent the thin edge of a mass consumer market wedge.

Introduction

Sinclair Research set out to build a simple to use personal computer, running BASIC and capable of breaking the psychological price barrier of £100. Well, they succeeded with their ZX80. Why ZX80? No reason really except that it's based on an NEC copy of the Z80 processor chip . . . and it sounds nice.

The machine is available through mail order either ready made or in kit form; there are no firm plans to sell it through the shops - yet. A kit will cost you £79.95 while its ready built twin will come out at £99.95. In addition to this you'll need a mains adapter (``600ma at 9V DC nominal unregulated'') . . . if you buy Sinclair's it will cost you an extra £8.95. Deliveries of the kit were expected to start in February, the ready-made in March.

The ZX80 is amazingly light, twelve ounces in fact, and easily held in one hand. The low weight is achieved through use of a moulded plastic casing just l mm thick.

It connects quite happily to the television set and the cassette recorder, although it might take a few minutes to find the optimal settings. Once attached to the TV, it gives a rock steady display (more on that later).

Hardware

I have to say that I think it very pretty (our art director would probably beg to differ) - the casing even has go-faster stripes, which look suspiciously like ventilation slots in black and white photographs (coincidence, I'm sure). I would, however, have been happier with something rather more sturdy; ABS plastic might have done the trick, although perhaps at the cost of attractiveness.

The keyboard is most interesting; it's one of those waterproof, chemical proof, completely sealed units and it's stuck on to the main PCB. Made of a special tough plastic, the under-surface is printed with the key symbols so as to eliminate any rubbing off. Between this keyplate and the PCB containing the metal contact strips (about five per key) is a piece of sticky plastic containing forty holes which line up with the ``keys''. This material is about .006'' thick and is just sufficient to keep the metal underside of the keyplate away from the contacts, except when touched of course.

Typing gives you a sensation of drumming your fingers rather than of doing anything useful. This is a totally mistaken impression because it really works rather well. For those who are interested, I found that a ``wiping'' action was more successful than the tapping movement usually associated with typing. Typists may be pleased to hear that the keys are in standard QWERTY layout although somewhat compressed compared to, say, the office IBM.

Looking inside the machine, I find that it's controlled by an NEC 780-1 processor chip . . . a copy of the well known and very successful Z80. This CPU, running at 3.25MHz, does all the work for the ZX80, including driving the TV and the cassette recorder. You'll notice that if any work is taking place, be it calculation, accepting input from the keyboard or driving the cassette, then the TV picture disappears - only to return when the activity is complete. This can be irritating to observers (at a demonstration for example) but I found it positively beneficial when keying in programs because it gave me positive feedback whenever a key made successful contact.

The BASIC interpreter, operating system, character set and editor are all held in a 4K Byte ROM. If you are feeling adventurous there's no reason why you shouldn't pop your own ROM (TMS 2532) in its place.

Memory in the basic system comprises 1K static RAM; you can add to it via the expansion port, giving a maximum potential of 16K. The memory expands with the aid of plug in modules, each designed to carry up to 3K in 1K increments. Thus five modules would be required to give the 16K maximum. At switch-on the machine does a memory check which also tells the system how much memory is online. Should you reconfigure the memory, then the command NEW will execute the memory check cycle again.

Moving on to the ``outside world'' connections, there's a cassette interface, TV socket and a hefty edge connector. The cassette interface comprises two 3.5mm jack plug sockets, securely mounted on the main (and only) PCB. One connects to the ``ear'' socket on the cassette recorder and the other to the ``mic'' socket. There is no facility for remote control of the cassette motor. Anyone with DIN sockets will have to buy a jack plug to DIN connector lead.

Although I encountered one or two problems at first, once working, the cassette interface proved trouble free. My particular recorder had a nasty habit of recording noises when the CPU was ``sending out'' silence. This caused the system to get its knickers in a twist when reading from cassette because it expected silence just before the file header record. After a couple of hours (what a confession) the culprit was found - the ``ear'' lead, which acts as a monitor while recording, was setting up some sort of oscillation. Answer? simple - disconnect the ``ear'' jack when recording. Another tip which ensures trouble free loading is to move the tape into the silent section before issuing your LOAD instruction. Rumour has it that the cassette operates at around 250 baud - I believe it, although it doesn't seem terribly important when you're only loading the 1K that I was.

The television connector is simplicity itself. Plug one end of the cable (supplied) into the ZX80 and the other into the television aerial socket, tune to channel 36 and you're in business. The display is magic; rock steady and very clear although reversed characters (white on black) are not so good.

I have already mentioned the business of the display switching off every time the processor needs to do something else. If this drives you mad then you will have to forfeit some of the undoubted pleasures that this machine has to offer. The screen is not memory mapped; it's treated like a serial file - like a printer in fact - which means that fast moving graphics are out of the question. No doubt some clever Dick out there will take up the challenge and fudge the system, just to prove me wrong. More about the reasons for this in the Software section, but anyone who is hooked on white characters on a black background can suitably modify the PCB, though why they should want to I'll never know. It's a matter of cutting one track and making a small bridge to another.

American television (525 line) users are catered for as well; all they need to do is solder in one diode and the system is converted from 50 to 60Hz standards. Do you take your computer camping with you? You'll be pleased to hear that it can run from a car battery, provided that the lead regulates the supply. I believe you can buy a cigarette lighter plug with a built in regulator . . . couple that with a portable TV and a battery powered cassette recorder and you'll be the envy of the campsite.

Now let's look at the hefty edge connector. This is where the memory expansion modules fit in, each one being ``piggy backed'' on the one previous. Thus there are always 44 contacts available for outside use.

There are 37 lines drawn from the CPU plus 3 power lines (at 0V, 5Vand 9V); the other lines comprise two earths, a ``clock'' signal and an ``external memory in use'' indicator.

All in all, the Sinclair ZX80 is a well designed, well produced personal computer. Memory addition comes a bit expensive at £300 for the full expansion but Clive Sinclair tells me bigger RAMs are on the way - that means cheaper expansion when they appear. If you like soldering and are good at it, it'll probably take you an evening to assemble the kit; if you're at all apprehensive than I suggest that you stump up the extra cost and save yourself twenty pounds worth of heartache by purchasing the ready built ZX80.

I'm sorry that there are no pictures of the machine's innards. The fact of the matter is that I was given one of the development machines which had a couple of ``Veroboarded'' EPROMS and a selector IC floating around on the ends of some pieces of wire which in turn were soldered into the ``official'' ROM socket. I thought it best to spare Mr Sinclair's blushes.

Software

The software of the ZX80 comprises the BASIC interpreter, the Editor and whatever it is that does the rest of the work (Operating System seems too grand a title). Rather than looking at each separately, I shall examine them in the order they might be encountered.

First of all the keying in of programs. For two reasons it's an absolute joy! First you don't have to type in many of the BASIC instruction codes, one key is sufficient, second you cannot enter anything that is syntactically incorrect. Some BASIC instructions have to be entered the long way (these are listed above the keyboard) but 29 of the instructions may be entered with a single keystroke, while only 8 need to be keyed in full.

As with many micros most of the instruction codes are stored in a single byte. Normal Z80 machine code can be entered using the POKE statement and executed with the USR instruction. This should keep the buffs happy after they have tired of BASIC. Syntax checking is superb - it's impossible to go wrong. Every character is checked on entry and, if the interpreter thinks that you are going to make a mistake, it signals with a reverse S (for Syntax) at the point it thinks you have gone wrong. If, later in the same line, you correct the error, then the marker disappears. What a grown up facility for such a small machine! Incidentally, the program lines are displayed very clearly with line numbers, instructions, operators and what have you being nicely spaced out.

Inside the memory, however, there's a completely different story. The lines of code are held as compactly as possible with most of the commands and operators occupying one byte each. The spaces are removed and there are very few extra bytes needed - for instance the new line code is one byte, although I did notice that the "=", operator needed one extra for some reason. I'm sure there are others but I'm equally sure they are very few and far between. An example of the storage requirement is as follows:

10 FOR A=16424 TO 17424 {18 Bytes}

20 PRINT PEEK(A); {12 Bytes}

30 NEXT A {5 Bytes}

40 STOP {4 Bytes}

So you see, the storage for that program (displaying the 1K memory) is 39 bytes long - an average of 10 bytes per instruction. I'll leave you to work out what sort of program you can get in 1K. Perhaps I should mention that the screen buffer uses part of the 1K, as does the stack and system control area The stack is held at the top of memory and ``grows'' down, I put 327 entries on it before it stopped accepting them.

The program and variables ``grow'' up into the screen buffer thus reducing the amount of data on display Eventually it's possible for the program or variables to grow so large that there's nothing left on display. It was while experimenting with this interesting feature that I crashed the system. It seems the software couldn't cope with someone entering a string 868 bytes long! After about 424 bytes of input the screen removed another character every time I keyed in a new one - it was most odd to watch.

Another way of crashing the system, in fact the only other way I could find, is to hit the EDIT key while in the middle of an INPUT loop. This returns the current program line with a syntax error which is impossible to clear. For those who are feeling unhappy about all this talk of crashing systems, don't worry, it's not as bad as it sounds. In the first place you have to enter forty characters after the screen has gone blank, and in the second place you can only hit EDIT when you are also holding the SHIFT key down.

Now it may be that, having loaded your program, you wish to edit it. Well once again there is some rather excellent software to help you. The Editor enables you to move a ``current line marker'' up and down the program text. Wherever it is you will always be able to see the marked line and at least some of its neighbours (it's called getting it in context). Pressing the HOME key causes the marker to disappear - it has in fact gone to an imaginary position, one above the first program line. Having reached the line to be edited press the EDIT key and the line will be presented at the bottom of the screen ready for you to do your worst. From now on it is as if you are entering the line for the first time.

The benchmark timings show the ZX80 to be very fast, even though I had to introduce some extra code to make some of the instructions work. Specifically I had to bracket expressions like LET A=((K/K)*K)+K-K . . . if I hadn't, the expression would have exceeded the ZX80's capacity. The machine can only operate on integers and these must have values from - 32768 to 32767. I couldn't execute Benchmark 8 because the machine has no logarithmic or trigonometrical functions built in.

Finally, it's possible to save programs and any variables associated with them. If you want to make use of those same variables when reloading the program, use GOTO rather than RUN. Although it's possible to SAVE programs in this way, no provision has been made to save files - yet.

That's about it for the software; once again, considering the size of machine and price, I think that it's not at all bad.

BASIC

The ZX80 BASIC has been well thought-out and, while it lacks some of the elegance and sophistication of the bigger machines, it's a very usable version of the language.

The main limitations relate to file handling and mathematical functions. File handling facilities don't exist, except by SAVEing the whole of memory (which is probably not as daft as it sounds). It does mean that you can save a program with all its variables reload it the next day, remember to kick off with a GOTO rather than RUN, and carry on from where you left off. On the small memory machine it doesn't seem that important, but on the larger memory machines it means you can hold some reasonable sized files together with your program.

The mathematical limitations are possibly more serious. The fact is the BASIC can only handle integers in the range - 32768 to 32767, no decimals, hence the programmer must write a little routine for each mathematical function that requires decimals to be used. This should pose few problems for those with the larger memory machines but it will undoubtedly occupy a fair chunk of the basic 1K-system.

So much for bad news; now here are some of the good features of the language.

Taking numeric functions first, the BASIC offers up to 26 single dimension numeric arrays of any length. It also allows three Boolean operations - AND, OR and NOT. The randomising functions are worth a mention. RANDOMISE n sets a seed value, while RND(n) gives a random number in the range 1 to n. PEEK and POKE are both available so it's possible to read or modify memory contents; coupled with the USR function, this means that Z80 machine code routines can be executed.

Up to 26 FOR . . . NEXT loops can be nested and the number of nestable subroutine calls seems to be dictated by the amount of memory available to the stack. On the 1K machine with a short (4 line) program, I was able to get 327 subroutine calls in before needing to RETURN.

String functions, while adequate, could definitely be improved. The absence of a DATA statement and the lack of string arrays caused particular frustration. Although there are ways around these problems, they can be time consuming and messy.

The functions which are available, and which form the building blocks of string handling subroutines, are STR$, TL$, CODE, CHR$ and INPUT. STR$ (n) returns a string of 1 to 6 characters representing the signed, decimal value of n. TL$ returns a string minus its first character while CODE returns the code for the first character in a string. CHR$(n) represents the character whose value is n and INPUT allows the operator to input numeric or alphanumeric information. A nice touch is that if the destination of input is a string variable, then the BASIC kindly provides a pair of quotes which act not only as a prompt, they also save a little bit of keying.

There is one trap here for the unwary, and I fell into it. I had this nice little loop going and after a while I got fed up with it. Could I get out of the system - could I heck! I hit everything in sight but all I managed to do was crash the system (see earlier). The trick is that if you are in an input string loop, remove the quotes and then put in an arithmetic expression which will resolve outside the range - 32768 to 32767.

So, that's the BASIC - I reckon that it's pretty good under the circumstances and in some respects I prefer it to the BASICs that do all your thinking for you.

Documentation

This comprises a programming cum operating manual. It's very well presented, being written by Hugo Davenport of Cambridge Consultants, with appendices by the mystery man from Cambridge who wrote the BASIC interpreter. (A fiver to the first reader to identify this elusive gent.) There are a few small mistakes in the manual - none of them terribly serious and all of them being dealt with before the next reprint. Its probably good enough to learn to program from it and my only real criticisms lie in the area of what it does (or rather, doesn't do) for the MW beginner. I lent the machine to one such person for a few hours and here is his reply regarding the documentation:

``I read Chapter 2 (Getting Started) and got completely lost by the third page. One minute it's telling me how to wire everything up, the next there's something incomprehensible about storing programs on tape. I couldn't find an `Idiot's Guide to getting started' anywhere.''

Maybe the Operating Manual wasn't designed with such a person in mind. Even so, novices like him must surely represent a good sized chunk of the ZX80's ownership potential.''

Future plans

A new ROM is being developed which will overcome most of the shortcomings of the existing system. Being 8K instead of 4K means that file handling routines will enable us to read and write tapes - even discs! This new ROM will also include the missing trigonometrical, logarithmic and floating point arithmetic functions.

Another area of development is on the memory front. A 16K plug in dynamic RAM is a distinct possibility; this will be considerably cheaper than taking the present £300 expansion route. A printer is also likely to appear in due course.

Potential Use

In its present form the ZX80 offers an ideal introduction to computing. It makes BASIC easy to learn, it's small enough for it not to be intimidating and it's cheap enough that, should you decide computing is not for you, you can give it away, sell it or whatever. Indeed it's probably cheaper to learn BASIC this way than to pay for many of the courses around.

Teachers might buy it for their students' use because at the price there is no need to go through a complicated rigmarole to get the money. The 1K version can be used for fairly simple games and activities although it's likely you will want to expand it before very long. Later, when the file handling facilities are introduced together with floating point arithmetic, I think the machine will become really useful, though still very much at the personal level. Home accounts and engineering calculations spring to mind immediately - don't ask me why! Suddenly the machine becomes something more than a teaching machine or toy: it starts to become a real computer.

Conclusion

Having just read Science of Cambridge's claims for the machine again, I have to say I agree with most of them. The only point I would question is that it offers high resolution graphics. OK, OK, so they are playing the same game as everyone else . . . all the same I feel that it should be explained. Just lately, people have taken to calling pixel graphics, high resolution graphics. Accordingly, what used to be called high resolution graphics now has to be called ultra high resolution graphics. To put it another way, the ZX80 offers a graphics resolution of one quarter of one character, plus you must write your own software to be able to use it. PET is in exactly the same boat, unless you want to buy the high resolution add-on at about £300.

The ZX80 appears to be a well thought out machine both in terms of hardware and software. It has an excellent editor and interpreter which between them help you avoid all sorts of nasty pitfalls. The BASIC instruction set lacks one or two fairly important facilities - namely file handling and floating point calculations. Despite this, it's still a fine machine on which to learn about computing. The new ROM expected later this year will overcome the prime limitations leaving me very little to say except that I hope Mr

Sinclair and his merry men of Cambridge can cope with the expected flood of orders and, perhaps more importantly, the after sales service which is vital in this sort of operation.

Our thanks go to Clive Sinclair for lending us the machine, and to Jim Westwood (its designer) for patiently answering so many questions.