The Complete Spectrum 02

Download as pdf or txt
Download as pdf or txt
You are on page 1of 56

The COMPLETE PART 2

All you want to know about the world's best-selling computer

ADotobose
Publication
TURN YOUR COMPUTER INTO A PROFESSIONAL
GAMES WRITING MACHINE FOR FUN AND PROFIT!
LASER BASIC adds 100 new commands to Sinclair Basic.
These extended commands are semi-compiling so graphic animation
— is extremely fast. LASER BASIC
——— includes, extended interpreter,
/ sprite/graphic designer, fully
7 documented program and 2 sets
pre-defined sprites.
• Up to 255 software $prltes can be defined, each with its own
user selectable dimensions (up to 7 screens wide!)
.rTUORC iPRXTt:
• Operations can be carried out, on or between screen
windows, sprites and sprite windows;
• Sprites can be block ‘PUT’ or can use one of three logical
operations - AND, OR and XOR.
•• Sprites and screen windows can be pixel scrolled in any
direaion, mirrored, enlarged, spun. Inverted or cleared.
• Procedures with local variables and parameter passing.
• TRON and TROF (trace facility).
• 16 bit PEEK and POKE.
• RENUMBER and REM renumber.
• Non destruaive MOVE with 2 frame anirnatlon.
• Collision deteaion and pattern recognition facilities.
OUT NOW FOR THE SPECTRUM 48K/
SPECTRUM+ ON CASSETTE ALSO

£14.95
available

NOW!
Microdrive compatible.

A new qge dawns! The arrival of


LASER BASIC: first in a powerful range
of development tools for fast
programming brought to you with the
combined skill and resources of
Ocean and Oasis - (producers of
“White Lightning’!)
Other, easy to use products in this
expanding range will include screen INTERACTIVE' SOFTWARE
artist/designers, music composers and
machine code emulators to make your
pro^amming more rewarding and
exciting.

PMnS. Telephone: 061 6'63#l:el“66^W^


In Pdrt IWo...
N

30 Beginners
Variables come under the microscope. We show how to use them in your first program.

Discovering Discs
Planning on buying a disc drive? Here’s all you need to make up your mind.

u:
^ J
...... ...^ vv ■ -V -- ^ - - -i ; ... .■„„;, - ....

Microdrives
■ ^ The facts about them and how to make the most of the additional commands.
----^-

C3 Monitoring the video


Confused by composite video? Helpful hints to bring better colour to your screen.
---- y

C4 INK and PAPER ]


All the colours of the rainbow. The Spectrum’s shades in graphic detail.
- ■ ■• ... . . . . .. . , . .„ J
-

Ready reference
57 Get the facts at your fingertips as we summarise the Spectrum’s graphics commands.

. .............—...—-—---—-----N ■

p-icp

’ooo—
00—0
■*■■—00
CO Take a byte
Take the mystery out of the way your Spectrum handles binary numbers.

^^^P^,A;^j^tforward graphic pregram ^pl}f esfiamed in line by line detail.

' .. •. • " ' ' .......*wn.rr.n..r.rnrVMnrn.,.n.nn.n,,.un»^^^ .


. . . ...

A ^ Get things moving


Animation can enliven any screen display — and it’s much easier than it looks.

. ........ ."'■'■'I
AA code
Start machine code programming by learning how to PEEK, POKE and CALL.

^..."" ... ....nun,u^..^^..u.un.U.,«........ ^

70 Upgrade
" Short of memory? Here are some of the options to expand your RAM power.

' -------------- — ------------------■■»“---^—V

yy Looking into books


m mm Read all about it. A personal selection of the best Spectrum books now available.

is published by ^ Database Publications Ltd. No material News trade distribution by


p. m Database Publications Ltd, reproduced in whole or in part without Europress Sales& Distribution Ltd,
«1 i r 4 1 J t I 1 Europa House, 68 ChesteT Road, written permission. While^e^ care is taken. ,, Crawley,
IsPE bjLAilriLu^^ Haiel Grove, Stockport SK7 5NY. P‘‘‘>lishers cannot be held responstble for west Sussex RHIO 6AF.
articles, listings or advertise- jgj. 0293 27053.

The Complete Spectrum i 37


\A9nture forth
with variables
GETTING the Spectrum to do things is easy, so long
as you know the words to use and how to use them
properly. By now: Part II of our comprehensive
PRINT “a string”
hands-on guide for the beginner
PRINT 2*3
PRINT “My name is Peter”
PRINT (2+5)*7~I
PRINT 2+5*(7-I) when:

should give you no problems. If, however, you find it 2


difficult to explain why the last two sums give different appears. What’s happened here? Previously when we
answers despite being made up of the same numbers, tried:
read the panel on operator precedence below.
PRINT X

LETting on about variables we got an error message. Now, somehow, x stands for
2 and when we use PRINT on x we get the number 2 on
On the L key of your Spectrum you’ll see the keyword screen. What’s happened is that the:
LET. When L is pressed in response to the flashing K
cursor, LET appears magically at the bottom of the LET x=2
screen, use it to type in:
has told the Spectrum that from now on the letter x will
LET x=2 stand for the number 2. Anywhere an x: is used in a
and press Enter. All you get for your trouble is an OK PRINT statement - and in other statements as we’ll see
message at the bottom of the screen and that’s it. It’s - the Spectrum knows that it stands for 2. Notice that
not too impressive until you try: it’s:
PRINT X PRINT X

and you’ll see that the operations can occur in c


Operator precedence any order. They give the same result. f
However when the plus/minus and multiply/
This is rather a grand name for what is, at this divide operators are mixed up in one sum, or r
level, usually common sense. Don’t worry if you expression, then we’ve got problems. What if we
don’t follow it first time. It’s one of those things are asked: “What is six plus eight multiplied by
that when you need to understand it, you will. two?” Is it 14 (6 + 8) multiplied by 2, giving 28 as ^
It should be fairly clear that: the result, or 6 plus 16 (2 x 8) giving 22? We get
PRINT 1+2+3 two different results depending on which
operator is obeyed first. To sort this confusion i
and out, we have to have a rule and it is:
PRINT 3+2+1
will give the same results. The order of the figures
Starting from the left do anything in
and which plus is dealt with first doesn’t matter
brackets first, then do all the divisions and
when the signs (or operators, as they are called)
multiplications, then do the additions and
are all pluses. The same applies to sums with all
subtractions.
minuses or a mixture of plus or minus. The order To put it another way:
of the operations isn’t important. Try:
PRINT 2—3+6 () comes before * and /
PRINT 2+6—3 which come before + and —
PRINT -1-2-3
PRINT -3-2-1
This is the rule the Spectrum follows when it
The same applies when the sum’s operators comes to evaluate expressions (solve sums) that
are all multipliers or dividers or a mixture of both. contain a lot of operators (+, -, and so on). In
Try: fact it’s the way we normally do our calculations
PRINT 2*3*4,3*2*4 without thinking about it. The trouble is that
PRINT 64/2/4,64/4/2 when we do start thinking about it the reasons for
PRINT 6*2/3,6/3*2 doing it this way seem a bit obscure! Take

38 / The Complete Spectrum


So, by using the keyword LET we can get the
Spectrum to give a number a label which we can use
later. Why we should do this will become clearer as we
learn more about programs and programming.

Variables vary
Let’s set up a variable called number with:
LET nuinber=3
So now, whenever I use number the Spectrum will
realise that it’s a variable name I’m using and substitute
the number 3 in its place. Try:
PRINT number, number*2, numbei^l

and you’ll get the answer


3 6
2
showing that the Spectrum has indeed used 3 wherever
The first uses a: as a label for 2, the second just prints
the number appeared. Now try:
out what it finds between the quotes.
So, when your Spectrum comes across a statement
LET number=4
like:
PRINT 2*x, x+4, x/2, x-x followed by:

it has no problems, provided that a previous LET has PRINT number, number*2, numbei^l
told it what x stands for. It just uses 2 wherever it finds The result is:
a: and carries on with the sum as before. To be formal,
the letter jc is what is known as an identifier or variable 4 8
name. The statement: 3

LET x=2 as now the micro has substituted 4 wherever it came

tells the Spectrum that you want to use a variable


named x and that, for the moment at least, its value is 2.
There are strict rules as to which variable names you Variable names
can use, as shown in the panel on the right.
The rules for numeric variables (variables that
stand for numbers) are simple but have to be
comfort in the fact that if you do your sums obeyed. A variable name can be made up of any
following the rule, you’ll get the correct answers. number of letters and characters, provided that it
So applying this rule to six plus eight begins with a letter. Punctuation marks and
multiplied by two we have: operators are not allowed. So:
6 + 8x2 number
sum I
giving:
are acceptable variable names but:
6+16
Isttime
which gives the answer: first*second
22
aren’t, as you’ll find if you try to use them in a
Get your Spectrum to confirm this with: LET statement.
You can, if you want, have spaces in your
PRINT 6+8*2
variable names, though the micro ignores them.
If we’d have wanted six to be added to eight So:
and then the result of that to be multiplied by two LET hours worked=10
we should use brackets as in:
is allowable and both:
PRINT (6+8)*2
PRINT hours worked
The part in brackets is done first, then the
multiplication. and
Try using the rules to solve the expressions: PRINT hoursworked
4X8+8/2+2
give the same result.
4x(8+8/2)+2
Finally, the Spectrum makes no distinction
4x(8+8)/(2+2)
between upper and lower case in variable names.
3x-7+21x2/7
This means that as far as the micro is concerned
1+2X2+3/3-3
the variable NUMBER is the same as the
and get your Spectrum to check your results. variable number which is the same as the variable
NuMbEr,

The Complete Spectrum / 39


One way of looking at variables is to see them as
labels attached to boxes or pigeon holes in the
Spectrum’s memory. The command:
LET hours=20

does two things. It sets up a box labelled hours


and puts the number 20 in it. Now whenever the
Spectrum is asked to do something using hours it
looks in the box labelled hours and asks the value
it Hnds there.
If now you enter another value for hours, say:
LET hours=15

then the box labelled hours now contains the


value 15. The number that used to be there is
there no more. The second LET has overwritten
it.
Now when the Spectrum comes across an
hours it goes to the box and uses the number it
finds there, 15.
The label is still the same, and it’s labelling the
same box. What’s changed is the value in the box.
And that is how variables vary. The name stays
the same, the value it stands for can change.

across number. The second LET has overruled the first show how the pay is worked out. When the variable
one. The variable number was 3 but it’s now 4. As you gets a value then the pay can be worked out.
can see, the value given to a variable name by a LET
isn’t a once and for all thing. It can vary as later LETs
give it a new value. And that is why they’re called A first program
variables. The name stays the same, the value it Let’s put what we’ve learnt about PRINT, LET and
represents varies. variables together and create a program. Type in the
These variables are powerful things. Try: following four lines, remembering to press Enter after
LET number=5 each one.
PRINT number,number+2, number-1 10 LET first=l
followed by: 20 LET second=2
30 LET sum=first+second
LET number=6 40 PRINT sum
PRINT number, number+2, number-1
If you find you ve made a mistake in a line that
and: you’ve entered, just retype the whole line again. On
LET number=99 pressing Enter, the new, correct line will replace the old
PRINT number,number+2, number-1 one.
The first thing you should notice is that instead of
Each time we get different results but each time the starting with a keyword, as was the case in our previous
print list: examples, these lines begin with a number. The next
PRINT number,number4'2, number-1 thing is that when they are typed in, nothing happens.
Entering:
stays the same. By the simple task of using LET to vary
the value of number the same print list can produce lots LET first=l
of different results. at least gives us an OK message. All we get for:
If you find the concept of variable strange it
shouldn’t be. We use them all the time. If I tell you that 10 LET first=l
I’ll pay you £2 for each hour you work then you know is a copy of the line on the screen. It’s the same with the
that your pay will be two times the number of hours other three lines. What’s happening?
you worked or, more formally: The rule is that when a statement is entered just by
pay=2*hours itself, the Spectrum obeys it immediately. When it
starts with a number in the range 1 to 9999, the micro
If you work 10 hours you’ll expect £20, if you work doesn’t obey the line but keeps it in memory as it knows
15, £30. As the hours vary, so does your pay. You’re it is going to use it later. So, as well as appearing on the
using hours as a variable. It’s a value that can change.
screen, a copy of:
One week it may be 5, the next 40 but whatever it is you
still know that by using that value in: 10 LET first=l
20 LET second=2
pay=2*hours
30 LET sum=first+second
you’ll get the right answer. The variable name is used to 40 PRINT sum
40 / The Complete Spectrum
be done quiet easily.
Editing programs
Whenever a line is typed in there is always a
chevron, >, between the number and keyword of
When you’re entering programs, you’ll often that line. So entering:
find typing errors creep in. What do you do if you
10 PRINT “Hello Mum”
wanted to enter the line:
10 PRINT 2*variable
and pressing Enter, results in:
lOPRINT “Hello Mum”
and you get something like:
10 PRINT 2*varable appearing on the screen. Adding a new line such
as:
which you obviously don’t want?
20 PRINT “Hello Dad”
If you spot your mistake before you press
Enter, then all you have to do is to use Caps Shift has the top of the screen becoming:
and the cursor control keys (5 and 8) in the usual
10 PRINT “Hello Mum”
way. While the line is still at the bottom of the
20>PRINT “Hello Dad”
screen it can be modified using the techniques
already covered. Notice that the chevron now points to the latest
If you’ve already hit Enter then things are line.
different. There’s nothing on the bottom line to It we’ve made a mistake and want to edit the
modify. The line sits there at the top of the screen line with the chevron, all we have to do is press
in all its incorrect glory. One course of action is to the Caps Shift key and the 1 key at the same time.
just type in the whole line again. The new line The result is that a copy of the marked line
automatically replaces the old line. So, if you appears at the bottom of the screen. There it can
had: be edited in the normal way. When it’s corrected,
10 PRINT 2*varable pressing Enter sends it back into the micro,
overwriting the old, incorrect line.
all you have to do to correct it is type in: However it s not always the last line we
10 PRINT 2*variable entered that wants correcting. Often we notice
that it is an earlier one. The remedy is simple. The
correctly. chevron can be moved up or down the listing
The trouble with this is that all your previous using the Caps Shift and 6 or 7 keys. Once the
typing is wasted. You have to type the whole line chevron is beside the line with the mistake. Caps
over again. It would be better if somehow the Shift and 1 transfer it to the bottom line to be
offending line could be made to reappear 'at the edited as normal. Once the line is modified,
bottom of the screen. Then it could be modified in pressing Enter sends it back to the micro,
the normal manner. The Spectrum allows this to replacing the incorrect line.

is held inside the micro. When the Spectrum is told to RUN something it
These numbered lines make up a computer program. looks in its memory for the lowest line number and
When the Spectrum is told to run the program, it looks executes that statement first. In this case the lowest line
for the line with the lowest number and obeys the number is 10 so the micro obeys the statement:
statement following that. Once that is done it looks for
LET first=I
the next lowest line number and obeys that. It carries
on, obeying each line in sequence, until it runs out of giving the numeric variable first the value 1. It then
lines to obey. Then the program stops. This is all a looks for the next line number and finds it is 20 so it
program is: An ordered set of instructions that the goes on to processing:
micro obeys, each one in turn.
LET second=2

setting up another variable second and giving it the


Running a program value 2.
The micro next obeys line 30, adding the values
If you haven’t already typed in: found in first and second and storing them in sum. It
10 LET firsts I goes on to line 40 and prints out the value of sum and
20 LET seconds2 then, running out of line numbers, the program stops
30 LET sumsfirst+second with an OK message at the bottom of the screen.
40 PRINT sum It may not be the world’s most stunning bit of Basic,
but it is a program, a series of numbered statements, or
and so got a program stored in the micro’s memory, do program lines, that are processed in line number
it now. Then get the Spectrum to execute the program sequence by the Spectrum. If you want to see the
by using the R key to get the keyword RUN at the program lines, or listing as it is called, then just press
bottom of the screen and pressing Enter. Enter after the program has finished running.
The result is that lines on the screen disappear and a Alternatively you can use the keyword LIST, found on
3 (the result of 1+2) appears. The message at the the K key, to display a program listing. We’ll be writing
bottom of the screen just tells you that everything some more programs in Part III, when we meet a new
worked properly. But how did the program work? Basic keyword, INPUT.
The Complete Spectrum / 41
Discovering discs
There is still an element of serial access while you
wait for the section of the track you want to spin
We help you decide on the disc around to the head, but it is much more like random
access, and discs are sometimes said to be random
filing system that’s right for you access.
The difference between the two methods can be
understood easily in terms of music recording if you
EARLY on in the development of computers it became compare a long-playing record with a cassette
obvious that tape storage had an inherent drawback. recording of the same music. It is much quicker to find
No matter how fast the data could be made to transfer and start to play an individual track on the disc than it
to and from the magnetic surface of the tape, there was is on the tape.
always going to be a lot of time wasted in winding Of course the computer disc drive cannot find its
through the tape to find the particular piece of data you way around the magnetic disc by looking for the little
were after. This is called serial access, and it is now gaps between the recordings like we do with LPs.
only used on large computers for security back-up However it kfiows exactly where each track is, and has
copies, although different priorities - that is low cost - the equivalent of an album cover to tell it what is to be
means it is usually the standard storage on many home found in each track. This is the disc directory, and it is
computers, the Spectrum being no exception. recorded on one track of the disc itself so it can be
However, by taking the same kind of magnetic constantly updated as the data stored on the disc is
coating material that is used on tape and spreading it changed.
onto a disc, a recording surface with as much storage The first disc drives had stacks of discs made of rigid
capacity as a piece of tape can be made. If one then material and eight or even 12 heads all moving together
arranges the recording tracks in concentric rings on the so that they could read bytes of data in a parallel
surface of the disc, very quick access to any part of the fashion instead of one bit at a time. Mainframes still use
data can be had by skating the record/playback head this sort of thing, but for other computers the size and
across the surface to the desired track. This is called cost of discs have been dwindling constantly.
random access: You go straight to the data you want. Discs made of thin flexible material with a protective

1 Buy RiMronics
1 Wafadrive 1 money

42 / The Complete Spectrum


sleeve were developed which could be removed from type of disc. This is a drawback in terms of software
the drive, replaced with another disc holding a different availability, as manufacturers find it inconvenient to
set of programs, or even sent through the post. These supply their products on a lot of different media.
“floppy” discs hold less information and are scanned Transferring software from tape to disc is seldom
by only one or two recording heads, so the transfer of straightforward, as the publisher will often go to great
data is slower. However their lower cost makes them lengths to protect against copying, even though they
more practical than the permanently installed hard will not provide their product on disc themselves.
platters for the general run of small computers. Most people buy a disc drive for rather more serious
Miniature hard discs are available even for personal purposes than loading arcade games at a higher speed.
computers, but they cost a good bit more. Such software support as you find for discs, therefore,
Smaller discs means less magnetic surface to record usually comes from the producers of serious utility
upon, but technical advances in recording materials software.
and techniques has partly made up for this, and even Other compatibility problems can arise when using
the new shirt-pocket-sized discs can now be made to two items with “shadow” ROMs on the same
hold up to half a magabyte. computer. Most discs will clash with microdrives, for
A few years ago no serious computer user would instance, and the microdrives themselves sometimes
contemplate committing his data to anything less than clash with the VTX5(X)0 Prestel modem. If you plan to
an eight inch floppy, but now there is even an IBM PC use complex stacks of equipment it is wise to check
with 3|in discs. compatibility with the supplier before you buy.
Sometimes a modification is available.
What’s available?
Opus Discovery One
A GOOD many add-on disc systems have become
available for the Spectrum in the nearly four years that This is a complete upgrade all in one box. Besides a
the computer has been around. Some that appeared disc drive you get a Centronics parallel printer port, a
have subsequently disappeared. At least one was Kempston compatible joystick interface (buy the stick
advertised for months in full page colour magazine separately) and a monochrome video output. The disc
spreads complete with price list and order form without is the widely-used Sony designed 3 jin type, and there is
ever actually appearing. However the ones we list for a space to have a second disc fitted in the largish Opus
you have been around for a while. Some of them are box. The edge connector is carried through for the use
even beginning to get some software support! of other add-on peripherals.
None of the drives available are compatible with There are a few minor drawbacks. The printer port
each other, in fact, they mostly don’t even use the same uses an edge connector rather than a proper amphenol

Centronics port^
More preferable to
than £120? high capacity and
^Magic Button?^

Beta-Plus
ijgSmes?

Triton QD i
1 “
Opus D iscovery

The Complete Spectrum / 43


The Beta-Plus does not use the microdrive syntax,
but something very like the cassette commands.
Instead of just extending the Basic to give extra
commands, the disc operating system is quite separate
and you switch between Basic and DOS, depending on
which functions you are using. Sometimes this
switching is done automatically, as when you load an
auto-run program from disc, and sometimes you do it
by entering a command.
There is a detailed catalogue with complete
information on every file on a disc, and you can rename
files. The DOS uses the printer buffer for workspace
and restores the contents after use, so there is no
memory overhead to make transferring programs from
socket, the video output is monochrome, not colour, tape difficult.
and the box is designed to fit the Spectrum rather too This is the only disc interface I know of that will
snugly - fine with either the original Spectrum or the co-exist with microdrives should you wish to use
Plus, but the access is too cramped for most upgraded Interface 1 for its network or RS232 ports. If you want
keyboards. A ribbon cable extender for the edge to use it with the VTX5000, ask for the modified
connector may be necessary. version.
The Discovery provides 170k of formatted storage
per disc, which is a reasonable sized filing cabinet, Triton QD
almost twice the size of a microdrive cartridge. The
discs themselves are more widely available than the The Triton QD (Quick Disc) is a cheaper unit than
other sub-five-inch media, and software is being made the Opus or Beta, but it has lower capacity and no extra
available on Opus format disc now. ports. It is possible to have two drives just by buying a
second Triton and chaining the edge connectors.
The operating system is in a shadow ROM
The Quick Disc is a smaller disc than the Sony type
working in much the same way as the microdrive
Interface 1. Opus has used the same command syntax (2.8 inches) and not as widely used, hence it is less easy
as microdrives in an effort to be compatible with to find the media in the shops. The drive has a flip up
software that is designed to use microdrive. This does door like a cassette unit, and like a cassette, the disc can
not work unless the commands are given in Basic. be turned over to play the other side. This means that of
the 100k capacity given by each disc, only 50k is
Machine code cleverness used in some microdrive-
compatible software will fail on Opus discs. available as a filing cabinet at any one time. This is just
Commands can be simplified in Opus syntax to save big enough for the largest Spectrum programs, but too
the typing fingers. It does this by defaulting to the m or small to be practical for filing systems.
drive channel, unless a different channel, like RS232, is One advantage of the Triton drive is that its
specified. This means that the specifier and associated catalogue function gives a lot of extra information
punctuation can be omitted from most commands. about file type and size. Another plus is that the disc
operating system doesn’t move the start of the Basic
Technology Research Beta-Plus program area the way that the microdrives and some
other discs do (it uses the printer buffer for workspace
The Beta-Plus is so named because it is an improved instead). This means that there are no memory
version of the original Beta disc. This disc interface problems when transferring a large program from
allows you to connect a number of different BBC-type cassette to disc. This disc was very fast on test.
disc drives to the Spectrum. This does not mean that The Triton operating system is, again, in a shadow
you can share files with the BBC Micro, only that the ROM, but the command syntax is different from
drives are readily available. You can have one to four microdrive, without being an improvement. It is no
drives, which may be 5 j or 3 jin, single or double sided, easier to type and some commands cannot be used
and 40 or 80 track, to provide megabytes of on-line from within a program.
storage.
The Plus in Beta-Plus consists of an updated disc Rotronics Wafadrive
operating system (DOS) in ROM (well, eprom
actually) and a Magic Button which allows you to The Wafadrive is not strictly a disc, but a tape
transfer cassette-based software to disc without getting spooler similar to the microdrive. The cartridges are
involved in protection busting. Some would say that the larger and more robust then microdrive cartridges, and
Magic Button does the protection busting for you, but they come in three capacities, 16k, 64k, and 128k, the
this device is not a gift to the pirates, as the disc copy smaller capacity sizes giving quicker loading times.
cannot easily be converted to a pirate tape, and you The Wafadrive is slower than microdrive, and it
need the disc operating system to run the saved needs a 2k workspace - four times as much - which
program. makes transferring large programs from tape more
Pressing the Magic Button saves an instant snapshot difficult, maybe impossible. However for about the
of the whole of the Spectrum’s RAM onto disc. This same price as an Interface 1 and a single microdrive
may be done at any point in the running of a program, you do get two drives as standard, and the Wafadrive
so it can be used to store a partially-completed word has both Centronics and RS232 printer interfaces
processing session or an adventure game in mid flow, fitted. You also get a free word processor thrown in,
to be taken up on the following day right where you left which is important, as other word processors won’t be
off. A drawback for the clumsy is the fact that this save set up to use Wafadrives.
takes place whenever the button is pressed, overwriting Wafadrive uses microdrive syntax, but allows a
any priceless program or data already stored on the short form by defaulting to the drives, like the Opus
disc. Backup, backup, backup! disc.
44 / The Complete Spectrum
MicFodrives:
What are th^?
than disc equipment. There are extra interfaces on the
microdrive equipment for the Spectrum network and
All the facts about this low-cost, RS232 printers. And, possibly the most significant
fast-loading alternative to discs point, some software such as word processors and
programming languages may be especially configured
to work with microdrive but not with disc.
The most important disadvantage is reliability, or
rather a degree of unreliability. Even those who swear
by microdrives admit that the cartridges must be
THE microdrive was originally conceived as a cheap handled carefully and that regular back-up copying is
alternative to disc drives. Unfortunately for Sinclair, it essential.
took rather longer than had been expected for both the There are those who point to the QL and the ICL
hardware and firmware to be brought to a point of One-Per-Desk as indications that microdrives are a
reasonable reliability, so they didn’t get quite the start success and here to stay. Others point to the QL and
they hoped for, and now the price of disc drives is One-Per-Desk and say that these computers would
dropping to the point that microdrives no longer look have sold much better with a single built-in disc.
amazingly cheap. Nevertheless, for the Spectrum they are the standard
However they do offer advantages over discs. Both fast-loading upgrade, and they are certainly as fast as
the drives and the cartridges are much more compact most discs, indeed faster than some.
switches in this ROM whenever it senses certain
The hardware addresses on the Spectrum’s address bus, smoothly
To use microdrives you must have the Sinclair taking over from the main ROM inside the Spectrum.
Interface 1, which slots on to the Spectrum edge There are at least three different versions of the
connector and pretty well hides under the computer. Interface 1 ROM. The later ones have fewer bugs and
The edge connector is carried through for other run the drives a touch faster on some commands. One
add-ons to be stacked. Other connectors are provided, major bug does remain. If you try to LOAD a Basic
including a pair of 3.5mm jack sockets for the program that is too big for the memory the machine
Spectrum network, and a non-standard RS232 pocket. crashes.
The microdrives themselves are attached by means of This can happen with Basic programs written on a
a second, smaller edge connector on the left hand side. Spectrum without microdrives because Interface 1
Up to eight drives may be neatly stacked together and moves the start of the Basic program up about half a k
plugged into this connector, but one or two are usually to make room for its workspace. Obviously this leaves
less room for programs, but the ROM^ routine that
enough for most of us.
The drives are tape spoolers that drive an endless checks that there is enough room to load a program
loop of tape at high speed past what appears to be a does not take account of the workspace. This can also
normal cassette tape head. The tiny microdrive occur with smaller Basic programs if RAMTOP has
cartridges - 3.5 by 4.5cm - contain about 11 feet of been moved.
tape on a single spool, which feeds through by pulling The latest version of the ROM is supposed to work
out from the middle of the spool and winding back on better when using the network to link a Spectrum to a
to the outside. This method of tape handling imposes QL, but there are so many versions of the QL ROM as
more stress and wear on the tape than a normal audio well that it is hard to say anything about this for sure.
The QL can use Spectrum microdrives as extra add-on
cassette, so the tape used is the more robust material
drives, and it uses the same tape cartridges, but the QL
used in video cassettes.
apparently formats the cartridges differently, so it
cannot read cartridges written on a Spectrum, or vice
The firmware versa.
The extra commands used by the microdrive, Unfortunately, the Interface 1 ROMs come soldered
network and RS232 port are handled by a new ROM in rather than socketed, so you won’t be able to just slot
in Interface 1. There is a circuit in Interface 1 that in the latest one, even if you can find a supplier.
46 / The Complete Spectrum
1
t

1
I
storage and retrieval of data
with the microdrive filing system

MOST people, when they contemplate upgrading from


cassette-based computing to microdrives, or even
discs, are thinking primarily of an increase in speed.
There is another advantage, though. Microdrives and
discs have a filing system which provides much greater
flexibility and convenience in the way you store and
retrieve software and data.
With cassettes you have to start and stop the tape
recorder manually and rewind it to get back to the
beginning. You have either to keep just one program on
each tape, and sort out the one you want by hand, or
wait for the tape to play through programs that you
don’t want while the computer watches for the right
program to come under the head of the tape.
With microdrives and discs the drive is started and
stopped by the computer, and there is no need to
rewind. The filing system keeps a directory or
catalogue which tells the computer where various
programs and data are stored on the media, so it can
pick out a program by name without a long search.
This is particularly handy when you are using serious
software like a word processor, which typically does a
great deal of storing and retrieval during a single
working session.
Besides saving and loading programs, you can store
data from a program on microdrive. To do this you
open a channel to the microdrive, print the data to that
channel, and close the channel. To read the data later
you open the channel and input the data. You can also
send one channel to another with the MOVE
command, which allows you to send a microdrive data
file to the RS232 printer port, for instance. Channels
may also be set up to move data between microdrives
and the network.
Using the Spectrum channels is not simple, but it
allows great flexibility in the handling of data output
from the more serious type of software. You might
never actually enter these commands directly, but if
you use one of the word processor programs that
works with microdrives, it may well employ them.
In practical terms the increase in speed gained from
using microdrives comes not merely from the speed of
the drive but from the fact that you need no longer
scrabble through a pile of unmarked cassettes and mess
around with play and record buttons. Sophisticated
applications like databases can take care of loading
and saving their various bits and pieces without even
consulting you, let alone prompting you to rewind a
tape.
Of course, the usefulness of a filing system is
dependent upon the size of the “filing cabinet”. A filing
system that can only deal with one or two files is
obviously no use at all. The microdrive will allow over
50 different file names in the catalogue for each
cartridge, although only the first 50 are displayed by a
CAT command.
However the cartridges only hold around 90k of
program or data, so it is doubtful that you would ever
have occasion to use more than a dozen different file
names. 90k is just 10k short of the smallest disc
capacity in common use (on the Osborne or BBC
computers, for instance) so while it is not commodious,
neither is it impossible. You may find that serious work
requires at least two drives to keep manual cartridge
changing to a minimum.
48 / The Complete Spectrum
Little Brothers should
be seen hut not heard.

REGULAR, CONDENSED, OR
EXTENDED FACES.

CUT SHEET A4 OR ROLLER


PAPER.

BATTERY OR MAINS
OPERATED.

A maxim which eloquendy describes the most home computers and popular software.
Brother HR-5. Perfecdy portable, the battery or mains operated
Less than a foot across, it’s nonetheless loaded HR-5 weighs less than 41bs.
with features. Which is really something to shout about
But there’s one thing the HR-5 won’t give you.
Earache. I PLEASE SEND ME MORE DETAILS OF THE REMARKABLE BROTHER |
HR-5 PRINTER
For the annoying ‘clickety clack’ many printers
NAME
produce is mercifully absent from the HR-5.
ADDRESS.
Quiedy efficient, it delivers high definition dot
matrix text over 80 columns at 30 c.p.s.
The HR-5 also has something of an artistic bent
Being capable of producing uni-directional
graph and chart images together with bi-directional
L- TELNO..
-j
text
It will also hone down characters into a
condensed face, or extend them for added emphasis.
Incorporating either a Centronics parallel
brother,
or RS-232C interface, the HR-5 is compatible with The future at your fingertips.
DEPARTMENT P, BROTHER OFHCE EQUIPMENT DIVISION, JONES + BROTHER, SHEPLEY STREET, AUDENSHAW, MANCHESTER M34 5JD. TELEPHONE: 061-330 6531.
TELEX: 669092. BROTHER SHOWROOM: 83 EUSTON ROAD, LONDON NWl TELECOM GOLD: 83: JBC002. BROTHER INDUSTRIES LIMITED, NAGOYA, JAPAN.
St

jSnOOK WHAT THIS, surname:


record no. 1
SURNAME: ^NDR^^^g
first name,
address
road
- ^foRD
pibst name. l-^^ne address.^*

PACHACe CAN PO! adqpess^-

age: AC
/'vaF: ^-
^^efcPOOL telephone:
age: 1-'

record no. -
--

W» t.D PROCESSOR - Ideal for writing record no.


first name.
peter „
road
address^: -rrfORO
letters or reports! Features: Constant time first
^ODRESSl: ^refORD
elF RO^^ address-.
telephone. --
ADDRESS
ADDRESS :
. 2 3 62 ..1
, i_ C.A AGE:
display • Constant word count (even Ttri EPHONE:
telephone.

age: 1'^
--

shows words per minute) • Normal or record no. -

record no. SURNAME: ^ rtH

double-height text on screen or printout. first name:roAD


ADDRESSI: ^^rr^nGTON
address.^-
telephone: ..- 9
S. READSHEET - Use your micro to PEUEFHONE. s-
AGE: 30

AGE:: 27
27
manage your money! Features: Number record no.

display in rows and columns • Continuous record no. ^


brown
LOS-

updating • Update instantly reflected ECO .


rfeSV. no;,-'-" B'
PELEPHONE-- S '
5
euE^;^ ,, .,
throughout spreadsheet • Save results for telephone:
ttRE: -S
age: 21

future amendments. record no. 5

record no. SURNAME:

GRAPHICS - Turn those numbers into SUBNfttlE-.


first NAME.
ADDRESS^- NANTWICH
rqa

first name: address-- gi.450'1


an exciting visual display! Features: 3D ADDRESSI^;
address^-
here?"
.telephone. -
ORO
^ ^_^,23A.il
telephone.
age: 11 —

bar chart • Pie chart • Graph. age:


rwfiF S 13
13

D^T.-.B-iSE - Use it like an office filing


cabinet! Features: Retrieve files at a
keystroke • Sort • Replace • Save
. and it’s all at
• Print • Search. price of just
I
, EASY TO USE
_G_-
JULY
JUNE
-f,9.89 46.4^
MP»RCH ftPRlL
91.37
91.37
■WC 40%^-'
-oloo 30.00
38.02

295
:;:;Q'no"" B : l

4136.72
2850.14

403.60
180.69
■348.62 -.49.70
276.91 109.83 106.07'
101.61

234.68
"139.21
'113.95 "l67.18

85.46
"l04.40
55.73 GRAPHirR
34.80
20.49
^OT RL
Page 1
spent

Of the
Showing tho ^ '^^'ocessot'
^PPtions avaiiablo^^ »^^'intout lafc

1 ab 1 ^

_i_ road
4GT0N
B0923

lemonstraf 1
T—= -i.bbr!°^^-cE ssor showing

OTBU SPEHT
M
^^7

. copy/copies of
Mini Office for Spectrum 48k/Spectrum +
□ I enclose cheque made payable to
Database Publications Ltd.
for £_
I wish to pay by
□ Access □ Visa No. __ .Expiry date.
Signed____

the unbelievable Name __


Address __

Post to: Mini Office Offer, Database Publications,


CASSETTi DATABASE SOFTWARE 68 Chester Road, Hazel Grove, Stockport SK7 5NY.
SOUND IDEAS FOR TOOK
SPECTRUM
he Three Channel Sound Based around the popular AY-3-8912
Synthesiser interface sound chip it gives you complete control
incorporates a BEEP audio (from basic or M/C) over 3 channels of
amplifier and a 3 channel sound tone and/or white noise, plus envelope
synthesiser. and volume control. It comes with its
The BEEP amplifier improves the sound own pod mounted (4") speaker with 1
quality and output of the BEEP metre of cable so that it can be
enormously. The 3 channel sound positioned anywhere.
synthesiser adds a totally new Once this is fitted to the expansion port
dimension to sound on your Spectrum. your programs will never sound the
It allows you to program your own music same again!
with harmonies, explosions, zaps,
chimes, whistles and an infinite range of
other sounds over a full 8 octaves.

Please rush me the following

.Three Channel Sound


Synthesiser Interfaces @ £29.95 each
Please add post and packing.
W/ I enclose cheque/PO/Cash for .Tot
X or debit my Access/Barclaycard No.

f Signature Name

Address
Or send S.A.E. for the New D.K.Tronics Spectrum Catalogue

‘‘Available direct or from good computer shops anywhere”

d^lronks
DK Tronics Ltd., Unit 6, Shire Hiil industrial Estate, Saffron Walden,
Essex CB11 3AQ. Telephone: (0799) 26350 (24 hrs) 5 lines
Microdrives:
The commands
expioined
Saving and Loading
SAVING and loading with microdrives obviously The special commands you’ll
requires different commands from the ones used for the need when you use microdrives
cassette recorder. There are a number of reasons why
the syntax of the new commands has to be more
complex than the old. For one thing, something must
be added simply to distinguish the microdrives from the
tape. Then the existence of the filing system means that
you must use a program name when loading, as there MERGE and VERIFY
are likely to be several programs on the cartridge, in no
particular order. You can MERGE or VERIFY Basic programs from
Furthermore, you can LOAD and SAVE from the microdrive in the same way as with cassette. However
network port and the RS232 port, as well as from the programs that have been saved to microdrive with a
drives, so more identifiers are needed to specify them. RUN-on-LOAD line number will not merge. This fact
And finally there are extra functions associated with a allows commercial programs to be protected from
file structure, such as formatting and cataloguing, copying.
which need their own instructions.
All the necessary extra bits, plus a deal of
punctuation that seems quite unnecessary but cannot Formatting
be omitted, makes the syntax of the new commands
long winded and unwieldy. There is, however, one When you buy a new blank microdrive cartridge the
quick short cut that can be used to good effect. If you first thing you must do is FORMAT it. This process
put a program with the name “run” on a cartridge, it runs through the loop of tape, testing it and placing
can be loaded automatically just by giving the markers on it, and makes a map so that the computer
computer a RUN command. This only works if the knows which parts are usable and which it should
RUN is the first command given after power-up or a avoid, such as the join where the loop is spliced. When
NEW, but it is very useful all the same. formatting a cartridge, you can give the cartridge itself
Many people write a little menu-driven loading a name which will appear in the catalogue.
utility and put it on to every cartridge, giving it the Some experts recommend that you FORMAT the
name “run”. This program displays a catalogue of the cartridge several times on the trot when you first get it,
cartridge and prompts you to type in the name of the to give it a good workout before committing any
program you want to load, without all the complicated program to it. You will find that each time you format a
bits. Such a program might go like this: cartridge it will format to a different capacity and you
may wish to maximise the storage available by
lU CAT 1
20 INPUT “NAME TO LOAD? ”;a$
30 LOAD ♦“ni”;l;a$
40 STOP
100 SAVE ♦“iii”;l;“run” LINE 10
110 REM Line 100 used to SAVE this program
As you can see in line 100, when using microdrives
there is a lot to type before you even get to the name of
the program. The asterisk (*) is used to kick the
Interface 1 “shadow” ROM into life. The“m” specifies
microdrive rather than network, and so on. The 1
indicates that it is microdrive number one you are using
(this is needed even if you only have one). The “LINE
10” part is exactly like the cassette command - it
makes the program run from line 10 automatically
when it loads.
The quotation marks and semicolons sprinkled
through the syntax are only there because the
Spectrum is using the same ROM subroutines to
process microdrive commands as it uses for PRINT
items, so you must include them even though they
convey no essential information.
formatting repeatedly until you get a high figure for
storage capacity (use the CAT function to find out the Standard Spectrum channels
capacity). You usually get about 90k of storage on
-—-------
each cartridge, and if a new one won’t give you at least
85k it is substandard. k The keyboard in input or the lower screen in
Formatting a cartridge erases it completely, so once output. (Obviously you can not output to the
you have put a program on a cartridge you must take keyboard or input from the screen.)
care not to use FORMAT accidentally. You may think s The upper 22 lines of the screen, output only.
that it is an unlikely mistake to make, but it has P The ZX printer, again output only.
happened to others!
The FORMAT command is also used to set the At---—-
baud rate for the RS232 port and to assign station Interface 1 extends the number '
numbers for the network. ofchannels, adding:
---——-'
The Catalogue t Text output via the RS232 port. Used for
listing, doesn’t send unprintable characters,
Each cartridge has a catalogue kept on it which is
and expands Basic keyword tokens into
automatically updated to include everything you save
spelled out form. Works in input but ignores
to the cartridge. The command CAT 1 will give you a
8th bit. Must have baud rate set with
list of the programs on the cartridge in drive 1, plus the FORMAT.
name you gave to the cartridge itself, and the number of b Binary data in and out via the RS232 port
kilobytes of space left free.
(full eight bits). The baud rate must have
The catalogue unfortunately does not tell you which been set with FORMAT.
names on the list are Basic programs and which are n Network input and output, requires a
blocks of code or data. If you try to load a ‘‘program” station number.
which is actually a code block, and so on, you will get a m Microdrive in and out, requires drive number
“Wrong file type” error report, but it still won’t tell you and file name.
what the file actually is. It is also possible to save a file
with an invisible name, which puts an even greater Figure I
strain on the memory.
technique is, the more difficult it will be to understand.
Still, this is often the case, and so it is with the Extended
Erasing Basic commands for channels and streams.
There is no need for an ERASE command with Behind these fluvial names lurk even more
cassette storage since you merely record over the old complicated machine code data manipulation routines.
program, but you need a way to remove redundant files The names are meant to simplify things by
from the microdrive. Formatting wipes all the concentrating the mind on the function of the
programs on a cartridge, but by using the ERASE commands, rather than the intricacies of the
command you can remove just the one named computer’s operations.
program. Channels are devices that data can be sent to or
This is particularly necessary when you are in the received from. Streams are the routes that the data
process of writing a program and saving moves along. These are logical devices and routes, not
partially-completed versions to microdrive from time physical ones. Each channel is an input or output
to time. Unless you give each save a new name, which routine in the Spectrum or Interface 1 ROM, and the
will quickly fill the cartridge, you will have to erase the streams are really a way to assign labels so you can
old version before saving the new one. This is because pick which channels you wish to use.
the microdrive cannot have two programs in a There are 16 possible streams in the Spectrum, but
catalogue with the same name. How would it be able to the first four are already assigned to link various
choose between them when loading? channels used by the normal Basic commands. PRINT
Microdrive cartridges can be protected against for instance uses stream#2, which is linked to the upper
accidental erasure by removal of the write protect tab. screen output channel. When you use PRINT#0 or
This is much the same as the record prevention tab on a PRINT i^l, you divert the output via the streams
cassette - it stops not only erasure and formatting, but ordinarily only used by the Basic editor, and the print
any saving operation as well, so it is only of use for appears in the lower two lines of the screen.
permanent program storage, not for changeable files of You can assign the streams from 4 to 15 to any of
data. the channels by using the OPEN # command and
CLOSE#will close it again. CLOSE#is important,
especially with microdrive data files, as just printing to
Channels and Streams a file does not actually put the data on the cartridge
until the file is closed. The channels are identified by
The Extended Basic in the Interface 1 ROM has single letters enclosed in quotes. These letters and the
powerful facilities for directing the flow of data from channels they represent are shown in Figure I.
one device to another, called channels and streams. By assigning a stream to the RS232 “t” channel and
Actually these are at work in the standard Spectrum as LISTing to that stream, you can LIST a program on a
well, but they are transparent to the user - that is, you full size printer. Or you can PRINT to the stream. You
don’t notice them. When the Interface 1 is fitted you can even send the catalogue down the stream with a
can program the channels and streams to very useful CAT command, to print out the microdrive catalogue.
purposes, and the people you buy your software from When saving and loading programs to the
can use them to make life easier for you. microdrive you don’t have to open a stream, you just
There is, as far as I know, no law of programming use an asterisk after the SAVE or LOAD, followed by
that states that the more powerful and flexible a the microdrive identification bits and pieces. However
50 / The Complete Spectrum
handling a data file is made easier by using streams. one that has been left out is a rename command. If you
You can open a stream to a file on the microdrive and want to rename a program or file on microdrive, you
then PRINT the data to the file via the stream. have to save it under the new name and erase the file
with the old name.
The MOVE command
MOVE will move data from one channel to another,
Cartridge care
via the assigned streams. This is a very flexible The tape in microdrive cartridges is subject to a good
command which can send a microdrive file to the deal of wear. There is nothing you can do about this
screen, the network, or even another microdrive file. except make sure that you don’t lose your programs
You could even use it to connect the keyboard directly when the cartridge expires. You do this by making
to the RS232 printer port. MOVE will open and close back-up copies. The back-ups don’t have to be on
the streams automatically, but it only works on data. cartridge, cassette tape will do. You aren’t supposed to
To send program files whizzing around the place you use them, just keep them safe to avert a disaster when a
must first load them and then SAVE or LIST them to cartridge goes wrong. This advice applies to discs, too,
the stream of your choice.
but many people have reported more than usual
More information on how to use the various reliability problems with microdrives, and extra care is
channels and streams associated with the drives, warranted.
network and RS232, is in the manual that comes with
You must not turn the power to the computer on or
the microdrives. Luckily, you won’t need channels and off while a cartridge is inserted in the drive, nor remove
so on to begin with, or maybe ever, because this part is a cartridge while the drive is running.
not simple. A number of books have been written to try These actions are almost certain to corrupt at least
to make the microdrives easier to understand, but part of what is stored on the cartridge and make it
whatever you do, don’t lose the manual. unreadable.
The cartridges are mechancially delicate
and should be kept in their cases when not in use.
Ashtrays, cups of tea, and the tips of magnetic
Most of the facilities offered by disc operating systems screwdrivers all display a disturbing attraction for
are available in the microdrive’s Extended Basic. The unprotected cartridges.

Microdrive command summary


CAT X 9 key, Ext Mode LOAD *channel;options Jkey
Lists the files on the cartridge in microdrive number x. Loads from channel “b”, “n” or “m” (specify). Options
Use CAT # 3;x to list on ZX printer. are usual load options. Usual form is LOAD
*“m”;l;“name” for loading program “name'' from
CLOSE #x 5 key, Ext Mode microdrive number 1.

Closes stream x. Sends any data left in buffer to file or MERGE * channel;options T key. Ext Mode
network.
Like cassette MERGE but from channel specified.
ERASE “m”;x;“name” 7 key. Ext Mode

Erases file “name” from cartridge in microdrive x. MOVE xTOy 6 key, Ext Mode
Moves data from x to y, where x and y are either stream
FORMAT “m”;x;“name” 0 key. Ext Mode numbers of channel identifiers. Streams are
automatically opened when x or y are channels. This
Formats cartridge in drive x, and names it “name”.
command will not terminate until an end of file marker
This erases anything already stored on the cartridge.
is reached, and this only happens when the source is the
Every cartridge must be formatted before it can be
used. network or microdrive.

FORMAT “n”;x 0 key. Ext Mode OPEN #x 4 key. Ext Mode

Sets the network station number to x (range 0 to 64). Opens stream x. Stream should not already be open.

FORMAT “t”;x 0 key. Ext Mode


PRINT #x;items Pkey
Sets the baud rate for the RS232 text channel to x. Use
Prints usual print items via stream x.
“b” instead of “t” to set the binary channel. Must be
standard baud rate: 50, 110, 300, 600, 1200, 2400,
4800, 9600, 19200. SAVE * channel;options S key
INKEY$ #x N key. Ext Mode As LOAD above, but saves.

Returns a character from stream x if available.


VERIFY * channel;option8 R key. Ext Mode
INPUT #x;variable Ikey
As LOAD above, but only compares file to check that
Inputs a variable (number or string) from stream x. previous SAVE was error free.

The Complete Spectrum / 51


IVIonitoring
the Video
Discover the benefits of using a
coiour monitor in piace of the
domestic TV set

THE Spectrum’s TV modulator can put out a very


good display on a colour TV set, particularly the later
Spectrums from Issue 3 onwards. A change was made
to the UL A in Issue 3 that made the colour output work
better especially with some foreign makes of TV
that had given trouble with Issues I and 2.
Not everyone is happy with the TV display,
however, and it certainly can be improved with a colour
circuit to carry out to the edge connector. Whatever
monitor. There are two kinds of video connection to a
issue you have though, using a whole edge connector
colour monitor, and the Spectrum, as it comes, is not
socket just to make a single connection seems a little
equipped with either one.
awkward, especially as there is an easier way.

RGB
The better sort of monitor uses RGB signals, which
stands for red, green, and blue. The Spectrum only has
Dashing away with
what are called “colour difference” signals available.
These correspond to red minus yellow, blue minus
a soidering iron
yellow and luminance plus sync. %
A special monitor is available for the Spectrum from IF you have never, ever, before messed about
Microvitec that will make sense of these signals, and with solder and veroboard, connecting dinky
very good it is too, although expensive. It attaches to electronic gubbins together into oscillators that
the edge connector with no fuss, and gives an extremely didn’t oscillate or amplifiers that did, then
sharp picture with no “dot crawl”, the small scale perhaps you shouldn’t read this.
shimmering you’ll see. This is really a RGB type A computer is about as complicated a piece of
monitor with some extra circuitry to cope with colour circuitry as comes, and it is not the ideal training
difference signals. ground for a keen learner with a new soldering
iron. So if you’re still with me. I’ll assume you
know how to solder. It can’t be taught from print
Composite video anyway.
The easiest place to get at the composite video
The other type of monitor uses a composite video signal is the point where it feeds into the TV
signal. In composite video, all the colour signals have modulator. You can find the modulator quite
been coded together into one complex signal, so you easily. It is the little metal box with the socket
need only one coaxial conductor to carry it around the where you plug in the TV aerial lead. You will
place, which is why this is the type of video signal that have to open the computer case to get at it.
the television companies themselves use in most of their At one end of the box, there are two wires
monitoring equipment. There is a composite video leading in. The nearest of these to the TV socket
signal available on the Spectrum board, but it may not is the composite video signal, the other is the
be present at the edge connector. modulator’s power supply. You need only solder
From about Issue 3 onwards the composite video the core of your coaxial lead to the signal wire,
signal was brought out to the edge connector, where it and the outer sheath to the metal box itself, for an
can be found on the underside of the board, fourteenth earth. Fit the other end of the coax with the right
pad from the non-slotted end of the connector. Earlier kind of plug for your composite monitor, usually
issues were supplied with an open link, which meant a BNC or phono type, and you’re away.
you had to open the case and make a join to get the
52 / The Complete Spectrum
so that you can gauge the effect on the screen.
Give it a tweak! This is not dangerous to you, as the voltages are
all very low, but you must take care not to touch
Besides dedicated monitors, you can get components other than the presets with the end
television sets that have composite video inputs, of your screwdriver, as even a momentary short
usually meant for use with video cameras. These circuit could damage the computer. These
will accept the colour video from the Spectrum presets go through their whole range of
and provide an improvement over the TV signal adjustment in a single 360 degree turn, so you
because you have cut out the modulator in the need only turn the screw a tiny amount to make a
computer and the demodulator in the TV set, so difference. Take care not to bend the keyboard
the signal is messed about much less. However, ribbon cables about too much, as they are fragile
bypassing the modulator won’t eliminate dot and tear easily.
crawl, because that is introduced during the There are two preset capacitors and two
coding into the composite video signal, not variable resistors all in a row. The two nearest to
during modulation. the TV modulator with the little brass screws are
The Issue 1 and 2 circuit boards have preset the capacitors. They are used to trim the
controls for setting up the colour signal circuits. frequencies of the two crystals that control the
These are adjusted at the factory and you are computer clock and the colour sync. The one
meant to leave them alone, but it is possible to nearest the modulator is the clock trimmer, and
effect a useful improvement to the Spectrum’s this is the one you tweak to minimise dot crawl.
display by tweaking them to suit your particular The colour sync trimmer should only be adjusted
TV set. Indeed, some TVs would not work in if you have no colour at all, and even then you
colour with these early Spectrums until this was should first check that the problem is not the
done - and some still wouldn’t work after it was tuning of the television set itself.
done! The two furthest from the modulator are the
First let us eliminate those Spectrums which colour balance controls. These don’t have proper
will not gain anything from this exercise. All screw heads, only an oblong slot, and you may
Spectrum Pluses and the later rubber keyboard have difficulty finding a screwdriver to fit
Spectrums with Issue 3 circuit boards do not properly. One controls the balance between red
even have the presets fitted. Instead they have and yellow and the other between blue and yellow
improved ULA circuitry that is self adjusting. and both together effect the green.
sr You won’t be able to turn a TV into a monitor These should be tweaked to give good colours,
»r with a few twists of a screwdriver. It may be best but also to obtain a nice neutral white. Obviously
e to leave your pots alone if the display is anything you will want to run a program or give instruc¬
like reasonable. After all, you might make it tions to the computer to get some colours into the
worse. If your whites are yellow or you have display to judge by.
trouble getting the colour to lock, then tweaking It is possible to get into a complete muddle and
ought to help. If your only complaint is dot crawl, mess up the display entirely. Don’t panic if this
then you should be able to get an improvement, happens, just make a cup of tea and have a good
but it will come and go. You should do these think about what you’re doing. There is nothing
adjustments when the computer is warmed up, as permanent or irretrievable about any of the
they tend to drift as the temperature changes. adjustments you’re making, and eventually it will
Adjustments must be made with the power on. come right.

The Complete Spectrum / 53


In the second part of this series,
we describe how to dispiay your
graphics in glorious coiour

so far the graphics we’ve been examining have been in


black and white. Of course the Spectrum, as should be
obvious from its name, is capable of producing
coloured text and graphics. This is achieved using the
commands INK and PAPER. PAPER. This selects the colour of the background that ■
First we’ll look at INK, which selects the foreground appears behind the foreground colour. The PAPER a
colour - the one you’re actually writing in. The actual colour is specified in exactly the same way as INK. a
colour you want to write in is indicated by a number Thus to select a blue background we would use: a
following the INK statement. The colours have the PAPER 1 ■
numbers 0 to 9 associated with them, as you’ll see from
Table I. The following line uses INK to select colour 2, When a clear screen command, CLS, is executed the A
which is red: screen is cleared with the current background, S
PAPER, colour. Therefore if the PAPER is changed to ■
INK 2 4, green, and CLS is used, the whole screen will become
The ink numbers, as they’re known, are fairly green. This is a very quick way of changing the display ”
straightforward between 0 and 7 — just the Spectrum’s to a complete block of colour.
standard colours. We’ll ignore ink numbers 8 and 9 for PAPER can also be changed temporarily within a H
the moment. Once a new INK has been selected it is statement in exactly the same way as INK. This is
remembered by the Spectrum and all further symbols shown in the program: I
produced will appear in the same colour, unless
another INK command is executed. It is also possible
10 INK 7 fl
to change temporarily the INK colour by including an
20 PAPER 1 Mil
INK command within a statement. For example, the
30 PRINT “WHITE ON BLUE” H
program below prints one line of text in red, one in
40 PRINT PAPER 2;“WHITE ON RED” «
yellow and another in red; 50 PRINT “WHITE ON BLUE” fl

10 INK 2
20 PRINT “HELLO HELLO” As the previous example shows, INK and PAPER
30 PRINT INK 6;“HELLO HELLO” can be mixed freely so that different coloured writing
40 PRINT “HELLO HELLO” can be produced on different backgrounds. The next S
program shows this further. This time RND is used to |H|
Line 30 is the clever bit, because it selects colour 6, select random foreground and background colours.
yellow, and prints the message “HELLO HELLO”
without altering the “general” INK 2 - red - selected
by line 10. When INK is included in statements in this 10 INK INT (RND*8) fl
way it must be followed by a semi-colon, otherwise the 20 PAPER INT (RND*8) 9
Spectrum gets confused and generates an error. 30 PRINT “This Is a message” 9
The second command associated with colour is 40 GO TO 10 9
54 / The Complete Spectrum
special effects with "
INK numbers 8 and 9
AS far as INK and PAPER are concerned the
numbers 8 and 9 are distinctly odd. They are
special in that they don't directly specify a new
colour but indicate the way in which the new
colour will be found. Let's see what effect they
have on INK.
If INK 8 is chosen, the foreground colour that
appears depends upon the current foreground
colour of the position being printed to. Therefore
.J if a yellow character is overprinted with a letter
A, the A will take on the colour already present —
yellow in this case.
This has the advantage that, ifyou're altering
something on a screen you've already set up, the
alterations don't stand out since they're made in
the foreground colour of the original. Ifyou like,
it's a sort of transparent ink. Key in this program
and see what happens:

10 INK 1
20 PRINT “I’M IN BLUE”
30 INK 2
40 PRINT “I’M IN RED”
50 INK 8
60 PRINT AT 0,0;“ALSO IN BLUE”

First of all the screen is cleared with CLS and


two lines of text are printed at the top of the
screen, one in blue the other in red. Next the
transparent ink is selected and the cursor is
positioned at text location 0,0 - the top left
Oufside the screen corner. Now another message is printed on top of
the previous blue message. Since INK 8 is being
The area of the television display around the used, the blue already there is used for the
Spec rum’s screen can be changed to different colours foreground colour.
with the command BORDER. When you turn the The second "odd" colour, 9, selects either
Spectrum on the BORDER and screen background black or white INK depending upon the
colours are the same. But by entering a BORDER background colour of the position being printed
command you can alter the part of the display unused to. If the background is light the INK is changed
by the screen to any of the eight colours available. As to black so that the two contrast nicely. If,
with INK and PAPER, a number follows the however, the background is a dark colour, white
instruction to indicate the new colour. For example, the INK will be chosen instead. This makes it easier
border can be made cyan with the statement: to read text which has been printed over an
unknown background colour.
BORDER 5 This example shows that black text will be
printed to contrast with the light coloured yellow
background already there:
0 Black
1 Blue
10 PAPER 6
2 Red
20 INK 2
3 Magenta 30 PRINT “RED ON YELLOW”
4 Green 40 INK 9
5 Cyan 50 PRINT AT 0,0;“BLACK TEXT”

6 Yellow
PAPER 8 works like INK 8, altering the
7 White background colour to that of the current print
8 Transparent position. PAPER 9, contrast, works in a similar
manner to its INK equivalent but uses the current
9 Contrast
INK (foreground) colour to determine the new
background colour.
Table I: INK colours

The Complete Spectrum / 55


Charting your Lines 60 and 70 now change PAPER to black
and INK to green. The next line calls the
graphics progress subroutine at line 400 which prints the 12
columns of asterisks on the screen, displaying the
TO round this section off, here’s a simple information for the first year. The number in the
program which creates a bar chart type diagram array directly corresponds to the height of the
to allow comparisons to be made between data columns. Thus if the Hrst array element contains
for two years. The data for each year is held at four the bar will be four characters high.
the end of the program. This determines the When the subroutine has finished, the program
height of 12 bars for each month in the year. In continues executing from line 90. This changes
fact, the bars consist of columns of asterisks. the PAPER to colour 8 — transparent — and the
To distinguish between the two years the INK to red - colour 2. Lines 95 and 100 read the
asterisks are printed in different INKs. To aid final 12 bytes of data and display the
comparisons between the two sets of figures corresponding asterisks.
we’ve done some pretty nifty work with PAPER Since PAPER 8 has been selected^ all
8. The data bytes for each column are first read characters printed will take on the background
into the single dimension array a(x) before being colour already there. So if we try to print one of
displayed in graphical form. our red asterisks where there’s already a green
The program contains two subroutines to save one from the first year, while our new asterisk will
repeating similar lines of instructions. The first is overprint the old it will retain the black
at line 400 and is responsible for creating the background of the old data. So if we see a red
columns of asterisks using the data held in the asterisk on a black background we know that
array a(x). The second subroutine — line 500 — ‘‘height” had been reached the previous year.
reads 12 data bytes into the array a(x)* The data If, however, we’re printing a red asterisk above
is defined in lines 600 to 630. the level reached the previous year, it will adopt
When the program is RUN the first 12 bytes of the yellow background already there.
data are read by calling the subroutine at line 500 All this means that it is now possible to see the
— see line 30. Next the BORDER is changed to differences in the two sets of data by comparing
white — colour 7 — and the PAPER is changed to the height of the black background given by the
yellow — colour 6. The CLS in line 50 then clears first year’s data, and the red asterisks from the
the screen using the PAPER colour to result in a second. This would not have been possible
solid yellow screen with a white BORDER. without the useful transparent colour option.

10 REM bar chart 410 FOR m=l TO a(n)


20 DIM a(12) 420 PRINT AT 21-m,n*2;“*”
30 GO SUB 500 430 NEXT m
40 BORDER 7: PAPER 6 440 NEXT n
50 CLS 450 RETURN
60 PAPER 0 500 FOR n=l TO 12
70 INK 4 510 READ a(n)
80 GO SUB 400 520 NEXT n
90 PAPER 8: INK 2 530 RETURN
95 GO SUB 500 600 DATA 4,2,1,1,3,5
100 GO SUB 400 610 DATA 7,4,2,3,8,4
no STOP 620 DATA 3,1,6,3,5,2
400 FOR n=l TO 12 630 DATA 4,3,6,3,5,6

56 / The Complete Spectrum


Graphic details

All the facts you need to know


about those graphics commands
I - at your fingertips

7
PLOT x,y Q key N
Places an INK spot at pixel coordinates x,y, subject to

□V
INVERSE and OVER. Moves the start position for
DRAW to x,y. The pixel coordinates are:
x= across the screen left to right, from 0 to 225
y= up the screen from the bottom, from 6 to 175.

DRAW x,y W key

Draws a line from current PLOT position to a point


displaced from it by x pixels horizontally and y pixels
vertically. (Use minus numbers to move left or down.)

DRAW x,y,2 W key POINT (x,y) 8 key, Ext. mode

As above, but draws a curve between the two points of Returns a 1 if the pixel at x,y is INK, or a 0 if it is
an angle z, where z is expressed in radians. PAPER.-
(Experiment!)

USR“a” L key, Ext. mode


CIRCLE x,y,z H key, Ext. mode
Returns the start address for the bit pattern of UDG
“a” (here a stands for any letter between a and u). This
Draws a circle with a radius of z pixels with the centre address and next seven addresses may be poked to
at x,y.
define the UDG - this is usually done with a program
loop reading and poking from DATA statements. At a
power-up the UDGs are predefined to look like capital
letters. Each one is defined by a 8 x 8 matrix using
System Variables eight bytes of binary. There are 21 UDGs, and 21x8
23606: Two byte address which is 256 less than = 168 addresses to POKE to define all of them. This
the address of the bit patterns of the character area is usually at 65368 in a 64k Spectrum, but can be
set. The normal set is in the ROM, but you can moved (see adjoining panel).
define your own set and POKE this address to
point to it. The character set bit pattern is defined
in the same way as the UDGs.
Graphics Mode 9 key + Caps Shift
23675: Two bytes, the address of the first user
defined graphic. You can have more than one set
of UDGs, and POKE the address to switch When in this mode, press letters from “a” to “u” to get
between the different sets. User Defined Graphics - these look like letters until
23677: The x coordinate of last pixel plotted. redefined - or press numbers 1 to 8 to get block
23678; The y coordinate of the last pixel plotted. graphics (with Caps Shift for inverted form). Cursor
becomes G in graphics mode. Press 9 key again to
leave graphics mode.
The Complete Spectrum / 57
I;:

under the appropriate column (or bit) values and add


together the value of all the columns in which a 1
occurs. For example, given % 10010101 you translate
Second in the series that aims to as follows:
take the mystery out of the way 128 64 32 16 8 4 2 1
your Spectrum handies numbers %1 00 10101
-► 128+16+4+1=749

Going from denary to binary is not at all difficult,


but is rather hard to put into words. You do it by
WE have seen that we can code our numbers in ways subtracting from the number you want to encode the
value of each column in turn, starting with the highest
other than our usual denary, or decimal, system. We
also looked last month at a way of coding known as the (that is 128, 64, 32 and so on).
If you can subtract a particular column value you
binary system, which uses the digits 0 to 1 to represent
any number - unlike the denary system which uses the put a 1 in that column and continue to subtract the next
lower column value from the remainder. If you cannot
digits 0 to 9. ,
manage the subtraction you put a 0 in that column and
You can encode any number that you want m binary
try to repeat the subtraction with the next lower column
— just use more columns (or “bits” as we say in
computer jargon), remembering that each new bit is number. So, starting with the highest column number
worth double the preceding bit. However it does get (128 in our case), you:
terribly cumbersome. For example, 100 (denary) 1. Attempt to subtract the relevant column number
encoded in binary is % 1100100 since;
64 32 16 8 4 2 1
o/o 110 0 10 0
-► 64+32+4=700

It is much easier to handle the number in our normal


system. To a computer this presents no problem, and
the fact that binary only uses two symbols is a bonus
because you can represent numbers with a sequence ot
JUST as we can do sums with decimal numbers,
“switches”.
so we can with binary numbers, though they’ll
nl
only involve Os and Is. Take a look at the
state of the art following:

SWITCHES are what we call “two state” - they re % 1


either ON or OFF. If we have a sequence of four + % 1
switches together we can encode numbers by having %10
them either ON or OFF. We could use ON to mean a 1, If you think about it, that is correct, since the
and OFF to mean a 0 in a particular column; sum adds one and one, and the answer %10 is
8 4 2 1 binary for two. One way of relating this to our
ON OFF ON ON usual way of doing sums is to say that we carry
-► % 1 0 1 1 = 77 when we get to two, instead of ten as we do in our
normal, decimal, sums.
Each of these “switches” represents a bit, and a Another way to look at it is that we have to
computer memory is full of bits. The Z80, which is the carry when we get to two because we aren t
microprocessor at the heart of the SpecUum, deals with allowed to use the digit ‘2’. If you remember, in
524,288 of them. To make things simpler the Zbu part one we had a rule forbiding two ‘ coins of
handles the bits in groups of eight bits at a time - the the same value. Try this sum:
group of eight being called a byte. With this type of
organisation the largest number you can store m a byte 4 2 1
% 1 1 in 3
is 255 since:
+ % 10 denary + 2
128 64 32 16 8 4 2 1 %1 0 1 L.
% 1 1111111
-► 128+64+32+16+8+4+2 + 1=255 Here we carry from the second column to the
third. Addition is not very hard at all - just make
Of course the computer can handle larger numbers sure that you always “put 0 down and carry 1”
(and not just whole numbers) but to do so it must use when you get a two. If you get a three then carry
more than one byte. Converting a byte from binary to
denary is fairly straightforward. Simply write it down
Fifi / The Complete Spectrum fab
“s
128 64 32 16 8 4 1
128 goes - set to 1 1
64,32 can’t go - set to 0 0 0
16 goes - set it to 1
1
8 can’t go - set to 0
0
d 4 goes - set to 1
1 1
e 2 can’t go - set to 0
0
1 goes - set to 1
1
% 1 0 0 1 0 1 0
—---- 1
Figure I; Convertingfrom denary to binary — s

(highest first).
required, starting with the highest first. For example, if
2. If you succeed then put a 1 in that column
I were to encode 161 in binary I would say, “Well, I can
number and continue to subtract other columns
use 128, so that leaves me 33 to find. 33 can be made up
from the remainder. If not put a 0 in that column.
of 32 and 1 so that does it: 128+32+1=161. So I
If you have not done all eight columns repeat from encode it as:
step 1.
Figure I should make it clearer. 128 64 32 16 8 4 2
In practice, when faced with encoding a number % 1 0 1 0 0 0 0
from denary to binary I tend to do it in my head, seeing = %10100001
which column values will add together to make the sum
After a while you’ll find this way quite simple.

one for two and put one down”. For example:


because the value of each bit is transferred to the
8 4 2 1 next higher bit, which is of course double in value
% 111 in — so the end result is that the whole number is
+ % 1 1 decimal +3 doubled in value. Similarly, we can do the binary
% 1 0 I n 10 equivalent of dividing by 2 by shifting to the right.
For example:
Subtraction is a little more complicated, am and
depends on whether you borrow or decompose;I 8 4 2 1
The latter phrase doesn’t describe the current % 1 1 0 1 which is 13
economic climate, it’s just that there are two becomes
schools of thought on the way subtraction should 8 4 2 1
be taught — the borrowers and the decomposers. % 110 which is 6
Fortunately, we can Ignore binary subtraction
Of course, 13 divided by 2 should gives you 6
since we can manage without it - as does the
remainder 1, but this technique ignores
microprocessor inside your machine. If you want
remainders. This sort of division, where we’re
to do some binary subtraction it is
only interested in the “wholes” is known as
straightforward enough provided that you
integer division. It’s equivalent to INT(13/2).
rerriember that it is two you’re borrowing or
As each bit is moved to the right, it occupies a
taking, not ten. Figure II illustrates the process -
column exactly one half lower in value, thus the
without any attempt to explain it.
sum total of all the bits is one half lower, save for
Before we leave the realm of simple sums, look
the original bit 0 which has disappeared
what happens if we shift everything in a binary
altogether (hence the ignored remainder).
number over to the left, putting a zero into bit 0
which would be left vacant otherwise. For ^
example: \
% % 1 '1
8 4 2 1 ‘1 6
, ~% 1 1 OR -% ‘ 'r
% 10 1 which is 5 1 In decimal —3
becomes % 1 1 % 1 1 ~T
8 4 2 1
% 1 0 1 0 Decomposition Borrowing
which is 10
This shifting to the left doubles the number
ry automatically. This isn’t too hard to visualise.
Figure II; Binary subtraction

The Complete Spectrum / 5.Q


More power to your number From decimal to binary
AS we’ve said, a byte contains eight bits. These bits are
/IS' we've seen, the Spectrum has a simple way to
labelled, somewhat peversely, bits 0 to 7, as you see
convert binary numbers to denary — the BIN
from Figure III. Bit 0, as you can see, is the ‘‘I”
function. However there’s no simple Basic
column. As this is the smallest value bit we say that bit
instruction to allow you to go the other way, from
0 is the least significant bit (LSB). Bit 7, the “128
decimal to binary.
column, is called the most significant bit (MSB). The
Well, here’s a simple program to do the work
reason for using the numbers 0 to 7 to label the bits
for you. It works by repeatedly taking away
instead of the more logical 1 to 8 has to do with powers,
powers of two from the target number:
a subject you almost certainly covered at school.
• If you can take a particular power of two
“2 to the power 2” is 2*2 — 4 away from the number, the column
“2 to the power 3” is 2*2*2 — 8 corresponding to that power has a one in it
“2 to the power 4” is 2*2*2*2 - 16 (line 110).
• If, on the other hand, it won’t go, the relevant
and so on. “2 to the power 8” would be eight twos all
column has a zero put in it (line 120).
multiplied together. Notice as the powers of two
increase — that is, as we multiply more twos together —
the answers are doubling, just as our column or bit la REH dtciial to binary
values do. 21 INPUT ‘Entir a diciaal nuabtr',n
Also, 2 to the power of 2 is 4, the value of bit 2, while
uaber
2 to the power of 3 is 8, the value of bit 3. It shouldn’t
31 IF nuabtr>»B ftND nwbar<256 THEN
come as any surprise to you to find that 2 to the power
BO TO 81
of 7 is 128, the value of bit 7.
You can verify this on the Spectrum by using the
41 PRINT 'Your nuabtr auat b» bitu#
symbol “t” which stands for “to the power of’. It en 8'
shares a key with the letter H. S8 PRINT 'and 255!“
Try: 88 FOR 1*1 TO 588: NEXT 1
78 PRINT : 80 TO 28
PRINT 2t4
88 PRINT nuaberj' in binary iis*
PRINT 2t7
98 PRINT
Be sure to try 211, which will show you why bit 1 has 188 FOR 1*7 TO 8 STEP -1
the value 2. Also try 2 0. The answer may surprise 118 IF (nutbtr“2*l)>*8 THEN LET nua
you. The fact is that any number to the power 0 is 1! bar*nuibBr-2*l: PRINT “1“): 80 TO 138
Hence bit zero has the column value of one. Figure IV
128 PRINT “8“}
illustrates this.
138 NEXT 1
148 PRINT t PRINT
158 80 TO 28

rV MMM., A

7 6 5 4 3 2 1 0
Bit number

1 0 I 0 0 0 0 1

64 32 16 8 4 2 1
Bit value 128

Bit number 7 654321 0

{
2f7 2t6 2f5 2t4 2f3 2f2 2tl 2t0
Bit value 128 64 32 16 8 4 2 1

I I 0 0 1 0

Figure IV: The bit pattern for 204

60 / The Complete Spectrum


We thought it was
about time we put you
in the picture.
When we introduced our AMX Mouse to micro-users, the
response was phenomenal.
And no wonder!
Hailed by the press as ‘probably the best input device that has
arrived recently', the AMX Mouse brings to Spectrum 48K users, the
same sophisticated, positive control that has, until now, been the
province of more expensive computers - like the Macintosh.
The fentastic AMX Mouse Package opens up an entirely new and
exciting world to Spectrum users and comes complete with Mouse,
interface, which also includes a Centronics printer interface, and all
these fabulous programs. , ,
AMX ART
This computer aided, drawing program has to be seen to be
believed. Making full use of on-screen windows, icons, pull-down
menus and pointers, you’ll be astonished at the quality of the vrork you
can produce, save and print using either ZX or Epson compatible
printers. It’s a program ideal for both hours of family fun or for serious
professional applications.
AMX COLOUR PALETTE
The vronderful pictures you create with AMX ART can be brought
vividly to life with rich vibrant colours - using AMX COLOUR PALETTE.
And with 8 Foreground and 8 Background colours you won’t be short
ofinspiratbn.
AMX CONTROL
Now you can create a ‘Mouse environment’ in your
own programs, AMX Control adds 28 commands to The software is supplied on cassette and a tape-to-
normal Sinclaif Basic and contains three programs. microdrive transfer facility is included. The AMX Mouse
1. The machine code program to extend the Basic interpreter, which package is compatible with the Spectrum 48K and
gives you full use of windows, icons, pull down menus, pointers and Spectrum +.
also supports AMX printer interface. Ordering couldn’t be easier.
2. An Icon designer, an individual program for creating and storing icons This superb package is available from all good computer dealers
" for use in your own programs. The number and variety of icons you Dr direct using the freepost order form below.
can create is limited only by your needs and imagination. So what are you waiting for?
3. A demonstration program containing on screen calculator and Get into the picture now!
puzzle.
This fabulous AMX Mouse Package costs only £69.95, a price as PLEA^USfTmEPO^fW ””
remarkable as the package itself and it includes a fully illustrated AMX MOUSE SPECTRUM 48K PACKAGE/S
operating manual. AT £69.95 EACH INCL. VAT AND P & P.
I ENCLOSE CHEQUE/POSTAL ORDER FOR £_
OR DEBIT MY |-1 ACCESS |g|
(TICK AS APPROPRIATE) | | \/|3/\

CARD NO.
EXPIRY DP
SIGNATURE
NAME_
(BLOCK CAPITALS PLEASE)

ADDRESS _

POSTCODE

IMAGINATION AT YOUR FINGERTIPS


SEND TO: ADVANCED MEMORY SYSTEMS LIMITED,
® FOR INSTANT ACCESS OR VISA ORDERS RING (0925) 602959/602690
FREEPOST, WARRINGTON WA4IBR.
Itlil

Trying to play all the games you can g4t for the Sinclr!
(About 5,000 trmes.)

1
How would you like to be blasted out of
the sky by anti-aircraft guns?

Or perhaps youd prefer to be vapourised


by aThargoid starship.

Or eaten for breakfast by mutant rats.

Well, you have all this and more to look


forward to, if you get a Sinclair Spectrum -k

Because there are more games available


for the Spectrum + than any other home
computer.

(About 5,000 the last time we counted.)

Not all of which lead to such sticky ends,


we might add.

You may, for instance, rather battle it out


on the chess board with a Russian grand
master. Or cross swords with Nick Faldo on
the golf course.

You won't just have the pick of the current


titles either.

You'll get first shot at the new ones too.


Because most of them become available for
the Spectrum + before anything else.

And because there are so many other


Spectrum owners there are more books and
magazines and clubs to join.

So if you get a Spectrum -+7 you may well


end up in a Grand Prix pile-up.

And your chances of being killed by


Gremlins are very high.

But you'll never die of boredom.

indair"
BRABHAM STRAIGHT

GRAHAM HILL PADDC5CK


BEND

HAILWOOD RISE 'MICRO*TLECTRONICS LTD

DRUIDS
i

)RNE
i ~T .
• . .1.

!
. .
\
1.

Name

Address

Postcode

iterface

Kempston Prop!

□ Formula Joystick Wji


Q formula Two Joystick -f Joystickf^r

Access/

All Prices include VAT P&P. Overseas add £4 P&P


Kempston Micro Sales Ltd. Singer Way, Kempston, Bedford MK42 7AW.
Tel (0234) 856633 Telex 826078 KEMPMI G
Analysis
In this series we present a
detaiied breakdown of a short
but interesting program. The first
listing shows how PLOT, DRAW
and GOSUB can combine to
form striking graphic effects

This REM is ignored by the


Give values to the numeric
Spectrum but acts as a program
variables drawlinel and draw-
label for humans. The program 10 REM Network
line2. These contain the line
will work without it.
numbers of the two subroutines
20 LET drawline1=8000 that are used.
The PLOT puts a dot at the 30 LET drawline2=9000
bottom of the screen, in the
middle. The DRAW draws a line 40 CLS-
from this to the top of the screen.

Each time the loop is performed,


fL 50 PLOT 128,0:DRAW 0,175 Draws a line across the middle
of the screen.
this line calls the subroutine at 60 PLOT 0,88:DRAW 255,0
the line number stored in Form a FOR ... NEXT loop
drawlinel. Notice how using a 70 FOR a=1 TO 2 which goes round twice. The
variable name tells us what the I 80 GO SUB drawlinel first time round the loop control
subroutine is to do. The program 90 NEXT a variable has the value 1, the
is more readable. second time its value is 2.

Make up another FOR . ..


NEXT loop control variable b. 100 FOR b=1 TO 2
This cycles twice as b takes the 110 GO SUB drawline2 |- Sets the start of each line to new
values 1 and 2. 120 NEXT b point on the line going across the
centre of the screen.
This endless loop stops the
program “crashing” into the 130 GOTO 130 Depending on the value of a, one
following subroutine definitions.
of these lines is performed. They
It also keeps the screen tidy.
draw from the previously plotted
Leave it out and see what
point to the middle of either the
happens next. 8000 FOR 1=0 TO 255 STEP 8
8010 PLOT 1,88 h top or the bottom of the screen.
8020 IF a=1 THEN DRAW 128-1,87
Form the first subroutine. It
draws the slanting lines from the
8030
8040
IF a=2 THEN DRAW 128-4,-88
NEXT I
¥ Make up yet another FOR ...
NEXT loop. As / takes values
midpoints at the top and bottom I 8050 RETURN from 0 to 255, in steps of 8 at a
of the screen. time, so the lines move across
the screen making a fan shape.
Ends the subroutine and sends
the program back to the Each time round the loop this
statement after the one that 49000 FOR m=0 TO 175 STEP 8
picks a point further up the
originally called it. 9010 PLOT 128,m|
centre vertical line.
9020 IF b=1 THEN DRAW-128,88-m
Make up the second subroutine,
drawing the slanting lines from
9030
9040
9050
IF b=2 THEN DRAW 127,88-ni
NEXT M
RETURN
du The first time the subroutine is
called this line draws the lines to
the left and right of the screen. the middle left of the screen. The
second time b is not equal to 1 so
The range of the FOR ... the line is ignored.
NEXT loop is smaller in this
subroutine because the screen is Sketches in the lines from the
smaller from top to bottom than right of the screen when b is
from side to side. equal to 2, the second time the
...

subroutine is called.

Once you’ve understood how Network works


see if you can make it more efficient. Is there any
need for two subroutines? Would just one do the
job? And when you’ve answered that, use it as a
basis for your own pattern-producing programs.
The Complete Spectrum ! 61
C3ct things
moving!
TERRY GREER begins his
easy-to-foiiow series on
animation techniques The background

ANIMATION is basically an illusion - nothing MEDIA. Frames per second


actually moves, but when a series of pictures, each Prof. Cinema 35mm 24
slightly different, is shown in rapid succession the eye 25
Television
and the brain interpret this as movement. This Amateur Film 16mm 24
phenomenon is called persistence of vision. Amateur Film 8mm 16-18
Of course it isn’t quite that simple. For the brain to be
fooled properly you have to meet several other VVUllVlllg lldl, ww*i>*** V

conditions. These are: anywhere near to placing such number of screens per
• The difference between pictures, or frames, as I second on to your TV and would run out of memory |
shall refer to them from now on, must be small. after about a third of a second. F
• The time interval between frames must be small. Fortunately there are ways around this. First you J
• The time taken to draw a picture must be much can get away with about 10 frames a second. Second, f
shorter than the interval between frames. and more important, you need only animate a small ?
• Any apparent difference between two consecutive section of the screen. Third, the same piece of |
frames should be regular. For example, if a ball animation can often be used over and over again. I
moves three pixels between frames 1 and 2 it should To see these ideas in action, try out Listings I and II I
move three pixels between frames 2 and 3. (A pixel which demonstrate the two main types of animation.
is the smallest dot of colour the Spectrum can put on Listing III combines these techniques to give very |
your screen.) sophisticated results. These last two examples make |
There are of course always exceptions. As with use of the speed at which the Spectrum can print strings
every conjuring trick, the timing is critical. Here timing of characters and change the system variable C HARS. f
refers to the speed at which one frame is replaced with In the next instalment I’ll detail the construction of a ;
another. The following examples show the normal walking character and give a listing enabling you to test |
number of frames per second shown in different media. your own animated graphics. f

block around the screen. Experiment by altenng


Listing I: Moving an obje^ the graphic character used. Can you make it
move more than one “step” at a time?
about the screen The animation is crude and jerky, mamy
because any movement is always eight pixels
This is a very simple example ® SSr block - in any direction and there
under the control of the cursor keys. Once the is no overlap of any two succeeding imagj Lme
program is keyed in and run, pressing keys 5 to 8 200 checks for movement, only printing
- the ^es with the arrows on - will move a solid

ISO IF INKEYI«'7" then let b»b-l


IM IF a>31 THEN LET a»31i LET il-a
170 IF a<0 THEN let a«l: LET al»a
180 IF b<0 THEN let b«ls LET bl«b
19i IF b>2l THEN LET b«21» LET bl«b
2N IF blOb OR alOa THEN PRINT AT
bl,al)' ’! LET al'ai LET bl»b
210 80 TO 110

62 / The Complete Spectrum


(a) Frame needed when self-matting, (b) The object, and the finished tffect.
(c) Matte of the object.

Methods of printing graphics THE MATTED OBJECT: This type of printing is


becoming increasingly popular with games program¬
mers, as can be seen in Highway Encounter, Knight
THERE are three main techniques for printing
graphics: Lore, Marsport and so on. It is by far the most complex
of the techniques described and requires a lot of
SELF-MATTING: This describes what happens memory and machine code to develop.
normally on the screen when one letter is overprinted The main background is held in memory untouched
by another.
as are all the objects. The frame itself and a
Unless the OVER option on the Spectrum is set to corresponding matte exist for each object - the matte
one the new letter or character will overwrite the old being the exact shape of the object if it were in
one so that only the new one is visible. silhouette.
This has the disadvantage that it can only be used if The procedure involves:
there is no background to corrupt or the background is 1. Transferring a blank background to the screen
taken into consideration when designing the frames - memory.
otherwise holes start appearing. 2. Adding the first object’s matte to the background in
OVER 1: It is very simple to restore the background to such a way as to leave a hole the exact shape of the
its original appearance simply by printing the same matte (normally using AND/OR in machine code).
character printed initially, in exactly the same place. 3. Adding the detail by printing the pbject to the screen
Many games use this method. over the matted background.
Its disadvantages are that things can look very Any other objects to be included are added by
strange if they pass over other objects, and that printed repeating steps 2 to 3.
objects tend to need to be solid with no hollow spaces Objects are added from those further away (least
(as in Jet Set Willy) otherwise holes in the character will priority) to those closest (highest priority) in order to
show the background. give a sense of perspective.
The disadvantages of this method are that it not only
requires a large amount of extra RAM set aside as a
screen buffer, but also requires twice as much RAM
ering overhead for the actual graphics since a matte is
occurred. If you omit the check, by deleting from required for every object.
.ke it it the following:
IF blOb OR alOa THEN
lainly UDGs
cels — you will notice that the flickering is present even
there when the block is apparently stationary. Despite IN the Spectrum normally only 21 characters are
.Line this the illusion of movement is definitely there. available to be redesigned as User Defined Graphics
it has (UDGs). All the patterns for the normal character set
from CHR$ 32 to CHR$ 127 and for the initial values
Program structure of the 21 UDGs are held in the Spectrum’s ROM and
are therefore fixed. The computer’s pointers however,
Prints the block (CHR$ 143) at which tell it where to look for a particular pattern, are
held in RAM and are thus changeable.
a particular location.^
Check that the block never One such pointer is the system variable CHARS at
gives an error report by trying addresses 23606 and 23607. Normally 23606 contains
to leave the screen. 0 and 23607 contains 60. This points to 256 less than
Overprints the object with a the character set in ROM. (The character set starts
blank space, but only if there with a space and continues to the copyright symbol.)
has been movement of the print Altering this pointer therefore gives you 96 new
position. printable characters - replacing the normal alphabet -
with only two pokes. A very powerful function indeed.
You can experiment by poking various numbers into
the two addresses, but beware for as soon as you start
the character set will become corrupted and illegible. It
is therefore a good idea to add a line similar to line 120
The Complete Spectrum / 63
in Listing II to restore the normal character set.
System variable UDG, at addresses 23675 and Listing III:
23676, is similar except that points to the User Defined
graphics area. Altering this has the advantage that the
The dripping tap
normal character set isn’t corrupted, but there is a limit This uses a combination of techniques. Movint
of 21 characters that can be “redefined” at a time. animation is used for the drop falling, and static
However you can maintain several sets of alternate animation for the drop forming and the splash at the
graphics in memory at the same time and switch bottom.
between them.
When poking these addresses remember it’s the low
byte which is poked into the lower address. To find out
the values to be poked you can use this short program:

10 PRINT "INPUT ADDRESS TO BE CONVERTED'


20 INPUT A
30 IF A > 65535 OR A < THEN PRINT "MISTAKE
HADE'sPRINT “PRESS ANY KEY TO CONTINUE"!PAUSE
0:CIS:SOTO 10
40 LET HI*INT(A/256)
50 LET L0=A-(HI«256)
60 PRINTiPRINT "LON POKE IS "jLO
70 PRINT "HI POKE IS ';HI
80 PRINTtPRINTtPRINT "NEKT?"
90 PAUSE 0;IF INKEYI="Y" OR INKEY$="y' THEN
CLStSOTO 10 2 REH LISTIN8 3
100 STOP 3 REH DRIPPING TAP
10 CLEAR 39999
And don’t forget - if you’re using the system 20 FOR n*l TO 120i READ a: POKE 399
variable CHARS, subtract 256 from the address of the 99+n,a! NEXT n
new character set before you input it. 30 LET a$»*"! FOR n»32 TO 52j LET a
♦■a»+CHR» ni NEXT n
35 60 SUB 2000
Listing II: Static animation 40 POKE 23606,64
50 POKE 23607,155
This short program demonstrates wnat is in my 60 LET p«5
opinion one of the simplest ways of obtaining 90 REH DROP FORMING
unlimited graphics, the judicious use of the 91 REH
system variables CHARS and UDG. Again, 92 REH
nothing is actually moving (remember this as the 100 PRINT AX 5,10;A<(1)
single most important fact). 105 PAUSE p
You will notice that the animation appears b ""
110 PRINT AT 5,10|A»(2) ^ 20
very smooth. This is mainly because the
115 PAUSE p ? 29
successive printings are self-matting, and the
apparent difference between consecutive frames 120 PRINT AT 5,10|AI(3) 29'
is only about one pixel. The Spectrum s speed at 125 PAUSE p 29'
printing strings also helps a great deal. 130 PRINT AT S,10iA$(4) 301
135 PRINT AT 6,10)A«(S) 301
85 REH LISTING 2
140 REH DROP FALLING : 300
141 REN ^ 300
86 REH
142 REH I 300
87 REH
150 FOR n>l TO 14 t 300
90 FOR n>l TO 2SS
100 POKE 23606,n
160 PRINT AT 4+n,10jAI(6}
165 PRINT AT 5tn,10>A4(7)
r m
110 POKE 23607,60 I 3os:
170 PAUSE 1 I 3001
120 IF INKEYIO" THEN POKE 23606,0
ISO PRINT AT 5+n,10;A4(S) ! 3001
I POKE 23607,601 STOP
130 PRINT AT 0,Oi'ABCDEF8HIJKLHNOPQR 185 PRINT AT 6^n,18)AI(9) I 3010
190 NEXT n 3011
STUVNXYZ"
195 REH SPLASH 3012
150 PRINT *B"
196 REH 3013
160 PRINT "C"
197 REH 3014
170 PRINT "D"
200 PRINT AT 4+n,9}A$(I0 TO 12) . 4000
180 PRINT "E"
190 PRINT "F"
210 PRINT AT 5+n,9jA4(13 TO 15) ■ P
215 POKE 23606,01 POKE 23607,60
200 NEXT n
300 60 TO 90

64 / The Complete Spectrum


Program structure

loving
Sets RAM TOP to 39999.
static
Pokes into place the data for the
at the
graphic characters.
Sets up A$ which contains all
the characters needed for the
program.
The pokes to change CHARS so
that it points to the correct area
of RAM.
3000 to 3014 Hold data for the 15 graphics
characters needed
Redefines the normal character
set if a key is held down - this is I
how you exit the program.

22i PRINT AT 4+n,9j* •


231 PRINT AT 5+n,9j' •
IF INKEVt.- THEN 60 TO 46
Illi SO TO 4166
1998 REN DRAN TAP AND FLOOR
1991 REN
1992 REN
2888 PLOT 8,7i ORAN 186,6
2885 PLOT 128,151
mL”?* -5.Bi
ORAN 8,16i ORAN 15,8i DRAN 0,4i DRAN
■J5,8i ORAN 8,-4i DRAN 15,0: DRAN 6 ,
"IB

®''5' ORAN -26,6


®RAN 16,6! DRAN 6,5: DR

2838 RETURN
2998 REN 6RAPHIC8 DATA
2991 REN
2992 REN
5 ^N|A8,8,8,8,8,8,8
JJ ;;; 78,66,8,8,6,8
‘‘•‘‘.133,133,141,155,78,66
u IJI! *>*'2^36,36,66,133,133
3884 DATA 141,155,78,68,6,8.8 8
3183 data 8,8,8,8;8,J,8:8’"’“’“

t!u Ifl! *»*’*'*.‘®.“.I33,133


3888 DATA 181,155,78,68,8.8.8 6

1f •'®.*.>.».N.38,32
2 i If'' 1,4
3812 DATA 2,8,6,16,32,3,1,18
813 DATA 42,88,132,136,8,32,77,17

p 8 rone 23686,81 POKE 23687,68« STO


Nybbles & bytes
All those Is and Os can be very confusing, and you
can end up writing:
Making sense of machine %1O11O101
code - Part II when you mean:
%10101101
It can be very difficult to spot where you’ve gone
wrong.
When I deal with binary I always split the bits up
into groups of four by putting a wiggly line down the
middle. For example, I would write %10110101 as
IN Part I we had a look at binary numbers, the sort
%1011^0101
your Spectrum uses. As we saw, a binary number
It’s far easier for my eyes to see the pattern of the
consists of a lot of 0 s and 1 s together, each 1 or 0
two sets of four than the whole eight at once. These sets
being known as a bit. These bits normally come in
of four are called nybbles. The left hand nybble, which
groups of eight at a time, called bytes.
contains the larger column values, is called the most
%10101100 is a typical binary number. Notice the
significant nybble (MSN). The right hand one is called,
% sign at the front - to distinguish binary from our
not surprisingly, the least significant nybble (LSN).
normal decimal numbers. After all, we don’t want
Figure III shows what goes on with the least
anyone mistaking it for ten million, one hundred and
significant nybble.
one thousand, one hundred, do we?
But how do we interpret it? Well, the values meant by
the Is and Os depend on the column they’re in. We’re Colum^
used to this from the old htu (hundreds, tens and units)
days of primary school: a 1 in the tens’ column meant
‘"one ten’, hundreds’ column
meant 100. Figure HI: LSN values
So: I think that you’ll immediately see that the biggest
number it can hold is 15, when all the bits are 1. And, of
course, the smallest number is 0. Figure IV shows all
the patterns:
different from:
nybble pattern value
0000 0
It s much the same m binary. Every column has its 0001 1
value. Figure I shows these values for each column of a 0010 2
byte. Notice how the first column is column number 0— 0011 3
micros start counting at 0. 0100 4
To arrive at the value of a binary number, you just 0101 5
add together the values of the columns containing ones. 0110 6
Figure II shows how the % 10101100 above translates 0111 7
into 172. 1000 8
Once you get back the ok, binary numbers are 1001 9
quite easy to handle. ^ discuss some further 1010 10
techniques on Page 58. 1011 11
One drawback to using binary from a human’s point 1100 12
of view is that it’s extemely easy to make mistakes with. 1101 13
1110 14
nil 15
Colt||nii number 7 6 5 3 2 1 0
Value 128 64 3^ 16 8 4 2 1
Figure IV: Nybble pattern plus values

You’ve probably thought to yourself, ‘^So what?


Figure 1: Binary column vahtes Why should 1 write %llll when it’s easier to write
15?” And you’ve got a point. In fact we’re going to
\ make it easier than that - we’re going to give each of
Value 128 64 32 1 6 8 4 2 1
our nybble patterns a code, consisting of a single
Bit 1 0 1 (» % 1 0 0
character.
= 128 + 32 + 8+4 The code for %00W) will be 0.
= 172 The code for %(K)01 will be 1.
The code for %0010 will be 2.
\ _^
Figure 11: Translating binary Yes, you’ve guessed it, the code is the value of the
66 / The Compfete Spectrum
pattern! So the code for %100:
about when we come to % 1010?
but we can’t use that for the code,
one digit.
All right then, it’s our code, so let’s decree
use A as the code for %1010. Okay, I know i
ten and you know it’s really ten, but our rule s
one character in the code so A it is.
You won’t be surprised to learn that %101 would be
has value 11, will have code B, %1100, which 1
12, has code C, and so on up to %1111 value 1 s form of coding is callec
has code F. You’ll understand why ii
Figure V shows all the ny bble patterns, this time with in has a value in binary
their codes and values. in hexadecimal. Let'
i binary for 15

Qrbble pattern code value %000011U hexadecimal &0F


0000 0 0 ! binary for 16
0001 1 1
0010 2 %00010000 hexadecimal
2
0011 3 3 What’s to obtain 16
0100 4 4 have tc hex sum is:
0101 5 5
0110 6 6
0111 7 7
1000 8 8 What’s happen g is that we “put 0 down, carry
1001 9 9 one” when we gel 0 16. In normd sums we do this
1010 A 10 when we get to 10 and the 1 goes in the tens column.
1011 B 11 In hexadecimal we carry when we get to 16 - each unit
1100 C 12 in the second column is worth 16. That’s why I said
1101 D 13 don’t worry about what happens when we get to 16.
1110 E 14 When we get there, we carry.
nil 15
k—-— _^_ This, incidentally, is why it’i called hexadecimal -
the hex is for six, the decimi foi ten - hexadecimal, the
f^lguftyiNybbkpatterns plus c04les number code based on sixteen.

What we’ve really done is to invent a ruh 0 units


instead of counting 1, 2, 3 ... 9, 10, 11,12, 7 units
we count 1, 2, 3... 9, A, B, C, D, E, 1 1 units
moment, ignore what happens when we gc 0 units
Of course the micro deals in bytes, but \ 2 units
our new code for these, too. After all, 3 units
significant nybble is a pattern of four bytes, j
least significant nybble, so all we do is code e,
separately, same manner.
Here’s 1

%10I0
now write

Value in Value in
16’s column I’s column

If you look back to Figure you’ll see that


% 10101100 is 172, so AC is re another way of
coding 172. To show that AC is re a number coded
in our new way, we’d better prefix 'ith &, as we did
with % for binary coding.
Here’s another example:

%1000 001

Here%10000011isi: 51, and coded in our i


this is &83. Notice how vital the is. If w
have it we would mean 83 in our ordinary sj
numbering - called denary or decimal - that i
and 3 units and not 131 as we had intended.
_
So with this new method of coding you can code any
byte in two characters, one for each nybble. For
The Compfete Spectrum f 67
digit hexadecimal number. This however is limited to a
maximum of &FF, or 255.
As we saw last month, we need larger numbers than
this to specify the 65536 memory locations the Z80
addresses. What we did then was to specify our
memory address with two bytes, hi bytes and lo bytes.
In hexadecimal, it’s two digits to a byte, so we can
specify any address with four digits (instead of the
altering to. So:
cumbersome 16 bits we used last time).
Figure VII shows how it works: POKE 28672,201

lob^rte will change memory location &7000 to &C9 (&C9 is


Coiumn htb^te
the hex equivalent of 201). Try it. As nothing seems to
Number 3 2 1 0 have happened, the more sceptical of you might be
Value 4096 256 16 1 wondering if I’m telling the truth. Has the value of the
contents of memory location &7000 really been altered
to &C9 by that POKE? Well, we can use a command
Figure VII: Four digit hex column values
called PEEK to examine the contents of memory
Just as in binary we kept doubling our column locations. Try:
values, so in hex we keep multiplying by 16. Hence the PRINT PEEK 28672
following values apply:
You’ll get the answer 201. So the POKE really has
column 1 1 =s 1
worked. Now, believe it or not, we’ve just entered a one
column 2 1x16= 16
byte machine code program into memory. You see,
columns 16x16= 256
&C9 is the instruction, or opcode, that tells the Z80 to
column 4 256 x 16 = 4096
“return from whence you came”. Its mnemonic - an
This is quite sensible when you think about it. If the easily remembered “codeword” - is RET. We met it on
lo byte were &FF (255)- that is, as big as a single byte on Page 34 in Part I.
can hold - and we added one, we’d have to show Right, we’ve put our machine code program at
somehow that we’d arrived at 256. We can do this by &7000. We get our Spectrum to execute it with:
adding a one to the first column of the hi byte (which is
USR 28672
worth 256) and setting the lo byte to &(W - in other
words, put 0 down and carry 1. This is a function which returns a value - which we’ll
The sums might get a bit hard if your mental ignore for the moment. It’s a sort of “GOSUB from
arithmetic’s a bit rusty, but you can translate from four Basic to the machine code routine that starts at
digit hex addresses quite straightforwardly. For 28672”. That’s why we need the RET (&C9) there. It’s
instance: the “RETURN” to match the “GOSUB” of the USR

&0202 = 2x256 + 2 514


&1A10= 1x4096+ 10x256+ 1x16 6672
&FFFF=15x4096 + 15x256 + 15x16 + 15x1 65535

Anyway, enough of this number theory. Let’s do command. Try it now. Enter:
some machine code. Last month we discovered that all
machine code was was a sequence of bytes in memory LET X=USR 28672
that gave the micro certain tasks. All you did was point The micro “gosubs” to &7000 (28672) and does
the micro at the first byte of the machine code and say what the byte tells it. In this case it merely says “go
go. back”, and you end up back in Basic. All right, nothing
That gives us three problems. First of all we have to spectacular has happened - but it worked, so
decide where in memory to put our machine code. congratulations. You’ve just run your first machine
Secondly we have to actually put the correct sequence code program.
of bytes into those memory locations. Lastly we have Let’s try something that does a bit more than this
to tell the micro to go and do the machine code though, to prove we’re really running code. As we said
instructions! last month, the firmware is full of machine code
To answer the first point, we’re going to store the routines that keep the micro going. And those routines
machine code at &7000 - 28672 in decimal. Never are there for you to call on - they’re already written.
mind exactly why for the moment. Let’s use one. There’s a routine that starts at &0D6B
Secondly, to get the correct value bytes in memory (3435 decimal) that clears the screen. To demonstrate
we use the POKE command. The rather inelegantly it, let’s call it directly from Basic by entering:
termed POKE needs two parameters, or numbers to go
with it, separated by a comma. It needs the location we LET X=USR 3435
want altering, followed by the number we want it As you’ll see, it works. What I want to do, though, is to
68 f The Complete Spectrum
Memory address |1 28672 28673 28674 28675
Contents of
memory location 205 107 13 201
1
CALL lo byte hi byte I
Meaning of the subroutine RETurn
above bytes at address Address of subroutine from whence
specified by next required by previous byte you came
two bytes (lo byte first)

Figure VIII: Our simple clear screen pmgram

call this routine from one of my own machine code if it’s there. When you are ready, call your routine with:
programs. After all, I might want to clear the screen in
the middle of one of my magnificent machine code LET X«USR 28672
creations, and I don’t want to have to go into Basic to and your screen should clear. Well done - your first
do it. machine code program that actually has a visible
The Z80 has a useful instruction that lets us call (or effect. Type some rubbish on to the screen, then:
“gosub”) to another machine code routine - the code
for it is &CD (205). You give the Z80 the address you LET X=USR 28762
want it to ‘‘gosub” to in the two bytes directly following again. As you’ll see, your routine is still there. Now
the &CD in memory. So to clear the screen with the take care with your machine code programs - it’s ail
routine at &0D6B you might think we want the too easy to
i crash your machine or wipe out your
following sequence of bytes in memory: ]
program. For instance, try:
LET X=USR 0
and you’ll see what I mean. If you now try the routine,
You’d be wrong though. The Z80 expects memory you’ll see that your code has gone. It’s often tiny errors
addresses to be given to it ‘‘back to front” - that is, lo that cause such disasters. The solution is simple —
byte first, followed by hi byte. So to call the routine at check and recheck before each Enter.
&0D6B the sequence is: As I mentioned last time, you can get special
programs called assemblers that let you type in your
programs in the more meaningful mnemonics rather
than as a list of bytes. If you wrote the above program
on an assembler and then listed it, it would look
The mnemonic for &CD is CALL, by the way. something like Figure IX.
However, we’ve missed out something very important
in our program - the RET (&C9). So our compiete address opcodes mnemonics
sequence of bytes, starting at memory location &7000 7000 CD 6B OD CALL &0D6B
(28672), would be: 7003 C9 RET

Figure IX: Assembler listing

Figure VIII illustrates the program. The mnemonics are what would be typed into the
Now let’s get the program into memory. Enter: assembler. The address column shows the address of
POKE 28672,205 the starting byte for each instruction, and the opcodes
POKE 28673,107 column shows the opcode and associated data bytes
POKE 28674,13 for each instruction.
POKE 28675,201 • Well that*s aUfor this time. In the next part qf the
series well be looking at better ways of entering
If you like, you can check up on it with PEEK to machine code — and learning some new instructions.
The Complete Spectrum / 69
RAM
upgrade
Stuck with 16k? We help point
the way to adding extra memory
to earlier Spectrums

THE 16k version of the Spectrum has not been


manufactured for some time, but there are still some
about. If you have one, you have no doubt noticed that
there are very few commercially available programs
that fit in the smaller memory, and that the
chart-topping games all need 48k.
Luckily there are plenty of suppliers of extra
memory for the Spectrum, and you can upgrade your
junior model to the full 48k for little over £20.
plain which end goes where. Not all of the chips in the
DiY or send away? kit will be the same, so it is also possible to put them
in the wrong sockets - but even a PhD wouldn’t be that
DIY kits are the least expensive way to upgrade, but careless.
require a measure of manual dexterity to fit. Mostly The second problem with fitting chips is that they
you only have to plug chips into sockets. Not quite as always seem to be supplied with slightly splayed legs.
easy as it sounds, but fairly easy - but you may have to This makes it difficult to line up the two rows of legs
solder a few links to the Spectrum circuit board. A with the corresponding holes in the sockets.
really sloppy job here could cause trouble, but it is a Carelessness or a heavy hand at this point can lead to
task that should not be beyond anyone. bent or broken legs, and a crippled chip. An IC
Opening the computer case is a simple matter of insertion tool is a perfect solution to this difficulty if
removing five screws from underneath. Unfortunately you can borrow one from somebody, but they are too
this act will void your Sinclair warranty, but this has expensive to be worth buying for just this one job.
probably already lapsed in the case of a 16k model. The alternative is to bend thelegs into line by holding
Some suppliers of DIY memory upgrades - and the body of the chip and pressing each row of legs in
some Spectrum repair specialists - will fit the chips for turn against a hard, flat surface. This is a tricky
you for a bit extra. In this case, you should get a new procedure, as too much bending is as bad or worse than
warranty thrown in. Don’t expect the man at the too little, but if you take it slowly and in stages, offering
computer counter in your local chainstore to fit them the chip up to the socket to check for fit, it will be easy
while you wait, however. You’ll have to send your enough. By the time all the chips are in place you will
computer away. feel that insertion tools are toys for the inexperienced.
You may or may not need to solder a link on the
computer’s circuit board. This will depend on the chips
Self fitting used in the upgrade kit. In the early Spectrum, Sinclair
found that he could save a lot of money by buying
HAVING removed the screws from the case you will partially faulty memory chips, and wiring them up to
find that the top of the case with the keyboard is use just the good half of the chip. The link was
attached only by the keyboard ribbon cables. These necessary to select which half of the set of chips was to
flat, printed film cables should be pulled gently out of be used.
their sockets and the top of the case set aside. The Some of the memory upgrades continue this practice
cables are rather fragile and must be handled with care, and therefore need the link, but the price of fully
particularly during reassembly. functional chips has dropped to the point where there is
There are two main things to watch when fitting no longer a big saving, so some upgrades use fully
chips into sockets. The first of these is orientation. functioning chips and do not need the link.
There are two ways in which the chip can be inserted, If you don’t want to solder, make sure that the kit
the right way round and the wrong way round. Even you buy promises “no soldering”. If you do intend to
people with a PhD get them in the wrong way round on solder, then you will need a suitable iron, which means
occasion, so read the instructions and pay attention! not too big. About 15 to 25 watts will do. You will also
The chips will be clearly marked with a dot or notch need proper resin cored electrical solder, and a suitable
at one end, and the instruction sheet will make it very length of tinned wire without insulation - make sure it
70 / The Complete Spectrum
which are not used in the Spectrum. Elaborate
anti-static procedures are therefore not necessary, but
it does no harm to avoid nylon clothing.
The final and most important step is to double check
everything visually before switching on. A chip may
survive being powered up in the wrong socket but if it is
the wrong way around, or has a leg bent under, it could
just expire. Check first.

A notable exception
If you have the very early Issue 1 Spectrum, then it is
not at all easy to fit an upgrade internally, so don’t try.
You would just destroy its antique value. Issue 1
Spectrums can be identified by the fact that the rubber
keys are grey rather than bluish. If you still aren’t sure,
open it up and you will find the issue number printed on
the circuit board.
You will also notice that it isn’t fitted with a flock of
empty sockets, but only two, which is why it is difficult
to fit the chips. In fact these sockets are meant for
fitting an upgrade circuit board that used to be supplied
by Sinclair. Issue I hasn’t been made since 1982
though, so there aren’t that many about.

The Rampak solution


IF you don’t fancy opening up your computer or
isn’t enamelled - for the link. sending it away (or if you have the rare Issue I), there is
If you have never soldered before, then what you will a memory upgrade from Cheetah that just plugs on to
need most is practice. Try out the tools on some waste the edge connector like a joystick interface. This costs
materials until you get the feel of it, and remember — it’s quite a bit more than buying the bare chips and
easier to get the solder on to things than to get it off installing them yourself - almost double in fact - but it
again!
is certainly simple. Naturally, the edge connector is
You may have heard horror stories about chips carried through.
being rendered defunct by static discharges arising Whatever you decide, do not attempt to use an old
from simply handling them. These stories are true! Rampak left over from a ZX81. It not only won’t work,
However they apply mostly to the CMOS type of chips but will cause damage.

Some suppliers ELR International


Upgrade kit, no soldering
Cheetah Rampak St. Nicholas House
24 Ray Street The Mount
London EC IR 3DJ Guildford
01-833 4909 Surrey GU2 5ZHN
(0483) 505605
Micro-World Computers
Repairs and Memory Upgrading RAM Electronics
1006/1010 Manchester Road Upgrade kit
Linthwaite From branches of Boots, Menzies,
Huddersfield HD7 5QQ Spectrum Group, or
(0484) 846117 Unit 8
Redfields Industrial Park
Mancomp
Redfield Lane
Repairs and memory upgrading Church Crookham
Printworks Lane Aldershot Hants GUI3 ORE
Levenshulme
(0252) 850085
Manchester M19 3JP
061-224 1888/061-224 9888 Fox Electronics
Upgrade kit
Video Vault
Fox House
Repairs and memory upgrading
35 Martham Road
140 High Street West
Hemsby
Glossop
Great Yarmouth
Derbyshire
Norfolk NR29 4NQ
(04574) 66555/67761
(0493) 732420

The Complete Spectrum 171


Looking
into books
The “Tune a Day” approach Is not well suited to
computing. Computing Is complicated. It Is one thing
lOLO DAVIDSON looks to attempt to Illuminate a complex subject, and quite
along his shelf and picks another to pretend that the subject can be made simple.
Many people have learned to program by struggling
out six of the best with badly printed magazine listings, whereas others
have learned in a more formal way In the classroom,
but In both cases the real teacher Is the computer Itself.
THERE are a great many books available that claim to For a book to aid this process It must contain real, hard
Introduce the beginner to the Spectrum In an easy, information, not just optimism and encouragement. A
painless fashion. Some of them are useful but many are good computer book Is primarily a work of reference.
a waste of time, offering little that you could not find In Rather than recommend a list of worthy books, I
the manual that came with the computer. At worst they give details below of the books I actually use myself.
contain only listings of moroiilc games written In Basic, They are not necessarily aimed at the beginner, and are
riddled with bugs and printing errors. Good or bad, all the better for that. After all, no one wants to stay a
computer books always seem to cost the earth, too. beginner.

Sinclair ZX Spectrum BASIC Programming Understanding Your Spectrum


(The Original Spectrum Manual) By Dr Ian Logan
By Stephen Vickers, Editor Robin Bradbeer Publisher Melbourne House
Publisher Sinclair Research
This book is an excellent way of making the transition
The User Guide that comes with the Spectrum Plus is from Basic to machine code, and afterwards it will
very beautiful, but does not cover the subject anything serve as a vital reference for machine code
like as well as the manual that came with the original programming. The section on calling machine code
rubber-key Spectrum. This one has 232 pages, none of routines in the Spectrum ROM from your own
them in colour, covering the Spectrum’s Basic in programs is especially useful. After years of hard use
tutorial detail, plus important aspects of using machine the cover is coming off my copy. I must get another.
code, such as the in/out ports and system variables.
The best beginner’s guide and an indispensible
Spectrum Hardware Manual
reference.
By Adrian Dickens
Publisher Melbourne House
Programming The Z80
By Rodney Zaks A soldering iron wielder’s guide to the Spectrum,
Publisher Sybex covering fault finding and fixing, experiments, and
add-on projects. Definitely not for the faint of heart,
This one is something of an expensive luxury, unless but you can’t blow your computer up just by reading
you really need to know the number of T-states about it. Perhaps most valuable are the circuit
consumed by a machine code instruction. There is diagrams of various sections of the computer, such as
nothing here about the Spectrum, but absolutely the power supply, and one of the whole Spectrum. My
everything about the Z80 microprocessor. early copy only covers Issue 1 and Issue 2 Spectrums,
so make sure you get a suitable edition if yours is an
The Complete Spectrum ROM Disassembly Issue 3 or later.
By Dr Ian Logan and Dr Frank O’Hara
Publisher Melbourne House Master Your ZX Microdrive
By Andrew Pennell
Just as the title says, this is the contents of the Publisher Sunshine
Spectrum ROM, the machine code program that runs
the Spectrum, presented as a Z 80 assembly language Andrew Pennell actually uses Sinclair’s microdrives
listing with extensive annotations explaining what is himself, and does not gloss over the problems and bugs.
going on throughout. You won’t need this one, or There are lots of example programs, in both Basic and
understand it, unless you are already into machine assembler, and a good section on using machine code
code programming. Then you won’t be able to live with the microdrives. Not a must by any means, but the
without it. definitive work on this subject.
72 / The Complete Spectrum
With Part II, you will see how The Complete Spectrum is
developing into a richly-detailed encyclopaedia covering all
aspects of computing with your Spectrum.
To keep your copies in perfect condition we have produced an
attractive binder to hold all six parts. It is bound in smart black
pvc, with the logo printed in silver. All you have to do before
inserting the monthly parts in your binder is to remove the outer
cover and the ‘Special Offers’ section in the centre.
For addresses in the UK, the binder costs £3.95, or £6.95 for
overseas.
If you missed Part I, or would like to subscribe for all the remaining
parts, you can do so by using the order form in the centre of this
issue.

Contents of Part I included:


• A step by step guide to your first 30 minutes using the
Spectrum. • Advice on saving and loading. • How to
avoid errors when typing in listings. • An investigation of
the Z80, the chip behind it all. • Computer jargon
clarified. • And the start of our regular series - a simple
guide to basic Basic, an introduction to machine code,
and a how-to-do-it guide to graphics.

In PartThree...
We help you explore further into the
ever-growing world of the Spectrum!
Databases - what they are and how to get the best from them.
Printers and interfaces - why you need them, and how they work.
Speech - how it can give an extra dimension to your Spectrum.
Upgrades - we compare all the latest Spectrum keyboards.
Breakdowns - what to do if your Spectrum ever lets you down.
And there are the regular features on Basic, machine code, and
colourful articles on graphics and animation techniques.
Plus pages of hints and tips to help you get the best from your
Spectrum.

On sale March 7
i A
>

OmCIAL COMPUTER GAME


k OF THE BOX-OFFICE No.l
I SMASH HIT. TAKE THE ROLE
FOF SYLVESTER STALLONE IN
; ALL THE ACTION-PACKED j?

^ BATTLE SCENES. if

1'

u.

SPECTRUM48k

Ocean House • 6 Central Street Manchester • M2 5NS • Telephone 061 832 6633 • Telex 669977
Ocean Software is available from selected branches of:(^^),WHSMITH ,^^SSSB!S,WOOiWORTHXUSKiS.Rumbe\ows,Greens
Spectrum Shops and all good software dealers.Trade enquiries welcome.
I £99.95
Rec. price
Our price 1 £69.95
SAVING 1 £30.00

Helps you get


much-more fun
out of computing
on i;our Spectrum!
• One ZX Microdrive. • One ZX Interface 1.
• Fun-packed Microdrive demonstration cartridge SUITABLE FOR:
• Three blank cartridges.
Spectrum 48k /
• Connecting lead for Microdrive/Interface 1.
• ZX Net lead. • Full documentation. Spectrum + /

Please order using the coupon at the back

.1.1 T^v \j \ji yji/ii i^uiuuf lu ucicr ininc inc new

K background colour.
Table 1: INK colours

The Complete Spectrum / 55


Enhance your Spectrum with a new keyboard!

Top-selling OKTronics keyboard


For ease of use nothing can beat this
Microdrive-compatible keyboard. It
offers more keys and functions than
any other in its price range - and
puts your humble Spectrum into the
professional league! Fitting it only
takes a few minutes, a screwdriver
and the simple instructions supplied.

SUITABLE FOR; Rec. price 1 £37.50


Spectrum 48k Our price 1 £27.50
Spectrum + SAVING 1 £10.00

The Saga 3
Elite Keyboard
Give your Spectrum the sheer
elegance it deserves with this
top-of-the-range keyboard from
Saga. It’s the finest you can buy.
With the keyboard and the number
pad you get a total of 87 keys, and SUITABLE FOlR: Rec. price 1 £79.95
a massive 27 of them are Spectrum 48k y Our price 1 £69.95
auto-shifted. Spectrum + y SAVING 1 £10.00

... and make it talk, sing and play music!

DKTronics 3 Channel
Speech Sound
Synthesiser Synthesiser
There’s an almost infinite Add a totally new dimension to
vocabulary tucked away in this your sound. Program music
popular speech synthesiser. It’s with harmonies, explosions,
extremely easy to use, as zaps, and more. Comes
everything you want your with an audio amplifier
Spectrum to say is entered in and a pad - mounted
normal English. The result is 4" speaker.
realistic speech that is ^
instantly recognisable.
SUITABLE FOR: SUITABLE FOFi.
Spectrum Spectrum y
Spectrum + y Spectrum +■ y

Rec. price 1 £24.95 Rec. price 1 £29.95


Our price 1 £19.95" Our price 1 £22.95
SAVING 1 £5.00 SAVING 1 £7.00

way 11 must oe loiiowea oy a semi-coion, otnerwise tne xu r Amn ii’n i


Spectrum gets confused and generates an error. 30 PRINT “This Is a message”
The second command associated with colour is 40 GO TO 10
54 / The Complete Spectrum
More savings on drives, printers, mice!

Opus
^o;
Discovery
In one simple step you can
transform your Spectrum into a
complete computer system. It
combines a powerful disc drive with
a wide range of interfaces capable of
running printers, monitors, joysticks
and other peripherals. No other
system can offer your Spectrum so
niany options.

SUITABLE FOIR; Rec. price 1 £199.95


Spectrum 48k y Our price 1 £149.95 Peripheral
Spectrum + v/ SAVING 1 £50.00 through connector

Put yourself in the picture with the Standard ront single height
most revolutionary add-on yet created standard font double height
for the Spectrum. Draw on the screen Bot. font sittBlc hea9ht
as youVe never been able to before. Bold font double height
Bring your pictures to life with aaai tont s inglb hb ight
glowing colours. And put windows,
icons and pull-down menus into your mi PonT mm
own programs! Italic font sinsie hei.ght
Italic font dOUttO hOiSht
EXt CUTE

«our

CrtNCEL

Package conies complete


with AMX Mouse, graphics
SUITABLE FOR: Rec. price 1 £69.95
software, mouse port, Spectrum 48k Our price 1 £59.95
centronics printer interface
and all connectors. Spectrum v/ SAVING 1 £10.00

Brother Printer
A feature-packed printer from one of
Japan’s best-known manufacturers,
it prints on both thermal and
ordinary plain paper.

• Speed ISOcps. • Up to 132 characters per line. •


Bi-directional. • Takes A4 size paper. • Mains or
battery operated. • 4 fonts with reduced, enlarged
and bold modes. • Requires centronics interface -
see offer overleaf.

SUITABLE FOR: Rec. price 1 £99.95


Spectrum Our price 1 £89.95
Spectrum + SAVING 1 £10.00

lu ucicr rfiinc inc ficw


background colour.
Table I: INK colours

The Complete Spectrum / 55


More cut-price s
The only home
business
package ever
to have
knocked games
out of the Top
Ten!
Four different
programs, plus
a 32-page easy-
to-understand
manual, for an
incredible
price.

Rec. price | £5.95


Our price 1 £3.95
SAVING 1 £2.00^

Four classic game


every Spectrum
owner will want —
and all on one
^ ^ 01

SPECTRUM

The box-office smash


hits your screen with all
the high-energy drama
that only Rambo can
create. Take the role
of Sylvester Stallone
in explosive all-action
battle scenes!

Rec. price 1 £7.95


Our price 1 £5.95
SAVING I £2.00

ZV rATBR il-^1
way 11 iiiusi oe loiioweo oy a semi-coion, oinerwise me
30 PRINT “This Is a message”
Spectrum gets confused and generates an error.
The second command associated with colour is
40 GO TO 10
54 / The Complete Spectrum
e software offers
Dawn of a new age!
Laser Basic is the first in a
powerful range of development
tools for fast programming.

ret of advanced games programming

Rec. price | £14.95


Our price I £10.95
SAVING I £4.00

Create your own Rec. price 1 £9.95


machine code programs! Our price I\ £7.95
So easy - just ‘load and go!’ SAVING 1 £2.00

All the
skill and
tension of
The chart-topping international
3 part adventure show jumping
comes on captured in
two cassettes - this gripping
and will give you simulation.
many hours of
enjoyment! Rec. price \ £7.95
Our price I £5.95
SAVING I £2.00
Rec. price \ £9.95
Our price | £7.95
SAVING 1 £2.00

uunii/ £Lfiuur tu ucicr mint: int: new


background colour.
Table I: INK colours

The Complete Spectrum / 55


Save on joysticks, light p^ns and interfaces
Kempston Formula 1 Joystick and Interface
Undoubtedly the best joystick currently available. This
latest version has eight-way micro switches for faster
action and longer life. It’s a firm favourite with games
players because It helps achieve those high scores which
before seemed Just out of your reach!

Joystick only Joystick and Interface


SUITABLE FOR:
Rec. price I £16.95 Rec. price I £26.90
Spectrum y
Our price I £13.95 Spectrum + Our price | £18.90
y
SAVING I £3.00 SAVING I £8.00

DKTroniks Light Pen


This best selling light pen plugs neatly into the rear
of the Spectrum or the printer connector. The
operating software now runs faster and supports 18
pre-defined instructions. • Save and load partially
complete screens. • Accuracy down to pixel level.
• Change all colours (border, paper, ink). • Draw
circles, lines, boxes, arcs. • Retain and animate
screens. • Insert text onto screen.
SUITABLE FO R: Rec. price 1\ £19.9^
Spectrum y Our price i1 £14.95
Spectrum + y SAVING 1 £5.00

Programmable Interface Dual Port


A fully programmable
joystick interface that
allows you to run ANY
software from ANY
supplier. Easy programmed
in seconds to give 8
directional joystick
movements.

You can use two joysticks


simultaneously with this
Dual Port interface. It will
run ANY software and
accept ANY Atari-type
joystick.

SUITABLE FO R; Rec. price1 £22.95 SUITABLE FOR: Rec. price 1 £i3m


Our price 1 £18.95 Spectrum jy/ Our price 1 flO.OFl
Spectrum v/
Spectrum -h SAVING 1 £4.00 Spectrum SAVING 1 £3.00\
v/

DKTronics Parallel Centronics Interface


Enables you to link your ^
Spectrum to any printer with a
standard centronics output, such
as the Brother HRS offered
overleaf. It is fully Microdrive
compatible and supplied
comnlete with full instructions

SUITABLE FOl Rec. price 1 £39.95


Spectrum v/ Our price 1 £29.95
Spectrum -h v/ SAVING 1 £10.00

yvttj lu muat UV luiiuwcu uy a acilll-WUlUll, ULUCIWISC UiC

spectrum gets confused and generates an error. 30 PRINT “This is a message”


The second command associated with colour is 40 GO TO 10
54 / The Complete Spectrum
A dust cover for your Make sure you've got a
Spectrum and Spectrum+
COMPLETE set of
Made of soft pliable
water-resistant black
vinyl and decorated
with The Complete
Spectrum logo in
silver.
All you wont to know cbout the wcxk^ best-sdiing conputer

ONLY £3.95

Use the form below to order the next


A binder for The
four parts — delivered to you post
Complete Spectrum free every month for just £6.
Keep all your copies
neat and clean in
If you missed issue 1, we'll send it to
this handsome you for £1.75.
binder.
Or you can order issue 1, together
ONLY £3.95 with issues 3 to 6, for only £6.95.

Valid to March 31, 1986

ORDER FORM Please allow up to 28 days for delivery.


Please enter quantity as required in box

£ P
The Complete Spectrum Peripherals
Parts 3-6; Speech Synthesiser. . £19.95 9043
UK, Eire . .£6.00 9013 * DualJoystickport. . £10.00 9044
Europe . .£10.00 9014 _ * Programmable Joystick Interface . . £18.95 9045
Overseas . .£18.00 9015 * 3 Channel Sound Synthesiser . . £22.95 9046
Issue No. 1: Lightpen . . £14.95 9047
UK, Eire . .£1.75 9016 Parallel Centronics Interface . . £29.95 9048
Europe . .£2.25 9016 Formula 1 Joystick. .. £13.95 9049
Overseas . .£2.75 9016 — Formula 1 Joystick and Interface ...,. £18.90 9062
Add an extra 95p and we'll also
send you Issue 1. 9020 CZl
Software^
Binder Laser Compiler .£7.95 9057
UK . £3.95 9030 Laser Basic .£10.95 9055
Europe/Overseas.£6.95 903 Never Ending story.£7.95 9058
They Sold a Million .£7.95 9059
Rambo .£5.95 9060
Showjumping .£5.95 9061
Dust Covers Mini Office .£3.95 9001
Spectrum Dust Cover 5 or more items — deduct .£5.00 9099
UK .
Europe/Overseas.
Spectrum + Dust Cover
£3.95
£6.9 5
9035
9036 B Disc Drive
UK .
Europe/Overseas.
£3.95
£6.95
9037
9038 B OPUS DISCOVERY 1
Includes all interfaces
and power supply (UK only) £149.95 9100 □
Keyboards
Saga 3 Elite (UK only).£69.9 5 9041
DK'Ironies Keyboard (UK only) ....£27.95 9042 B. Printer
BROTHER HR5

ZX Spectrum
Includes 4 fonts
and paper (UK only) £89.95 9101 □
Expansion Pack
(UKonly) . £69.95 9040 □ AMX Mouse
Order at any time of the day or night Complete with
interface and software (UK only). £59.95 9102 \ |
Telephone Orders: Orders by Prestel:
061-429 7931 Key *89, then 614568383
AH prices include postage, packing and VAT
Don't forget to give your name, address and credit card number Overseas orders sent exclusively by Air Mail TOTAL

ENQUIRIES ONLY; 061-480 0171 NOW PLEASE COMPLETE PANELS OVERLEAF

\jxj! tu ucter ffiific iric new


background colour.
Table I: INK colours
The Complete Spectrum / 55
Payment: Please indicate method (>/)

□ A ccess/Mastercharge/Eurocard

[ L.J_l_J Li i 1 J 1 1 1 1 i 1 1 1 1 1

□ B arc/a y card I Visa

I-1 .ill L_L_..L.J till I ■ t i


Cheque/PO made payable
to Database Publications Ltd.

BLOCK CAPITALS PLEASE

Name _
Address

Post Code

Signed
Don't forget to provide: Your address, your cheque/credit card No.

C/) Q m Tl H
00 c 30
o
o O o m ®
TT 3-T3 m O
*0 o
TUCK INTO FLAP

CD 0)
O o
■1 O 3
o wa
Wi 30
C
£
o <0 CD
s4 0)
a T3
z CD
O
< i-f
C
3

iL iiiusr uc iTTiiuwca uy a £v iix i


Spectrum gets confused and generates an error. 30 PRINT “This Is a message^’
The second command associated with colour is 40 GO TO 10
54 / The Complete Spectrum

You might also like