You are on page 1of 132

Summer

Britain's Biggest Magazine For The Sinclair user


Over 100 pages off
j f
> infori programs
1
IIU1
BUG-

I III I I I M V
The Darnel and the Beast
A game of concentration and ouspence i n which you, the
intrepid hero. must wander i n the darkness and dangers
of the Beafit's palace, find the Da*-.el hiding or imprisoned
there, k i l l the Beast, and then l a s t but not l e a s t , lead
the Daneel t o the palace e x i t before she starves t o death.
An extremely complex, f r u s t r a t i n g and e n t e r t a i n i n g game.
Price £6.50

Dictator
You have .just become the 12?th jrwsident f o r l i f e o f the
state of R i t l a b a . The o b > c t of your rule i r t o do what
a l l previous presidents f a i l e d t o do, that LB, t o take
f u l l advantage o f the s i t u a t i o n f o r your own good.
The program i s supplied on high q u a l i t y cassette, together
with an 3 page booklet containing detailed d e s c r i p t i o n s ,
inrtructionr. arid h i n t s .
iTice £9.00
S t a r Trek
The classio computer game In which you trek acrosr. the
galaxy i n piearch of Klingore to n p with your phasers and
photon torpedoes. You have long and short range scanner* t o
help you f i n d then, litarbases to refuel your s h i p a t and.
of csurse, various witty comment?. froa the crew.
Price £6.50
House of Gnomes
Another f a n t a s t i c adventure game f o r the 16K :x8l.
Price £7.00

INVADERS
Fast moving, machine code version of the famous arcade
game, for the 16K ZXfll. Shields are provided to help protect
you from the boatr of the marching a l i e n s . Ten levelfi of play
from easy to s u i c i d a l . On screen scoring,
i r i c e only £4.00

BUG- BUG-
ZXAS £5.00
SFiriiES PFISNS
Thir. f u l l s p e c i f i c a t i o n ZilO Aascabler acoeabler. a l l the l*rograa hick 1
standard /,il<s/ aneaonicr., which arc s i a p l y written i n t o £3.50
Prograa Ibck Tt £"}. 50
KM* stateaenta within your BAI" IC prograa.rfheD assembled, Prograa i'ack 3 £4.50
the acseably l i s t i n g ; , together with assembled coder, ami trograa Pack 4 £4.50
addrwsix; arc dir.played on the screen. The assembled codec irogram Pack 5 £4.50
and addresses, are die played on the screen. The -Tnr.eab led Ifograa I'ack 6 £4.50
code i c executed by 1FR. The praflraa occupied 5K- 1M®
Irogram luck 7 £5.00
aeart- that /.XX' wiybe used in conjunction with ZXUB.
Program lUck 8 £6,00
The program te a v a i l a b l e for both the l6K ZX81 and the
GK l«*» ZX80. K"ull doctwentation on how t o m e the
anseabler ( i n c l u d i n g a lir.t of the w e w n i o ; ) ir. supplied.

I f I K \ %
ZXDB £ 6 . SO
Multifile
A muitl jxrrpoee f i l i n g systea f o r the 16K ZXfll. A wide range
The perfect complement t o the ZXAIi asr.eibler, ZXDB of possible a p p l i c a t i o n s .
is a complete combined Machine code dlcar-seabler and l"rice £17.50
detwgging program.
Ajurt fro® the the program haj. f e a t u r e , i n c Videof^rnph
including SDIGLE SfKI', BI-OCK SEARCH. TRAK.KrJt AND KILL. Gratliical display and t e s t i n g progrna. Hundreds o f pcr.slble
HKX U)Al)h». RBCI5TH1 DEPUT and • o r e , a l l of which are applications.
executed by simple one key c<H«andr; froa the keyboard.
Frice £7.50

ZXTK rfi.oo
Viewtext
0 ayKte f o r 16K 2 X 8 1 G r t ror
Irfw ^ n T * " " * " ^ <"*pl*y*
ZXTK enhances the f a c i l i t i e s offered by ZX81 BAijIC -
a muit for the serious BASIC p r o p M w r . Includes f u l l
Constellation
re-nuabering, the a b i l i t y to manipulate grcupi o f liner,
and merpe Til«b, road filenaar*. from tapes a**1 "ore. Turn your ZX8l into a telescope. Civets an accurate
representation or the night sky on any date o f the
Century.
RENUM £4.00 Price £0.00
A11 pr leer- Inc lur. lvn.
Hernia lis a f u l l renumbering program. Henuaberc l i n e BUG BYTE
numbers, GOTOh and CtEUft-., and w i l l renuaber existing
pro^njM.. '* t«JP IHt A1HANV
<MDHA11 simi T
In/tWOOl tl«i»
ZX 80/81 HARDWARE/SOFTWARE
ZX KEYBOARD •
Now with repeat key and facilities to add numaric
pad. The keyboard has all the 80/81 functions on
the keys, and will greatly increase your pro-
gramming speed. It is fitted with push type keys as
in larger computers.
The keyboard has been specially designed for the
Sinclair computer and is supplied ready-built. It
also has facilities for 3 extra buttons which could
be used for on/off switch, reset, etc. £27.95.
Numaric add on £10.

4K GRAPHICS ROM
The dK Graphic module is our latest ZX81 accessory. This module, unlike most other
accessories fits neatly inside your computer under the keyboard. The module comes ready
built, fully tested and complete w i t h a 4K graphic ROM. This will give you 448 extra
pre-programmed graphics, your normal graphic set contains 64. This means that you now
have 512 graphics and w i t h there inverse 1024. This n o w turns the 81 into a very powerful
computer, with a graphic set rarely f o u n d on larger more expensive machines. In the ROM
are lower case letters, bombs, bullets, rockets, tanks, a complete set of invaders graphics
and that only accounts for about 50 of them, there are still about 400 left (that may give y o u
an idea as to the scope of the new ROM). However, the m o d u l e does not finish there; it
also has a spare holder on the board which will accept a further 4K of ROM/RAM. This holder is
fitted with a 1K/2K RAM and can be used for user defineable graphics so you can create your own
custom charactor sets. £29.95.

MEMORY 80/81
16K RAM
Massive add-on memory for 80/81. £32.95.
2K & 4K RAM
Static Ram memory expansion for the 80/81. They both work w i t h o n b o a r d Ram i.e. 4K plus
onboard = 5K. This is the cheapest small m e m o r y expansion available anywhere. 2K RAM
£14.95. 4K RAM £19.95.
10 PORT
Interface your computer with the real world, our 10 port has holders to add up to 6K of RAM. £12.95.

16K
As seen at the ZX Microfair.
81 SOFTWARE
DEFLEX This totally new and very addictive game, w h i c h was highly acclaimed at the
Microfair, uses fast m o v i n g graphics to provide a challenge requiring not only quick
reaction, but also clever thinking. One and t w o player versions on same cassette. £3.95
3D/3D LABYRINTH You have all seen 3D Labyrinth games, but this goes one stage beyond;
you must manoeuvre w i t h i n a cubic maze and contend w i t h corridors w h i c h may go
left/right/up'down. Full size 3D graphical representation. £3.95.
CENTIPEDE. This is the first implementation of the popular arcade game on any micro
anywhere. Never mind your invaders, etc., this is positively stunning, the speed at which this runs
makes ZX invaders look like a game of simple snap. £4.95.
Graphic ROM Software Centipede. The graphic ROM version of our popular Centipede game. The
only real version of Space Invaders on the ZX81.
23 Sussex Road, Gorleston,

[K'tronics
Great Yarmouth, Norfolk.
Telephone: Yarmouth {0493} 602453
Dept. Z X C 5 8 2

ZX COMPUTING S U M M E R1)xCOMPUT
ZX Computing Editor: Tim Hartnell Origination and design by M M Design ft Print.
Vo4. One Editorial Assistant: Tina Boylan London
Number One Group Advertising Manager: Ron Moore
Summer 1 9 8 2 Managing Editor: Ron Harris. Published by Argus Specialist Publications Ltd,
Managing Director: T J Conned. 1 4 5 Charing Cross Road. London W C 2 H OEE.

CONTENTS Orbit
A massive 16K Z X 8 1 program to
zap
Get your computer into gear for this little
recreate the orbits of the four inner stunner.
planets of our solar system.
Tourist Trap 38
Here's your chance to get back at all
those people who keep stopping you and
asking you the way to Piccadilly. This
massive ADVENTURE program will run
on a Z X 8 0 o r Z X 8 1 .

Sinclair users speak out on the RAM Bigger Bytes


pack, a new users' club opens in
Scotland, and more. The I K supplied with the standard ZX81
BureaudeChange . . . .23 is a little restrictive, to say the least.
Benchmarks 11 If you're in the habit of jetting off to
Stephen Adams outlines a simple, and
cheap way to increase your memory
exotic parts of the world like Blackpool, power.
Henry Budgett and Tim Hartnell show you'll need your trusty Z X 8 1 to decode
you how to test the speed of your ZX the funny money for you.
computer, with eight programs to try. Machine Code 46
windfall ROM Bug 24 Machine code is a piece of cake. Or so
our authors believe, and they do their
best to unravel its mysteries and
Here's a 16K Z X 8 1 game designed to Dr Frank O'Hara grapples with the
convince you.
appeal to your materialistic instincts. dreaded ROM bug.

ZX80 Renumber 27 Micromouse 49


Chess
This will save you actually building a
Chess in 1K? Well, this program doesn't A renumber program to help you tidy up robot mouse, or a maze for it to run in.
play chess, but sets up a board so two your output. All you need is a 16K Z X 8 1 .
people can play. Splendid graphics, and
in just 1K.
Library Building 28 PEEKing and POKEing .50
ZX Computing it constantly on the look-out for wall There's a great temptation to put all your
written articles and programs If you think that your programs on one long, long cassette. W e PEEK and POKE are very usefut
efforts meet our standards pleasa feel free to submit tell you why it's not such a great idea, programming tools. Here's how you can
your work to us for consideration. put them to work for you.
Material should be typed If possible. Any pro- and give you some hints to organise your
grams submitted must be listed, cassette tapes muddled life.
alone will not be accepted, and should be accom-
panied by documentation to explain how they work
and make it easy 10 run them AN submissions will be power Boat 35 One-armed Bandit 56
acknowledged Any published work wilt be paid for.
A l work for consideration should be sent to the
Editor at our Charing Cross Road address Seasickness be my friend. Ruislip Lido Set this program up on your 1 K Z X 8 0 ,
awaits your ZX-powered craft. and win a little money from your friends.

ZX C O M P U T I N G S U M M E R1)xCOMPUT
ZX Computing is published quarterly in April, July. October end January. Distributed by: Argus Press Sales b Distribution Ltd. 12 18 Peul Street. London EC2A 4JS
0 1 - 2 4 7 8 2 3 3 . Printed by: Henry Garnett Ltd., Rotherham.
The contents of this publication including all articles, designs, plans, drawings and programs and all copyright and other intellectual property rights therein belong to
Argus Specialist Publications Limited. AH rights conferred by the Law of Copyright and other intellectual property rights and by virtue of international copyright
conventions are specifically reserved to Argus Specialist Publications Limited and any reproduction requries the prior wntten consent of the Company. 1982
Argus Specialist Publications Limited

Othello Quicksilva 74 Software Review . . . 1 0 4


This game was invented way back in the Nick Lambert used to make electronic Down in the depths with Greye's T Rex.
1880s, and has recently surged in organs, now he runs a company which or on the playing field with Michael
popularity. Who needs people, when a has put proper graphics, sound and Orwin, our reviewers lead the way.
16K ZX81 can prove a hard-to-beat colour on the Z X 8 1 . We talk to the man,
companion? and we examine his output.
Printer Tricks .107
Swappo 61 Chopper Squad 77 Make your ZX printer bend to your will,
with wide characters and large
characters.
Get your brain and your digits in order in Climb aboard your 1 K Z X 8 1 'copter and
this 1 6 K Z X 8 1 program. head for the hills. 'Tis time to drop a few
bombs.
Moving Pictures 108
Book Reviews 62 Draughts Get your aliens on the move with these
programming techniques.
The titles on the market for ZX computer 'Guess the number' is OK for a while,
owners is growing by the hour. We try to but eventually Z X 8 0 owners want a
sort out some of the more worthwhile program with a bit more meat. This Software Review . . . 112
ones for your bookshelf. version of draughts gives you a full
screen display and rapid response. Hewson's "Hints and Tips", along with
Area Calculator 65 their software moves under the
microscope.
Business 86
Carpets or paint, the Z X 8 0 can work out
how much area you'll be covering. Make full use of your Z X 8 1 with this Machine Code 114
program to handle files on up to 1 0 0
customers. We also take a close look at More of machine code's mysteries
Newsbeat 66 one of the leading suppliers of ZX dispelled.
business software, Mike Salem.
Here's the latest news from Sinclair
Biorhythms 116
Headquarters, including the true story
behind Clive's sweaty tracksuit.
UFO
Space shootdown time again for Z X 8 1 Good day. bad day, sad day, glad
owners. day . . . this program tells it all.
Hardware Review 68
ZX Drawing Board . . . . 9 3 Computer Glossary . .118
Stephen Adams takes a close look at
MCP's Microdevelopment pack, and Three programs to turn your Z X 8 0 or
gives you an honest assessment of its Z X 8 1 into a 'real artist'. Bewildered by the jargon committed
worth. computer owners use? Run through this
extensive article, and you'll be able to
Closer Look 92 fake it with the best of them.
Hypno What makes the Z X 8 1 tick? Peter
Freebrey takes a took inside. Squareology 124
A bewildering array of designs await you
in this full screen dazzler for a 1 6K
ZX81.
Horrorville 96 Challenge your 16K Z X 8 1 to a game
which takes real brains to beat.
1 6K ADVENTURE time withr this
Keyboard Review . . . .73 frightening program for brave Z X 8 1
owners. Specifications 128
Crofton have produced a keyboard
which completely swallows the Z X 8 1
ZX80 Fights Back 101 Our indispensible reference guide, for
Tim Hartnell tries it out. A bundle of programs for old ROMmers. serious users.

ZX C O M P U T I N G S U M M E R1)xCOMPUT
iiiiiiniiiMiiiiiiiimiifi

Sinclair ZX8I Personal Comp


the heart of a system
that grows with you.
Kit:
1980 saw a genuine breakthrough -
the Sinclair ZX80, world's first com-
plete personal computer for under
£100. Not surprisingly, over 50.000

£49*
were sold.
In March 1981, the Sinclair lead
increased dramatically. For just 95
£69.95 the Sinclair ZX81 offers even
more advanced facilities at an even
lower price. Initially, even we were
surprised by the demand - over Higher specification, lower price -
50,000 in the first 3 months! how's it done?
Today, the Sinclair ZX81 is the Quite simply, by design. The ZX80
heart of a computer system. You can reduced the chips in a working
add 16-times more memory with the computer from 40 or so, to 21. The
ZX RAM pack. The ZX Printer offers ZX81 reduces the 21 to 4!

Built:
an unbeatable combination of The secret lies in a totally new
performance and price. And the ZX master chip. Designed by Sinclair
Software library is growing every day. and custom-built in Britain, this
Lower price: higher capability unique chip replaces 18 chips from
With the ZX81, it's still very simple to theZX80!
teach yourself computing, but the New, improved specification
ZX81 packs even greater working • Z80A micro-processor - new
capability than the ZX80. faster version of the famous Z80
It uses the same micro-processor, chip, widely recognised as the best
but incorporates a new, more power- ever made.
ful 8K BASIC ROM - the 'trained • Unique 'one-touch' key word Kit or built - it's up to you!
intelligence' of the computer. This entry: theZX81 eliminates a great You'll be surprised how easy the
chip works in decimals, handles logs deal of tiresome typing. Key words ZX81 kit is to build: just four chips to
and trig, allows you to plot graphs, (RUN, LIST, PRINT, etc.) have their assemble (plus, of course the other
and builds up animated displays. own single-key entry. discrete components) - a few hours'
And the ZX81 incorporates other • Unique syntax-check and report work with a fine-tipped soldering iron.
operation refinements - the facility codes identify programming errors And you may already have a suitable
to load and save named programs immediately. mains adaptor - 600 mA at 9 V DC
on cassette, for example, and to • Full range of mathematical and nominal unregulated (supplied with
drive the new ZX Printer. scientific functions accurate to eight built version).
decimal places. Kit and built versions come com-
• Graph-drawing and animated- plete with all leads to connect to
display facilities. your TV (colour or black and white)
• Multi-dimensional string and and cassette recorder.
numerical arrays.
• Up to 26 FOR/NEXT loops.
• Randomise function - useful for
games as well as serious applications.
• Cassette LOAD and SAVE with
named programs.
• 1K-byte RAM expandable to 16K
bytes with Sinclair RAM pack.
• Able to drive the new Sinclair
printer.
• Advanced 4-chip design: micro-
New BASIC manual processor, ROM, RAM, plus master
Every 2X61 comes with a comprehensive, specially- written
manual - a complete course in BASIC programming, from
chip - unique, custom-built chip
first principles to complex programs replacing 18 ZX80 chips.
M TV',-. ULtl (
n b i xr *
TMtv
LET
IIS?
t^BJ.
LCT
POK
^aes pok
396ft LET
R E r

~ses po*
090 FOR
>991 FOR
99S POK
(>JsK+Z>
1S3 NEX-
OJ (VfffJfT

Available now- At last you can have a hard copy


of your program listings -particularly
the ZX Printer useful when writing or editing
programs.
for only £49.^ And of course you can print out
your results for permanent records
or sending to a friend.
Designed exclusively for use with Printing speed is 50 characters
the ZX81 (and ZX80 with 8K BASIC per second, with 32 characters per
ROM), the printer offers full alpha- line and 9 lines per vertical inch.
numerics and highly sophisticated The ZX Printer connects to the rear
graphics. of your computer - using a stackable
16K-byte RAM A special feature is COPY, which
prints out exactly what is on the
connector so you can plug in a RAM
pack as well. A roll of paper (65 ft

pock for massive


whole TV screen without the need long x 4 in wide) is supplied, along
for further intructions. with full instructions.

add-on memory. How to order your ZX81


BY PHONE - Access, Barclaycard or
by cheque, postal order, Access,
Barclaycard or Trustcard.
Trustcard holders can call EITHER WAY - please allow up to
Designed as a complete module to 01-200 0200 for personal attention 28 days for delivery. And there's a
fit your Sinclair ZX80 or 2X81, the 24 hours a day, every day. 14-day money-back option. We want
RAM pack simpiy plugs into the BY FREEPOST - use the no-stamp- you to be satisfied beyond doubt -
existing expansion port at the rear needed coupon below. You can pay and we have no doubt that you will be.
of the computer to multiply your
data/program storage by 16! r,To: Sinclair Research. FREEPOST, Cambertey, Surrey. GU15 3BR Order
Use it for long and complex Oty Item Code Item price
£
Total
programs or as a personal database. £
Sinclair ZX81 Personal Computer kit(s). Price includes
Yet it costs as little as half the price ZXSi BASIC manual, excludes mains adaptor. 12 49.95
of competitive additional memory. Ready-assembled Sinclair ZX81 Personal Computer(s).
With the RAM pack, you can Price Includes ZX81 BASIC manual and mains adaptor 11 69.95
also run some of the more sophisti- Mains Adaptors) (600 mA at 9 V DC nominal unregulated) 10 6.95
cated ZX Software - the Business & 16K-BYTE RAM pack 18 49.95
Household management systems Sinclair ZX Pnnter. 27 49.95
for example. 8K BASIC ROM lofitZX80 17 19.95
Post and Packing 2.95

• Please tick if you require a VAT receipt TOTAL £


*l enclose a cheque/postal order payable to Sinclair Research Ltd. for £
•Please charge to my Access/Barclaycard/Trustcard account no.
IPlease
I print
I I
in lair-
'Please delete/complete as applicable 1 I 1 I I I I I I I I I I

Name: Mr/Mrs/Miss I I I I 1 I I I I I 1 I I I I I I
ZX8I
6 Kings Parade, Cambridge. Cambs.. CB21SN
Address: I I I
I I I 1 I I I I I I I
L

FREEPOST - no stamp needed.


1 I I
I I I I I J L M i l
zxc os I
Tet: (0276) 66104 A 21282.
Letters

A l l l l l
o m e
What we're trying to do for
y o u . . . and how you can help us
Welcome to the first bumper articles in this issue to help you development? In this issue of of your computer, whether you
issue of ZX Computing. The fathom out the mystery. Both ZX Computing, we take a trip want it to help you develop your
Z X 8 1 and the Z X 8 0 are great of the articles contain sample through the ZX library, giving programming skills or learn
computers, and we're going to routines for you to enter and you an honest assessment of machine code, play games or
make sure you make the most run, so you can see your some of the books you can buy. use it in business. But we need
of your Sinclair micro. machine code in action im- The same goes for software. you to help us. The only way we
As you'll see by looking mediately. It seems that every cottage in can keep up the high standard
through this magazine, we've If you're tired of trying to the UK hides an industry pro- we've set in this first issue is for
got a host of programs for you make your programs fit into 1K, ducing ZX software. How good you to send us your best pro-
to try, to demonstrate how flex- and don't want to spend too is it? And is it worth the money? grams, routines, construction
ible your micro can be. There much expanding your com- Again our reviewers look fear- projects and discoveries. We'll
are a lot of games, because puter's memory, this issue's lessly at a selection of the soft- pay for any material we use. If
most of us like playing games, construction article will give ware packs on the market. . . you have any opinions on soft-
but there are many other pro- you additional bytes very and reach some surprising con- w a r e or h a r d w a r e y o u ' v e
grams as well to show you, for cheaply and simply. clusions. bought for your Z X 8 1 or Z X 8 0 ,
example, how you can use your The number of Z X 8 1 books At ZX Computing we're or on Sinclair's delivery, repair
ZX computer for business. on the market is bewildering. committed to producing a or back-up service, please
If you don't yet understand How can you decide which is magazine which will be of share them with us, so we can
machine code, but you want to the best book for you at this genuine assistance to you to share them with other readers.
learn about it, we have two stage in your programming ensure you make the most out Tim Hartnell

ZX C O M P U T I N G S U M M E R 1982
Letters
The @*?$1!&£@ 50
60
LET CA - 1 2
INPUT X $
with an assembled Z X 8 1 .
Note that I have no
is relocatable, that is, it can be
placed anywhere in RAM.
RAM pack 70 PRINT V A L X $ connection with Sinclair,
80 PRINT V A L X $ (TO 2) John Miller,
except as a satisfied user.
Dear ZX Computing, Farlington, Portsmouth.
I've read many letters which Entering either C, CA or CAT
D E F Rolfe,
mirror my own problems with produces the appropriate
Sinclair's 16K memory pack. answer on line 7 0 , and will
Haslemere, Surrey. Och aye the 81
I bought a 16K RAM pack, even break down CAT to CA
on line 8 0 to print 12 as the • CAiVUB
PLOSIVE Dear ZX Computing,
and — like so many
answer. Following an advertisement
correspondents — have - ZX81 and a feature in the local
suffered with bytes of
paper, a Z X 8 1 users' club has
information altering Andrew Field,
been formed in tnverclyde
themselves before the Epping, Essex.
(Gourock, Greenock and Port
computer crashed. When 1
Glasgow). The club is meeting
first encountered the problem,
weekly on Wednesdays at
I sent my 16K pack back as I
members' homes in turn.
thought it was faulty. It was
returned with a note to the Our numbers are as yet
effect that there was nothing] small, but they are increasing.
wrong with it. Screen invert We would be grateful if you
could mention us in 'ZX
I have now relieved the Computing', The number to
problem of disappearing data Dear ZX Computing,
When writing games for my phone for meeting details is
but at the expense of my Gourock 3 9 9 6 7 .
Z X 8 0 . 1 made a number of Z X 8 1 , 1 find that I sometimes
'alterations', the first of which need to 'inverse' everything
was to abandon the flimsy top on the screen at a particular
part of the casing. I presumed stage in the program. It is
that the fault was a heat possible to use a BASIC
problem and hoped this would subroutine to do this but this
cure it. It partly worked and so is a slow process — half a
I then unbolted the regulator minute or so — so I set about
and heatsink from the board And an answer writing a machine code
routine which could be used in
and left it standing in free air
with an additional heatsink. Dear ZX Computing, the SLOW mode.
This helped greatly, but did Having read about the various Type in the following
not totally solve the problem. problems with the 1 6K RAM program:
pack, I am beginning to
The final 'modification' was 10 POKE 1 6 3 8 8 . 0
wonder if I am exceptionally
to remove the casing around 12 POKE 1 6 3 8 9 , 1 2 7
lucky, or are all the other
the 16K RAM pack. There are 14 FOR C = 3 2 6 0 0 TO 3 2 6 2 4
satisfied Z X 8 0 / 8 1 users too The club secretary (me) and
1 5 chips inside the case which 16 INPUT N
busy writing long and complex one of our other members
get quite hot. I now have no 18 POKE C, N
programs to find the time to 20 NEXT C attended the ZX Microfair.
problems with data altering —
write? 22 NEW bringing back the saga of a
except under one condition.
When working on a large I did have some crashes day in London neither will
program (3K plus), and with the 3K RAM, so I wrote The numbers to be entered forget. Not that we would
extensively altering the to Sinclair and received a letter (line 16) are as follows: want to. W e only hope it will
program, I find there comes a which included the following; be possible to arrange
point where the computer " W e have found that 4 2 , 1 4 , 6 4 . 6. 2 2 . 1 2 6 . 2 5 4 . something similar further north
lubrication on the contacts 1 1 8 . 3 2 , 8. 5, 1 2 0 , 2 5 4 . 0 , 3 2 , so that all our members can
cannot handle the extreme 5, 2 4 , 6, 1 9 8 , 1 2 8 , 1 1 9 , 3 5 ,
alterations. soives the problems of RAM have the opportunity of seeing
24. 2 3 7 , 2 0 1
pack connections. You should a wide range of both hardware
first clean the edge connector and software.
K Huber, The routine will still remain at
with surgical spirit and then
Hayes End, Middlesex. smear it with Vaseline." the top of RAM, even after
NEW, so it can be used for any Robert Watt,
I did this and had no further Gourock, Renfrewshire.
trouble, and when my 1 6K program LOADed during a
* CXPLCMMVr RAM arrived I repeated the programming session. You
D A M E I
need to include the following *Eric Deeson, the organiser
ZX81 treatment. Again, no trouble of the EZUG (Educational ZX
at all. routine in the BASIC program:
Users Group) is planning a
With regard to Sinclair 9000 PRINT A T 0 , 0 : microfair in Birmingham in
service, I can only say that I 9010 LET R R - U S R 3 2 6 0 0 September. More details on
am very happy. Like many that in the next issue of ZX
others, I received a letter Line 9 0 Q 0 ensures that the Computing. Jo find out more
about the 1 6K R A M delivery. m/c routine starts scanning at about EZUG, send a large,
Mine arrived in four weeks. I the beginning of the screen. SAE to EZUG, Highgate
had a keyboard fault on the The routine takes less than an School, Birmingham B12 9DS.
Z X 8 1 kit that I assembled for eighth of a second to RUN and TH
Catty wonder my son. It was replaced by
return post after phoning
Dear ZX Computing, Cambridge. We had another
The wonders or u.C's little intermittent fault, and as I was
machine never ceases to able to go to Cambridge, I took
amaze me. Did you know that it to the Sinclair office. I was
this program actually works: directed to the Service
Department where, after
10 LETC « 1.5
spending some time on it and
20 LET A - 4.9
30 LET T = 20 failing to find the offending
40 LET C A T - 49 component, they replaced it

ZX C O M P U T I N G S U M M E R 1962
Memotectrs New Memory System for the ZX81
It grows as youprogress

Memopak 16K Memory Extension Memopak 64K Memory Extension


-£39.98 incl.VAr -£79.00 incLW
It ts a tact thai the ZX81 has revolutionised home computing The 64K Memopak is a pack which exterxjs the memory of
and coupled with the new Memopak 16K it gives you a the ZX81 by a further 56K. and together with the ZX8' gives a
massive 16K of Directly Addressable RAM. which is neither full 64K which is neither switched nor paged and is dtrecny
switched nor paged With the addition of the Memopak 16K addressable The unit is user transparent and accepts basic
you ZX81 s enlarged memory capacity will enable it to commands such as 10 DIM A(9000)
execute longer and more sophisticated programs, and to
hold an extended database BREAKDOWN OF MEMORY AREAS
The 16K and 64K Memopaks come in attractive, custom OW Sinclair ROM
desgned and engineered cases which f ii snugly on to the 8 16K This section of memory switches in or out m 4K
back of the ZX81 giving firm, wobble-free connections blocks to leave space for memory mapping holds its
See be:ow for ordering information contents during cassette loads allows communication
between programmes, and can be used to run assembly
Coming Soon. MEMOPAK RAM
language routines
H - f l E S GRAPHICS 16 32K This area can be used tor basic programmes ana
Memotech Ik fW> CENTRONICS I F j assembly language routines
C**WONC\ M W R T M MID SOFTW0*V«RI
T I M R S M TFIIHFK* 32--64K 32K of RAM memory for basic variables and large
arrays
With the Memopak 64K extension the ZX81 is transformed into a
All these producls are designed to fit piggy back fash on powerful computer suitable for business leisure and
on to each other and use the Sinclair power suppty educational use at a fraction of the cost of comparable
WATCH THIS SPACE for further details We regret we are as yet systems
unable to accept orders or enquiries concerning these products O
but we let you know as soon as they become available Unique 3 month trade-in offer! <
When your programming needs have outgrown the capacity ID
How to order your Memopak. provided by 16K RAM and you fmd it necessary to lurther <0
By Post: Fit m the coupon below and enclose your extend your ZX81 s capacity we will take back your 16K
Memopak and allow a discount of £ 15 00 against your
£
cheque P O . Access or Barclaycard number
purchase of our 64K mode! * <r
By Phone: Access Barclaycard holders please ring 'We reserve the right to refect for discounting purposes units when ©
Oxford (0865) 722102 (24-hour answering service) have been either opened or damaged m any way

Please make cheques payable to Memotech Limited Please send me:


Please debit my Access Barclaycard' account number Quantity Price Total
16K RAM. Assembled £39.95
'Pteasea&ete whichever aoes not appty 64K RAM. Assembled £79.00
Postage £2.00
SIGNATURE DATE,
Total Enclosed
NAME
ZX1
We want to be sure you are satisfied with your Memopak - so we offer a 14-day money back Guarantee on ali our products.
Memotech Limited, 3 Collins Street, Oxford OX4 1XL, England Telephone: Oxford (0865) 7221023/4/5
Benchmarks

Testing
your
ZX81
speed
Henry Budgett and Tim Hartnell
look at the 'standard' series of
benchmark tests and apply them
to the ZX81 to see how well it
performs. Try the tests yourself
and see if your machine
measures up.

There are a number of ways to establish the efficiency of a com- the information stored, and storing each number as a floating -point
puter, and the tests performed are generally called 'benchmarks'. number uses up much more space than does storing such numbers
Each set of these standard tests tries out a function or functions of as integers. Other BASICs (such as the Acorn Atom and the BBC
the computer, and produces a measureable result which can be Microcomputer, for example) allow you to specify which sort of
compared with other computers performing similar tasks. numbers you wish to deal with, and allots only the necessary space
The most commonly used tests in the microcomputer world are to do so, thus maximising memory and processing speed. The
those introduced way back in 1 9 7 7 by the Yankee magazine Z X 8 0 , of course, works only in integers.
KILOBAUD. While they're not particularly rigorous, they do offer a Anyway, here is the first benchmark:
quick and simple solution to the problem of checking out how well
1 REM *BENCHMRRK DNE*
I the computer performs certain arithmetic functions.
The speed of processing depends on the speed of the micro-
5 I F I N K E Y $<>**'* THEN GOTO 3
u 10 I F I N K E Y T H E N GOTO JO
< processor's clock. In the Z X 8 1 , the BASIC runs at 3 . 2 5 MHz. B<3 FOR K = 1 TO
There are eight benchmarks in the series. Apart from the last 30 NEXT K
o one — which requires the presence of certain mathematical func-
•0 4-0 P R I N T
tions and demands floating-point numbers — you'll be able to run a
version of them on the ZXBO. Each test should be run and timed 1 0
&8 times, then an average of the results obtained. The built-in FOR . . . NEXT function on the Z X 8 1 incorporates a
The first test is a simple loop program that sets up a FOR . . . routine to compare the variable K with 1 0 0 0 , so this program runs
£T relatively quickly. The second test uses the comparison statement
NEXT loop of 1 0 0 0 counts. This, and the other tests, waits until a
© key is pressed after pressing RUN before starting the program. You IF. This runs more slowly, because each time the computer comes
enter RUN, then press NEWLINE, and then touch any key (except across the IF K less than, it has to look up the value of K in its
BREAK) as you start your timing. Lines 5 and 1 0 in each program variable store, and compare this with 1 0 0 0 . This, as you'll see,
ensure that the program waits until la) you've taken your finger off takes time. If you find, by the way, that you do not have the pa-
the RUN key (line 5) and then until you've pressed any key (line tience to wait while your little computer runs through each of these
10). You'll obviously have to omit these lines on the ZXBO. You things a thousand times, change the 1 0 0 0 in tine 5 0 to 1 0 0 . This
stop timing when the zero appears in the top left-hand corner of the is benchmark two:
screen.
The tests are particularly fascinating if you can run them on
1 REM •* B E N C H M A R K TUD*
another computer to compare the times. The Z X 8 1 is not a very
5 I F INKEY$< >"" THEN GOTO 5
fast machine, even in FAST mode. Part of the slowness can be 10 I F I N K E Y $ = " " THEN GOTO J 0
attributed to the fact that the Z X 8 1 stores all numbers as if they 20 LET K=0
were floating point numbers (ie as if they had digits after a decimal 30 LET K = K + 1
point), even when they are integers (whole numbers). The more 50 I F K < 1 0 0 0 THEN GOTO 3 0
bytes a variable occupies, the longer it is going to take to process 6 0 P R I N T "0 '

ZX C O M P U T I N G S U M M E R 1962 11
elements of the array. Specifying memory requirements takes a
certain time, depending on the w a y in which the variables are
stored. Benchmark six:
1 REM JBENCHMfiRK S I X *
5 I F I N K E Y J O " " THEN GOTO S
10 I F I N K E Y $ = " " T H E N GOTO 10
2 0 LET K=0
2 5 D I M H ( 5 )
3 0 LET K =K + 1
4-0 L E T R=K.'2*3+4--5
4-5 G G S U B 7 0 0
4-6 F O R L =1 TO 5
4-3 N E X T L
5 0 I F K < 1 0 0 0 THEN GOTO 3 0
SO P R I N T " 0 "
7 0 0 RETURN
The seventh benchmark fills up this array (tines 4 6 , 4 7 and 4 8 )
every time you run through the loop. If you need to cook a dinner
for 1 0 guests, take the dog for a 2 0 mile walk or repaint the living
room, do it while this test is underway. Benchmark seven:

1 REM * 6ENCHMRRK SEUEN*


5 I F I! .KEY 4 < >" " T H E N GOTO 5
10 I F I t KEY' $ - " " T H E N GOTO 1 0
20 LET ) —0
2 5 D I M i ( 5 )
3 0 LET K = K + 1
4 0 LET
Our third test in the series simply adds a little bit of arithmetic 4-5 GOSUB 7 0 0
within the loop (line 4 0 ) . The result of the calculation is assigned to 4-6 FOR L = 1 TO 5
the second variable, that is, it is set equal to A. The difference in 4-7 LI- T M <L ) = R
your computer time between the running of test t w o and test three 4-S N E \'T L
is directly related to the time it takes your computer to do a few 5 0 IP K < 1 0 0 0 THEN GOTO 3 0
simple sums. Benchmark three: 60 P R I N T " 0 "
700 RETURN
1 REM *BENCMM9R>i THREE*
5 I F I N K E Y S O " " THEN GOTO F The final test in the series — which you won't be able to run on a
10 I F I N K E Y $ = " " T H E N GOTO 1 0 Z X 8 0 — was introduced as a test of the various numeric functions
2 0 LET K =0 of the interpreters. A badly written logarithm calculation may
3 0 LET K = K + 1 cause the result time to be very slow. It is worth testing each func-
4 0 LET R =K S K + K - K
5 0 I F K <1 0 0 0 THEN GOTO 3 0 tion that is available on your computer separately to establish both
5 0 P R I N T " 0 " its accuracy and speed of operation. The 'raising to a power' (* * ,
shift H) is particularly slow on the Z X 8 1. a fact which can be put to
In test four, w e use numeric constants (ie numbers) instead of good use if you wish to slow down a loop in a program, without us-
variables. This test should run slightly faster than the previous one ing the jerkiness of PAUSE, and without using t w o lines to set up a
because there is less need for the Z X 8 1 to look up variables. FOR . . . NEXT loop.
Benchmark four: Entering LET Z = RND * * RND * * RND will use the slowness of
the RND function, and the lethargic nature of the * * to produce an
1 REM ^ B E N C H M A W FOUR* impressive drop in speed. This is ideal in programs when you want
5 I F INKEY $<>*'" THEN GOTO B
the computer to pause slightly to make it look as if it is thinking.
10 I F I N K E Y $ = "" THEN GOTO JC*
2 0 LET K = 0 A n y w a y , back to benchmark eight. Run this, noting that the 1 0 0 0
3 0 LET K - K + l used in the other tests has been cut to 1 0 0 (line 7 0 ) because you
4 0 LET R = K . / 2 t 3 f 4 - S could well leave school, marry, have kids and all that before the
5 0 I F K < 1 0 0 0 THEN GOTO 3 0 test was over if you let it mount up until K was 1 0 0 0 . If you have
5 0 P R I N T "id ' already cut the 1 0 0 0 in the previous tests to 1 0 0 , drop this one to
2 0 . Benchmark eight:
The fifth benchmark introduces a wonderful character, the
Phantom Subroutine Call. This tests just how well a computer 1 REM *BENCHMARK E I G H T *
stores the return address from a subroutine. A subroutine, as you S I F I N K E Y $ < -> THEN GOTO 5
probably know, sends action to the line specified (as in GOSUB 10 I F INKEY 3 = " THEN GOTO 1 0
7 0 0 ) then follows the program through from that line until it hits 20 LET K =0
the word RETURN then sends action back to the line after the line 3 0 LET K=K+ 1
which had the GOSUB command (in this case it is line 5 0 ) . If a com- 4 0 LET R=K * * 2
puter system is well designed, the extra time taken to process the 5 0 LET B = L N (K>
phantom call should be minimal. Run benchmark five, and see if it 60 LET C = S I N <K.>
takes significantly longer than test four: 7 0 I F K < 1 0 0 THEN GOTO 3 0
SO P R I N T " 0 "
1 REM *6ENCHMRR.K F I U F •*•
5 I F INKEY $<>"•' THEN GOTO S Try running the tests in both SLOW and FAST modes, and if you
10 I F I N K E Y S» - " " THEN GOTO J P get the chance, try them on another kind of computer to see how
2 0 LET K =0 well the Z X 8 1 measures up.
3 0 LET K=K + 1 The tremendous slowdown in speed which occurs in SLOW
4 0 LET R = K . / 2 * 3 + 4- - 5 happens because the computer spends far more time looking after
45 GOSUB 7 0 0
the steadiness of the picture than it does actually doing any other
5 0 I F K < 1 0 0 0 THEN GOTO 3 0 useful work. In SLOW, the Z X 8 1 spends only around 1 . 2 8 milli-
6 0 P R I N T " 0 "
seconds of every 2 0 milliseconds doing anything other than look-
7 0 0 RETURN
ing after the T V picture.
Things get a bit more hairy in benchmark six. Not only do w e Let us know how you get on with these tests, and tell us how
keep our Phantom Subroutine Call, but w e tetl the computer to your results on the ZX machines compare with the same results run
DIMension an array. When the computer initialises an array, it sets on other makes of computers owned by your friends. We'll be
aside in memory a number of locations to store the contents of the discussing your results in the next issue of ZX Computing.

12 ZX C O M P U T I N G S U M M E RISZXCOI
16K Games

Windfall From Ottery St Mary in


The aim of the game is to ac-
quire as many currency notes
as possible during the one
Devon comes this minute 2 3 seconds the game
program by C Llewellyn, runs, without picking up any in-
designed to appeal to verse Cs, which determine that
all previous notes collected are
your materialistic counterfeit. In order to keep the
instincts. Run over the game moving at a fairly rapid
money flowing up fro pace, the SCROLL function is
used, and the information need-
mthe bottom of your ed for scoring is fed into strings,
TV, avoiding the which are processed at the end
counterfeit cash. of the game. AH currency, you'll
be delighted to know, is con-
verted into Sterling, at an ex-
change rate of 55p to the
dollar. The standard pound sign
is worth a pound (surprise, sur-
prise), with the inverse pound
sign worth a fiver. An ordinary
dollar sign is 55p, and an in-
verse dollar sign is $5, or
£2.75.
You are an inverse blob at
the top, with " 1 " to move left,
" 0 " to move right and " 9 " to
move down. You score by runn-
ing over the relevant sign, mak-
ing sure you avoid the inverse
C.
Line 8 0 reads LET C$ = "in
verse $ inverse £ $ inverseC £
inverse $ inverseC inverse £ $
inverseC inverseC inverse £ in-
verse $ " without any spaces.

3 1 0 NEXT R
1 REM W l N D i - H _ L By i. L L E X I E 1 X >•"
3 2 0 FR ST
1© FvlINT RT 7 . 3 . U I N D F f L
3 3 0 CLS
L" 3 0 0 0 LET R = 1
20 f-OP. P - 1 TO S&O 3 0 1 0 L ET Y = 1
30 NEXT R 3 0 2 0 LET Ll = - 2 0
n p i N T fV 1 7 , 3 . "THE £ W t E LET Z = CODE B t ( P , 1 )
3 0 3 0
IN5 304.0 LET X =C-ODE P $
5 0 FOP R =2 O 10 -
3 0 5 0 I F V >=U +Z THEN GOTO 3 0 9 0
60 NEX" ' R 30t>0 LET P =CODE R * (R-20+Z.WJ.>
CL5 3 0 7 0 LET C=COOE R $ v R - 2 0 > Z >
80 L ET 3 0 8 0 I F X —P T H E N GOSUB 4-000
9C ET T =3 3 0 9 0 LET R =R + 1
100 LET R - 1 3 1 0 0
LET LET U=U + 1
110
120 LET X" s il C*
3 1 1 0
3 1 2 0
I F
5LOU
R <151 THEN GOTO 3 0 3 0
130 DIM R$ i1S 0 .2) 3 1 3 0
DIM P R I N T RT 1 7 / 6 ; " Y O U COLLECTE
140 B® I 1 5 0 ..23 D
150 LET C = I N T {RND * 1 2 J +1
LET 314-0 FOR R =1 TO 1 0 0
160 P - I N T IRND #17) +3 3 1 5 0 NEXT R
170 P R I N T RT 2 0 , P ; C $ (C.t 3 1 6 0 P R I N T RT 1 9 . . 2.; ' W O U L D Y O U L I
1S0 I F I N K E Y $ = " 1 " THEN L E T X =X -
KE RN OTHER GAME?"
3 1 7 0 P R I N T RT 2 1 , 1 ; '•Y/-N"
' 190 I F I N K E Y $ = "0" THEN LET X + INPUT 5
3 1 8 0
1
200 I F I N K E Y $ = " 9 " THEN LET Z *
3 1 9 0
3 2 0 0
CLS
I F V THEN G O T O 4-0
1
210 PR I N T RT Z ,X;
3 2 1 0 STOP
220 LET R $ ( R .. 1 > = C H R $ P
4-000
4 0 1 0
I F
I F
C = 1 2 THEN LET
C = 14.0 T H E N LET
T=T + 1
T =T +5
230 LET fit ( f l ^ ) - c t i c y 4-020 I F C = 1 3 THEN LET T = T * 0 , 5 5
24.0 LET B $ ( R , 1 ) =CHR$ Z 4-030 I F C = 14-± T H E N LET T = T + 2 . 7 5
2 5 0 LET B $ ( R . . 2J> .x 4 0 4 0 I F C = 1 6 8 THEN LET T = 0
260 LET R =R + 1 4 0 5 0 RETURN
2 7 0 SCROLL
280 I F R <151 T H E N GOTO 1 5 0 L I N E 8 0 1 5 , WITHOUT
2 9 0 P R I N T RT Z , 7 ; " END OF f- THESE 5PRCE5:
it
SHE B s
300 FOR R = 1 TO 1 0 0 W A V
14 ZX C O M P U T I N G S U M M E R 1982 2)
Autumn issue on sale July 23
And we've got even more
for you next time!
= "in-
rseC £
rse£ $
se£ in- Make sure you get the next bumper issue of ZX Computing.
aces.

Features include:

. How to produce your own user-defined graphics


. Fearless book reviews
. Penetrating software reviews
. Using the ZX81 in business
. Getting to grips with machine code
. A host of games, ZX80 and ZX81, I K and 16K

If you're serious about exploring the full potential of


your Sinclair computer, and you want an easy-to-under*
stand series of articles to improve and develop your
programming skills, then ZX Computing is for you.

Fill in the coupon below and give it to your newsagent

Newsagent,
Please reserve me a copy of the Autumn issue of
ZX Computing, available July 23rd.

Name

Address

1ER 1962 ZX C O M P U T I N G S U M M E R 1982 15


The Explorer's Guide to t h e Z X 8 1
IF YOU'VE GOT A 2X81 THEN YOU NEED THIS BOOK 1
Prograrm for IK HAM. and prograrm for 16K HAM
ZX81 GAMES
FED UP WITH BEING RIPPED OFF?
Gjmei Bui mm and Engineering Application!
RAM & I/O Circuit!. Uuful ROM Routine! Hmti HAVE YOU BOUGHT
and Tipi 120 pagei f4 95 BORING/WORTHLESS/RUBBISH GAMES?
D O N T DESPAIR, TRY THESE!
What Can I Do w i t h 1K? GAMESTAPE 1. for 1K -only £3 96
By Roger Valentine A Irath and original b o o k 10 Games .net ASTEROIDS, UFO, CODE. BOMBER.
containing 4 0 program* and routinei tor the GUILLOTINE. K ALElDESCOPE. etc
unexpended 2 X 8 1
PROBABLY THE BEST VALUE IK TAPE AVAILABLEI
We've done m IK, games that some of our competitors
required 16K to do!
3 4 A m a z i n g G a m e s for the 1K Z X 8 1 I
GAMESTAPE 2. for 16K or v f4 96
by AJ at tan GourUy. £3 95| •STARFIGHTER Superb Machine Code Space Batt".-
Set against a background of twinkling stars, with
stunning explosions • il you can hit the Enemy)
PYRAMID Can you move the PYRAMID.' M.jkt
The Z X 8 0 Magic Book mistake and t will collapse1 A Thinkers Game
•With 8K ROM/ZX81 Supplement* ARTIST The Ultimate Graphic Designers A,d' 8
Directions, 10 Memories. SAVE, COPY. RUBOUT, CLS.etc
Gimn pfogramt, computer muue. converting programi
written in other BASICS, improving the picture GAMESTAPE 3. for 16K - only C5 96
RAM & l/Ocircuiti. and much more £4 75 'CATACOMBS A Mulli Level Graphics Adventure
Each Level can include up to 9 Rooms, 8 Passages, 7
Getting A c q u a i n t e d w i t h your Z X 8 1 Monsters. Food. Gold. Traps. Phantoms, an Exit do the
next Level), and there's an infinite number of Levels!
75 * piogrami including Draught!, bv Tim Hartndt f4 96 This is NOT one ol the necessarily limited text
Adventures, as sold elsewhere
Mastering Machine Code on your Z X 8 1
by Tom Baker GAMESTAPE 4, for 16K only C5 96
180 page* ot immeme value to beginriei and e>p«rf alike C5 96 *30 MONSTER MAZE Unbe'-evable Graphical Can you
find your way through the Maze' The EXIT is there
ALL PRICES INCLUDE U K P8.P somewhere, but then so is a T REX, and it's after YOU'
All in 30 (the T REX will actually run toward you in

n
• 15* VAT WHERE APPLICABLE
perspective1), you've never seen anything like I his before'
OVERSEAS CUSTOMERS ADD
C1.50CARRIAGE PER ORDER GAMES MARKED " incl Machine Code Prices inci VAT ft U K P bP
\W wiinv 1
PAYMENT WITH ORDER PLEASE iadd appropriate postage on Foreign Orders)
TIME DATA LTD . Dapt G , Swallowdala Baiildon.
Euck SS16 5JG Tat. <0268) 411125 (MON-fRI) J.K.GREYE S O F T W A R E

UHIEDALA
D e p t . Z X , 16 P A R K S T R E E T , B A T H , A V O N B A 1 2 T E
Trade enquiries welcome

MICHAEL ORWIN'S ZX81 CASSETTES


CASSETTE ONE CASSETTE T W O
for 1K ZX81 Ten games in Basic for 16K ZX81 •

. a »• •«
« «

<
• •
RECTANGLES a i
INVADERS (IK) AWARI • • •
1 . » WT • a• * •
* •• ftV ft» H
"I had your Invaders React H A M i A A mm
T * OAHT or itt-flft I
rft *>lbC i fi ! ! ' , !
ftft «
ft ft n A»n
cassette . . . I was delighted Mft V
ft
V
with this first cassette."
P. Rubython.
London NW10
#
"I have been intending to write %

to you for some days to say P H A N T O M ALIENS <Ou* nfiyf


how much I enjoy the games
on Cassette One' which you r z r > r
Supplied me with earlier ihis
month Please let . . into the PONTOON PENNY S H O O T
secret of your first time load 1
every time?" [•»OMTocwg
• "1 THC bMfM- Mf>',
'Ou» ( . w o n l«
(»**«
n u t
irva a a n • •
E H . London SW4 BUG SPLAT 'HI tTVO «T IV
woun »r««
IS CIH
Just two our Of over 20
unsolicited testimonials.
( P R l 1 WILL »TIC« UTTH IT

VOW «*UC HON r i H


Cassette One 1K machine code programs:
React, Invaders, Phantom Aliens, Maze of Death, Planet Lander,
Bouncing Letters, Bug Splat.
I K Basic Programs:
I Ching, Mastermind, Robots. Basic Hangman Cassette Two contains Othello. Awari, Laser Bases. Word
PLUS Large screen versions of Invaders and Maze of Death, ready Mastermind, Rectangles, Crash, Roulette. Pontoon, Penny Shool
for when you get 16K. and Gun Command.
Cassette Two costs £5.
Cassette One costs €3.80

Recorded on quality cassettes, sent by first class post, from:


Michael Orwin. 26 B r o w n l o w Road. Willesden. London N W 1 0 9QL. (Mail order only please)

16 ZX C O M P U T I N G S U M M E R IS ZX COI
IK Chess?
Graham Charlton shows you how to do pieces are: + Rook; X Bishop; $
Queen; £ King and * Pawn.
the impossible — squeeze a kind of If you have extra memory,
chess into 1K. you can enter an entire game in
This program, which just fits move from E2 to E4, enter one string — M $ — at the
into 1K, allows two players to " E 2 E 4 " , then press NEWLINE, beginning of the program,
96
play chess using the Z X 8 1 as and the board will be reprinted, deleting line 6 0 and adding 1 3 5
their board. The program can with your move shown. You LET M $ « M$ (5 TO). Then the
easily be modified to trigger the need to enter t w o separate computer will whizz through a
printer so you have a perma- strings Isuch as E1G1 and game move by move. It is
nent record of the game. H 1 F 1 ) to castle. fascinating to watch. You may
Pawns are automatically wish to add a loop to slow
It is very easy to use. When
promoted to Queen when things down a bit so you can
the prompt appears, just enter
work out what is going on.

,1
your move as a string, that is. to reaching the final rank. The

I m ^BB^^^^m .

.'.'.'.'.'.'a'A -rib-
i < < < •

TE JLL
• i


1 • • • • •
1 1 i A* *
• . <

1
• • « • • •• «• »• t 4
LET
3 7 6 | 6 5 | • m W S4.
3 » 1 J M P 3 2 * * * * * * * 1
• • • • • • • •
X t £ X ? + * * • • • • • m
• • • • • •
2 0 P R I N T R T 0 , O ; • • • • • • t «
3C FOR R « i TO S I STEP 10
4.0 P R I N T R 5 \'R TO • •••n
• > » . . . .. • < V i V i V i V <
5 0 NEXT R

.. •
. . . • • • • • • • • • • • • •
• • • • » . .
• • • i
• • • • •• *
6 0 INPU T MS
• » • <
• • • •
7(3 LET F = 1 0 * (37-CODE MS + CO
• •
•. ••• •
* < • • *
• * • * DE M S - 3 6
• .
. >. •.
.
• • • <
. • • .
• • •
SO LET T = 10 * (37-CODE MS S +CO • • •• • • • • • • »• i
DE MS(3>-36
• • • • •
• * •
• i• * • * •• •• •»• i 9i3 L E T R S ( T ) = R $ <iFS
i * • » • » 4 100 I F T < £ 0 RND fi$(T)=
" THEN • • - * • - * *

LET fl| (T) = " J**


110 I F T >SO RND (T.» = " B " THEN
LET R $ (T.l t • • • • • •
ISO LET G=CO0E M $ + COC'E M S f £ S
130 LET R $ f F ) = ( " " RND 2 * I N T fC
/ 8 J sG) + f * 1 " RND 2 * I N T i:G/fi.< )G.»
14-0 G O T O SO
ZX81 Programs

Orbit
S M King from Bristol takes
you and your ZX81 far out
into space, where you can
obsereve the four
innermost planets of the
solar system — Mercury,
Venus, good old Earth and
Mars — happily circling the
sun.
S M King from Bristol takes may still find use in an in-
you and your Z X 8 1 far out structive role it would be causes the program to wait until a
Line 2 2 5 :
into space, where you can much better placed in, say, number (the choice) is entered,
observe the four innermost a "Star Trek" type of pro- checks to see if the number entered is a
Line 2 3 0 :
planets of the solar system gram as a "long-range scan- 1, 2 or 3. If it is then the program
— Mercury, Venus, good old ner report". continues at line 2 4 5 . If not, then a
Earth and Mars — happily
circling the sun. The Program reminder is PRtNTed (line 2 3 5 ) and the
program returns to the INPUT
Orbit is a program which The program w a s w r i t t e n statement at 2 2 5 .
was originally intended to on a Sinclair Z X 8 1 with 8K Lines 2 5 0 - 2 6 0 : choose the period incrementing factor
produce an animated simu- F l o a t i n g - p o i n t B A S I C and (in days),
lation of the movement of 16K of RAM, although it by Line 2 6 5 : sets the period counter to one.
the four inner planets in no means uses this much. Lines 3 0 0 - 3 0 5 : display the second "question". How
our solar system around the With the omission of REM many days, months or years are to be
sun. H o w e v e r , it soon s t a t e m e n t s and w i t h the displayed?
became apparent that pro- use of other space-saving
ducing a c c u r a t e elliptical Line 3 1 5 : makes the number entered at line 3 1 0
tips (which will be discussed an integer if it was a decimal. It has no
o r b i t s w a s g o i n g t o be later) the program should
rather d i f f i c u l t , especially effect if the number was already an
fit easily within 7K — with integer. Note that the number must be
w i t h the l i m i t e d 64x44 four planets.
resolution available. The greater than one for the program to
D o c u m e n t a t i o n is given continue.
result is that the program to aid conversion to other
uses circular orbits to Line 3 3 5 : displays the third "question". What real-
m i c r o s and t h e p r o g r a m time time delay is required between
display the relative motion should RUN unaltered on a
of the planets at the ex- successive "frames" of the animation?
Z X 8 0 with the 8K BASIC. Line 3 4 5 prevents the delay from being
pense of accuracy. Whilst it
zero seconds. Line 3 5 0 converts the
figure entered into a number used by
the PAUSE instruction.
Lines 4 1 5 - 4 4 3 : DIMension 8 arrays (2 per planet) to hold
Lines 3 0 - 7 6 : PRINT the introduction. Line 3 5 , for the pixel co-ordinates for PLOTting and
example, PRINTs one blank line, UNPLOTting. The first array in each case
Lines 8 0 & 8 5 : cause the introduction to be displayed holds X-coords, the second Y-coords.
for 4 0 0 0 / 5 0 (80) seconds. The POKE Lines 4 4 5 - 5 2 0 : calculate the positions that each of the
instruction simply resets the system four planets will be at during the
variable. These lines could be replaced simulation. Lines 4 5 0 , 4 7 0 , 4 9 0 and 5 1 0
by a FOR/NEXT loop. calculate X pixel co-ordinates, whilst
CLS is the "Clear Screen" instruction, Lines 4 5 5 , 4 7 5 , 4 9 5 and 5 1 5 calculate Y
Line 9 0 :
assign variables to the number of pixel co-ordinates.
Lines 1 0 0 - 1 1 5 :
radians each planet moves per day. The Lines 5 2 5 - 5 4 0 : "black-in" the starting positions of the
numbers are expressed in scientific planets.
notation: ie, 5 7 • 1 E-03 - 0 • 0 5 7 1 . Line 5 4 5 : sets the main loop counter to one.
Lines 120Ef 125: pixel co-ordinates for the start position Line 5 5 0 : increments the period counter,
of Mercury (Hermes), Lines 5 6 0 - 5 7 5 : display the positions of the planets
Lines 1 3 0 & 135: pixel co-ordinates for the start position during the simulation,
of Venus. Line 5 8 7 : checks to see if the required number of
Lines 140Ef 145: pixel co-ordinates for the start position days/months/years have been
of Earth. displayed. If they have then the
Lines 1 5 0 & 155: pixel co-ordinates for the start position program jumps to line 7 0 0 .
of Mars. Lines 5 9 0 - 6 0 5 : "black-in" the positions of the planets
Lines 1 6 5 - 1 8 0 : assign variables to the "orbital radii" of during the simulation,
each planet. The numbers are the Line 6 1 0 : increments the loop counter,
number of pixels, Line 6 2 0 : returns the loop.
Lines 2 0 0 - 2 2 0 : display the first "question". The
animated display will show successive PROGRAM BETWEEN LINES 7 0 0 AND 9 9 9 ONLY WORKS
earth days, months or years. WHEN THE M A I N SIMULATION HAS FINISHED.

18 ZX C O M P U T I N G S U M M E R 1982 i
ZX81 Programs
Lines 7 0 0 - 7 0 6 : PRINT the fourth "question" down the right SUBROUTINES AT LINES 1 4 9 5 , 1 5 9 5 , 1 6 9 5 and 1 7 9 5 :
hand side of the screen, contain the different pieces of data on each
Line 7 1 0 : waits until a letter(s) are entered. Line 7 1 5 of the four planets.
causes the program to jump to line 7 3 0 if a SUBROUTINE AT LINE 1 9 9 5 :
" Y " is entered. If an " N " is entered then the PRINTs the general headings for the data.
program STOPs, otherwise the program SUBROUTINE AT LINE 2 1 0 0 :
waits at the INPUT statement at line 7 1 0 . converts plot co-ordinates to PRINT AT co-
Lines 7 3 5 - 7 8 0 : display the fifth "question" and wait for a ordinates and then displays each planet's
proper INPUT at line 7 7 5 . initial letter by the pixel square representing it
Lines 7 9 0 - 8 4 0 : execute the various subroutines, on the display.
Line 999: causes the program to halt. Equivalent to an Line 2 1 4 5 contains an inverse " H " .
END statement. Line 21 5 0 contains an inverse " V " .
Line 2 1 5 5 contains an inverse " E " .
SUBROUTINE AT LINE 1 0 0 0 : Line 2 1 6 0 contains an inverse " M " .
"btacks-in" the left % of the screen.
Line 1 0 1 0 contains 2 3 inverse spaces.
Line 1 0 2 5 puts the sun (an inverse asterisk)
in the centre of the black square. The Display
SUBROUTINE AT LINE 1 0 5 0 : (a) PRINT AT co-ordinates: ground an UNPLOT statement
displays the planets in their starting The Z X 8 1 PRINT AT state- DISPLAYS the planet, whilst a
positions. ment is of the form — 9 9 9 9 PLOT statement will "btack-in"
SUBROUTINE AT LINE 1 1 0 0 : PRINT AT (line), (column); the square again. If your com-
displays the period. "{whatever is t o be puter normally writes WHITE
SUBROUTINE AT LINE 1 1 4 5 : •PRINTed)" - where: ON BLACK then it may be found
removes any print statements on the right- line numbers are from 0 to better to make the right hand
hand side by PRINTing blank tines. Nine 21 inclusive. side of your screen WHITE with
>a spaces are contained in the string in tine column numbers are from 0 your inverse spaces. If you do
1155. to 3 1 inclusive. so remember to change all
(b) PLOT/UNPLOT co-ordinates: writing in PRINT statements
ie The Z X 8 1 PLOT/UNPLOT after tine 6 2 0 to your inverse
statements are of the form graphics, delete lines 1 0 0 0 ,
- 9 9 9 9 PLOT (X pixel 1 0 0 5 , 1 0 1 0 and 1 0 1 5 , and
coord), (Y pixel coord) . . . change the characters in lines
"blacks-in" pixel 1025,2145,2150,2155and
9 9 9 9 UNPLOT (X pixel 2 1 6 0 to your "normal" and
coord), (Y pixel coord) . . . NOT inverse characters.
" w h i t e s - o u t " pixel — It may have been noticed
where: that in lines 5 6 0 - 5 7 5 and 5 9 0 -
X coords are from 0 to 6 3 in- 6 0 5 the Y coords are being
clusive deducted from 4 4 (The
Y coords are from 0 to 4 3 in- greatest Y pixel coord). This
clusive causes the planets to revolve
Normally, the Z X 8 1 prints ANTICLOCKWISE about the
BLACK ON WHITE. During the sun. If the " 4 4 - " is omitted
real- simulation, the first 2 3 col- th en t h e p l a n e t s revolve
umns (down all 2 2 lines) are CLOCKWISE. All PRINT AT,
"blacked-in" (Line 1 0 1 0 ) . PLOT/UNPLOT statements are
ing So that the planets and sun referenced to the top LEFT-
can be seen on the bfack back- HAND corner of the screen.

hold
nd
Space Saving
:ase tf the program IS to be used as 4. Put variables AH, AV, AE,
part of some space-borne AM, SXH & SYH, SXV &
he adventure game then its length SYV, SXE & SYE, S X M &
will undoubtedly want to be SYM, RH, RV, RE and RM in-
d 510 shortened. I suggest the follow- to their respective routines.
t ing course of action: (5. Reduce the number of
1. Remove the REM state- planets.)
date Y ments. Again there is no reason why
2. Remove the introduction the planets should be called
he and the first THREE "ques- Mercury, Venus or whatever.
tions". The program was written in a
3. Replace the INPUT state- "modular" form to aid conver-
ments for the three "ques- sion but this does make it rather
tions" by LETs. lengthy.
of

its

RKS

IMER 1982 ZX COMPUTING S U M M E R 1982


ZX81 Programs
ID R E H ** O R B I T SY S . K I K S 125 LET S Y H = 17
15 R E M * * W R I T T E N F E B 1 9 3 2 F O R 127 REM ** S T A R T I N G P O S I T I O N
20 R E M * * © K Z X S 1 U J T H I 6 K R A K U E N JS
25 REM 1 3 0 LET S X U = 17
30 PRINT "ORBIT" 1 3 5 L E T S Y U = 14-
35 PRINT 1 3 7 R E M ** S T A R T I N G P O S I T I O N
4G> PR I N T ' T H I S S I M U L A T I O N C«ISF EARTH
LBV 5 T H E O H E I T S OF T H E F O U R I 14-0 L E T S X E = 22
NMER PLANETSOF OUR SOLAR S Y S T E M . 14-5 L E T S Y E = 9
14-7 R E M * * S T A R T I N G P O S I T I O N
4-5 P R I N T MARS
50 P R I N T " T H E P L A N E T S S T A R T AT 1 5 0 L E T S X M -4-2
THERE POSITIONS »RELATIVE 155 LET S Y M = 24-
TO THE SUN AND EACH OTHER) AS C 160 REM * ORBITAL RADII
F JAN 1 1992AND MOUE AT SCALE SP 163 REM * * MERCURY
EEDS-" 1 6 5 L E T R*H* = 5
55 PRINT 167 REM UENUS
60 PRINT "THE ORBITAL R A D I I H P 1 7 0 L E T R*U* = 9
UE ALSO B E E N S C A L E D D O U N A C C O R D I N 173 REM EARTH
GLY . " 1 7 5 L E T R* Ef = 1 3
65 PRINT 177 REM MARS
7 0 P R I N T 'THE P R O G R A M A L S O P R O 160 L E T R M = 20
UIDES THE USER WITH THE FACXL 2 200 PRINT AFTER UHAT TIME PERI
TY FOR R S H O R T R U M - O O M H O N TH OD W O U L D Y O U L I K E THE P O S I T I O N S C
E PHYSICAL F E A T U R E S OF E A C H PLA F THE PLANETS UPDATED?"
NET . " PRINT
75 PRINT 205 PRINT 1. E A C H D A Y "
76 PRINT THE PROGRAM DOES NOT 1•
2 1 0 P R I N T s'. EACH 30-DAY MONTH
RLLOU FOR ORBITAL ECCENTRICITY
H E N C E IT I S N O T U E R Y A C C U R A T E 2 25 PRINT 3. EACH 365-DAY YEAR
IN P L O T T I N G "
80 PRUSE 4000 2 2 0 P R I N T "EN TED 2 OR 3 "
65 POKE 16437 ,255 225 INPUT PD
90 CLS 227 PRINT .
95 REM ** R R D I A N S M O U E D E A C H 2 3 0 IF P D > =1 A N D P D « = 3 T H E N G O T
DAY BY P L A N E T S O 24-5
9 7 R E M ** M E R C U R Y 235 PRINT "PLER5E ENTER 1 OR
100 LET R H = 5 7 . 1 0 E - 0 3 3"
103 R E M ** V E N U S 24.0 G O T O 2J
105 LET A U = 2 7 . 6 2 E - 0 3 24-5 P R I N T
1 0 7 R E M ** E A R T H 24-7 R E M * * S = TIME PERIOD
110 LET AE = 17. 2 I E - 0 3 INCREMENTING FACTOR
1 1 3 R E M ** M A R S 2 5 0 IF P D = 1 T H E N L E T S = 1
115 LET A M = 0 B . 3 0 E - 0 3 2 5 5 IF P D = 2 T H E N L E T S = 3 0
117 REM ** S T A R T I N G P O S I T I O N 260 IF P D = 3 T H E N L E T 5 = 3 5 5
MERCURY <HERMES* 2 6 3 R E M ** S E T P E R I O D CC\UNTef^
120 LET SXH =21 T O ONE
265 LET TIME =1
260 IF P D = 1 T H E N L E T A » = " D A Y "
2 3 5 IF P D = 2 T H E N L E T A $ = " M O N T H "
2 9 0 IF P D = 3 T H E N L E T A $ = **YEAR"
300 PRINT H O U M A N Y ">A»>**» D O
YOU WANT"
301 P R I N T "TO BE D I S P L A Y E D ? "
305 PRINT "(POSITUE UHOLE HUMBE
RS ONLY) "
310 INPUT ND
313 PRINT
3 1 5 L E T N D = I N T VND)
3 2 0 IF N D >1 T H E N G O T O 3 3 5
325 PRINT "POSITIVE WHOLE NUHBE
RS ONLY"
3 3 0 GOTO 3 1 0
333 PRINT
335 PRINT "REAL-TIME DELAY BETU
EEN UPDATES REQUIRED < SECONDS)
34-0 I N P U T P
34-5 IF P < 1 T H E N G O T O 34-0
350 LET P=P*50
355 CLS
400 GOSUB 1000
4-05 G O S U B 1050
4.10 G O S U B 1 1 0 0
415 DIM H(ND+1)
420 DIM I(ND+1)
425 DIM U(ND+1)
4-30 D I M U (ND + 1)
43S DIM E(ND+1)
440 DIM F(ND+1)
442 DIM M(ND+1)
443 DIM N(ND•1)
4 4 4 R E M ** C A L C U L A T E P O S I T I O N S
OF MERCURY

20 ZX C O M P U T I N G S U M M E R IS ZX COI
ZX81 Programs
4.4.5 LET Z=1
4-46
a FOR R =86 TO CS6+ND*S> STEP
45®
5*Z.i ) L E T H t Z ) = £ 2 ^ R H * S I N +
4i 5 5
S*Z) )LET I(Z)-22+RH*COS (&H*
457 LET Z - Z + l
4-60 N E X T R
4 6 3 R E M ** C f i L C U L R T E P O S I T I O N S
OF V E N U S
464 LET Z=1
4-65 F O R R = 2 0 7 T O (20 7+N£>*5> S T E
P 5
4*70 LET U ( Z J = 2 2 +F!V#S IN t2&7
+S *Zi >
4 7 5 L E T U tZ) = 2 2 + R U * C - O S < A U » < 2 * 7
•f S * Z J )
4.77 L E T Z = Z + 1
43© NEXT R
a © 3 R E M ** C R L C U L R T E P O S I T I O N S
OF E A R T H
4 3 4 LET Z=1
•485 F O R R = 1 T O 1 + M D ^ S S T E P S
4 9 0 L E T E (Z) = 2 S f R E * S I M (RE*V1->S
*Z) J
4 95 LET FtZ)=22+RE*COS fRE
*Z> i
497 LET Z = Z U
500 NEXT R
503 R E M ** C R L C U L R T E P O S I T I O N S
MORS
504. L E T Z = 1
5 0 5 FOR R =133 T O i1S3+ND»SJ ST£
P 5
510 LET M (Z? = 2 2 + R M * S I N f R M # f ISC-
>
515 LET N CZJ = 2 2 + R M * C O S <OH*(lS3
)
517 LET Z ~ + 1
520 NEXT R
525 PLOT SXH,5YH
530 P L O T S X U . SY'J
535 PLOT SXE,SYE
54-0 P L O T S X M .. S Y M
54-5 LET U = 1
550 L E T T I M E = T I M E + .1
555 GOSUB 1100
560 U N P L O T H (U ) 1 4 4 - 1 f U > >
565 U N P L O T U ( %J J (44-IJ (UA >
570 U N P L O T E CO) U 4 - F U O >
575 U N P L O T M ( J ) ( 4 4 -N ( J>
530 PRUSE P
535 POKE 16437,255
587 IF U = N D - 1 T H E N G O T O ' 0 0
590 PLOT H(J)j ( 4 4 - 1 J
595 P L O T U CJ) , 1 4 4 - U f u O >
600 P L O T E (J) ..( 4 4 - F (J) .»
605 P L O T M ( U ) ,( 4 4 — N (J)
610 LET U=U + 1
620 GOTO 550
700 PRINT RT S "UOULD YOU"
-

7 © 1 P R I N T R T 6 ,23; " L I K E R "


702 PRINT RT 7 , 2 3 , "DETAILED"
7 0 3 P R I N T R T 3 , 2 3 ; "" R U N - D O W N "
704. P R I N T R T 9 , 2 3 ; ""O N R "
705 PRINT RT 1 0 , 2 3 ; PLRNET?"
7 0 6 P R I N T RT 12,23; Y OR N "
710 INPUT G »
7 1 5 IF 0 $ = Y " T H E N G O T O '30
7 2 0 IF Q $ = "N THEN STOP
725 GOTO 710
730 GOSUB 1150
735 PRINT RT O,23 "UHICH"
740 PRINT RT 1,23 "PLRNET?"
745 PRINT RT 3,23 "ENTER"
750 PRINT RT 4,23 "CODE;"
755 PRINT RT 5,23 "H-MERCURY"
760 PRINT RT 6,23 "U-UENUS"
765 PRINT RT 7,23 "E-ERRTH"
770 PRINT RT 8,23 "M-MRRS"
775 INPUT P*
7 6 0 IF P $ = " H " O R P $ = " U " O R P $ = "
ZX81 Programs
164-3 RETURN
R F M * * EfiRTH D R T R
- '00 PF-INT R T 0 . 2 3 ; " E A R T H "
- t -w' w Pf . I N T R T 3 , 2 3 ; " 1 2 7 5 3 K M "
1 7 2?* PR I N T RT 6 , 2 3 ; " 150E+0S> M "
- 7 5 r r INT hT 9,23;"365 DAYS"
PRINT RT 1 2 , 2 3 ; "
• o c, PR IMT R T i f , 2 3 ; " 3 3 3 K "
~ - -:••"< w - INT R T 1 9 , 2 3 ; " £ 3 H S S M I H '
1 7 5 . 6 R £ 1 .JRN
1 7 9 5 R r H * * MORS DRTR
1800 p r I N T RT 0.23;'MRRS"
cp I N T PT 3,23, '6753 K M "
r . 1 o.
— JL <U P P !*n H! & .23; " 2 2 S E 4 0 9 M"
1 6 1 5 PP INI RT 9,23; "587 DAYS"
1 6 8 0 PP I N T RT 1 2 .. 2 3 ; ' - 2 . 6 " .
162? P R :"T RT 16,23;" £98 K"
1 6 3 2 5 P R LMT RT 1 9 , 2 3 ; "24-H 3 7 M I N '
1 6 4 \D R E U R N
** G E N E R A L H E A D I N G S
PR INT cn 2 j 2 3 ; " D I A M E T E R : "
IT.' P R I N T RT 4,23; " D I S T A N C E "
- ... c1pr I N T A T = O ,0 1w> -
, "FROM SUN:"
5 0 1 5 PrslNT R T 7 ,23; " S I D E R I A L "
pr I N T R T 6 , 2 3 ; " P E R I O D . "
2 D 2 5 P R I N T » T 10 2 3 ; " M A X I M U M "
2O30 P R I N T RT 1 1 23, " M A G N I T U D E
E" OR P 1i = " M " T H E N G O T O i 0 3 5 P R I N T RT 13 23; " M A X I M U M "
785 CO)TO 7"
7 7 5 P R I N Tr R T 1 4 2 3 ; " S U R F A C E "
£ 0 4 . 5 PR INT RT 15 23; " T E M P ; "
790 GOSUB 115© d 3 5 0 PRINT m 17 23; • A X IAL "
795 GOSUB 2000 2 0 5 5 P R I N T p. r 1 3 2 3 ; " R O T A T I O N ;
3©0 IF P $ = " H " T H E N G O S U B 1 5 0 0 2060 R E T U R N
505
8 1 0
IF THEN GOSUB 1600
IF P $ = " E " T H E N G O S U B 1 7 0 0
2100 R E M * * P L O T T O P R I N T A T
2 1 0 5 LET XH-JNT iM (xJ> / 2 )
815 IF P $ = " M " T H E N G O S U B 1 3 0 0 5 1 1 0 L E T Y H s I N T i I (J) /2.t
820 P R I N T RT 2 1 , 2 3 ; " P R E S S N/L' 5 1 1 5 LET XU^INT ( U 1 U )
825 GOSUB £100 5 1 2 0 L E T Y U r l N T f W 1 J.> / 2 )
630 INPUT 2$ 5 1 2 5 L E T XE = INT { E i U > y2)
835 GOSUB 1150 513© L E T Y E = I N T (F (U) / £ )
640 GOTO 700 5 1 3 5 L E T X M = I N T CM iJ> / £ >
999 STOP L E T Y M s I N T (N (u > 2 >
1000 R E M ** B L A C K S C R E E N SUB.-'R
214.0
514-5 P R I N T RT Y H - 1 , XH-1;
1005 FOR 1=1 T O 2 2 5 1 5 0 P R I N T RT Y U - 1 , X U - I ;
1010 PRINT £ 1 5 5 P R I N T RT Y E -1 . XC-1;
5 1 6 0 P R I N T RT Y M — 1 , XM-1;
1015 NEXT I 2 1 7 0 RETURN
1020 REM ** P O S I T I O N C E N T R A L S U M
10 25 PRINT RT lO.ll; "B"
1030 RETURN
1050 R E M ** D I S P L A Y P L A W E T 5
STRRTING POSITIONS
1 0 5 5 U N P L O T SXH..SYH
1050 UNPLOT SXU,SYU
1 0 6 5 U N P L O T S X E .. 5 Y E
' (5*70 U N ^ L O T SXM,SYM
1275 Re"5" U R N
1100 R E M * * D I S P L A Y P E R I O D
1 1 0 5 P R I N T RT 0 , 2 3 ; " E R R T H "
1110 P P I N T RT 1 , 2 4 - ; R $ ; " : "
1 1 1 5 P R I N T RT 2 , 2 5 ; T I M E
1120 R E T U R N
1 1 4 5 P F M ** C L E R R R.H.S
115© FOR 1=0 TO 21
1155 PRINT RT 1,23;"
1160 NEXT X
117C- RETURN
1C.95 REM ** MERCURY £>RTR
' F.00 PRINT RT 0 23;"MERCURY"
1505 Pr INT R T 3 , 2 3 ; " i d 6 S K M "
1 5 1 3 PP I N T r r 6 , 2 3 ; " S B E ^ S M "
1513 P R I N T R'T 9 > 2 3 . " 3 8 D R Y 3 "
15 SO PRINT 12,£3;" -J-9"
P R I N T RT 1 6 , 2 3 ; " 5 7 3 K "
1530 PP INT R T 1 9 , 2 3 ; " 5 9 D A Y S "
154.0 RETURN
- 5 9 5 R E M ** V E N U S D A T A
; t - 0 0 r r I N T P' 0 23,"UENUS"
1 6 0 S PRINT AT 3,23;-12369 KM
1 £ 1 ? PRINT RT 6 , 2 3 , " 1 0 3 E + O 9 H "
e i o PK INT PT 9.23.; " 2 2 5 D A Y S "
P R I N T AT 1 2 . 2 3 , " -i.4-"
1^-25 P R I N T RT 1 5 . 2 3 ; " 5 2 3 K "
: i 3 e P R I N T R T 1 9 ,23; "24-7 D A Y S "

22 ZX C O M P U T I N G S U M M E R 1982 i
16K Games

Bureau de Change
If you're always jetting off
to exotic parts of the world,
like Paris, Geneva or Black-
pool, you'll be in need of
this program which rapidly
converts your money from
one currency to another.

The program, as written by


Bob Perrigo, caters for six
different currencies, but it
can easily be modified to
handle as many currencies
as you need. The values of
major currencies and their
exchange rates w i t h the
pound are p u b l i s h e d in
many n e w s p a p e r s , par-
ticularly the Financial
Times. Current values have
to be entered w h e n you
first RUN the program. Once
the values are in RAM, you
can use the program again
by entering GOTO 6 instead
of RUN. The word END after
the semi-colon in line 1 0 0 is
not a mistake. It acts just as
END does in other BASlCs,
stopping the p r o g r a m . It
does so in this case because
the 2 X 8 1 considers t h e
word END to be an unassign-
ed variable, and will stop
the program with the error
code 2 / 1 0 0 . Any other let-
ter, or combination of let-
ters, which is not used
elsewhere in the program,
will stop it as effectively as
does END,

3 REM ^CURRENCY CONVERTER * 58 LET E=©


4 REM *BOE P E R R I G O / 60 IF C $ = " £ " T H E N L E T E = P
T I M HRP.TNELL* 65 IF C £ = " $ " T H E N L E T E = P * D
5 GOSUB 110 70 IF C $ = " D " T H E N L E T E = P * N
6 P R I N T " E N T E R C U R R E N C Y 1" 75 IF C $ = " S " T H E N L E T E = P * F
7 PRINT "£ - P O U N D S " , " * - D O L 60 IF C $ = " Y " T H E N L E T E = P * Y
LRRS* ' , "D - D E U T S C H M A R K S " . " 5- S S5 IF C $ = " R " T H E N L E T E = P * R
UISS F R A N K S " . " Y - Y E N " , " R - R A N D 90 IF E = 0 T H E N G O T O 5 5
95 L E T E = I N T ( E t l 0 0 + .5) / 1 0 0
& INPUT A S 100 PRINT A B; " = " C $ ; E; E N D
10 PRINT "ENTER A M O U N T " 110 PRINT "DEUT5CH MRRK?"
12 INPUT B 120 INPUT M
15 LET P = 0 130 PRINT "YEN?"
20 IF THEN LET P=B 14-0 INPUT Y
25 IF T H E N L E T P = B * 1 ,'D 150 PRINT "RAND?"
30 IF R s = " D " T H E N L E T P = B * 1 ,'*M 160 INPUT R
35 IF flt="5" T H E N L E T P = B * 1 ,'F 170 P R I N T "i i-UIS FRANC"
4-0 IF A $ = " Y " T H E N L E T P = B * 1 ISO INPUT F
45 IF R * = " R " T H E N L E T P = B * 1 ,*'R 190 PRINT "U5 DOLLRR?"
50 IF P = 0 T H E N G O T O 5 200 INPUT D
55 PRINT "ENTER CURRENCY 2" 210 CLS
57 INPUT C« 220 RETURN

ZX COMPUTING S U M M E R 1982 23
insight

Frank O'Hara looks at the bug in the


original 8K ROM, and explains how it
occurred. He reveals a new bug which
only comes to light when running a
zx printer, and gives a checking
routine which prints the powers of
two from two squared to two to the
32nd, exactly.
I first became aware of the bug 2. The log of the mantissa of the bug in subtraction. preciable difference to the
in the Sinclair 8K ROM after should then yield zero. But . 2 5 Because s u b t r a c t i o n just augend (and - Yt 32 is a good
writing a fairly fast BASIC pro- is held approximately on the changes the sign and adds, it example when added to - 2 log
gram to obtain the smallest Z X 8 1 , unlike (%), which is held will help to think of simply ad- 2) then the addend is set to zero
prime factor of any odd number exactly. The result of this is that ding on a negative number, (n and nothing happens. Unfor-
up to 2 3 2 - 1 in a matter of log of the mantissa comes out floating point addition, the ad- t u n a t e l y the programmers
seconds rather than minutes. as - ! 6 3 2 , an approximation to dend (ie the number being add- thought they should do a bit
When I tried the program out on zero. Finally, the sum of - 2 log ed on) has to be lined up with more at this stage, and in-
2 3 2 - 5, the largest prime 2 and - Vi 32 adds two to the the other number (the troduced the bug. Three bytes
number in this range, it seemed correct answer because of the "augend") to make the addi- which were not needed (at
to be taking a long time to run. bug in subtraction. tion possible. If the addend is 1 7 3 3 to 1 7 3 5 hex in the old
On breaking in and checking the This brings us to the source too small to make any ap- ROM) had the effect of causing
divisor, I found that it had gone a "carry adjust" mechanism to
well past the square root of the be wrongly invoked, shifting
number (about 6 5 5 3 6 ) . On the result one place right,
checking the square root, I preserving the sign bit and ad-
found that the Z X 8 1 w a s ding one to the exponent. This
holding a 12 digit number {in- sometimes trebled the number
stead of 6 5 5 3 6 ) as the square 10 F O R R = 0 T O 31 (4-Vi32 gives 12) and
root of the 10 digit number 2 0 L P R I N T R T 1.. R . . 0 P 0 P 6 5 sometimes increased it in other
2 3 2 - 5. 30 NEXT R ways ( 1 0 - V i 3 2 gives 2 6 ; and
Further investigation reveal- as s t a t e d above - 2 log
ed errors in exponentiation and 2 - i 4 3 2 gives - 2 log 2 + 2).
even in subtraction. In the The sequel is that a new
event all these errors were to ROM has been produced by
trace back to a programming Sinclair Research without these
mistake in subtraction. To see 1 0 P R I N T R T 2,. 3; P O W E R S OF" J? three bytes. It is supposed to be
how they arose, it is best to FROM 1 TO 32" , available on demand, but mine
follow a simple e x a m p l e 20 LET N = 1 took three months to arrive.
through to its source. 30 FOR X = 1 TO 32 There are ways of getting
The ZX81 gives SQR {%) 4 0 L E T N=2*.W around the bug. For example,
correctly as .5. But SQR . 2 5 is 5 0 L E T R = I N T (N./10P.1 LET S = 1 0 * S Q R ( N / 1 0 0 )
given as 1 . 3 5 9 1 4 0 9 . Listing 60 LET B=N-1O0*R works for square roots.
the ROM shows that SQR X is 70 PRINT " " RND X<10;X;" A new, and rather subtle
evaluated as X * * . 5 . The in- 5TR$ R RND R><3; "0" RNI> .RND bug, comes to light on the
struction "PRINT . 2 5 * * . 5 " 6 < 1 0 ; B , printer. Enter program one, and
gives the same wrong answer 80 NEXT X run it. You'll be quite surprised
1 . 3 5 9 1 4 0 9 . The f u n c t i o n at the result.
X * * Y in turn is evaluated as Even w i t h the amended
EXP (Y • LN X). The instruction ROM, certain powers of two are
"PRINT LN . 2 5 " returns the POUERS OF 2 FROM 1 TO 32 not worked out exactly (such as
answer 0 . 6 1 3 7 0 5 6 4 instead 2 * * 3 1 ) , even if you display alt
of - 1 . 3 8 6 2 9 4 4 . T w o has 1 0 digits. Program two prints
been added to the correct the powers of t w o from two
answer. At this stage we could 1 2 2 4 squared up to two to the 32nd
well suspect that addition is at 3 8 4 16 exactly, with all their digits. The
fault. 5 32 6 64 list it produces can be useful for
The last stage of detection 7 123 8 256 checking certain expressions
requires one to split the LN 9 512 10 1024 on the Z X 8 1 . Once you've run
routine in two, by uploading it 11 2043 12 4096 program t w o as listed, try runn-
into RAM and running it there. 13 8192 14 16384 ing it with LET N = 2 * * I in line
Happily this works. At least the 15 32768 16 65536 4 0 . As alternative, and com-
first half runs and that is all w e 17 131072 18 262144 pletely accurate expressions, \
need. To evaluate LN X the 19 524288 20 1048576 recommend LET N = 2 * * 3 2 / 2
ZX81 has to add the log of the 21 2097152 22 4194304 and LET N = 2 * * 3 2 - 2 + 1.
exponent and the log of the
23 8388603 24 16777216 These can be fully displayed by
25 33554432 26 67108864 PRINT " 2 1 " ; N - 2 1 E8 and
mantissa of X. In the case of 27 134217728 2© 268435456
.25, the log of the exponent is PRINT " 4 2 " ; N - 42E8
29 536870912 30 1073741824 respectively.
correctly evaluated as - 2 log 31 2147483646 32 4294967296

ER 1962 ZX COMPUTING S U M M E R 1982 25


Not
Mine of Information Ltd
Microcomputer Consultancy b Booksellers

ZX OTHELL*
A major game o f s t r a t e g y
f o r t h e Sinclair ZXS1
p e r s o n a l computer +
16KB R A M
# Easy to learn
For ages 7tol07
/ Pit your wits against
an inhuman intelligence!
Nine levels of play from
novice to expert

. . . is a stylish and
£10
ergonomic plinth for theZX81.lt raises and B E N D F O R O U R E R E E C A T A L O G U E OF"
tilts the TV to avoid eyestrain, holds the16KRAM lOO S E L E C T E D M I C R O C O M P U T E R fiQOKS
in place and hides the wiring and power supply. Prices include P-Pin UK
This very professional unit costs £15, a built-in Add 20", for delivery to Europe. Africa or the Middle East
power switch is £3, plus postage at £1.50, inc. VAT
Peter Furtong Products, 125 Catford Hill, London SE6 4PR. Orders to Moi (223)1 Francis Avenue St Albans Herts
Callers by appointment, please Tel 0 1 6 9 0 7799. Visa, Ac cess. AL36BL England Phone 0727 52801 Telex925859

Z X 8 1 S O F T W A R E F R O M V I D E O S O F T W A R E LTD 1 K & 1 6 K
16K SOFTWARE PRICE NEW VIDEO-INDEX NEW
VIDEO-SKETCH (ZX81 only) Move (he cursor to any Q How do you store 5 7 . 0 0 0 characters in a 1 6K R A M
pan of the screen Draw or rub out as you move n Mix in A Use VIDEO INDEX
text or graphics Save picture in memory Save picture Catalogue your cassettes, your record collection, relerences to
sequence on cassette 7 95 magazine articles Amazingly versatile Capacity for 1 . 0 0 0
VIDEO-PLAN (ZX81 only) Performs the function of an individual references each of which can generate 5 7 characters of
analysis book Arithmetic functions include addition, text Powerful search facilities once the index has been created
subtraction, multiplication 7 95
How is it d o n e ' The system cannot really fit 5 7 , 0 0 0 characters
VIDEO-AD Rotating display of 16 pages of advertising
in a 16K R A M It gives the illusion of doing so by eliminating
material Set-up your own pages and change them as
duplicates For instance in an index of articles in computer
and when required. 7.95
magazines about the Z X 8 1 certain words occur time and again
VIDEO-GRAPH Planning and design aid Create
V I D E O - I N D E X detects these duplications and thereby conserves
pictures/charts/graphs and store within the program. €5 95
space.
VIDEO-VIEW Do it yourself teletext Create pages of
data Store them within the program 5 95 What do you get?
1 A machine code master program which sits at the top of R A M
V I D E O - M A P (ZX81 only). Educational game b3sed on
This is initially loaded like a BASIC program •
maps Navigate your plane to its destination. 5 95
2 A demonstration index containing 1 , 0 0 0 references to articles
FORCE-FIELD IZX81 only) Animated bombardment
about the Z X 8 1 in the popular magazines
game 3.95
3 A detailed instruction manual
SPACE-RACE (ZX81 only) Party game for eight
players 3 95 You may then proceed to create your own catalogues and indexes
and save them on cassette
TEST-MATCH Realistic simulation of a test match
This program is fast, efficient and ingenious and is by far the best
series. Dynamic scoreboard 3 95
product w e have introduced for the Z X 8 1
FOOTBALL LEAGUE Realistic simulation of an entire
N B There isn t room for a commentary on this cassette so you'll
season Every match played and results shown with
have to read the manual
progressive league table 3 95 Z X 8 1 orZX80+"8K R O M
STOCK-MARKET <ZX81 only) An exciting game of skill ZX printer is useful but not essential. Price C9 9 5
and tudgement Buy and sell stocks and shares as prices
change in response to world events 3 95 Mail order customers add f l per order
PACK 1 - V I 0 E 0 - P L A N + V I D E O - A D 17 9 5 Allow 2 8 days for delivery
PACK 2 - V I D E O - V I E W + VIDEO-GRAPH 13 9 5 Cash with order please to V I D E O S O F T W A R E LTD
G A M E S E T - V I D E 0 - M A P + 5 GAMES 19 9 5 Stone Lane. Kinver.
1 K PARTY TRICKS I Z X 8 1 only) 4 95 Stourbridge.
Personal callers welcome during office hours West Midlands DY7 6EQ

26 ZX C O M P U T I N G S U M M E RISZXCOI
A. Beasley

After using the Z X 8 0 for a


few months I found that there
was a need for a simple
renumbering program. In the
attempt to solve the problem a
BASIC program was written
out but this took far too much
memory space. While machine
code was the obvious solution
it did raise yet another
problem. How could the
program be stored so that it
could be used without any
trouble. After attempting to
store it in a REM line it was
found that some of the codes
made the system crash when
the program was listed.

Solutions
To get over the problem the
following method was
developed. First all the
variables are CLE A Red. A
string variable is now set up to
contain the required number of
bytes and the machine code is
POKEd into it. As this string
variable is the first in the list
its location can be found from
the two bytes called VARS,
see page 1 22 in the manual.
By adding one to the value
obtained you have the location
of the first character in the
string. To call the program you
simply find the value of VARS,
add one and use this number
as a USR call.

More Problems
This method generates its own
set of problems, however. If Operation 1 CLEAR
you are using it tor program To use the program type in 2 LET Z$ • *aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
operation you cannot use the with Z$ containing 3 3 3 LET
following commands, RUN, characters. Now run the A$ = ' 0 6 0 0 0 E 0 A 2 1 2 8 4 0 7 0 2 3 7 1 3 E 0 A 8 1 4 F 3 0 -
CLEAR or NEW. By using program then remove it by 0 4 0 4 CB70C0237EFE7620FA237ECB7FC018E6"
GOTO you can get over the typing just the line numbers 4 LET A = 1 + PEEK! 1 6 3 9 2 ) + PEEK! 1 6 3 9 3 * 2 5 6 )
RUN problem and the others and then 'Newline'. The 5 FOR C = 1 TO 3 3
are not really drastic. program you wish to renumber 6 LET B = CODE ( A $ ) - 2 8
The main advantage of this can be keyed in but remember 7 LET B = B* 16
method is that when you save not to use the RUN or CLEAR 8 LET A $ - T L $ ( A $ )
the program you still preserve keys and make sure that the 9 LET B = B + C 0 D E ( A $ ) - 2 8
the string for the next time. It program does not contain Z $. 10 LET A$ = T L $ { A $ }
should be noted that the To activate the renumber 11 POKE A,B
GOTO and GOSUB statements type PRINT USR 12 LET A = A + 1
are not altered but you do get (1 + PEEK(1 6 3 9 2 ) + PEEK- 13 NEXT C
everything into 3 5 bytes. (1 6 3 9 3 ) * 2 5 6 ) .

4ER 1982 ZX COMPUTING S U M M E R 1982


Building
Library

K
jt-
I*

f>
g
p
f<
tr
ki
P<

library
o
rt
F<

si
o
IT

P'
A
at
b*
a
After the first mad Fi
si
programming spree with fr
st
your machine you may like k)
B<
to build yourself a library irr
m

of useful programs. w
2(
w
V<
se

28 ZX C O M P U T I N G S U M M E R 1962 Z
I

Library
The first few weeks after the
purchase of your Z X 8 1 may
justifiably be defined as the
"infatuation" stage. The
power of the machine to
generate data at apparently
phenomenal speed is
fascinating, even exciting to
those new to the computer
keyboard. Scores of little
programs are lovingly saved
on cassette tapes — most of
them centred around the
FOR/NEXT loop. Typical
programs include printing out
"HELLO" 4 7 times, filling the
screen with nine-digit columns
of sin(x)and —cos(x) or
meaningless equations chosen
primarily for their complexity.
As many of these little morsels
as possible are crammed on
both sides of C 6 0 (or in some
cases even C 1 2 0 ! ) tapes.
Frantic trips to purchase new
supplies of blank cassettes are
frequently made or, if the
shops are shut, a previously
loved recording of
Beethoven's ninth is
irreverently erased in order to
make room for a program
which generates the first
Organisation, The programs, therefore no need
to memorise what you have
is more humiliating to a proud
2 0 0 0 primes (I often wonder Key? named them; if you have to
demonstrator than one of
those sarcastic error
what you do with primes after Any attempt to organise your amend a program, there is no messages which leap up from
you generate them but they computing life must begin danger of the extra few bytes the bowels of the BASIC
seem to offer solace to many). with a simple rule . , . one extending into the obliterating interpreter whenever it suffers
program on a tape with a copy the beginning of the next the slightest confusion.
on the reverse side. program; if the tape is Particularly if you are trying to
Naming Names Superficially, this appears to accidentally dropped into a impress.
But all things come to an end be a shocking waste of tape plate of soup (or a similar 2) Will the program check for
at some time or another. It because, on the average, most household hazard degrades its ridiculous input 7 Remember
sr gradually dawns on most of the tape will remain unused performance) only one that an input can be
people that their "collection" but in spite of this the rule is program is lost; if you lend a mathematically acceptable
is in reality nothing more than sound in human terms. It is tape to a friend for copying and free from syntax error but
a heap of rubbish. Most of better to waste a few feet of purposes and it is returned a can stilt lack realism. For
what they have saved is relatively inexpensive tape in corrupted length of jargon, example, let us assume a
useless, and the few that have return for the following there is less danger of physical program, which assists in the
some merit are buried benefits: no infuriating violence breaking out if only design of a signal amplifier,
between dozens of unwanted searches for programs "in the one program is spoilt. asks for the supply rail
remnants. middle"; no need to name Finally, w e cannot entirely voltage. If the operator
discard a psychological factor. mistakenly keys in 2.6E4
Weeks, perhaps even months instead of 2.6E 4 will the
of programming work stupid machine accept
condensed onto one tape fails this . . . or what is more to the
to impress the casual point . . . will the stupid
10 REM PRIME N U M B E R S acquaintance. Spread out into program accept it and go on to
20 DIM O ( 2 0 O 0 ) twenty or so, neatly labelled
cases with the whole resting
compute a recommended
output current in the order of
30 L E T Z = 1
35 S C R O L L in a partitioned "cabinet" will kiloamps? In short, does the
40 PRINT 2 enhance your local reputation program include full data input
50 LET O(l) =2 as an egghead. validation routines?
6 0 F O R G = 3 T O 2 0 0 0 S T £ P SP 3) Is the program completely
70 FOR H=1 T O Z self-explanatory to the
3 0 IF I N T ( G.-'tf I H J > + /.H* =G T H E N
GOTO 5 0 0
worthwhile operator? Are there, for
100 N E X T H Programs instsice, full instructions on
the V D U screen or does it
150 L E T Z = Z + 1 "Worthwhile" in this sense mean searching for some
200 LET Q ( Z ) = G means "is it worth saving on scrap of paper somewhere
240 S C R O L L tape?" Consider the following which contains the gory
250 PRINT G as a reasonable set of criteria
250 P A U S E 5 0 details of the button-pressing
50© N E X T G from which to start: routines? No accompanying
1) Has the program been document of any kind should
tested for every conceivable be necessary because the
input combination. For VDU screen can tell all. There
example, what happens if you should also be a title page
input a "0" or a negative which defines clearly the
number or a number with purpose of the program.
umpteen digits in it? Nothing Remember that at the time of

1MER 1382 ZX COMPUTING S U M M E R 1982 29


Library
writing, the purpose is all too
clear but after a few weeks or
months the memory fades.
4) Is the textual material on
the VDU easy to understand
and pleasantly arranged?
There is no excuse for sloppy
presentation and curt chunks
of computer jargonese
interspersed with
abbreviations. Just because
the computer has no soul or
manners this is no excuse for
omitting the pretence. A little
care taken in presentation will
give the pleasant illusion that
lurking behind the cold
rectangular sheet of glass is a
"being" with a heart of
gold . . . kindly and paternal
when the occasion warrants it
and yet hesitating to deliver
streams of pure vitriol if its
human operator enters silly
figures or presses wrong
buttons. In other words, give
your computer a personality.
Space out the text in a
readable manner, Nothing is
more tiresome than a page full
of closely spaced reading
matter, particularly if it is
composed entirely of capitals.
There is no need to stuff
everything on one V D U page
but never allow the pages to
scroll. Text creeping up from
the bottom and disappearing
at the top should never be
tolerated; it is unpleasant to
read and amateurish.

Expansion
5) Is the program planned
with the idea of future time, it seems unnecessary. In It means laying out a program difficult; computers are odd
expansion or improvement in fact some of us deliberately in neat little modules, each things.
mind? No program can ever be leave out remarks in order to capable of being individually For example, if someone
perfect and equally true, no prevent other people tested in its own right. In fact came and asked me to write a ^
program can ever be understanding how our there is a specific program to print out a table of
absolutely complete. There masterpiece works. This programming philosophy with the singular solutions of a
will always be the nagging attitude can be self- many little rules and second order differential
doubt, particularly when it is destructive because the writer regulations resting beneath equation I would take the
re-run a few weeks later, that of the program may eventually the blanket title of money in advance and
some extra facility or twist become the victim. Another "STRUCTURED probably deliver the goods
should have been added. In obstacle to future amendment PROGRAMMING". This is (suitably tarted up in
many cases however, this can is a poorly structured original worth detailed study if only to accordance with the previous
be a difficult or even and close-packed line know when to break some of advice) the next day. This is
impossible task. In the first numbers. Never start a the rules. not because maths and
case, the program may be program with line number less physics is my strong point (I
utterly incomprehensible when than 1 0 0 in case some extra Programs To might pass O-level maths with
LISTed if several weeks have stuff may have to be squeezed Write difficulty) but because the
elapsed since it was written. in at the head. Be methodical Advice on what programs to actual maths details must
Juggling with obstinate in the choice of subroutine line write is about as difficult as reside in some text book
statements, temper, numbers. Stick them all advising on the best length for equation somewhere or other.
frustration and the other together well down the a piece of string. An overall It would just be a case of
multitude of ills popular during bottom, say at line 9 , 0 0 0 piece of advice is simply to letting the faithful old BASIC
program construction onwards. In this way, you will walk before you run. Don't interpreter handle the sordid
eventually leads to a transient avoid the ugly embarrassment attempt to write wildly details once the correct
state of euphoria when the of having to leap frog over ambitious programs unless sequence of brackets and
beast finally decides to work. them with a wasted GOTO you are quite certain you operators have been entered
There is a mad rush to "get it statement when the lines start understand the full from the text book to the
on to tape" and indulge in a to creep down further than the implications of the task ahead. VDU.
satisfying bout of self- original estimate allowed. Unfortunately, it takes some Such programs are
congratulation. The term "program experience to know in elementary number crunching
It takes a little while to structure" of course means a advance whether or not a exercises, impressive but
appreciate the value of the lot more than the mere certain programming task is routine. On the other hand, a
REM statement because at the organisation of line numbers. likely to be easy or horribly request for " a little program to

30 ZX C O M P U T I N G S U M M E R 1962 Z
Library
sort and classify my butterfly
collection" could turn out to
be a nightmare. The following
is a crude attempt to group the
classes of programs which can
be written and appropriate EXPLOSIVE
remarks on their respective G A IVIES
difficulty factors.
for «».,. Z X 8 1

Numbercrunching
These follow a relatively
simple pattern; inputting the
required parameters, fitting
them into the "equation line"
and displaying the results in a
clear manner. (liitadhy " *
Two subroutines should be £ Tim Martncll
considered almost
indispensable to number-
crunching activities, one to
round off numerical results to
a desirable number of decimal
places and the other to line up An extra twist is to novel and interspersed with game. The most awkward
the decimal points. Answers incorporate random selection exciting animation takes a thing to get right in
like 3 4 . 5 6 8 9 3 0 2 inches or of the pairs to stop the disproportionate time to programming such a game is
£ 6 7 . 2 4 5 7 8 9 4 5 lack realism operator using a sequence. program in relation to the the difficulty factor. Too hard
and the sight of a VDU screen There is, however, an element subsequent playing time. As and the player is frustrated;
full of figure groups zigzagging of danger in this type of programming exercises they too easy and the game is
from top to bottom is not only program. It tends to breed quiz are superb. Whether many of described as boring.
i! I addicts. Tape after tape is them are really worth the tape
difficult to read, it is quite
revolting in appearance. saved on all possible subjects storage is debatable. Consider
Always use TABln) to position
columns, the semicolon as a
until the entire household
takes on the appearance of a
for example the class of
games which could be covered
Enthusiasm
delimiter encourages Bamber Gascoigne Show. by the classification "Moon The behaviour pattern of the
zigzagging. Landing". They all follow the players, however much care is
same well-worn path . . . you taken with the programming
Quizzes Games are in some dangerous James
Kirk situation . . . too much
details, is distressingly
familiar. Great enthusiasm at
Many sophisticated programs This area is undoubtedly throttle and you run out of first but declining
have been written under the popular and it cannot be something or other . . . too exponentially towards
general title of Computer- denied that senior little and you crack the surface complete apathy. For those
Aided-Teaching or Computer- programmers in the of the moon or Mars or who have a genuine love for
Aided-Learning. Less professional classes devote whatever particular member of game programming the
ambitious but surprisingly many hours to thinking up the galactic regions happens following little tips may be
useful programs are relatively new games or introducing new to fit the title. They will all found useful;
are odd contain a couple of equations
easy to write (and certainly twists to existing ones. Explain the rules concisely
worth saving) based on Unfortunately, a game from the Newtonian tables, in the title page.
jmeone suitably embellished to fit the
questions and answers. program, unless particularly Display as much animation
to write a
a table of
s of a
ntial
;e the
nd
goods
)
> previous
i. This is
Bnd
j point (I
naths with
ise the
. must
book
e or other,
ise of
Id BASIC
ie sordid
rect
ts and
i entered
:o the

re
crunching
/e but
sr hand, a
program to
as your skills in
programming allow.
Don't allow the computer
to respond "too
instantaneously". An
apparent immediate
response does not impress
the player.
Choose your GO-BACK-TO
destinations carefully. It
is pleasant for the ego
when the computer asks
for your name and instantly
promotes you to
" C A P T A I N . . . " b u t it
soon becomes an irritating
chore if this ritual has to be
repeated on each replay.
Take particular care to
make programs crash-
proof. There are some who,
finding themselves in an
irretrievable position, would
crash the program rather
than suffer the humilation
of being beaten by "some
damned machine".
Try and add a few original
twists. For example, allow
a few loop holes for
cheating but make the
computer respond with
something like,
" W e noticed your pathetic
attempt at subterfuge three
lines ago, but in view of your
obvious immaturity, we
decided to overlook the
matter. Should it occur again
you will be disqualified."
Note the use of the royal
" W E " above. . . very useful
little dodge to create an air of
omnipotence, although don't
overdo it by using phrases like
" M v RAMS and I "; subject use examples like milk
bills to start off with. Milk is of
course a delightful source of Tape books have been impressed (and
Dynamic Art health giving energy but the Sales brouchures often draw
educated) by "BASIC AND
THE PERSONAL COMPUTER"
compilation of milk bills is not attention to advantages of by Thomas A. Dwyer and
Providing the world " a r t " is
likely to cause a flutter of storing useful day to day Margot Critchfield but there
not taken too literally, some
excitement, followed by a information on home are probably dozens of equally
quite astonising moving
mad rush to write the computers, recipes etc. as useful. The following little
patterns can be generated on
program. General purpose reference snippets of wisdom (?) may be
most of the home computers.
They are however far more My wife would look at me "books" can certainly be very of some assistance to those
impressive if you are fortunate in sheer astonisment if I useful on tape, providing there who, like myself, have no
enough to own an APPLE or suggested she used my Z X 8 1 is a title selection page or natural abilities in the art of
other model which includes each month. She would pages. Once the tape is loaded programming.
colour combined with high- probably write it out on the (the most annoying stage), it 1) Buy a good book on BASIC
resolution graphics. The back of an envelope in ten is quicker to get at a given and carry out EVERY example
Z X 8 1 , despite the great play seconds flat, certainly before I page by pressing a number of it. It's not a bit of use just
made of its "graphics facility" would have time to fumble key than turning the pages of "reading" a book on this
is not really suited to the job. It round for the ON/OFF switch. a paper book. subject.
certainly has very useful It is appreciated of course that 2) Buy as many magazines on
such simple examples are
graphic "keys" but the
resolution in general is typical weapons of the Programming computing as you can afford
in addition to this one of
pathetic; equivalent to educationalists, based on the It is difficult to say anything course.
painting a portrait with a ten principle "teach from the original on this subject. 3) Keep a notebook, or
inch ceiling brush. know to the unknown", "use Literally hundreds of books preferably a card index
homely analogies" etc etc. have been written on the system, and copy down every
Sorting DATA There is a danger however
of de-glamourising a subject
BASIC language alone,
besides the thousands written
little programming "module" (
or dodge which has general
It is this area that the and underestimating the public on programming principles in purpose use. In this way you
computer is truly at home. mood and intelligence. Why general. However good the gradually acquire a
Every home computing not substitute plutonium manuals supplied are it is background in fundamental
enthusiast should take "data imports for milk bills? The almost essential to dip into the techniques and you can slip
processing" seriously. Strange program would be just as easy pocket again and buy at least them in your programs
how so many writers to write and marginally more one book on BASIC. Which whenever the need arises. Is
attempting to teach this exciting. one? For what it is worth, I this cheating? Depends on I

32 ZX C O M P U T I N G S U M M E RISZXCOI
Library
how you define cheating. even require that supreme academic purists who insist on a good idea to draw out a
There is little point in re- emblem of respectability the a carefully thought out logical rough plan of campaign in the
inventing the wheel on every club tie! approach on paper first. The form of an outline flowchart,
possible occasion. second influence was that of prior to operating the keys.
Issac Newton, not practical necessity. Prior to Another discipline carried
renowned for his modesty, the micro-processor and high over from the past is an
density integration of obsession with memory
once repled to a remark by an
admirer, "If I have seen a tittle
The Final words semiconductor memory, economy. It seems pointless
further than most, it is computing was very to prune a program (that
In conclusion, it is worth expensive, VDUs were non- works) down to the last byte
because I have stood on the examining some advice given
shoulders of giants." To copy existent or rare, every unless there is a real danger of
in the manuals concerning the response was spewed out on running out of memory. If you
down a complete program and art of programming.
pass it off as one of your own reams of expensive paper and, have say, a 1 6K memory and
Apparently, it is a cardinal sin above all, the cost per minute your unpruned program takes
is of course a different matter. to compose at the
Ethics apart (not particularly precluded the luxury of idle 6K why fiddle about with it.
keyboard . . . . it is called doodling. To increase execution speed
fashionable nowadays "winging it". We are
anyway) some one else might The position with the home just for the sake of it is
instructed by the tribe elders computer is different. Very another pointless operation. If
have read the same magazine to write the complete program
and bang goes your few of us can afford printers your program works and it is
on paper before approaching anyway . . . at least not in the reasonably " t i d y " leave it
reputation! The sort of the keyboard; at least every
modules worth saving for first year of ownership. The alone and get on with another.
separate module. This disipline V D U wastes nothing. It is a In this way your tape library
future and continous use came into being because of
include, lining up decimal perfect doodling pad and will grow much quicker and be
two non-related influences. unlike paper, can be used over just as useful as those of your
points, rounding to n Firstly, the influence of the
significant digits, sorting and over again. It is, however. fusspot colleagues.
numbers into ascending or
descending order, sorting
names into alphabetic order,
etc etc.
A word of warning
regarding program modules or
indeed full programs printed in
magazines. Some of them
don't work! The usual cause is
a misprint some where along
the line and readers, to judge
from the rather acidic tone of
their letters, express surprise
that "the Editor doesn't proof
read them before printing".
Proof reading costs time and
but to proof read computer
programs to guarantee 1 0 0 %
error free would probably
treble the cost of a magazine.
In any case, if they don't work
id (and then make them work . . . it's
IC AND good practice anyway and the
)MPUTER" mistake is often the trival
er and omission or incorrect insertion
>ut there of a comma or quote or
s of equally perhaps an unmatched
wing little parenthesis.
i (?) may be Join a local computer club.
to those They tend to be friendly
ave no gatherings all anxious to learn
he art of from each other and refreshing
free from professional
i on BASIC snobbery of any kind. The
ry example home computer addict tends
>f use just to be thought of as slightly
>n this weird by "normal" people, a
kind of mutation. It is
igazines on comforting to spend a few
;an afford hours in the evening with
me of other mutants. The great thing
is to join soon while the hobby
k, or is still young.
idex As the numbers of these
down every clubs grow and the
"module" membership expands to
s general excessive limits, the character
s way you may change, tt could reach a
i state like that which exists in
damental the so-called "exclusive" golf
u can slip clubs, questionnaires on
ams various aspects of the
d arises. Is applicants background.
pends on Perhaps, God forbid, they may
Pe/iAXU4oi , r

o
' — ~\TY"

J ~ \

Personal Software is a new quarterly publication from the people who


brought you Computing Today. To celebrate the launch of the BBC
Microcomputer our first issue will consist of more than 20 programs
covering Domestic, Financial, Educational, Games and Scientific areas.
All the programs are fully tested and documented and the listings have
been produced directly from the BBC Micro to eliminate errors. As an
additional service we are offering copies of the programs on tape through
our CT Software organisation.
As well as featuring the best software from previous issues of Computing
Today converted for the BBC Micro in order to show off its advanced
features, the publication also includes a number of specially commissioned
programs which reveal even more special functions.
If you own or have ordered a BBC Micro, or are just looking for a
collection of Extended BASIC programs to convert to your system, then
you need Personal Software: BBC Programs.
Personal Software will be on sale at your local newsagent from Friday 14th
May at £1.95 or you can order directly from us at £7.80 per annum or
£1.95 per copy. To ensure a single copy or a complete year's supply fill in
the form below — you can even spread the load with your credit card.
V.
r' a
h

SUBSCRIPTION ORDER FORM


Cut out a n d SEND T O :
F
[i
513, LONDON ROAD. h
THORNTON HEATH, VI
SURREY. H
ENGLAND.
a
li
«
Please use BLOCK CAPITALS and include post codes Please commence my subscription to Personal Software with
the issue. v
Name (Mr Mrs Miss)
d«l«t> Accordingly SUBSCRIPTION (tick »
Address RATES Appropriate)

£7 80 lor 4 issues L\ 96 lot a tingle


UK copy oi the

Signature I am enclosing my (delete as necessary)


Cheque Postal Orderfnrer national Money
Date Order for £
(made payable to ASP Ltd)
OR
Debit my Access. Barclayca/d'
('delete as necessary)
82 Summer


34 ZX C O M P U T I N G S U M M E RISZXCOI
16K Games

Power Boat

if you're desperate to try out your value near to, or slightly

sea legs, this little speedy simulation above, the maximum speed
for the section.

of a power boat race on Ruislip Lido The more power you


supply to t h e drive, the

should start the adrenalin pumping. faster the boat will go. If
you enter too much power,

it was written by Andrew Thomas you run the risk of a most


dramatic flip-over.

and Careth Canister for the PET, and Variables used in this pro-
gram are:

converted for the ZX81 by Tim C is t h e d i f f e r e n c e b e t -

Hartnell. w e e n actual and rated


turning circles.
D is the distance to the
You're in control of an ex- give you the direction and ing on the corners will get leader.
tremely p o w e r f u l , 16K m a x i m u m s p e e d for t h a t you disqualified. The lower E is the previous 'power to
power boat, with a state-of- section. There are 2 0 sec- t h e n u m b e r e n t e r e d for the main drive'.
the-art on-board computer tions in all. Even finishing the rudder, the smaller the E l is the present 'power to
(looking somewhat like a the race is an achievement, as t u r n i n g circle and hence the main drive'.
small black thing from Cam- you'll see when you run the pro- the smaller the radius. F is the amount of fuel re-
bridge), racing around the gram. Entering zero will make maining.
Lido against o t h e r top You must enter the your craft continue in a M is the m a x i m u m speed
champs. The course and a m o u n t of R U D D E R y o u straight line. The ratio bet- for the section.
weather conditions vary in need to make a turn. Too w e e n the rudder and the P is your position.
each game, although the much and you'll cut the cor- radius varies from one to 1 0 R is the rated turning cir-
weather doesn't alter dur- ner, too little and y o u ' l l when stationary, to one to cle.
ing the course of a game overshoot the corner. five at top speed, just to S is your present speed.
(the reliability of the Slightly cutting the corner, make a difficult game near- T is the rudder position.
climate in West Ruislip is if you can manage it, helps ly impossible. To complete W is the prevailing weather
well-known). The course is you get ahead of the other the course, you must also condition.
marked out with buoys to drivers. However, bad driv- regulate your speed to a X is the section number.

lO REM *PQUER BOAT* 24- 0 P R I N T " C O N D I T I O N S ARE " ; R $ »


20 REM *ANDREW THOMAS* U)
30 REM JGRRETH C A L L I S T E R * 2 5 0 LET P = 1 0 0 0
40 REM *TXM HRRTWELL* 260 LET P=S
90 LET E=S0 2 7 0 LET D = 10
100 DIM R $ ( 6 , 1 0 ) 2 3 0 LET E =0
110 LET A $ ( 1 > = " CALM 3 0 0 FOR X = 1 TO 2 0
120 LET A S ( 2 * = " M I L D " 3 05" SCROLL
130 LET A $ ( 3 ) = " C H O P P Y " 3 1 0 IF RND-J 0 . 3 THEN GOTO 3 2 0
140 LET R $ U ) ="ROUGH" 3 1 1 LET R =0
150 LET R $ <5> = " U E R Y ROUGH" 3 1 2 LET M =55 + I N T tRND*55J - U * 2
160 LET R $ l"8 J = " S T O R M Y " 3 1 5 GOTO 34-0
230 LET U = I N T tRND*S>->i 3 2 0 LET R = I N T * R N D * 9 0 > +lt?
235 LET 5=0 3 3 0 LET M s I N T t' 3 0 + R N D * 2 0 - f R S 3 - U <
237 SCROLL *2
16K Games
34© S C R O L L 1002 SCROLL
34-5 P R I N T " S E C T I O N "; X 1003 PR-INT " T O O MUCH ACCELERATIC
N"
34-7 S C R O L L 1010 GOTO 1200
35© PRINT "POSITION 1020 SCROLL
352 SCROLL _ 1025 PRINT M £ S A H ) Y O U R B O A T T-
3 5 5 IF D < 0 T H E N P R I N T " Y O U L E A D ENT "THROUGH" N
B Y "; A B S ( I N T (D> ; " M E T R E S " 1026 SCROLL
3 5 6 IF D < 0 T H E N G O T O 3 <55
357 SCROLL __ .„ „ „
360 PRINT " D I S T f t N C E TO LEADER I
^
1 0 2 7 P R I N T " T H E M A R K E R S , Y O U HA*.
E BEEN"
1023 SCROLL
K
S ";INT (D);" M E T R E S "
365 SCROLL 1029 PRINT ,"DISQUALIFIED"
1 0 3 0 IF C > 0 T H E N G O T O 1 0 6 0
IT
370 SCROLL , 1040 SCROLL
3S0 PRINT "SPEED MAX SPEED RR 104 5 P R I N T " Y O U S H O U L D N T T A K PI
DIUS
385 SCROLL
FUEL"
390 PRINT " **; I N T „
RNERS"
1046 SCROLL a
1047 P R I N T /'SO W I D E "
" : I N T (M> ; " "; I H T FR> ; 1050 GOTO 1200 d
"; I N T (F) 1060 SCROLL
1 1 0 6 5 P R I N T " Y O U S H O U L D N T C U T COFSL
J 1 0 P R INT " " P O W E R M R IN D R I V E ? (1 NERS "
T O 100.1 1070 GOTO 1200
t i l I F P
E X < l i
O R E 1 > 1 0 0 THEN GOTO
1030 SCROLL
1035 PRINT N S E H M F C * Y O U D A M A G E L RAI
P
415 THE BOAT "
417 PRINT EL "A
1086 SCROLL wri
420 SCROLL 10S7 PRINT "BY GOING SO F A S T "
4-25 PRINT "RUDDER POSITION? 10 pro
1090 GOTO 1200
TO "; 1100 SCROLL mo
426 INPUT T . 1 1 0 1 P R I N T " P H U T - . , O U T OF F U E L tin{
4.3 7 IF T < 0 O R T 9 THEN G O T O 4-2FCV 1200 SCROLL wh
433 PRINT T pre
1210 PRINT "ANOTHER GAME?"
450 IFRE1-E>50-U*2 THEN GOTO 10 1220 INPUT U$ pel
1225 CLS
1 2 3 0 IF C O D E (L$J O C O D E "N" THE»VC
°460 L E T C = ( 5 / 1 0 0 + 1.* * 1 0 * T - R RUN me
470 IF A B S < C ) > 1 8 - W T H E N G O T O 1 1240 SCROLL
0 2 0 Z8
430 IF C<6 THEN GOTO 510 1250 PRINT "OK,BYE" hel
C O N D I T I O N S RRE STORMY ing
t i l PRINT1" "YOU TOOK CORNER FAR
TOO WIDE" SECTION 1
50© LET C =12 _ P O S I T I O N 5
5 1 0 I F C > —6 T H E N G O T O 54-0
SCROLL R DISTANCE TO LEADER IS 10 METRES
525 PRINT "YOU CUT CORNER TOO
LOSE" SPEED MAX SPEED RADIUS FUEL
5 3 0 LET C =13 0 50 0 1000
54-0 LET E = E 1 . . . P O W E R M A I N D R I U E ? *. 1 T O 1 0 0 ) 4
SS0 LET S*5/3+E/1.2-tT/I®^ R U D D E R P O S I T I O N ? (O TO Sf 0
5 6 0 I F S ) I . 1 » H + 1 B - W THEN GOTO
0 8 0 _
SECTION 2
5 7 0 LET D = D + M - ^ + C''2
POSITION 7
5 3 0 LET P = I N T ( D / i © + R N D » 2 + 2 ) DISTANCE TO LEADER IS 56 METRE-
5 3 5 I F P : 2 THEN LET P = 2 pr
5 9 0 I F D <=0 THEN LET P = 1 RO
SPEED MAX SPEED RADIUS FUEL
600 LET F = F - V*EV10» »*2+E> / 2 3 74 3 9 9 7 ©1
6 1 0 I F F < 0 THEN GOTO 1 0 0 0 P O W E R M A I N O R X J T ? I. I T O 1 O 0 ) 5 W
6 2 0 NEXT X RUDDER P O S I T I O N ? IO T O 9> S
6 3 0 I F P > 1 THEN GOTO t?70

121 P R I N T L " C O N 6 R F T T U L R T I O NiS


S - YO SECTION 3
U WON" POSITION 15
660 GOTO 12O0 „ D I S T A N C E T O L E A D E R IS 125 M E T R E
5 7 0 IF D > 3 0 T H E N G O T O 7 1 0 SPET MAX SPEED RADIUS FUEL
675 SCROLL . AND M
680 PRINT "YOU FINISHED. R 62 © 995
P O W E R M A I N D R I U E ? C I T O 100J 7
OT T O O " R U D D E R P O S I T I O N ? CO T O 9/ <3
6 § 2 PRIHT'" " P A R B E H I N D T H E L E R D E
R" SECTION 4
690 GOTO 730 POSITION 2©
700 SCROLL D I S T A N C E T O L E A D E R IS 179 METRE!
715 P R I N T L " U E L L , RT LEAST YOU F ^PEED MAX SPEED RADIUS FUEL
INISHED" 7 59 69 991
P O W E R V'A I N D R I V E ? CI T O 1 0 0 ) 7
72§ P R I N T U " V O U F I N I S H E D ",P R U D D E R P O S I T I O N ? (.0 T O 9 ) 6
74 5 S C R O L L MFCIIMFCJSFTAS Y O U R B O A T U E N T T M R O U C
7=.0 P R I N T " D I S T A N C E T O L E A D E R W T H E "FIPKERS. Y O U H R U E B E E N
R 5 "; I N T (D.I , " M " DISGURLLFIED
760 GOTO 1200 YOU SHOULDNT TAKE CORNERS
1000 SCROLL _ _. , _ SO UIDE
100 1 P R I N T "YOUR BOAT C O L L A P S E D ANOTHER GAME?
FROM "
ZX C O M P U T I N G S U M M E R 19E)
16K Games

}RTIO

3RT W
zap 1

*zN J L ' R T H E
' I R F O T
REM
(SQ5U5 ® T h N
2 REM

FOLLOWING
COMMANDS:
5K7

EERNDIK?"
GOSUf 7 f ? R N D VB

CHR$

AS
GOSLU?

Paul Gausden from POKE i5516/H7


J Hfl'.f
Kingswood brings a little POKE
POKE
1 6 5 1 3 , 9 1
1 5 5 3 9 , 1 1 7

machine code into play to


C O l put you in the cockpit of
1
REM 5K7 GOSUB ? £ R N D <* C H R $ •
GOSUB ®TAN
KE 2 R E M E £ R N D R ? , C H f i $ *7 G O S U B
a biplane engaged in a 3TAN
3 LET S C R = 16514-
deadly battle over the 4. L E T CPV = 1 5 5 3 4
10 P O P F - 0 T O 4
T CORj straits of Mallacash. 2 0- P R I N T T R P F + 8 ; " V ' J T f l B 30-.F
2 , '
30
''
NEXT F^
4-3
5 0 f- O R * F - 0 T O ^ S
MAGEcJ 60 PRINT TRP 9-F; " ; TAB 2 2 *F;
Paul writes to ZX Computing: each time, so now the stars • | »

"A short while ago I was stayed where they were!


PRINT TAB 9-F.: " » TAB 22*-F;
T" writing a 'space war' type of
program with a starry sky, and
"One of the programs I've
written using this routine is »SO NEXT F
moving the space ships by prin- ZAP. It uses the routines to
3 0 FOR F t 0
ting black squares over them save the foreground (the in- * 0 0
which meant that as the game terior of the cockpit) and recalls
UEL " progressed all the stars disap- it each time. You are chasing 11 a< N i X T
r
peared. after an enemy aircraft and you PRINT AT
1 2 0 *JLm ' ; A T 16,
"I was trying to find a way have to remember the controls 15, " RT 1 7 . 1 3 ; "
around this when a friend lent work in reverse. 1 3 0 L E T i.=USR C P V
1
THEN me his "Programming the " T o get the GOSUBs in the 1 4 0 L E T 3=4-5
Z 8 0 " , by Rodnay Zaks. This REM statements, type THEN 1 5 0 LET K » 0
helped me to write the follow- GOSUB and rub out the T H E N . " 1 6 0 LET X —J NT T RND*32)
ing machine code program: As you can see from the 170 LET V - TNT ( P N D i l S j
Id hl,7530h ( 3 0 0 0 0 1 screen printout, the enemy
160 L E T P;!.;SR S C R
Id de, (d-file) plane is the little thing you can
1-90 P R I N T A T Y X ; " JL "
155 TF S = 0 T H E N S T O P
inc de see through the cockpit. It 200 IF J N K E V $ = " C " T H E N G O T O 30O
ETRE5
Id be, 0 2 D 6 (726) moves randomly around, and
you must use 5 , 6 , 7 and 8 to
210 L E I X = X + I N i (RND*3.» - I f ( I N K t .
LDIR Y ? = 5"3~ ( I N K E V $ = " 8 " )
Ret move yourself into a position 2 2 0 L E T X = X + 2 * f (X<0> - i \ .)
FUEL where the enemy plane will be 2 3 0 LEI V = Y + I N T (RMD*3)-It(INKF
1O00 "This program loads what is on the cross of your sight. As T$sf7' 1 - ( INKEV $ a ' 6" >
>0) 4 Paul pointed out, you have to 2 4 0 L E T Y = Y + 2 * ». iY <0) - » Y > 1 7 ) )
0 above memory location 3 0 0 0 0
into the display, and by chang- remember that you are, in 250 GOTO 1
ing over the de and hi registers it e f f e c t , moving backwards, 3 0 0 P R I N T M T 13 ^ 14-; ' faafB"
saves the display a b o v e swinging the view of the enemy 310 LET 3 =3-1
3 0 0 0 0 . This meant that when I against the sky. This may 3 2 0 IF X < 1 7 A N D X > 1 3 A N D V = 1 4 - T
ET R E -
printed out my sky I used one sound complicated, but it E N G O T O 34-0
routine to save it, then used the becomes very clear once you 330 GOTO 210
FUEL
other as a type of CLS, but RUN the program, and gives a 340 LET K = K + 1
good impression of a dogfight.
3 5 0 P O K E 3 0 6 4 3 tK + 1 5 6
fQ 'f B recalling the same background 360 GOTO 160
0

X"
METRE 3
FUEL
30 ) 7
S

i METRE
FUEL
.00 ) 7

HROUG I

I ED
i

S U M M E R 19CX COMPUTING S U M M E R 1982 37


ZX80 Adventure

T O U R I S T T R A P is a 4K Z X 8 0 "adventure" type program 140 PRINT "IF YOU GET THERE YOULL NEED)7
which can be easily converted (essentially by changing the way
the random numbers are generated) for the Z X 8 1 . It is very, 150 PRINT " $35 TO BRIBE YOUR WAY IK'
very light-hearted but is fun to play, and gives you a framework 160 PRINT
upon which to construct your own A D V E N T U R E . You might
like to try changing this program slightly so that it asks for, and 170 PRINT ,PRESS NEWLINE"
uses, your name from time to time.
180 INPUT A$
1 RANDOMISE 190 IF NOT A$ = "" THEN STOP
10 PRINT ,"TOURIST TRAP" 200 GOSUB 1610
20 PRINT ,"12 shift G"
30 GOSUB 16 30
50 LET X = 0
60 LET S " 30
70 LET W = 1
80 PRINT "HERE WE GO ON
90 PRINT LONDON TOWN..."
100 PRINT
110 PRINT "YOU HAVE $30, AND YOURE
TRYING"
PRINT "TO GET TO BUCKINGHAM PALACE"
PRINT "(THE PALACE IS ON FOOTPATH 10)
PRINT
ZX80 adventure
1220 IF W < 1 AND RND(IO) > 8 THEN GOTO 17 30 420 IF A = 4 THEN PRINT "TUBE STATION",,
\225 IF W < 1 THEN LET W = 1 "ENTRANCES"
230 PRINT "twospaceTHIS IS FOOTPATH " ;W 4 50 PRINT
250 IF W * 10 THEN GOTO 1690 460 PRINT "WHICH ONE WILL YOU USE?"
,L NEEDm 270 PRINT "SO YOU ARE " ; CHR$(128);CHRg 470 INPUT B
WAY I N"\ (166 - W);CHR$(128);" FROM THE PALACE' 475 IF B > K OR B < 1 THEN GOTO 470
280 PRINT 480 GOSUB 1610
28 5 IF S < 1 THEN LET S = RND(5) 500 IF RND(10) < 4 OR B - A THEN GOSUB
\2 90 PRINT "YOU HAVE $";S;" IN YOUR POCKETS" 1170
300 LET X » X + 1 530 LET C = RND(4)
310 PRINT 540 IF C = 1 THEN PRINT "FOOL";
320 PRINT "five shift S THIS IS PROBLEM ";X
330 PRINT
350 LET K = 1 + RND(5)
360 PRINT
370 PRINT "YOURE FACING ";CHR$(128);CHR$
(156 + K);CHR$(128);"space";
LET A = RND(4)

IF A " 2 THEN PRINT "SHOPS"

"CROSSINGS"
Tourist trap
550 IF C = 2 THEN PRINT "IDIOT"; 750 IF A = 1 THEN LET CfS " "PARKING
560 IF C ~ 3 THEN PRINT "HELP"; TICKET"
m
570 IF C = 4 THEN PRINT "SURPRISE"; 810 IF A 2 THEN LET CfS = "PASS TO TB&
620 PRINT "YOURE FACE TO FACE",, TOWER"
"WITH A "; .8
820 IF A = 3 THEN LET C$ - "POSTCARD <S
630 LET A = RND(7) TRAFALGAR SQUARE"
640 IF A = 4 THEN PRINT "GREEN 8 30 IF A * 4 THEN LET Cg - "MAP OF
650 IF A = 5 THEN PRINT "BLUE "; CAMBRIDGE"
66 0 IF A ~ 6 THEN PRINT "BRIGHT RED
670 IF A = 7 THEN PRINT "SICKLY
YELLOW
680 LET A « RND(5)
690 IF A = 1 THEN LET B$ "SMILING
POLICEMAN"
IF A ~ 2 THEN LET B$ - "BEWILDERED^
TOURIST"
IF A = 3 THEN LET B$ TICKET
INSPECTOR"
IF A = 4 THEN LET Bff = "PARKING
WARDEN"
IF A = 5 THEN LET B$ -
"BUS DRIVER"
LET A = RND(7)

-Jm
ZX C O M P U T I N G S U M M E R «
Tourist trap
IKING 840 IF A = 5 THEN LET C$ = "MONKEY ON (9)"tf"POINT THE OTHER WAY(10)?"
A STICK"
1000 INPUT A
>S TO THi 350 IF A - 6 THEN LET C$ = "PACK OF FISH
1005 IF A > 10 OR A < 1 THEN GOTO 1000
AND CHIPS"
1010 LET B - RND(IO)
860 IF A - 7 THEN LET C$ = "RINGSIDE SEAT
>TCARD Ol 1020 GOSUB 1610
AT OXFORD CIRCUS"
1030 IF RND(5) - 1 OR A < 8 THEN LET A = B
900 PRINT B$,"WITH A"
OF 1040 IF A - B THEN PRINT "YOU FOOLED
910 PRINT C$
THE ";B$
920 PRINT 1050 IF A'= B THEN LET S « S + RND(iO)
930 PRINT "HOW DO YOU REACT?" 1060 IF A = B THEN PRINT "AND NOW HAVE
940 PRINT
iS
9 50 PRINT"SPIT(1) ","SWEAR(2) ","SCREAM IF A = B THEN LET W = W + RND(4)
FOR HELP(3)",,"POKE AT IT WITH A IF W > 10 THEN LET W = 10
STICK(4 ) ","SAY YOU DONT SPEAK ENGLISh PRINT
(5)","SAY YOU ARE A STRANGER IN TOWN IF NOT A = B THEN PRINT "THE ";B$;
{• ) nos pace BOOK A " OUTWITTED","YOU"
FLIGHT TO PARIS(7 ) , IF NOT A = B THEN LET S = S • RND(5)
"HAIL A CAD(8)", ,, IF W < 10 THEN PRINT "YOU ARE CLOSE
"BUY A RIOT SHIELD TO",FOOTPATH CHR$(128);CHR${156 +
CHR$(128)
GOTO 160
LET A = RND(4)
GOSUB -1240* (A = 1) - 1 340*(A = 2)
- 138 0*(A = 3) - 1510*(A « 4)
GOTO 160
PRINT ,"YOUVE FALLEN DOWN"
LET B » RND(4)
IF B = 1 THEN PRINT " IN FRONT OF
BIG BEN"
IF B " 2 THEN PRINT " IN THE STRAND'
IF B = 3 THEN PRINT "IN FRONT OF THE
TRAFFIC","IN PICCADILLY CIRCUS"
IF B ~ 4 THEN PRINT RND(99);" STEPS
TO THE THAMES"
LET W — W - 1
LET S = S - RND(2)
RETURN
PRINT "f i vespaceYOU ARE CAUGHT RIDING
ON A","fivespaceNO. ";RND(99);" BUS
WITHOUT A TICKET"
LET W = W - 1 I
LET S = S - RND(2)
RETURN
PRINT ,"YOU GAIN A"
LET D = RND(6)

SUMMER 1 » ZX COMPUTING S U M M E R 1982 41


Tourist trap
1400 IF D « 1 THEN PRINT , "STALE SALAD RQ
1410 IF'D = 2 THEN PRINT "TICKET TO THE
PLANETARIUM"
1420 IF D = 3 THEN PRINT "GOOD SEAT AT
COVENT GARDEN"

1430 IF D 4 THEN PRINT "TUBE TICKET T0\


SHEPHERDS","BUSH"
1440 IF D = 5 THEN PRINT "SEAT UPSTAIRS
ON A ";RND(99); " BUS"
1450 IF D » 6 THEN PRINT "BLACK EYE FROM I
A RUDE LOCAL"
1470 LET S = S + RND(5)
1480 LET W - W + RND(3)
1490 IF W > 10 THEN LET W = 10
1500 RETURN
1510 PRINT "YOU FIND A MAP OF LONDON"
1520 PRINT
1530 PRINT
1540 PRINT "CHOOSE YOUR BONUS (UP TO $ 5) jl
1550 INPUT A
1570 LET S » S - A*(A < 6)
1580 LET W = W - A/2
1590 RETURN T
(C
1610 CLS
fc
1615 FOR M = 1 TO 25*RND(5) 4
tit
1620 NEXT M d.
tC
16 30 FOR M = 1 TO 5 m
at
1640 PRINT oi
R.
1650 NEXT M
Xt
1660 RETURN Si

1690 PRINT "YOU ARE AT THE PA LACE GATE"


1700 PRINT "DO YOU HAVE $35 TO BRIBE YOVa
1710 PRINT "WAY IN? PRESS N/L TO FIND OU%
17 20 INPUT A$
17 30 GOSUB 1610
1740 IF S < 35 AND W > 5 THEN PRINT "yOl/l
HAD ONLY $";S;" SO YOUVE","BEEN
DEPORTED..."
1745 IF W < 1 THEN PRINT "YOUVE FAILED AS
A TOURIST... AND BEEN BEHEADED...";
1750 IF S < 35 THEN GOTO 1740
1760 PRINT "YES, YOU HAVE $";S
1770 PRINT "THE RED CARPET AWAITS YOU..A
1780 RUN 1770

ZX C O M P U T I N G S U M M E R 19©Z>
Construction

Double
LAD ROM

THE

your R A M
AT

TO

MRS

FROM The limits of the 1K supplied on-board with the standard ZX81
become frustratingly obvious once you start to write programs.
You probably spend more of your time trying to save memory
with little tricks than you do in improving the program. Here's
one solution. Stephen Adams, author of 20 Simple Electronic
Projects for the 2X81' explains how you can double the memory of
your computer. Even if you've never touched a soldering iron
V" before, you should be able to carry out the simple modifications
necessary to get some workable RAM space. This RAM addition
gives not only a full 24 line screen, but also gives twice as much
program space. The 1K extra RAM described in this article is
) $5)
cheaper to install than Sinclair's own suggestion of replacing the
1K chip supplied with a 2K (4816) RAM chip.

The I K of original R A M This chip decodes the upper into, or out of, the RAM chip on 2K sections instead of IKones.
(ORAM) can come in two t w o address lines A 1 4 and the data bus. As the decoding tn other words, it will only
forms, two 2114s or a single A1 5, so that when the correct of A 1 5 / A 1 4 provides only a repeat every 2K within the 16K
4 1 1 8 . The single chip is iden- address for the RAM 16K section in memory, the section.
tified as IC4 in the circuit (1 6 3 8 4 - 3 2 7 6 7 } is on the ad- RAM chip appears again and
diagram and two 2 1 1 4 s as dress lines, the RAM CS line to again, at every I K within that The 7400 IC
lC4a and 4b. Both are con-
nected up to the same data and
the RAM chips is lowered to
binary 0 .
16K section. In order to add
another 1 K of RAM, we have to
Decoder
address tines. They are This line is then used to turn divide this 16K space into The address decoding is done
operated by the same signal, on the RAM chips, so that the larger units or else both chips by a 7 4 0 0 NAND gate IC,
RAM CS, which is generated by other address lines using AO to will appear at the same ad- w h i c h contains four such
the control chip known as the A 9 can detect which byte is re- dress. The line we will use is gates. A NANO gate will only
Sinclair Control Logic or ULA. quired. The data is transferred A 1 0 , which witl provide us with change its output to binary 0

r rot/pj
w 0U T1

•YOU

.ED AS

)U

IER 1962 ZX COMPUTING S U M M E R 1982 43


Construction

G A T E S 1 - 4 IN 7400 IC

13

0 VOLTS- PIN 7

+5 V O L T S - P I N 14 CIRCUIT DIAGRAM

when both inputs are binary 1, binary 1. The other input to the third change will be ORAM, as we are going to mount it on tN je
otherwise the output is binary gate depends on A1 0 . It must A 1 0 is now binary 0 again. This Z X 8 1 's PCB using a piece a p
1. Figure 1 shows the connec- be binary 1 to operate gate two, sequence will repeat itself all Blu-tack or a double side< o
tions to the IC. and binary 0 for gate three to the way through the 16K sec- sticky pad, so the legs of the IC
h
The RAM CS line is con- operate. tion. are sticking upwards, and cfe
u
nected to both inputs of gate As A 1 0 changes'every 1K, not make contact with tto
c
one, so that its output of gate starting as binary 0 , then Construction and ZXB1 's PCB. The only connec $
one is constantly binary 0 ,
unless the correct 1 6K section
changing to binary 1, then back
to binary 0 again, the ORAM
Alterations tions that are made are to th»
PCB at the points shown. Th
c
ir
is decoded by the ULA. If the will be first turned on by gate The first step is to wire up the connection to the ORAM C!
RAM CS line is changed to three going to binary 0 , and 7 4 0 0 IC as shown in Fig. 2, lines is made underneath th
binary 0 by the ULA, one of the then the ERAM (Extra RAM), remembering that it is shown PCB.
inputs to gates two and three is The next RAM to come on in the upside down. This is because The RAM CS line appears o
the edge connector pad 2 A, W-
can solder our connection n lr
the 7 4 0 0 IC (pins one and twc C
to the hole connected to th m
A10 edge connector pad 2A. Th g
printed circuit track leadini „
O R A M CS from this pad to pin eight c v
+5 V O L T S lC4b must be cut. Pick a spo £
half-way along the track an t )
make two small cuts about a a
eighth of an inch apart, using f(
craft knife. Then, still using th g
craft knife, scrape away all c
the track in between, sotherei n
no connection between th t )
t w o . Attach the wire from pi e
T O PAD 2A eight of the 7 4 0 0 IC to pin eigf c
O N EDGE of IC4b, whether fitted or n<r
CONNECTOR Keep all the wire to the 7 4 0 0 1 t !
as short as possible withck ((
0 VOLTS
7400 IC (UPSIDE DOWN} touching any other track. A a
E R A M CS tach the 0 volt and +5voltwif b
to either side of capacitor CS s
making sure you get them th t ,
right way round. The only wo t(

44 ZX C O M P U T I N G S U M M E RISZXCOI
Construction

+5 V O L T S 0 VOLTS

CONNECTIONS TO ZX81

IC4

) 7400

T
EDGE CONNECTOR
J
int it on the left is the ERAM CS line. The together. Solder the ERAM CS ween tracks on the PCB and on and the other 2 0 0 nS. This is
a piece of position you fix this will depend wire to one of them, making the tCs. Check that the connec- the time (in nanoseconds)
iuble-sided on what sort of ORAM you sure it does not touch the tions to the PCB are not likely to taken to operate the chip after
gsof the IC have. Stick the 7 4 0 0 IC (legs ORAM'S pin eight. wander about and touch any- the CS line is operated. The
Js, and do upwards) onto the printed cir- thing else. On re-assembling chips needed for this project
with the cuit board in the position the Z X 8 1 and applying 9 volts can be up to 4 5 0 nS. The best
ily connec-
i are to the
shown. The A 1 0 connection
can be made by pushing a wire
One 4118 as ORAM to it, you will find that PRINT
PEEK 1 6 3 8 9 gives a result of
thing is to look at the price of
the chip, not forgetting that you
;hown. The into the hole next to L2 and 7 2 . (f not, or the inverse 'K' will require t w o of them for the
This is a bit more difficult as the
ORAM CS soldering it. does not appear, check all your extra 1K of R A M .
O R A M covers up one of the
»rneath the connections again.
ERAM sockets. An IC socket The 7 4 0 0 also comes in t w o
should be soldered into position The reason for all this work is versions. The original, cheaper
appears on
pad 2A. W e TWO 221S as ORAM onthe IC4b, then a 2 1 1 4 IC
placed in it with its pin eight left
that 2 1 1 4 s only cost 9 9 p plus
V A T , whereas the cheapest
7 4 0 0 and the more expensive
7 4 L S 0 0 . The 7 4 L S has more to
mection to In this case, remove the t w o outside the IC socket. The other 4 8 1 6 is £ 7 . 0 0 plus V A T or recommend its use, however,
ne and two! ORAM ICs and mount t w o 2 1 1 4 must be mounted under- more. If — despite the cost — as it requires less power to
:ted to the more 2 1 1 4 s on top of them. neath the IC4, This is done by you want to install a 4 8 1 6 , operate and has protection
id 2A. Tl ER AM 2 1 1 4 s should have their laying the top of the 2 1 1 4 place it the same w a y round in diodes built into the input of the
ick leading pin eights cut short, so that against the PCB over the pin the socket of the 4 1 1 8 and cut gate. It is therefore best to use,
jin eight of when they are mounted on the connections for IC4a, N o w the strap from L1 to L2. A new as it only costs a few pence
Pick a spot ORAM the two pin eights do not solder wires from the IC4a con- strap must then be inserted bet- more. The 7 4 0 0 and the
j track an< touch. Solder this 'piggy back' nections to the 2 1 1 4 R A M IC, ween L2 and A 1 0 . This modifi- 7 4 L S 0 0 use the same pin
ts about ar arrangement together, except making sure it is the right way cation will not stop you using a numbers.
>art, using i for the pin eights. The top round, so that the cutaway of 16K pack, as the R A M CS con-
till using the ERAM's pin eight should then the IC is nearest the edge con- nection on the edge connector
away all ol be soldered to a piece of wire nector. Do not solder a wire to still works.
n, so there is making sure that it does not pin eight. Join the t w o ERAM's
jtween the touch the lower ORAM'S pin pin eights together using a
ire from pill
;topineighi
eight. These pins are the RAM's
CS pins.
piece of wire and then solder
the ERAM CS to pin eight of the
Shopping list
itted or not ERAM in socket IC4b.
the 7 4 0 0 IC Put the 2 1 1 4 s back into There are at least three dif-
ble without their sockets, making sure the ferent 2 1 1 4 1 K R A M chips
f track. At ICs are the correct way round, available. The L version takes
+ 5 volt wire as shown in Fig. 3. The top and Finishing touches less current and so is useful if
jpacitor C 9 bottom RAMs should be the you are using your machine
let them the same way round. Now join the Before applying any power to with extra boards. The other
he onty wirf two pin eights of the ERAMs the Z X 8 1 , check all the connec- t w o types are differentiated by
together, and solder the ERAMs tions for bridges of solder bet- their speeds. One is 4 5 0 nS

U M M E R 19S ZX COMPUTING S U M M E R 1982 45


Machine code

First steps in Machine


code
There seems to be a myth sur-
rounding Z X 8 1 machine code.
For some strange reason it is a
common belief that programm-
ing in machine code is not easy. Machine code may seem
16514

"2A0C40"

"0618"
Machine
code address
LD HL.
(D FILE)
LD B,
Gf
twentyfour
Indeed there are even people
who would go as far as to call it bewildering, but Toni Baker — "23" LOOP: INC HL
IK
author of Mastering Machine Code
"7E" LD A.IHL)
difficult. Suffice to say this is "EE80" XOR80h Sq

on Your ZX81 or ZX80 — is


not the case for, while it is true "FEF6" CP F6h
that the use of machine code "2803" HR Z.EXIT
was omitted from the Sinclair
Manual, all you need is one little
convinced the whole subject is a "77"
"18F5"
LD (HL).A
JR LOOP
(BASIC) program taken from piece of cake. Here, Toni "10F3"
"C9"
EXIT: DJNZ LOOP
RET
the book. Mastering Machine
Code On Your Z X 8 1 . to get you attempts to convince you, with a M
started. Here it is . . . clever screen-handling routine Now please note — you do not
need to understand what I've
ad
vo
10 INPUT X and the raw ingredients of a written in the right-hand col IK
Mj
20
30
LET A * - " "
IF A$ » " " THEN INPUT A$
BREAKOUT game. umn. All you need to do is enter
what's written in the left col-
Ca
Pa
40 IF A * - " S " THEN STOP umn. When you've done that 1K
50 POKE X. 1 6 * C O D E A$ + type " S " to stop the program.
CODE A » ( 2 ) - 4 7 6 your own BASIC programs.
me to teach the whole of
60 LET X - X + 1
Try this one. Load the above Now add these lines:
70 LET AS AS(3 TO) note machine code from scratch —
there is nothing between that would be like trying to program, then add the follow-
ing line: 1 0 0 IF INKEY$ < > * ' " THEN
" T O " and " I " squash Sinclair's BASIC
GOTO 1 0 0
80 GOTO 3 0 Manual into t w o or three pages 1 REM 1 2 3 4 5 6 7 8 9 0 2 3 4 5 6 7 8 9 1 0 5 IF INKEYt = " " THEN GOTO BR
— so instead I'll give you one or 105
Now obviously there isn't t w o little machine code Now RUN the program and input: 1 1 0 RAND USR 1 6 5 1 4 36 I
enough room in this article for routines which you can use in 1 2 0 GOTO 1 0 0 ST{

46 ZX C O M P U T I N G S U M M E R 1962 ZX C
Machine code
N o w t y p e RUN 9 0 and just see 40 FOR I = 1 T O 5 0 I REM 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 76 PRINT "thirty t w o inverse
w h a t happens w h e n y o u t o u c h 50 NEXT) 901234567890123456 spaces"
any of the keys. Incidentally, 60 RAND USR 1 6 5 1 4 789012345678901234 80 LET X - P E E K 1 6 3 9 6 + 2 5 6 *
lines 1 0 to 8 0 can actually be 70 GOTO 4 0 567890123123456789 PEEK 1 6 3 9 7 + 2 0 0
012345678901234567 90 POKE 1 6 5 1 4 . X - 2 5 6 * INT
deleted altogether n o w , a n d
890123 (X/256)
only line one is needed. F r o m
n o w on, any time the m a c h i n e Run this a n d s t a n d b a c k in N o w R U N t h e p r o g r a m a n d in- 100 POKE 1 6 5 1 5 , I N T ( X / 2 5 6 )
put t h e f o l l o w i n g ( c o u n t i n g " / " 1 1 0 LET A - U S R 1 6 5 1 8
encounters the statement amazement. 120 GOTO 1 1 0
as " n e w l i n e " ) :
RAND USR 16514 the For s o m e t h i n g a little m o r e
machine code magic will w o r k . c o m p l e x , h e r e is a r o u t i n e Lines 1 0 t o 7 6 just print t h e
16516/0101/2A8240/3600/
w h i c h will m o v e a ball a r o u n d a 3 A 8 4 4 0 3 D 2 0 0 2 2 3 2 3 2B 7E b o a r d . Y o u c a n r e p l a c e t h e s e by
Try this little g e m . D e l e t e all
s c r e e n , b o u n c i n g it off w a l l s FE80/200B/2A8240/4A8440 any board-printing routine you
the lines except line o n e . N o w
and bricks. ED44/328440/228240/3A8540 like. Lines 8 0 t o 1 0 0 are ab-
add the following lines:
Y o u c a n d e v e l o p a kind of /3D/2006/11DFFF/19/1804/ s o l u t e l y v i t a l for t h e m a c h i n e
10 FOR l « 1 TO 1 0 0
B R E A K O U T - t y p e g a m e using I I 2100/1 9/7E/FE80/200B code to w o r k , (although the
2 0 PRINT 'three spaces
this r o u t i n e . L o a d t h e m a c h i n e 2A8240/3A8540/ED44/328540 + 2 0 0 c a n be m o r e or less
followed by three inverse /010000/7E/FE08/2009/03/
c o d e loader a t t h e s t a r t of t h e + a n y t h i n g — it just d e t e r m i n e s
spaces'; 3A8540/ED44 328540/228240
3 0 NEXT I article a n d a d d o n e e x t r a line: t h e p o s i t i o n of t h e s t a r t of t h e
/3634/C9/S
ball), a n d all t h e f u n h a p p e n s a t
FE80/200B; 2 A 8 2 4 0 / 3 A 8 4 4 0
1 1 0 and 1 2 0 . T h e instruction
Y o u c a n n o w d e l e t e lines 1 0 on-
LET A a USR 16518 just
wards. m o v e s t h e ball o n e s q u a r e
T o d e m o n s t r a t e h o w this a l o n g . If y o u P R I N T A a f t e r -
w o r k s just add the following w a r d s y o u ' l l find i t ' s a l w a y s
BASIC: z e r o u n l e s s t h e ball hits a brick,
in w h i c h c a s e it will be o n e .
10 PRINT " t h i r t y - t w o inverse
spaces" S o y o u s e e , t h e loop 1 1 0 t o
20 PRINT "Inverse space thirty 1 2 0 is n o w really t h e w h o l e of
spaces inverse space" the ' g a m e ' It's up to you to im-
30 as 2 0 p r o v e it, but as long as y o u
40 PRINT "inverse space thirty
d o n ' t alter t h e m a c h i n e c o d e
graphic A inverse space"
50 as 4 0 a n d just play a r o u n d in B A S I C ,
60 FOR 1 = 1 T O 1 0 r e m e m b e r i n g t h a t LET A « U S R
70 PRINT "inverse space thirty 1 6 5 1 8 m e a n s " m o v e t h e ball
spaces inverse space" o n e s q u a r e " , it should be no
75 NEXT I t r o u b l e at all.

SECOND FOUNDATION
Quality SoPtuare ZXUl SOFTWARE
ie I have bought numerous other items ot software
are excoHent
nsltucnons
They LOAD welt, have perfect
Yours
the most user-friendly > have ever mei "

16K ROM Pack °;3V


IP R Noits) .
ALL OUR SOFTWARE
IS ON CASSETTE AND D E L I V E R E D BY RETURN

CQMPUTATUNE T U R N S T H E IK z x e i INTO A
•chin* ONE OCTAVE ORGAN. STORING 100 NOTES PLAYS
1* Imlall^e F t C f "GtlJIT lMVtDHtt- C M M t U
da add re s i | sror mjrss — K COXMJ soon, BACK TUNF AUTOMATICALLY - C 2 75

ZXS1 sort-ware
)HL.
.FILE) STARTER PACK TWELVE IK G A M E S O N ONE
>8, CASSETTE, SEVEN MOVING GRAPHIC GAMES
'•ntyfour GALAXY INVAOERS 'requires minimum 4K RAM) in machine code INCLUDING Road-Race. Subsearch, Tank-Shoot
C HI Cassette and instructions £3 00 A N D Pop. EXCELLENT VALUE - C3 9 0
l A.(HL) 1K GAMES iDuck Shoot. Moonlander, Hangman, Crossword. Letter
)R 80h Square' Cassette arid instructions £3 00 ARCADE PACK FOUR ISK G A M E S ON ONE
>F6h "Just a short note to say how good your Space Invader CASSETTE - Surround. Tank-Shoot Spider Chase
IZ.EXIT cassette is i w<H recommend your company any day " IS A R. Preston)
AND Tenpin Bowling C3.90
) IHL).A "I have iust received your cassette of GALAXY INVADERS
which I thmk is the best on the market ' am very pleased VARIED G A M E PACK FOUR I6K GAMES.
I LOOP with your quick service " (S.C Beds)
INZ LOOP "Enjoying 'GAMES' very much - 'Letter Square' is quite Jaywalker. C a r - C r a s h . Smargana AN0 Fox and
rr addictive " (F W Manchester) Hounds. C A R - C R A S H " IS MACHINE CODE AND
MULTIGRAPHICS 2.3 Requites minimum 16K RAM) cieate drawings, WORTH C3.90 ALONE! ALL FOUR GAMES C3 9 0
you d o not advertising displays, etc. on screen Displays can be saved on tape, printed on
your ZX punter Cassette and 20 page illustrated Manual W 50 T O L I N K A - isK U S E Y O U R z x a i A S A C H E S S
what I've
IK GRAPHICS Kaleidoscope. Large Print. Medium Print, Draw a Picture! GAME RECORDER FEATURES TOO NUMEROUS
t-hand c o l
Manuarf only 'contair accurate istmgs, notes, information and ideasl C3 00 TO M E N T I O N C3.90
do is e n t e r Cassette and instructions £3 00
ie left c o l - Package of cassette and manual £4.50 G.C.E. E X A M S 180 MIN EXAM IN O LEVEL
done t h a t IK STATISTICS >4 programs descriptive and inferential stats) Cassette and PHYSICS OR MATHS - GIVES GRADE AND
j program. instructions C3 00 DETAILED REVISION PROGRAMME C3.90 EACH
"I acknowledge receipt of MULTIGRAPHICS and
STATISTICS Having experienced nothing but trouble with
s software, i was agreeably surprised by the good
quality and flexibility of your products IV S Berks I
2X80 S O F T W A R E A L S O A V A I L A B L E Prices are inclusive (Overseas add £1 0 0 P&PI
* Send s a e tor details, describing your system Send s a e for details, or cheque with order to
B R I D G E S O F T W A R E I Z ) ' M a i l order o n t y W S E C O N D F O U N D A T I O N . 22 Bramber
Eu,0 Belgrave, Tamworth Staffs B77 2LL
36 F E R N W O O D , M A R P L E B R I D G E , °~n
STOCKPORT, C H E S H I R E SK6 5BE Work*™* top rem

M M E R 1962 ZX COMPUTING S U M M E R 1982 47


HILDERBAY LTD
PROFESSIONAL SOFTWARE
MICRO GEN
II you don't believe that the Sinclair ZX81 can do real work, QUALITY PRODUCTS
come and see us et the Computer Fair Exhibition, Earls Court
(23rd-25th Apnl)and theZX Micro Fair, Central Hall,
Westminster. London SWl (30th April-lst May).
ZX81
ZX81416K SOFTWARE: Reviewed m Your Computer " (Feb 1982)
A / D CONVERTER BOARD
» Payroll for up to 30 employees Meetsall regulations £25 This 4 Channel analogue to digital converter, originally developed
* Stock Control Fast. big. and versatile £25 for joystick control, can be used for such applications as
* Budget£15 measurment of voltage, temperature, light intensity etc.
* Critical Path Analysis Up to 500activities £ 15 The board fits in between the RAM pack and the ZX81 (No skill
* VAT & Mortgage & Loan £8 is required to make this connection, and it actually improves the
* GOLD: A really good adventure: together with the intriguing stability of the RAM pack)
"Pick a Word" £8 Price n o w only £18.50. .
*
*
RELIABLE 16K RAM Pack tor theZX81 £42
BEAMSCAN:Beamanalysistorarchitectsandengineers£25 JOYSTICKS FOR THE
*
*
APPLE II Payroll: £35
HEWLETT PACKARD9845B: Superspline (general purpose ZX81, ONLY £9.60 EACH Th
wa
interpolation and tabulation). * The most exiting add-on ever for the ZX81, free yourself of ftr<
* MEMOTECH 64K Memopak £ 79 that dead, unresponsive keyboard (an
* 1 or 2 joysticks may be connected via our A / 0 board a r
DO YOU HAVE DIFFICULTY LOADING TAPES! We have theanswers; * Turns your ZX81 into a true programmable games machine the
and lor well under £ 10 * Extends ihe capability of the ZX81, imagine the tremendous ten
varity of games an applications that now become possible. rigt
Contact us tor more details.
* Details supplied on how to use the joysticks in your own blai
CROFTON PROFESSIONAL KEYBOARDS, MONITORS, VDU's programs nur
Please note that you cannot connect conventional analogue ran
Prices include VAT. Post & Packing COD Orders E2 extra.
toysticks directly to the digital input ports found on most I/O the
boards, and A / D convenor such as ours is required
TAPE HINT: Don't use the first 20 seconds A free copy of ZX AMAZE plus any one of the games listed
of your cassettes — most tape problems below when ordenno a lovstick and an A / D board

L
are found near the ends of the tape.
PROGRAMS AVAILABLE
HILDERBAY LTD ZX SPACE INVADERS. lYou've tried the rest, now
8/10 PARKWAY, REGENTS PARK try the BEST.
LONDON NW17AA This program has many features including an ever
increasing rate of play, (they'll get you in the end).
only £3.95
Enquiries for Hilderbay Ltd. will now be handled
by HOLDCO LTD. Tel. 01-251 3090 ZX BREAKOUT. Quite simply the best breakout on
the market.
Features seven bat angles, (you won't find this one
A L S O O N ZX81 + 16K easy).
o n l y £3.95
Financial Budget/ C a s h Flow Forecast: T h e program
ZX NEW YORK. |A very addictive arcade game.
allows thirteen c o l u m n s (12 m o n t h s + total). T h e forecast
c a n be c h a n g e d a n d a " W H A T IF?" possibility c a n be ex-
Bomb and shoot your way out of trouble, otherwise
a m i n e d on t h e screen. £25. you are doomed to crash.
Generates a different pattern, for a different
Sales Day Book: k e e p s a record of all invoices, with nett,
game each time you play. On the reverse of the
VAT, zero rated a n d total. £18.
cassette is ZX REFLEX, find out how fast you really
Purchase Day Book: k e e p s records of alt p u r c h a s e s a n d are.
VAT. £18.
^ ^ ^ ^ ^ ^ ^ n o w o n l y £3.95
Petty C a s h Book: K e e p s a record of all petty c a s h ex-
S a E H ^ T h e original and still the best
p e n s e s a n d a l l o w s for VAT to be c a l c u l a t e d from total if
Graphic display of Chessboard 6 levels of play
unknown. £18.
Displays record of your moves and the computers.
C a s h Sales Day Book: a s s a l e s day book but w i t h t h e addi- Board can be set up to any position. Has ability to
tional " M e t h o d of p a y m e n t " feature, incl. c a s h , c h e q u e , change sides or level in mid-game. PLUS
postal order, Access, Barclays, sundries a n d unpaid. £18. CHESS CLOCK on reverse side, records time taken
Cassette Recorders: individually tested f o r Z X 8 1 a n d sup- by each player. Resetable function. Single key
plied with a test t a p e for loading. £22. entry.
Barcharts for Architects: a simplified version, t a k e s a w a y NOW ONLY £6.50
the tedious task of m a n u a l l y h a n d l i n g the p r o b l e m £25. All our games are written in machine code, and can be used with
Bank A c c o u n t : c a l c u l a t e your b a n k c h a r g e s whilst keep- joysticks or keyboard, (except chess, keyboard only) Supplied on |
ing your account £5. cassette with library case
To allow vou to prove to yourself that our products are second to |
Architects P r o g r a m s : Barchart w i t h S-curve/Dewpoint none, MICRO GEN offers the following terms to our customers
c a l c u l a t i o n s N.B.S. on c o m p u t e r / S t r u c t u r a l programs/etc. 14 D A Y S FREE APPROVAL
etc. ON ALL PRODUCTS
All programs now alsoavailable for ATARI and S H A R P E All money will be refunded if goods are returned in good i _
condition within fourteen days of despatch. | J
HOLDCO LTD.
14. BRITTON STREET Postal O r d e r s p a y a b l e to: 2 P
1
LONDON EC1M5NQ M I C R O GEN Dept Z X C
1
24 A g a r C r e s c e n t , B r a c k n e l l , B e r k s .
Tel: 01-251 3090 T E L : (0344 ) 27317
1

ZX COMPUTING S U M M E R 1 ) x CO
Micro
This program it fascinating to end, the number of moves it took Y = 1 T H E N GOTO 120
watch, and makes a good demon- is shown. Y=6 THEN GOTO 169
stration of the ZX81, A 'mouse' Y-3 THEN GOTO 200
fan inverse asterisk) starts off in The obstacles change position,
a random position somewhere near the mouse flashes off and on a Y=4- T H E N G O T O 2 5 0
the top left hand corner of the few times, and then begins again. Y=5 THEN GOTO 290
9creen. It is aiming for the bottom The mouse cannot get itself into a Y =2 T H E N P P T D J
right hand corner. There is a solid trap it cannot get out of, unless Y=7 THEN GOTO 330
black 'frame' on the screen, and a it happens to land in one at the INT RT R+l,Bj
number of obstacles are placed very beginning, so have patience, PEEK ( P E E K G + 2 5 6 * P E E K H>
randomly within the frame. When no matter how long it seems to =0 T H E N LET T - 1
the mouse finally makes it to the be taking. 14-0 I F T = 1 T H E N L E T R = R * 1
150 IF T = 1 T H E N G O T O 1 0 0 0
152 IF R N D > * 2 T H E N G O T O 1 6 9
154. IF R = 0 O R B = 3 0 T H E N G O T O 1 6
1 REM M I C R O M O U 5 E 1BK 9
5 LET G = 16398 155 P R I N T RT R-1,B#1;
6 LET H=G + 1 1 5 6 IF P E E K CPEEK G + 2 5 6 # P E E K H)
10 PRINT RT 0 . 0 =0 T H E N L E T T =1
1 5 7 IF T = 1 T H E N L E T B =B
1 5 8 IF T = 1 T H E N L E T R = R - 1
1 5 9 IF T = 1 T H E N G O T O 1 0 0 0
F O R R =1 T O 2 0 1 6 5 IF R N D < . 2 T H E N G O T O 1 1 0
II
35
«•
P RINT RT 2 +RND#18, 1 +RND#27; 1 6 9 P R I N T R T R ^ B + 1.:
1 7 0 IF P E E K (PEEK G+256*PEE.K
ii
3 6i i P R I N T RT 2 + R N D * 1 8 _ . 1 + R N D #27,; =0 T H E N LET T = 1
1 8 0 IF T = 1 T H E N L E T B = B * 1
l*
3 7I* P R I N T RT 2 + R N D f 18..1 + R N D #27.; 1 9 0 IF T = 1 T H E N G O T O 1 0 0 0
1 9 5 IF R N D < . 6 T H E N G O T O 2 9 0
4-2 P R I N T RT
*•
R/0;"M" 200 PRINT RT R+l.B+l:
4-3 P R I N T RT 3 + R N D H 5 , 2 +RND#22; 2 1 0 IF P E E K ( P E E K G f 2 5 6 * P E E K H.»
-» »• =0 THEN LET T =1
4.4. P R I N T RT 2 + R N D H B , 1 #RNP.#27; 2 2 0 IF T = 1 T H E N L E T R = R # 1
tl it
2 3 0 I F T = 1 T H E N L E T B = B +1
4-5 P R I N T RT 2 + R N D # 18 2 # R N D * 2 4 ; 24.0 IF T = 1 T H E N G O T O 1000
24.5 IF RND <.3 THEN GOTO J10
4.6 P R I N T RT 3 4 R N D * 1 5 , 2 +RND #27; 250 PRINT RT R-l^B;
2 6 0 IF P E E K (PEEK G + 2 5 6 # P E E K H)
47 P R I N T R T 2 + R N D H 8 , 2 + R N D #24- J = 0 T H E N L E T T = 1
IS
MQ t
2 7 0 I F T = 1 R N D R > 0 T H E N 1JFT ,R=*P
P R I N T R T R . 3 1 ; "•'*
57 P R I N T R T 2 + R N D * 16.. 2 -f R N D #26.; 2 8 0 IF T = 1 T H E N G O T O 1000
290 P R I N T RT R,B-1;
60 NEXT R 3 0 0 IF P E E K ( P E E K G # 2 5 6 # P E E K Hi
61 FOR Z=1 T O 13 =0 T H E N L E T T = 1
62 P R I N T RT 2 0 . 3 0 ; " " 3 1 0 I F T = 1 R N D B >0 T H E N L E T B = B
63 PRINT RT 20,30; ' B "
64- P R I N T RT 2 0 . 3 0 : "fS" 3 2 0 IF T ~ 1 T H E N G O T O 1000
65 PRINT RT 2 0 . 3 0 ; " " 330 IF B =0 OR R =0 T H E N G O T O 1 1 0
66 PRINT RT 2 0 , 3 0 ; " D " 34.0 P R I N T R T R - l ^ B - 1 ;
67 PRINT RT 2 0 . 3 0 ; " " 3 5 0 IF P E E K ( P E E K G 4-256 # P E E K -H.»
68 NEXT Z =0 T H E N L E T T = 1
70 L E T R = I N T ( R N D * 6 + 1) 3 6 0 IF T = 1 T H E N L E T R = R - 1
75 LET Q=0 3 7 0 IF T = 1 T H E N L E T B = B - 1
80 LET B = INT (RND*15fl) 3 8 0 I F T = 1 T H E N G O T O 100P»
85 PRINT RT 2 0 . 3 0 ; " " 390 GOTO 110
90 LET E=R 1000 PRINT RT E . F ; " "
95 LET Q=Q+1 1010 PRINT RT R , B ; " B "
100 LET F=B 1020 G O T O 90
101 IF R = 2 0 R N D B = 3 0 T H E N G O T O 2000 P R I N T R T 0.. 1 5 O ; *Ji"
2000 2010 FOR N =1 TO 50
105 LET T=0 2020 NEXT N
106 IF R N D > . 24-78 T H E N G O T O 1 2 0 2 0 3 0 P R I N T R T 0 , 1 5 ; " |
110 L E T Y = I N T ( R N D # 7 ) +1 204.0 G O T O 3 0
POKElng

The absence of a memory-mapped display can be a


nuisance, especially for the writer of games programs, as
ZX80
one of the most interesting things one is able to do is to
PEEK at individual screen locations and to POKE characters
directly on to the screen. Animated graphics, of course,
depend on this facility but they are definitelyout with the
ZX80 because the screen would remain blank while the
action was being computed. On the other hand using POKE
to put characters onto the screen is feasible ana is
potentially a useful feature.

quantity of data to be Of course the display-file he


Filing A Display displayed. The addresses of Character By has to exist before we can i<
the various locations on the
screen also vary according to
Character start PEEKing and POKEing ai 2<
With a memory-mapped it. If we wish to POKE onto a 31
display there is no problem the length of the program. In The first character in the blank screen then it is first 4<
because the display file is addition the location display-file is a "newline" necessary to create a display' 51
contained within a fixed addresses change during the character so that if we call the file full of spaces. 6<
amount of RAM. The screen running of a program address of the start of the Unfortunately a succession ol 71
can be considered to consist whenever data is input for the display-file W then the first PRINT statements will not g<
of a matrix of locations first time or variables are visible character location (top achieve this and although a
(number of lines by number of assigned. left) is at W + 1. Each line FOR . . . NEXT loop PRINTing 91
characters per line) with the The computer, of course, consists of up to 3 2 visible individual spaces will, it is vet 04
memory address of each one knows where the display-file is characters with a new line cumbersome. Luckily
fixed and known. To make a in the RAM at any time and character at column 3 3 . By PRINT , , , , creates a line ful 2(
character appear at any the address of the start of the adding the appropriate of spaces so a short loop can^oi
desired point on the screen it display-file is recorded as a multiple of 3 3 plus the column be used to produce the ;1<
is simply a matter of POKEing two-byte record at address number to W we can get the required number of screen
the code for that character at 1 6 3 9 6 . By PEEKing at that address of any character lines. Obviously characters 2<
the relevant location address. address we can locate the location on the screen. If we can be used as well as spacet
On the Z X 8 0 things are display-file and then calculate call the row number A and the to create a display-file. Up to;3t
rather different. The display- the addresses where we need column number B then the 2 3 lines can be printed in this
file uses a variable amount of to POKE to get characters on address formula is W + (A way.
RAM depending on the to the screen. — 1 )* 3 3 + B. Having ensured that we he

50 ZX C O M P U T I N G S U M M E R 1 ) x COM
POKElng
have a display-file we can now to the listing extend this
• • • • • • • • • • • • • i • • • • • • • • • •• •• • • • • •• •• •• • •
take a PEEK at its starting simple program:-

9
address. The following Specify character to be ' • • • • • • • • • • • • • • • • • • a

l l t i p
subroutine achieves this and it POKEd:- • • • • • • • • • • • • • • • • • • •
is used in all subsequent • • • • • • • • • • • • • • • • • • • •

• .• • .• • .• • .• • .• • .• • . a • • • •
• • • • • • • • • • • • • •• •• •• ••
listings:- 8 4 INPUT C • • • • • •
i • • • •
Of course the display-file 1 1 0 POKE W + Y,C •v.v.v.
has to exist before we can (C is relevant character code) - v . v . v . ,
start PEEKing and POKEing at
it. If we wish toi POKE onto a POKE character taken from
blank screen then it is first the keyboard:-
necessary to create a display-
file full of spaces. 84 INPUT C$
Unfortunately a succession of
I
86 LET X = CODE (C$)
PRINT statements will not 88 IF X > 1 9 1
achieve this and although a THEN GOTO 8 4
FOR . . NEXT loop PRINTing 1 1 0 POKE W + Y,X
S individual spaces will, it is very
cumbersome. Luckily
PRINT . . . creates a line full of it will be noticed that the
e spaces so a short loop can be
used to produce the required
programs above assign
variables P and W before the
number of screen lines. first PEEK. This is because, as
E Obviously characters can be
used as well as spaces to
mentioned before, any
variable assignment or initial
create a display-file. Up to 2 3 input will alter the location of
lines can be printed in this the display file. If you write
way. any screen-POKE programs
Having ensured that we and find that the characters
have a display-file we can now are displaced it will almost
take a PEEK at its starting certainly be because a variable
address. The following in either PEEK or POKE has not
subroutine achieves this and it been previously assigned. A
k is used in all subsequent similar case is where an initial
listings:- input or an assignment is 2 3
made after a previous PEEK or 4 5 6 7
8 9 o
5 0 0 LET P = PEEK{ 1 6 3 9 7 ) POKE, when it will be 0 "Z * -
v -
5 1 0 I F P > 127 necessary to take another
r v u
THEN LET P = P — 2 5 6
PEEK at W before POKEing «*o mam •
• o ' p'
again.
520 LET W = PEEK! 1 6 3 9 6 ) A
~ 0 ° f ** 0 B »
+ P* 2 5 6 «H J K L 37
careful POKES
cu ..cute mi
530 RETURN
* X C
V fl >
Another thing worth W M
It should now be obvious how
we can use this address to remembering is that POKEing
POKE a character onto the can be a hazardous occupation •




• • • t * « *
• • • • • •

screen. The following program if you happen to POKE in the •












• • • • • • • • • • • • • • • a • • • • • • • • • • • • •
wrong place or even if you • • • • • • • • • • • • • • • • • • • • I
establishes a blank display- •










• • • • • • • • • • • • • • • a
• •
file, inputs a row and column POKE an inappropriate •










• •

• • • • • • • • • • • • • a •
• • • • • • • • • • • • • I • •• •• • • • • • • • •• •• •• •• •• •• •a •
character code in the right
- - _ _ -

number, POKEs character • • • • • • • • • • • • • «


place. Care should therefore • • • • • • •
code 148 (inverse asterisk) at • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •
be taken when writing ' • • • • • • • • • • • • • a
• • • • • • • • • • • • • a
the relevant address and then •• •••••• ••• •• • • • • • • • • • • • • • • • • • • • • • • a
programs to ensure that
inputs another "grid • • • • i • • • • • • •
characters are not POKEd
reference". When the program
outside the boundaries of the
is run, inverse asterisks appear display-file. Usually such
at your bidding anywhere on characters seem to disappear requirements when writing
isplay-file
we can
the screen
10 LET P » 0
without trace but sometimes screen-POKE programs if you Graphic Example
they can find their way into have no memory expansion.
POKEing at 2 0 LET W = 0 your program, invariably with
)KE onto a 3 0 FOR A = 1 TO 22 Having grasped the Finally, here is a simple games
unpleasant consequences principles involved in defining program that demonstrates
it is first 4 0 PRINT Some bad POKEs can cause
e a display- and locating the display-file it the features discussed and
50 NEXT A havoc with the video control. is relatively simple to which just fits onto the 1K
6 0 INPUT A The codes for all statements, manipulate it. Existing Z X 8 0 . The computer prints up
ccession of 70 INPUTB tokens and operators should
will not characters on the screen can a display consisting of black
80 IF A > 2 2 OR B > 3 2 definitely be avoided (ie codes be replaced by POKEing an and grey squares in a pattern
though a THEN G O T O 6 0 > 191).
p PRINTing alternative code at the same determined by a number input
9 0 LET Y = (A — 1 > * 3 3 + 8 address. If this is the code for at the beginning of each series
A/ill, it is very A more subtle problem is
100 GOSUB 5 0 0 that any extensive use of a space (0) then the character of games. The object of the
kily 110 POKE W + Y , 1 4 8 screen space is very expensive already on the screen game is to get the
es a line full 120 GOTO 6 0 disappears. By PEEKing at the 'woodworm" Ian asterisk),
in terms of memory. A 2 3 line
>rt loop can 500 LET P = PEEK(16397) address you plan to POKE to which first appears at tine 8
"blank" screen will occupy
ethe 510 IF P > 127 THEN LET you can see what character column 1, to eat its way
7 6 0 bytes of RAM, which
if screen P = P - 256 already occupies that location, across the screen to column
does not leave much for the
tweeters 5 2 0 LET W = PEEKI16396) thus opening up the possibility 3 2 in the least number of
program if you are using the
ill as spaces + P* 2 5 6 of a conditional response. All moves. The snag is that the
basic model Z X 8 0 with 1 K of
Mile. Up to 530 RETURN the relevant character codes black squares represent a
memory. You therefore need
inted in this are identified in the Z X 8 0 particularly tough kind of
to think hard about the
The following two alterations balance of memory handbook. wood and each time one is
J that we

U M M E R 1983 z x
COMPUTING S U M M E R 1982 51
POKEing
eaten a penalty of 5 moves is 3 2 and displays the total at 38 LET Z = Z + 1 Count No. of moves Th<
incurred. Numerals 6, 7 or 8 the end of each game together 40 INPUT C Which way? adc
are input as pseudo-cursor with the best performance in 42 GOSUB 5 0 0 Locate display-file CH
controls to move the insect the present series. Pressing 44 LET M = W + (A — 1 >" 3 3 + dis|
down, up, or forwards NEWLINE after a game sets up B the
respectively. The computer another game in the same 46 POKE M, 0 Put a space where insect ; i n c
keeps track of the number of series. Entering a character 48 I F C = 6 and A > 11 Set A and the
moves taken to reach column starts a new series. O R C = 7 AND A > 1 THEN make sure we don't at t
LET A = A — 2 * C + 13 POKE off-screen can
50 I F C = 8 THEN LET B = 8 + 1 line
2 LET Y = 3 2 0 0 0 No. of moves — best so 52 LET M = W + (A - 1 C 3 3 + Set M to next insect Mev
far! B location address jse
4 INPUT R Seed for random number 54 IF PEEK(M) = 1 2 8 THEN LET If there's a black square \7~fe
generator Z = Z + 5 the way, add penalty J)te
8 LET P = 0 56 POKE M, 2 0 Put insect in next locatior -j
10 LET W = 0 Assign variables prior to 58 IF B = 3 2 THEN GOTO 6 2 Watch for end of game j l s
PEEK 60 GOTO 3 8 Next move
12 LET B = 1 and POKE 62 IF Z > Y THEN Y = Z Set Y to best so far ^
14 LET A = 8 64 PRINT "END OF GAME IN he
16 LET Z = - 1 " Z , " MOVES" x>si
18 LET M = 0 66 PRINT "BEST SO FAR", " Y , " >OK
20 RANDOMISE R Set seed for random MOVES" her
number generator 68 INPUT X$ i th<
22 FOR N = 1 TO 3 5 2 70 CLS
24 LET D « 9 72 NEWLINE for another J?®',
26 LET X = RNDI2) IF X$ = " "THEN GOTO 8 game
28 IF X = 1 THEN LET D = 1 2 8 Print eleven lines with 74 Any character for anotha^ OL
30 PRINT CHR$(D); black and grey squares at RUN series )3rc
random. Pattern 5 0 0 LET P = PEEK(1 6 3 9 7 ) hrec
determined by R. 5 1 0 P > 1 2 7 THEN LET P = P - 2 5 6 Subroutine for setting W j
3 2 NEXT N 5 2 0 LET W = PEEK(16396) to address of start of rt
3 4 GOSUB 5 0 0 Locate display-file 4 P* 2 5 6 display-file
3 6 POKE W + 2 3 2 , 2 0 Insect in initial position 5 3 0 RETURN . T

AND FOR
s
P
(f
P
. T
|ai

THE '81
C
P<
H
<2
cc
ac
CI
ef
e\<
ug
While there are many
similarities between the
ZX80 and the ZX81
in the way the display
is handled, there are some
significant differences.

52 ZX C O M P U T I N G S U M M E RISZXCOI
POKEing
sves The display file is a block of
addresses that contain the
ile CHR$ codes that form the
display on the TV screen. At
the beginning of the file we
sre insect is find a Newline CHR$, and
there are also Newline CHR$
ion*t at the end of each line. As we
n can print up to 32 CHR$ per
line, every 33rd CHR$ = a
lsect Newline CHRS. These are
s used by the ZX81 ROM as
k square in references and should not be
snalty altered.
xt location To find the position of the
jf game display file we can use: 5 LET
Z= 1 + PEEK 1 6 3 9 6 + 2 5 6 *
j far PEEK 16397. " Z " will now be
the address of the first print
position on the screen. If we
POKE Z with any CHR$ code
then this CHR$ will be printed
n the first position on the
position, and so on, as shown
nother on the chart.
To prevent printing, or
for another should I say POKEing, to the
33rd CHR$ there are generally
three different approaches.
setting W 1. To use a dedicated POKE
tart of routine that can never work
out to hit a 33rd CHR$. ZX8t
2. To peek at the position on the
screen before POKEing, ie if
PEEK (position) = 118
(Newline CHR$) then don't
POKE here.
3. To use a formula that will
automatically skip every 33rd
CHR$, ie let us say X is the
position we wish to poke then
we can use POKE
(Z + X + INT(X/32),(CHR$
code) this will automatically - D H O l V f
add one after every 32nd - PROGRAMMING
CHR$ making 3 3 = 34
effectively, and so on for
every line. A simple program
using this formula :-

5 LET Z = 1 + PEEK 1 6 3 9 6
+ 256*PEEK 1 6 3 9 7
10 FOR X = ' T O 7 6 3 STEP 7
2 0 POKE (Z + X + INT(X/32)),8
3 0 NEXT X
4 0 STOP
(Note:- That this formula
automatically adds one to
every 33rd position. The One thing to remember is that have hit the target. 1.5 positions per line to hit the
memory map chart must be the display file is using the Looking at this idea w e can top right-hand corner.
read as (position) — (line memory immediately after the see that system 1 can be used Considering we have 9 shifted
number on left) to give the BASIC program. This means as we don't intend to POKE to the right options (0 to 9) if
correct number per position). that if the BASIC program is over the edges of the screen, we use 1.5 + 9 = 0 . 1 6 6 *
ANOTHER SHORT PROGRAM altered then " r u n " is required and the plotting involved has a (the INKEY$ number) this will
5 LET Z = 1 + PEEK 1 6 3 9 6 to find the new value for " Z " , limited path. give us the right amount of
+ 256*PEEK 1 6 3 9 7 or at least the new value for After the normal line 5 to shift per line to plot our gun
10 LET A = 0 " Z " must be calculated. find " 2 " w e then POKE fire. I've rounded down to
20 LET B = 3 3 An idea of a simple program Z + 7 2 6 , 1 2 8 to put a square 0 . 1 6 so there is no chance of
25 IF A < 0 OR A > 7 6 7 may be as follows. W e have a block for the gun. Then to fire over-stepping the corner if 9 is
THEN GOTO 3 5 gun at the bottom left-hand straight up to the top line is selected. So the basic program
30 POKE Z + A + INT/A/32), side of the screen. Pressing easy, we simply POKE is shown as, an INKEYS input,
128 any key from 0 to 9 will fire Z + 6 9 3 , 2 3 then successively followed by the fire routine.
35 LET A = A + B the gun at a target at the to - 3 3 from this, poking all the
4 0 IF A > 0 THEN LET B - 3 3 line on the screen, " 0 " to fire way up to 0 . Taking the top
50 fF A > 7 6 7 straight up, " 9 " to fire line to equal 3 2 CHR$ wide (Note: - The line numbering
THEN LET B = - 3 1 farthest right, w e will also and the number of lines down should be followed to leave
6 0 IF A = 27 THEN C I S need to PEEK at the top line in to the gun being 2 2 we must room for the rest of the
- 7 0 GOTO 25 the relevant place to see if we shift to the right 32 + 22 = program).

z
U M M E R 1983 x COMPUTING S U M M E R 1982 53
POKElng
BASIC PROGRAM Beginning to run out of
ideas now, I decided to use
5 LET Z = 1 + PEEK 1 6 3 9 6 the above with different CHR$
+ 2 5 6 * PEEK 1 6 3 9 7 making line 2 0 0 POKE
1 0 0 POKE Z + 7 2 6 , 1 2 8 Z + B , 2 4 . You will see the
1 5 0 LET AS = INKEY$ difference is astounding.
1 6 0 IF A $ < " 0 " OR A $ > Finally, learning the effect of
" 9 " THEN GOTO 1 0 different CHR$, I settled for
1 7 0 LET A = VAL A$ the flake drift effect using
1 8 0 FOR B = 6 9 3 T O O STEP CHR$ 2. Because this is only a
- 33 quarter size it gives the
2 0 0 POKE Z + B,23 impression it's moving twice
2 1 0 LET B = B + A * 0 . 1 6 as fast (very useful). The
2 2 0 NEXT B correct final program then is:-
3 2 0 GOTO 1 1 0
190 POKE ( < 6 9 3 ) * Z + B +
(Run using KEYS 0 to 9 to fire) 33-A*0.16,0
Now we have the problem of 200 POKE Z + B,2
rubbing out the stars ( * ) after 230 POKE Z + B + 3 3 - A *
each shot. Try:- 3 0 0 CLS 3 2 0 0.16,0
GOTO 1 0 0 . This rubs out the 3 2 0 GOTO 1 1 0
"fire" line backwards, not All the rest as BASIC program.
such a good idea. Try:- LIST
1 8 0 , EDIT, change line Now for the easy bit — a
number to 2 3 0 , N/L (new moving target. The easiest
line). LIST 2 0 0 , EDIT, change way is by filling up a string
line number to 2 4 0 and with 3 2 CHR$ and printing it
change 2 3 (CHR$ being at line 0 , 0 . then shifting it
poked) to 0, N/L. LIST 2 1 0 , along by letting the string =
EDIT, change line number to the string (2 TO) + the string
2 5 0 , N/L. LIST 2 2 0 , EDIT, (1) and reprinting at 0 , 0
change line number to 2 6 0 , creating a circular shift
N/L. Then add:- 3 2 0 GOTO movement. Add lines:-
1 5 0 AND 3 0 0 N/L.
6 0 LET BS » "
7 0 FOR B = 1 TO 16
Running the program, now
8 0 LET BS = BS + CHR$(INT
plots the gun fire, followed
(RND* 11)) + "
immediately by plotting blank
9 0 NEXT B
spaces in the same positions,
1 2 0 LET B$ = B $ ( 2
using the same routine. This
TO) + B$(1)
solution is acceptable though
1 3 0 PRINT AT 0,0;B$
in my opinion it makes the
whole firing routine too long, Running this, you will notice
doubling up the time involved that although you bit the
per shot. target, nothing happens so far.
It was therefore decided to The use of CHR$ codes 0 to
try blanking out the fire one 10 for the targets simplifies
step behind leaving only one the scoring where we PEEK,
" * " printed at any one time. then * 10, to give us possible
Try this:- 2 3 0 , N/L, 2 4 0 , N/L, scores of 0 to 1 0 0 ,
2 5 0 , N/L, 2 6 0 N/L, (to rub out
the last effort). Add lines:-1 9 0 W e now need to alter the
POKE ( B < 6 9 3 ) * Z + B + 3 3 - system slightly as rather than
A * 0 . 1 6 , 0 followed by N/L. poke onto the top line we need
Then EDIT, change the line to PEEK at the location firstly,
number to 2 3 0 and rub out then alter the BS accordingly.
( B < 6 9 3 ) * so the line reads Add to main program:-
2 3 0 POKE
Z + B + 3 3 — A * * . 1 6 , 0 then 180 FOR B = 6 9 3 TO «
N/L. This formula should STEP — 3 3
reverse the plotting for one 240 LET C = PEEK (Z + B)
step and blank out the " * " 250 POKE Z + B , 2 3
one step behind.
This works well, but it If shots are fired from all ten graphic symbols in the C$ 1 0 DIM E$ ( 1 , 3 2 ) miti
tends to give one the positions they hit B$ at (1), string, I've up'ed the numbers 30 LETC$="037ADHK(ne<
impression of a snow flake (4), (8), ( 1 1 ) , ( 1 4 ) , ( 1 8 ) , (21), by 2 7 to keep the entries RU" he i
drifting rather than a gun fire (25), (28), (31). As these simple, the 2 7 must be 1 10 PRINT AT 2,0;E$(1) V S
shot. It was decided to try numbers don't work out deducted from the code before 2 6 0 PRINT AT 2,1 2; iec
blanking out three or four conveniently the best solution use. The C $ , then, is rather " M I S S E D " AND C = 018"">
steps behind, to form a short is to store these numbers in a like a data statement that " H I T " AND C > 0 ; "=»
train and thus killing the snow string (C$1, and use the record holds the numbers used to C*10
flake effect. EDIT to change of the INKEY$ (A) to give us a alter the B$ (targets). W e also 2 9 0 LET B $ ( C 0 D E C $ ( A + 2 0
line 1 9 0 t o ; - 1 9 0 POKE pointer to pick out the number need to display the score (line -27) = " " 60
(B< 594) *Z + B + 1 3 2 - A * required from this string. 2 6 0 ) and blank it out before
0 . 6 4 , * and line 2 3 0 - CLS. To save us worrying about the next shot (line 1 1 0 ) . A line 00
3 2 0 = GOTO 1 0 0 . This again single and double figure of blanks is automatically
I decided wasn't the effect I numbers we simply use CHR$ produced for us in line 1 0. To complete the program w 1 0
required. codes. Rather than entering Add to main program:- just put in a few subtleties. I

54 ZX C O M P U T I N G S U M M E RISZXCOI

POKElng
330 PRINT AT 0 , 0 ; E $ ( 1 ) 80 LET C$ = C $ + C H R $
340 PRINT AT 0 , 6 ; " H I T (CODE B${X) + 1 2 8 )
POINTS ( - } T I M E " 9 0 NEXT X
3 5 0 PRINT A T 2 , 6 ; 1 0 0 SLOW
"OVERALL SCORE O F " 1 0 0 PRINT A T 0 , 6 ; A $ ; AT
3 6 0 PRINT AT 4 , 1 3;H-T 0 , 4 ; A $ ; AT 0 , 2 ; A $ ; A T
3 7 0 IF H - T > 3 0 0 THEN 0 , 0 ; A $ ; A T 0 , 6 ; B $ ; AT
PRINT AT 8 , 1 0 ; " W E L L 0 , 4 ; B $ ; AT 0 , 2 ; B $ ; AT
DONE" 0 , 0 ; B $ ; A T 0 , 4 ; C $ ; AT
3 8 0 IF H - T > 4 0 0 THEN 0,2;B$; A T 0 , 0 ; C $
PRINT AT 8 , 1 0 ; " V E R Y 1 2 0 CLS
GOOD"
4 0 0 IF INKEY$ < > " " T H E N 5 LET Z = 1 + PEEK 1 6 3 9 6
GOTO 4 0 0 + 2 5 6 "PEEK 1 6 3 9 7
4 1 0 IF INKEY$ = " " T H E N
GOTO 4 1 0 ORDINARY PRINTING
4 2 0 CLS
4 3 0 RUN 20 LET B = 2
30 FOR A = 0 TO 2 1
40 PRINT AT A , A + B;
50 NEXT A
The object is now to try and
FIRST M E T H O D POKE
beat the 5 0 0 score using the
keys in order 0 - 9 . To
complete the programme a 60 LET B = 3 4
title and instructions should be 70 FOR A = 0 TO 2 1
written in, at lines 4 4 0 80 POKE Z + A * B , 8
upwards and end with a 90 NEXT A
GOTO 4 0 0 instruction.
SECOND M E T H O D POKE
Rather than fill a string full
Same program as above but
of blanks w h y not DIM ( 1 , 3 2 ) ,
insert this line:-
this makes the machine do the
work for us. Then use String
(1).
75 IF PEEK(Z + A * B ) = 11 8
THEN GOTO 9 0
To extend on this idea why
not D I M a string ( 1 . 3 5 2 ) if w e
THIRD M E T H O D POKE
now print this at 0 , 0 ; w e will
Lines 5 to 5 0 as above then:*
clear the top half of the
screen. Also if w e print this
String (1) at 1 1 , 0 ; w e will 60 LET B = 3 3
clear the bottom half of the 70 FOR A = 0 TO 7 6 7 STEP
screen. B
80 P O K E Z + A + INT
A simple w a y to print a
(A/32),8
picture quickly is to print it via
90 NEXT A
a String. The easiest w a y is to
draw this picture on squared
paper. Then type in a direct
command FAST. Then line Conclusion
number for example:- The first method of direct
POKEing to the screen is
10 LET A$ = " faster than the "PRINT A T "
by far. The only way to print
this is now followed by the faster would be to resort to
rest of line being blanks. extremes. A single line of
"PRINT A T " ; " A T " ; " A T " to
So the first line is filled with print the lot in one line or to
blanks then the picture can be print a string containing the
drawn in the normal manner as pattern required, of course if
seen on the screen. When the you are prepared to do this,
picture is complete end the several lines of direct POKEs in
quotes then new line. W e can succession will still work out
now edit this line, rub out the fastest possible. The second
unwanted blanks at the method of looking to see if it is
32) limiting the firing to ten shots, We also wish to display the beginning and new line to safe to POKE takes time and
0 3 7 A D H K 0 one on each key to keep it fair. overall "hit points" = H and have our required picture in works out at about the same
each time the target moves the correct positioning. speed of the "PRINT A T " .
The shots information is held
w e clock up " T I M E " « T. The third method using the
2 0E$(1) by S$. We must now fire in
Add to main prograrn:- Try this simple program:- formula, surprisingly enough,
2J2; theorder 0 , 1 , 2 , 3 - 9. Add to works out a little quicker in
" AND C = 0 ; ma'" program:- response to the "PRINT A T " ,
IDC>0; " = ] 4 0 LET H = 0 10 FAST
5 0 LET T = 0 20 LET A$ = " " as well as being safe. The
1 4 0 LET T = T + 1 30 LET B$ = " " second method in some cases
DDE C $ ( A + 1 2 0 LETSS = " 0 " may have an advantage even
" 160 I F A $ < > S $ THEN 2 7 0 LETH = H + C* 10 40 LET C$ = " "
2 8 0 PRINT AT 1 5 , 2 2 ; 50 FOR X = 1 TO 6 6 6 though it is slowest. This is
GOTO 1 2 0 that it detects the sides of the
3 0 0 LET SS = STR$(VAL " T I M E = " ; T; AT 60 LET A $ = A $ + CHR$
1 7,22;"SH0T = ";S$; ((RND< 0.11# 24) screen which can be used to
S$ + 1) bounce or deflect a moving
e program w e 3 IF S$ = " 1 0 " THEN AT 1 9 , 1 8 ; " H I T PTS. = " 70 LET 8 $ = B $ + C H R $
;H {(RND<0.4)*24) object quite easily.
„ subtleties B GOTO 3 3 0
55
U M M E R1983zxCOMPUTING S U M M E R 1982
ONE ARMED
BANDIT

Winnir

:OIN
JELL
:ASTLE
.EMON
:HERRY
DRANGE

Vt random
vill appear,
hen choos
he barrels
o hold bar
'ress " Y '
O hold bar
•ress "Y"
O hold bar
•ress "Y*
e. To hold
arret 3 Pn

List of

ZX C O M P U T I N G S U M M E R 1)x C O M P U T
This is a ZX80 version of the pub
game. Three barrels are rolled on
which are marked six symbols.
According to the symbols
displayed, different payments are
awarded.

Winning Positions

COIN COIN COIN 66


BELL BELL BELL 55
CASTLE CASTLE CASTLE 44
LEMON LEMON LEMON 33 10 LET W $ = "
CHERRY CHERRY CHERRY 22 15 LET V $ = "
ORANGE ORANGE ORANGE 11 20 LET C = 1000
25 RANDOMISE
COIN COIN 18 30 D I M A{2)
— COIN COIN 18 35 LET H$ = " N N N "
BELL BELL 15 40 INPUT Q$
45 IF 0 $ = " S T O P " THEN STOP
BELL BELL 15 47 LET C = C — 5
CASTLE CASTLE 12 50 FOR I = 0 TO 2
— CASTLE CASTLE 12 55 IF CODE<H$) = 6 2 THEN G O T O 6 5
LEMON LEMON 9 60 LET All) = RND(RND<6»
_ LEMON LEMON 9 65 LET H$ = T L $ { H $ )
CHERRY CHERRY 6 70 NEXT I
_ CHERRY CHERRY 6 75 IF A ( 0 ) = A(1) OR A H ) = A<2) THEN LET C = C +
ORANGE ORANGE 3 3 " A(1)
— ORANGE ORANGE 3 80 IF A ( 0 ) = A(1) A N D A ( 1 ) = A<2) THEN LET C = C +
CHERRY - 5 8-Ail)
85 IF A | 0 ) = 2 A N D NOT A ( 1 ) = 2 THEN LET C C + 5
At random intervals, " H O L D " 95 CLS
will appear. The player may 98 PRINT 'ONE ARMED BANDIT M . R . H A R R I S O N "
then choose to hold any of 100 PRINT CREDIT $ " ; C
the barrels. 105 PRINT
To hold barrel 1 1 10 PRINT W $
Press "Y"(else " N " » 115 FOR I = 0 T O 2
To hold barrel 2 120 PRINT V $
Press "Y"(else " N " ) 125 IF A(l) = 1 THEN PRINT " O R A N G E " ;
To hold barrel 3 130 IF A(l) = 2 THEN PRINT " C H E R R Y " ;
Press "Y"(else " N " ) 1 35 IF AO) = 3 THEN PRINT " L E M O N " ;
i.e. To hold barrel 1 and 140 IF AO) = 4 THEN PRINT " C A S T L E " ;
barrel 3 Press " Y N Y " N/L 145 IF A(l) = 5 THEN PRINT "BELLE";
150 IF A(l) = 6 THEN PRINT " C O I N " ;
List of Variables 1 55 NEXT I
A(0) Result for barrel one. 160 PRINT V $ , , W $
AID Result for barrel t w o . 180 IF RND(5) < 5 THEN GOTO 3 5
A(2) Result for barrel t w o . 185 PRINT " HOLD
C Result for barrel one. 195 INPUT H$
W$ String used for display. 200 LET G$ = H $
VS . String used for display. 205 FOR J = 0 TO 2
H$ String used for containing what is to be held 215 IF NOT (CODE(G$) = 6 2 OR CODEIG$) = 5 1 ) THEN
'held'. GOTO 1 9 5
G$ String used to check H$ is legal. 220 LET G$ = T L $ ( G $ )
Q$ String used to stop programme. 225 NEXT J
I Dummy variable. 230 GOTO 4 7
J Dummy variable. 330 STOP

ZX COMPUTING S U M M E R1)xCOMPUT
p

16K Cames

Challenge your Z X 8 1 to this the most pieces on the board


hundred-year old board game, when the board is filled, or
in a program written by W P when neither of you can move.
Davies of Bristol.
Othello was invented in the The player's pieces are Os,
1 8 8 0 s . The game is based on and the computer's pieces are
the older game Reversi, but has asterisks. The board is updated
a restriction on the opening after each move, together with
moves. Othello is played on a a confirmation of the move and
draughts board, with double- the current score. There is also
sided pieces. As you'll see at a cue for the next move, as well
the beginning, there are four as an end-game routine.
pieces on the board. You place If you want a faster game,
your own piece so that at least add 6 7 5 SLOW, 1 0 3 5 PAUSE
one of the opponent's pieces is 7 5 , 1 0 3 8 FAST. This modifica-
'trapped' between a piece of tion blanks the screen while the
yours and your new piece. The clever ZX 81 works out its next
opponent's piece or pieces then devastating move, reducing
flip over to become your pieces. thinking time to around 15
The winner is the person with seconds.

58 ZX C O M P U T I N G S U M M E R IS ZX COI
REM "OTHELLO" L E T U = P -I J *D (I)
St_GU L E T R f U i ^T
GOTO 1103 LET R=INT (U/10)
LET 5 = 0 LET C = U - 1 — 1 0 * R
IF N O T R (P) =0 T H E N R E T U R N PRINT RT lfatR.SfSfC;^*
IF E = 1 T H E N G D 5 U B S 0 0 NEXT U
FOR 2-1 * RETURN
L E T G>=P FOP 1-0 TO 3
LET J - l P R I N T RT 19tl.0;D$
I £T Z - D ; I) NEXT I
L E T
P R I N T RT 1 3 . © ; " Y O U H R V E S
IF = 3 T H E N G O T O 1*70 I HRUE " ; 5 M
IF RiGCi = T T H E N G O T O 1 5 0 RETURN
LET d = J 1 L E T N=G>
I GOT i 1 0 0 LET E=0
f LET 55 =-S
- * J -1 LET T=M
l IF E = 1 T H E N G O S U B 3 0 0 FOR R = 1 T O S
I NEXT I
FOR C = 1 T O 6
! IF E - 1 T H E N LE" 5 U = 5 U + 5 * 17 ~ L E T P = H-C*-10*R
,* iT =M ) G O S U B 4.0
IF E = 1 .ET <T = 7r S < N T H E N G O T O 6 1 0
<* tT=U) IF S + I N T ( R N D * 3 ) = N T H E N GOT
I IF E = 3. T H E N G O S U B <110
I RETURN L E T N=rS
l IF T = U T H E N LET R $ - " O " LET X = P
I IF T =H T H E N L E T R$="*" NEXT C
! IF T s M "~HEN LET NEXT R
I IF T - U T H E N L E T B $ = " Y O U IF N = 0' T H E N G O T O BSO
t P R I N T RT 0 , 0 ; D $ LET E = 1
i P R I N T RT 0 . 0 ; B $ ; " C H O S E R ; LET P=X
i (C+37) L E T Rs'l N T (P/10)
t L E T R CP) - T LET C=P-1-10*R
l P R I N T RT 1 + 2 * R , S + GOSUB 40
f L E T S U = 5 J t l * <T=U>
FT S M = 5 M + 1 * £T--M)
RETURN
F O P J a l T O <J

UMMER 1! ZX COMPUTING S U M M E R 1982


16K Games
6 9 0 IF N = 0 T H E N P R I N T « T <3,0.; " I 1150 LET O (4.) = 1
COULD NOT MOUE 1160 LET D (Si = - 1 i«
7 0 0 IF N = 0 T H E N G O S U B 4-10 1170 LET D ( 6 ) = —9
7 1 0 IF U S ^ " " R N D N = 0 T H E N G O T O 1180 LET D ( ? i a- 1 0
1500 1190 LET C (8) - - 1 1
720 IF 5M+SU=64 OR THEN 1200 LE"( M= - 1
GOTO 1500 1210 LET U= 1
800 P R I N T "jfcttjJqaan&VM-EG 8 R O R 9 1220 LET R < 4-5'} = M
9 TO STOP-" 1230 LET R I S E ) =M
610 I N P U T U * 1240 LET R ( 4-6) = u
5 2 0 IF U $ = " " T H E N G O T O 9 9 0 1250 LET R (55) =U
8 3 © IF U $ = " 9 9 " T H E N G O T O 1260 REM PRINT, BORRD
54.0 L E T R = C O D E 1270 PRINT
3 5 0 IF R <1 O R R > 6 T H E N G O T O 8 1 0 1280 LET S U - 0
860
1265 LET SM-0
LET Cf=U$(2) 1290 PRINT TRS R 6 C D E F
6 7 0 IF THEN GOTO 610 10.
860 LET C=CODE (C$)-37 H **
6 9 0 IF C < 1 O R O S T H E N G O T O 6 1 0 1300 FOR R = 1 T O 6
9 0 0 L E T P=l+C+10ifrR 1310 PRINT
910 LET T=U 1320 PRINT TRB 6: R ;
920 LET E=0 1330 FOR C = 1 TO S
930 1340 L E T Xrfi[lfCfl©fft)
94 0 G O S U 6 4.® 1350 IF X = M T H E N P R I N T y *» .
* .%

9 5 0 LIF E T
S - O T H E N GOTO
E = 1
SIC 1360 IF X = U T H E N P R I N T O";
960 PRINT U$ 1370 IF X = 0 T H E N P R I N T W> * * •
Fit .»
9 7 0 G O S U 6 4-0 1380 LET SU=5U+1*(X=U)
9 6 0 1390 LEV SMsSM+1*(XsM)
G O T O IF1 5 0
5 M + 5 U = 6 4 OR S M * S U = 0 T H E N 1400 NEXT C
9 9 0 IF U 0 1 4 10 PRINT
1 120

I
"YOU H I S S E $ = " " T H E N P R I N T R T O..0,; NEXT R
9 9 5 IF U t - D YOUR TURN" 1430 PRINT
1000 ' " T H E N G Q S U E 4-10 1440 PRINT "YOU HRUE " 'U; I Hft
1 0 1 0 I N P U T H^aCTHgr.t
P R I N T FOR flHBK" UE S H
1020 $ 14-50 L E T Di="
1 0 3 0 PIF R I N T T R B
THEN GOTO 1500
8.; "THINKING. .
1040 GOTO 500 1460 GOTO 800
1100 D I H R ( 10©J 1 5 0 0 IF S M > S U T H E N PRlNfT
1110 DIM D ( 8 ) 1 5 1 0 IF S M < S U T H E N PRINT CONGRfl
1120 LET D ( 1 ) = 1 1 TULRT10N5"
1130 LET 1 5 2 0 IF S H = S U T H E N PRINT ' - R DRfi
114.0 L D (2'} =1© U - "
E T D 13'i ^9 1530 S FOP

THE ANDREW
BUFFER DEVELOPMENTS
MICRO SHOP ZX81
2X8 BIT P A R A L L E L I N P U T / O U T P U T BOARD FEATURES I
(NEXT TO STREATHAM STATION) INCLUDE:

16 P R O G R A M M A B L E L I N E S
NEW SOFTWARE SHOP EXCLUSIVELY FOR E A C H L I N E M A Y BE SET A S A N INPUT OR O U T P U T Get
UNDER PROGRAM CONTROL S">a
F U L L Y TTL COMPATIBLE

ZX81
w r il
A M U L T I T U D E OF APPLICATIONS I N C L U D I N G : mod

• K E Y B O A R D & DISPLAY SCANNERS


PROGRAMS. GAMES, " A D D ONS" • L I G H T I N G C O N T R O L SYSTEMS
• H O M E S E C U R I T Y SYSTEMS
MOST OF THE MAIL ORDER ITEMS ADVERTISED •CENTRAL HEATING CONTROL
IN THIS MAGAZINE AVAILABLE OVER THE COUNTER
•MODEL RAILWAY CONTROL
a
I
9
LOADING PROBLEMS? TRY OUR INTERFACE
BUSINESS Et TECHNICAL DATA HANDLING PROGS; AND MANY MORE!! £16.50 (inc VAT + p&p)
PROPER KEYBOARDS; CONSOLES; VDUs I 1 0
COMING
SOON
i) C O N V E R T E R C A R D - A N A L O G U E TO DIGITAL
The BUFFER Micro Shop, ii> C O N V E R T E R C A R D - DIGITAL TO A N A L O G U E ^
iii) RELAY CONTROL CARD
374a Streatham High Road, jvl R E A L - T I M E C L O C K WITH C A L E N D A R
London SW16 c JL
Tel: 01-769 2887. Telephone B R I G H T O N (0273) 564629 (24 hourt), or write to ^ ^
93 B E A C O N S F I E L D V I L L A S , P R E S T O N P A R K , B R I G H T O N ,

I
?)( c
lTURES

Get your digits into order in the on a TRS 8 0 and further it so that instead of just stopp- message.
smallest number of moves. modified by Tim Hartnell to ing when you get the digits into A further modification
This program was originally make it run in Sinclair BASIC. order, the computer prints would be a 'lowest score'
written by Don S c a l e s , Once you've got it working as them out in inverse graphics, feature. Pressing any key at the
modified by H J Garwood to run listed, you might like to modify and gives you a congratulatory end will give you a new game.

10 DIH ftfSJ 15 P R I N T RT 3,0,


20 FUR Z = 1 TO 9
30 L E T R = X N T *RN£>*9.» 1 2 2 0 IP dill O R U>9 THEN GOTO 10
4-0 It Z = 1 T H E N G0"~0 30 260 LET K = ( J 4 i ) / 2
50 FOR O - l TO Z - l 270 FOR Z-l TO K
60 If• R FJI =R THEN GOTO 3 0 280 L E T R =R\Z>
70 M':XT U 285 LET RfZ)=fl«J+l-Z)
8C L r r R vz > 2 8 7 L E T fiU( + l-Z>
ND X T Z 2 9 0 NEXT Z
95 LET 8 = 0 29S LET B=B + 1
P&P) 97 PRINT RT 6,6; 30O FOR Z=1 TO 9
100 F OR 3 = 1 T O 9 3 1 0 IF flfZJ :>Z T H E N 3 G T O 9 7
110 P P X H T R RS.»; 320 NEXT Z
120 NEXT 5 3 3 O P R I N T " I T T O O K Y O U "; B; KC
13© PRINT UE5"
ITAL
300 PRINT 34-0 PAUSE 4-E4-
iGUE 3 5 0 CLS
205 P R I N T " E N T E R NLFMBER T O RE'JE
360
RSE, M O U E ";B->I RUN
210 INPUT U
write to
IGHTON.
ZX COMPUTING S U M M E R1)xCOMPUT
Peek, Poke, Byte
and RAM! Phil Garratt looks at this routines. These programs, and
the suggestions for programm-

T h e c o v e r of this w e l l - flashy book, with cover ing exercises tend towards l


mathematical bias; factorials,
presented book gives a clue as
to the audience it is aiming at. art by the man who areas, solving equations and
the like. There are a few garnet
Drawn by John Harris, who
drew the Z X 8 1 manualcover.it produced the cover of as well, such as Molehunt and
Hangman, though nothing ver>
shows the same spaceship, but
this time in flight. The book
clearly intends to give further
Clive's manual. substantial or new. The pro-
grams all fit into 1K, and all tha;
I tried were bug-free and wet
assistance to the new owner in documented.
getting his or her machine 'in manner and avoids merely are covered with just sufficient This is a well-written and at
flight' — or at least up and runn- repeating the manual. The book information to ease the begin- tractively laid out book, whidi
ing. goes on to cover arithmetic ner into writing his or her first has deliberately (and success
The book a s s u m e s no assignments, variables, loops, programs. To help maintain in- fully) avoided becoming y?
previous knowledge of com- loading and saving ( w i t h terest and give blistered fingers another rehash of the manual
puting, and starts right from the photographs to show you what a rest, the book includes lovely think it would be of grea
beginning with setting up the your telly should look like), little " D e Bugs" strip cartoons assistance to the new Z>
Z X 8 1 and adjusting your TV. graphics, plotting and debugg- and a ZX crossword. owner, even though the boot
This is all done in a light-hearted ing. With the exception of There are over 2 0 complete would be outgrown in a coupk
("On no account use Channel! debugging, which is explained programs contained in the of months. To experienced Z)
No. 5, it stinks!") but thorough in some detail, all these areas book, plus a number of useful users I would suggest that ner
Book reviews

ms, arid I time you convince somebody routines, and "Graphics ride volved in such things at such an tions (you can see this is |ust
gramm-l to buy a ZX81, get them to buy again!" early stage — then the priority the sort of book your teachers
/wards a I the book as well. . . and then The book m e t h o d i c a l l y of m a t h e m a t i c a l operators would leap on), and GOTO and
ctorials, I borrow it. The cartoons are covers the ins and outs of the (such as multiplication before FOR/NEXT loops.
jns and ) great, and who knows, you Z X 8 1 starting with general in- addition) is discussed. Already I T h e book w o u l d be, I
v games may pick up a trick or two. formation on what computers can sense newcomers flipping believe, fairly heavy going,
mntandl "PEEK, POKE, BYTE and can do, followed by a short in- past this section in exaspera- despite its simplicity, for a per-
ling very I RAM", Shiva Publishing Ltd, troduction to computer lan- tion, looking for something a lit- son who has just picked up a
The pro-1 ISBN 0 9 0 6 8 1 2 1 78. guages and binary arithmetic, tle more directly relevant to computer for the first time, but
and then a brief section on what their needs. when used as a text to guide
and' well} ZX81 BASIC BOOk a program is — using a sample
'program' describing certain
W e are already up to chapter pupils who have the benefits of
a live teacher on the spot,
The ZX81 BASIC Book, pub- eight (some of the chapters are
actions by Mickey Mouse in a only one or two pages long) would be very useful indeed. It
n and a t - 1 lished by Newnes Microcom-
Walt Disney cartoon. Once before the first particularly is difficult to imagine why the
k, w h i c h l puter Books, is more staid in ap-
you've traversed this ground, useful information for first-time material has been presented in
success-1 proach than the others review-
and worked out how to plug bewildered users is presented. this order, with GOTO assigned
i n g yet ed in this section of ZX Com-
your computer into the telly, The use of LET to assign values a lower priority than converting
manual. I j puting, and for that reason is
the book gets down to work. to variables is e x p l a i n e d , radians to degrees, and loading
of great sure to appeal to schools,
Direct input commands are f o l l o w e d (in s u b s e q u e n t and saving programs is con-
new ZX Although the approach is fairly
covered, and — in a section chapters) by such things as the sidered less important than fin-
the book straight, the book is far from
sure to confuse newcomers use of commas in PRINT for- ding natural logarithms of
i a couple dull, with witty (?) chapter titles
who don't have a maths back- matting, the use of the EDIT square roots.
enced ZX like "Gone out, bizzy, back
ground, or don't want to get in- function, trigonometrical func- If you are teaching a class of
that next soon" to introduce sub-

A.1 V" R

SUMMER 198 ZX COMPUTING S U M M E R 1382 63


Book reviews
14-year olds the rudiments of Z X 8 0 Pocket Book, in his intro- The programs in the book are they were produced just for ihf
computing using a Z X 8 1 , and duction: "This is our second good, and varied. They vary money, while others feel gooc
you want to do it 'by the book' book along these lines. . . from the good-for-a-weak- and deliver the product the*
this is the book to buy, but if although the style is hopefully laugh PIN THE TAIL ON THE covers proclaim. This book i <
you're not. . . have a good look less clinical. . . Newcomers to DONKEY to a TUNNELS AND one that delivers.
at it in the shop before you computing will hopefully find TROLLS CHARACTER GENER- When I first reviewed t N *
decide. Z X 8 1 BASIC Book, something more challenging A T O R , w i t h some m a t h s Z X 8 1 , I was highly critical afc
Newnes Technical Books, ISBN than just another set of games (STANDARD DEVIATION) and the miniscule I K provided or
0 4 0 8 0 1 1 7 8 5. to copy and run . . . I have . . . machine code (DICE SIMULA- board, but along with manf T h l
tried to expand on the 'useful TION) along the way. others, I have since then learr»;'°r
The ZX81 Pocket subroutines', as I think these A number of additional 1 K
p r o g r a m s are scattered
ed a number of tricks t J t
squeeze the maximum intt P | 0
Book give a much clearer picture of
how certain features can be throughout the book. The ap- Clive's unforgiving RAM. Rogt hav
Trevor accurately sums up the highlighted and how you can proach of the book is, as Trevor Valentine has also learned tht »Vn
thinking behind the book, and stretch the Z X 8 1 to its ut- said in his foreward, 'less lessons of program packing pr<<
explains how it differs from the most . . . " clinical' than his earlier book, so and some of the best of ther the
string handling is up near the are presented in this litt B n t
front, and clearly and simply ex- volume.
plained. The programs are divided ir £ ®
You'll pick up a number of to seven sections: Fate and fo- JJJ3
useful ideas which you'll want tune; Printing with more frillt n u n
to use in many programs. My Casino gambling; Data filei Qf e
favourite, and one which I see Business programs; Utilitie: Ir
over and over again in other and Games. The section title 90.
people's programs, showing do not even hint at how wid<* nd
how well the lesson has been the program selection is in thi
learned, is the use of PAUSE book. Programs include thc**1M
4E4 (which Trevor suggests predictable standards (CRAPS*®^
you memorise as PAUSE for- I CHING and SPACE RESCUE
ever) at the end of a game to as well as a number of the su the>
freeze the action until any key is prisingly effective and usefu
retouched to give you a replay. business programs — VAT
The Z X 8 1 Pocket Book, Phipps Bank Record, Credit Cardt
Associates, ISBN 0 9 5 0 7 3 0 2 Payroll, Test Data and Payslip
2 X. Some of the games are ver
good indeed, such as Roulettt
and there is even a very ods
What Can I Do With "computer dating" simulation
1K? which enables you to enter you
intelligence as 'thick as twi
The Z X 8 1 publishing band- short planks'. All in all this isi
wagon is one which a number splendid book, and one whid
of people including myself will repay your investment tiro
have jumped onto, with mixed and time again. What Can I [>
results. Some of the books With 1K?, V £r H Computer Sa
have a 'bad feel' to them, as vices.

c c
ZX C O M P U T I N G S U M M E R 19^
• • •

ZX80 Programs
ist for the
feel good
luct their
5 book is |
AREA CALCULATOR
jwed the
critical of
vided on-
ith many The following program, produced
for the Z X 8 0 and using only the
hen learn-
1K of RAM, will calculate the area
tricks to within a polygon. The computer
ium into plot* the point! whose co-ordinates
Wl. Roger have been entered, using a 3 6 10 PRINT " H O W M A N Y V E R T I C E S ' " 220 FOR O 0 TO V t
arned the symbol code, and the area is 20 INPUT V 230 lFY-Y(OIANDX X ( 0 ) 1 H E N G O T O 270
packing, primed underneath. The sign of X CLS 240 NEXT Q
t of them the area will be positive if traced 40 PRINT " G I V E CO O R D I N A T E S " 250 PRINT "
this little anticlockwise and negative If all, 50 DIM X(V-l) 260 G O T O 280
or any, of the figure is plotted
60 DIM YIV1I 270 PRINT C H R S I Q + 1561.
clockwise. On the display the
divided in- plotted points are displayed in the 70 FOR N = 0 TO V 1 280 NEXT X
te and for- same code as the axes and are 80 I N P U T XIN) 290 PRINT
iore frills; numbered according to the order 90 INPUT Y I N ) 300 NEXT N
lata files; of entry. 100 PRINT " r , X ( N ) ; " . " , Y ( N ) , " l " 310 F O R N 0 1 0 31
; Utilities In the entry stage of line 8 0 and 110 NEXT N 320 PRINT CHR$! 156 * N l ,
:tion titles 9 0 , inputs of greater value than 3 2 120 I N P U T AS 330 NEXT N
how wide and 21 respectively will not be 130 CLS 340 LET Z = 0
n is in this displayed although the area is 140 FOR N = 1 T O 2 0 350 FOR R ~ 0 TO V 1
still calculated. All the input
elude the co-ordinates are repeated after
150 LET Y e 2 1 N 360 LET S - R + 1 - ((R + l l / v r v
s (CRAPS, entry tor checking, N E W L I N E will 160 PRINT CHRS( 156 + Y) 370 LET T s R + 2 - H R + 2 I / V ) * V
RESCUE!,! cause the program to continue if 170 FOR P = O T O V-1 380 LET Z - Z + X l S l ' I Y l T ) Y<R)i
of the sur- they are correct. 180 IF Y = YIPI T H E N G O T O 210 390 NEXT R
ind useful 190 NEXT P 400 PRINT " A R E A l S " . Z / 2 .
V AT, 200 G O T O 290 410 IF N O T I Z / 2 C 2 Z THEN PRINT " 1 / 2 .
lit Cards, 210 FOR X 1 TO 31 420 PRINT " S Q U A R E U N I T S "
id Payslip.
s are very
s Roulette,
i very odd
simulations
i enter your
:k as t w o
all this is a
one which
tment time

ZX81 1I6Ik
at Can I Do
nputer Ser-
SOFTWARE
All our software comes w i t h full instructions and is SAVEd and ready to RUN, no
need to spend hours laboriously typing in from books.

ZX-81
P A C K W t tKkjOn an <* CONTROL TECHNOLOGY -
AiR TRAFFIC C O N T R O L A r m a i a d radar acraan of Duty
—Txr\ ihcwrv you tXWfl planaa H O
' W A D E R S SELF P L A Y . P H O N E B O O K
land
haao fnandt
PERSONAL
trC rMtivaa n u m b a * onmc m t r t i D A T E 81 C O M P U T E R SCIENCE
eompuw daeng prov " P** *or you'
Alt O N L Y « »

P A C K li ? mciudaa a« of C a s s e t t e 1!4 PACK 16/1 + 16/2 • 16/3


A D V E N T U R E A T L A N T I C Y o u m a y D t c t n t vary rieti or
you t w t b* n w o o r « d < w « w B R E A K O U T SQUASH (»ny two only f 5 95)
PRACTICE. L A N G U A G E T R A N S L A T O R c i ^ i l i m any ALL THREE ONLV
Europaan 10 any othar C O M P U T A P R I N T A tupa« vaiua eaaaarca o< 1W and IK tottw*>* « r m » n . €S 96
dm tr.* program to p>*d<ct ratuils o» ton ' K M Mactwia Coda and Baa*
•ootta« poet. « c Includaa
ALL O N L Y I* K Raact invadan Phantom A l « m M a n of Daatt1
Planatianctar. I C>»ng. Hangman. Invadar*. Laaat Baae.
TAPEBOOK 50 3 + CASSETTE 1 W
ractangla p k j l mora BOTH ONLY
ALL ONLY [4 SE £9 96
P A C K W 3 meludaa all of
iNDI 500 indao i o M ' K C D R A U G H T S Compuiai
CtMQuan B A T T L E S H I P S - n * u l u l warlara on v o w
s u m compviar
B O T H OFFERS ARE O N L Y £13 96
M A S T E R M I N D - Bram T w r »aa * you can D w i • T a p e b o o k 50, V e r s i o n 3 SPECIAL OFFER
T O ALL 2X81 O W N E R S
All O N L Y tt SB
SO program! for (ha IKRAM 2X81
Laiaat v t u u n ncHxMt
Tna braaklVoug* you v« wa'tad tor SQUASH BREAKOUT, COLUMBIA SPLAT, I pneaa trouoa V A T and poatag* and packing
P R O G R A M T H E Z X t l IN E N G U S H I I I INTEGRATION. CREDIT CARD CALCULATOR BANK
Wrth G A M A L (1 you can n o w «vnta advantura programa A C. VATCHECK, TANK BATTLE, TORPEOO CONTROL TECHNOLOGY,
n h o v n not « M i and wtt- G A M A L SI you « »>av« HEXLOADER BINARY CONVERTER AND LOTS LOTS
39 G l o u c e s t e r Road. G M Cross.
n « V »0i»ntur» you * a v « warn tor lha (mca of ona VOHE
Comaa on • • a i m wtth awtrucfeon book. (7 K S M a m a m g yaAra at <S 96 tha lof. H y d e , Cheshire SK14 6JG
061 368 7568

U M M E R 1982 ZX C O M P U T I N G S U M M E R 1982 66
News

Clive sets
the pace
Uncle Clive will be donning his and finishes in the Market
sweaty tracksuit to set the Square at the Guildhall Steps.
pace in a half-marathon to be
held in July. Co-organised for the
The half-marathon, to be Festival by Cambridge City's
included in this year's recreation department and the
Cambridge and Coleridge
Cambridge Festival, will be
Athletic Club, the event is
sponsored for £ 5 0 0 0 , by open both to club-based
Clive's company — Sinclair runners and general
Research — which is, of enthusiasts. Entries have
course, based in Cambridge. already been received from as
The race is expected to attract far afield as Wales and
a number of top-class runners Durham.
to the city. Clive will be
among an expected 2 0 0 0 Uncle Clive told us his
competitors following a three- company sees its sponsorship
lap course through the city's of the marathon as oart of its
historic streets. Starting in commitment to supporting and
King's Parade, close to developing cultural life of the
Sinclair's offices, it includes a city. It is also sponsoring, as
riverside stretch along part of the Festival, a concert
Chesterton Lane, the 'Backs', in King's College on July 3 1 . 1 •Lem
Clive Sinclair
Timmx.
Sincfon

Sinclair miss the bus Ti


Sincla
Sinclair and Timex, were Michael Levy. It was Mindware is one of the few the best of it was made a deal
most conspicuous by their fascinating to hear questions American companies which available for American to get
absence at the giant West from those present at the talk have realised how big the consumers. some
Coast Computer Faire held in who had never heard before of Z X 8 1 is going to be when it in the!
San Francisco at the end of the Z X 8 1 . Michael tried to takes off in America. Michael The secret word from the lucky >
March. explain the excitement the Levy has visited the UK three States is that the computer to buy
The booth listed in the Z X 8 1 was generating in the times in the last few months will not be known as the ZXBshops
catalogue as being the Sinclair UK, but I could see his words to sign rights and distribution when it is launched there by aerfum
one was unmanned were received with some deals for UK products. He says Timex. The most likely nam« ync
throughout the show, the scepticism. When he told the that the standard of UK is 'Timex 1 0 0 0 ' or if, as oyalty
most important computer seminar about the crushing software, hardware and appears possible, the levv co
show in the world. Some crowds at ZX Microfairs, the publications is very high, and computer is sold with 2K on . l l f r i » n ,
4 0 , 0 0 0 people crammed into disbelief reached fever pitch. thus was anxious to ensure board, the 'Timex 2 0 0 0 ' . jj,,^™
a show with over 6 0 0 stands,
ind Tirr
to be confronted at the alleged
>f Sine)
Sinclair booth with a tiny,

Schools
handwritten notice saying that echnoli
Clive's people would not be It als
Jncle C

lap it up
there.
I found a disconsolate set Ithougl
of four Z X 8 1 owners — who he ZX t
are very much in a minority w eye
among computer users in pparer
More than 2 5 0 0 UK
America — sitting sadly in the onderi
secondary schools have
booth swapping Zee-X81' uiggly
bought Z X 8 1 s to give their
stories. he besi
pupils hands-on computing
One enterprising Z X 8 1 w forr
experience.
owner in the States, Eric mbol t
Last May, Sinclair Research dersto
Reiter of 16th Avenue, San worked out a deal with the
Francisco, had a tiny, one-yard et been
educational distributors Griffin mencar
wide booth, in which he was and George to sell Z X 8 1 s at a
showing his expansion board, cut price to schools. The Sincla
which is suitable for ZXSOs. scheme, which is now closed, OMPlJT
ZX81 s and the Z X 8 0 - 'arketm(
aimed to provide a wider and
lookalike, the MicroAce. The iat the I
more economic choice of
expansion board was a •uch gre
complicated, spaghetti- equipment than was available
under a government-assisted schools that insisted on S marke
junction type motherboard all schools." ise in th
which was controlling little scheme for the purchase of buying a Z X 8 1 . " W e believe that the
computers. Although the gh-tech
lights and squawkers. Putting it diplomatically. success of . our scheme in
government thought it was . . n g i n g fr
A series of seminars were Uncle Clive said: "Although
wonderful for schools to buy bringing microcomputers to^ r o s c o p (
held throughout the show. welcoming the government
micros, it was not prepared to many schools vindicates OUfeyu q u i
One talk was given by the initiative, we felt it did not
give cash for the purpose to fully account for the needs of approach as both practical %mpetito
president of Mindware,
economic." .mputer

66 ZX C O M P U T I N G S U M M E R 11
COMPl
News

Users'
clubs • EZUG (Educational
A network of users' clubs for
the Z X 8 1 has sprung up in the Z X 8 0 / 8 1 Users' Group), Eric
UK. The largest group, the Deeson, Highgate School,
National Z X 8 0 and Z X 8 1 Birmingham 1 2. Send a large,
Users' Club, produces a stamped, addressed envelope
monthly magazine Interface, for details. EZUG also caters
acts as an 'umbrella' club to for the BBC Microcomputer.
publicise local groups, and
• Roger Pyatt, 2 3 Arundel
assists in the presentation of
Drive, Orpington, Kent ( 6 6 )
the ZX Microfairs. The
national club is at 4 4 - 4 6 Earls
20281.
Court Road, London, W 8 6EJ, • Austin Knott, 2 6 9
and you can get a sample Telegraph Road, DEal, C T 1 4
issue of Interface, along with 9EJ.
details of the club, by sending • Christoph Moeller, Gross
€ 1 . 0 0 to the Earls Court Road Kurfurstenstrasse 4 1 a , 4 8 0 0
address. Bielefeld 1, Germany.
- The North London Hobby • Danmarks Nationale Z X 8 0
Computer Club has a og Z X 8 1 Club, Skovmosvej 6 ,
Z X 8 0 / 8 1 users' group 4 2 0 0 Slageise Dk Denmark.
meeting each Monday night
from 6 - 9 p.m. It is held at the • Steve Brumby, 3 8 Eastfield
North London Polytechnic, Road, Messingham,
Holloway Road, London, N 7 Scunthorpe, Sth. Humberside.
*t»m Tarshis, Executive Vice President in charge of operations. (diagonally opposite Holloway • Ken Knight, 2 2 Mount
Timex, at the press conference announcing his company's tie-up with Road tube station). Street, Aylesbury, Bucks.
Sinclair Research
Most local computer clubs H P 2 0 2SE ( 0 2 9 6 5 1 8 1 ) .

Timex buys it up
Sinclair Research have signed For the time being,
have a large percentage of
Z X 8 1 owners, so you are sure
to meet fellow enthusiasts if
you get in touch with your
• David Blagden, PO Box
1 5 9 , Kingston upon Thames,
Surrey, KT2 5 Y Q .
• Anthony Quinn,
a deal with Timex in America Sinclair's Boston-based US local club. If you'd like to start Heckenrosenweg 6 , 3 1 7 0
to get the ZX81 sold through subsidiary will continue to sell a local club, write to the Gifhorn, W . Germany.
some 1 7 1 , 0 0 0 retails outlets the ' 8 1 by mail order until National Z X 8 0 a n d Z X 8 1 • Conrad Roe, 2 5 Cherry
in the States. Very shortly, Timex's o w n sales reach Users' Club so they can Tree Avenue, Walsall, W S 5
agreed levels. The Boston publicise your address. It will 4LH.
lucky Americans will be able
group will then concentrate on also be listed in future issues • Ian W a t t , 1 0 7 Greenwood
to buy ZX81 s from the same
selling the new flat-screen of ZX Computing. Road, Clarkeston, Glasgow.
shops which sell jewellery,
telly. This is expected to be Local clubs that w e know • J. Palmer, 5 6 Meadowfield
perfume and Timex watches.
available just before about include: Drive, Edinburgh ( 0 3 1 - 6 6 1
Uncle Clive will get a 3181).
royalty on all sales under the Christmas.
• Leeds Microcomputer
new contract, which covers Users Group. Meets

users crowd it out


current and future Sinclair fortnightly on Thurs eve in
personal computer products, Leeds, new members
and Timex's own development welcome. Contact: Paul
of Sinclair computer O'Higgins, 2 0 Brudenell Mt.
technology. The ZX Microfairs, organised the floor-space, and the show Leeds 6 , tel: ( 0 5 3 2 ) 7 4 2 3 4 7
It also includes the use of by Mike Johnston, are going was open for three hours after 6 .
Uncle C's version of BASIC, from strength to strength. longer than the first one had • Brunei Computer Club:
although the pound sign on The first one, last been. meets alternate Mondays
the ZX keyboard has raised a September, attracted about For the third show on 1 9 0 0 - 2 2 0 0 hrs at St
few eyebrows in the States. 4 0 0 0 restless Z X 8 1 owners, Friday, April 3 0 and Saturday, Werburgh's Community
Apparently the Yanks were who surged seven-deep May 1, Mike is determined to Centre. Contact: Mr R
wondering what in hell this around exhibitors' stands in avoid the queues, and make Sampson, 4 The Coots,
squiggly little symbol meant. one half of one hall at the Stockwood.
sure all those attending have a
The best guess that it was a Central Westminster Hall. The good time. • Worle Computer Club:
new form of mathematical three-hour queue — in the rain meets alternate Mondays
symbol which the British — infuriated many would-be The main attractions at the 1 9 0 0 - 2 2 . 3 0 at Woodsprings
understood, but which hadn't attenders, so Mike decided to second show — add-on Inn Function Rooms. Contact:
yet been taught in progressive double the space for the hardware bits to get Z X 8 1 s to S Rabone, 1 8 Castle Rd,
American schools. second show, held at the end sing and dance, to draw real Worle, Weston-Super-Mare,
of January. SPACE INVADERS and user- Avon, tel: 0 9 3 4 5 1 3 0 6 8 .
Sinclair Research told ZX
defined graphics — will be out • P Compton, 2 9 North
COMPUTING that Timex's He needed to. The New
in force at the third show, as Marine Road, Scarborough,
marketing expertise meant Scientist, commenting on the Nth Yorks, Y 0 1 2 7EY.
that the ZX81 would make second show, said that in well as part of the rapidly
expanding output of books, • Jonathan Meyer, Vanspaen
much greater inroads into the terms of crowd concentration, Straat 2 2 , 6 5 2 4 H.N.
US market than has been the the show gave the Royal software and selection of
books and software. Nymegan, Holland.
case in the past. And, with a Wedding a run for its money. • Royston H Wallis, 2 2
high-tech background — Some 1 2 , 0 0 0 people came Based on the catalogue of Mallard Crescent, Pagham,
ranging from cameras to the second time, again there the second show, it seems Bognor Regis, West Sussex,
iters to scgyroscopes - Timex reckon was a three-hour queue, and that a new ZX-based company P021 4UU.
ates our they'll quickly become a viable again the crowds were seven has evolved every day and a • Raymond Betx, Chemin du
ictical an«competttor in the personal or so deep around the stands, half since the launch of the Moulin 3 8 , 1 3 2 8 Ohain,
(computer field. even though there was double little wonder. Belgium.

MER 1 9 » 2 z x COMPUTING SUMMER 1982


67
Hardware

DCP
a

c

M icr odevelopments
t
a

Packs
Stephen Adams takes a peek and
a poke inside this system which
is based on a single input/
output port and intended for a
wide range of educational and
control applications. It can be
used — with the other packs
available to plug into the port —
to monitor heatf light and
voltage, as well as activating
alarms and motors, and making
sounds.

and LEDs. A suitable circuit devices. The port connectors pack or another port to work as
The Basic V Pack diagram is included in the leaflet on the back are designed to be it cannot plug directly into t N
This is 4K of dynamic RAM (2 x that comes with the port. It is used by two other packs ' A ' expansion port of the com-
6 1 1 6 s ) to add to the basic 1K very easy to use and comes in a and ' C ' to provide extra puter. It is in a tough black bo*
provided with the machine. robust black plastic box 3)4 * facilities, but only one pack can like the 'P' pack, but with the in-
This gives a total of 5K, the 3% x 1% inches. Demonstra- be used at a time. put and output sockets 2 mm
maximum amount of memory tion programs are given, and wander sockets. These wander
allowed by the system. It also with the accompanying infor- The A' Pack sockets are the same as used
on some multimeters. They
provides separate input and mation any user should find it
output ports at the back of the easy. The 'A' stands for analogue and also take the connection plugs
'P' pack which are memory This is a basic building block the pack provides an interface used by schools and colleges to
mapped. Because the port is for DCP's control system and between the digital world of the connect up science experi-
memory mapped, it can be although it provides only 5K of computer and the real world we ments.
PEEKed and POKEd to get infor- memory, this should be more live in. The 'A' pack is used for
mation to and from the com- than enough to control most The 'A' pack requires a 'P' measuring a voltage between 0
puter. It makes no difference if
the computer is a Z X 8 0 or a
Z X 8 1 and it will work with a 4K Fig. 1
or 8K ROM. It is not possible to
connect anything else to the
computer without using a Output f r o m port set t o 2.5 volts.
motherboard as the only other
connectors on the 'P' pack are
0 . 1 molex pins for the port.
These pins are about % inch
long and there are 10 for input RESISTOR X
and 1 0 for output. The pins are
connected to the eight data
lines and also provide + 5 and 0 Input t o ' A ' pack.
volts. They can only drive one
TTL gate from each output pin.
The ports address is any-
where from 2 1 5 0 4 to 2 2 5 2 7
as the single port replaces 1K of
KNOWN RESISTOR
RAM. The plug connections
used for the port are readily 0 volts.
available from other sources
than DCP.
The port can be demon-
strated by the use of switches

ZX C O M P U T I N G S U M M E R 1982
and 2 . 5 volts. This will produce Table 1.
a number between 0 and 2 5 5
on PEEKing at the INPUT from
the port. There are + 5 volts
and 0 volts connections from
the pack, so these can be used 45 ma.
to create the voltage required. Port 'P' pack
These should be used with care
as they may cause the crash of ' A ' pack
the computer if too much cur- 80 ma.
rent is taken.
The output of the Digital to 'C' pack 775 ma. (Max.)
Analogue converter will con-
vert the number between 0 and
255 into a voltage between 0
and 2 . 5 5 volts. This can be ad-
justed within the port, if it is not
correct, and a complete circuit pack, but also burn out the 'P' either an answer somewhere
diagram is given. The accuracy pack as well. Solving Equations near what you believe the cor-
is ± 5 % on both the analogue These devices are intended for rect answer to be, or — if there
input and output. use in educational or control is more than one correct
The resistor c o u l d be purposes. Games could be answer — a number near the
measured using this device by another possible use, but the This clever routine, written by answer you are seeking. Then
connecting them as shown in price of these packs might put Jeremy Ruston, uses Newton's press NEWLINE and sit back
Fig. 1. By knowing the voltage that out of bounds. The limit of method for solving equations. and watch the fun as the com-
across the known resistor and only 5K of RAM and only one Enter the equation you want puter verges t o w a r d s the
the voltage output by the port might prove restrictive in solved for X when prompted by answer.
analogue port, the resistance use, but up to 1 2 8 different line 1 0 , then — in reply to the To try it out, enter X * X - 5
can be calculated. As the 1 bit devices can be controlled. prompt from line 4 0 — enter a (to find the square root of five)
resistance of the unknown The boxes are robust and starting position for the Z X 8 1 or X * ' 3 - 2 7 . 6 to find the
resistance rises, the measured could be used in schools with- to work from. This should be cube root of 2 7 . 6 .
voltage across the k n o w n out needing a set of expensive
resistor will fall. The computer plugs and sockets. I have
can then be used to work out L- RTF-.N W E W T O N S M E T H O D - F O R
doubts, however, over the in- S O L ^ X H G EOLTRT T O N 5
the unknown resistance. puts to the 'C' pack. If any REM BY UEREMY RUSTON
voltage over + 5 volts is used, PRINT "ENTER P FUNCTION ";
The C Pack some form of protection will be
required to stop the port blow-
20 INPUT
30 PRINT
FS
F$
The 'C' pack again requires the
ing up. 4-0 P R I M T "ENTER R STRRTIN6 POX
The documentation that M"
use of a *P' pack or another 50 INPUT S
port. The ' C pack can plug comes with the port is very
clear and simple to understand. 60 PRINT 3
directly onto the connectors at 7"0 P R I N T '* I N P U T MAXIMUM ERROR
the back of the 'P'. The leaflet included with each
pack details its uses and gives a
The 'C' pack provides eight
program to demonstrate its ©0 INPUT ERR
relays which can be controlled
capabilities. The current drawn 90 PRINT ERR
by the output of the port. The
by these packs is shown in table
1O0 PRINT RT 10,10;3
relays are turned on by making
1. DCP packs cost £ 3 7 . 9 5 for
110 LET X=3
any of the eight bits Binary 0 . 120 IF R B 5 VURL L'F$.» > -: E R R THEN
the price of the 'P' pack, 3"! O P
The outputs from the back are
£ 2 9 . 9 5 for the 'A' pack and 130 LET T=URL LF$>
by the same 2 mm sockets as
£1 9 . 9 5 for the 'C' pack. Both 140 LET X =X +0- 0 0 0 0 1
used on the 'A' pack. The out-
'A' and 'C' packs must be used 150 LET B = (URL TF$> -T> Y 0 . 0 0 0 0 1
puts consist of eight single con-
tact switches, which connect
with a 'P' pack or other ports. 163 LET 5 = 3-T.'B
to a common wire. They are not
1*7® GOTO 100
connected to the computer at
all. The contacts are normally
closed and can carry 12 volts at
1 amp maximum. Therefore
when the computer is switched
on and the output from the port
is 255, all the switches are
closed. I would have thought
this would be a disadvantage in
a controlled situation, as all the
devices would be turned on
under no control from the com-
puter.
The inputs consist of a set of
eight resistors connecting each
of the input connectors to 0
volts. This means that when
PEEKing the port with nothing
connected the user will see 0 .
There is no buffering between
these input pins and the input to
the port, so that the application
of any voltage above + 5 volts
could not only damage the 'C'

ZX COMPUTING S U M M E R 1982 69
Hypno Tim Johns from
This program, instead of using

^T°bVi°US
r u i N i , makes use of POKE
putting the code values of the j
characters directly into the
of

Birmingham has display file, the start of which is


identified in line 10. By doing
J £ 2 2 u ? ? d a routine this, you get a 2 4 x 24 display
whereas using PRINT restricts
which shows off the you to 2 2 lines.
graphics capability of The style' of each frame of
the pattern is established in
the ZX81 to good fl??S t ° , ? n d 5 0 ' P , u s 7 0 ^
effect creating a BO. which set the probability of
constantly changing the characters chosen being
square pattern on the changed within each frame
and hence the 'uniformity or
TV screen. variety' of pattern of the
frame, and also the probability
of the characters being aligned
in or out of phase.

I ^

• r - r - . i ,

ft• :V • "» ? ••' l


0 Jr. . J

70
ZX C O M P U T I N G S U M M E R
ZX
i6KCames^

2 0 0 POKE
T O 3 4
ill IE? xlr*T-3**»
11 LL
tng i * "
10 LET
of
KE, W + i i i Rgg r
the li |gs5e 30*
the 21 £ f t ergiiS 3 l o NEXT N T O

t
his 270 FOR ^ i
mg
i
ay. i l l <«*<>••>
cts ! !
31® ^^
i of ill SSKI
in
T
jnd ill t ^ T l ^ ^ * * " ° ^ 121 fcg 1=1
fOf
ing §11
ne,
or
the
ttty ill POKE ^ ^ ^ * '
led

U i J J J, J J i J . Jl i . i J

'A^/ff/T

^ C O M P U T I N G S U M M t H 1982
MONTH I

PROGRAMMERS' TWO-
PORTABLE POWER?
STEP
o
After years of writing books on computers
and awarding his famous 'White Elephants' O K , so you've learnt to program in BASIC.
to the industry, Adam Osborne finally took Now, perhaps, you'd like to have a g o at
the ultimate step and produced the assembly but you're put off by the fact that
Osborne I. Despite the fact it is portable, you can't alter your programs with the same
well. almost, and fairly reasonably priced ease as you can in BASIC. Well, what you
as hardware goes, the main attraction seems need is our two-pass assembler which lets
to be the fact that you get several hundred you write and modify the assembly code first
pounds' worth of software thrown in for free. and then turn it into machine c o d e without
Having humped the system up hill and destroying your original.
down dale and generally put it through its .So, if you'd like a professional software
paces, our reviewer will hopefully have tool to help you with your assembly
recovered sufficiently to put pen to paper language programming, don't miss out on
and report on his findings. our next issue!

SIMULATING FORTH ARE YOU SECURE?


The interest sparked off by our recent series Or, to be more precise, are your programs 9
on FORTH has been so great that even we In our next issue we'll be taking a look at a
were taken by surprise. As a result, next rather clever method of program protection
month we'll be publishing a rather novel which actually allows your programs to be
B A S I C simulator for FORTH operations so copied but then won't let them run on any
those of you who would like to try out the other system frustrating in the extreme!
language — without actually having to buy W e will also be publishing an extremely
a version of it for your system — can have a ingenious Voting Loader which guarantees
g o . It certainly won't break any speed perfect loading from cassettes at almost any
records, in fact it is extremely slow, but it speed. So, for your own peace of mind and
does allow you to get to grips with Reverse the security of your programs and data,
Polish Notation. make sure you secure a copy of our June
issue.

Article* described here a r e In an a d r a n c e d state of


preparation but circumstances m a y dictate c h a n g e s to the
final contents.

WARE AT HOME IN BUSINESS


Review

Keyboard Review
Crofton's Adaptakit is housed with the review model, but it
m a neat, matt-black metal box,
around 1 2 inches by six, which
The touch-sensitive keyboard is appears a very useful addition)
which is attached to the
holds the Z X 8 1 . There are 54 one of the main sources of keyboard case by two self-
keys on top which duplicate all
tbeZX81 keys. Additional keys
criticism of the ZX81. is an tapping screws to prevent the
Z X 8 1 PCB or edge connector
are provided for many func- external keyboard the answer? becoming strained. This plate
tions such as GRAPHICS,
COPY, right and left cursor and
Tim Hartnell investigates should minimise memory
failure.
EDIT, as well as two shift keys Crofton's solution to the All in atl this is a nice
and a BREAK/SPACE bar at the
bottom of the keyboard. problem. package, and one which turns
your Z X 8 1 into a 'real com
The keyboard is not com- puter' — or at least makes it
pletely satisfactory to use, which provides an output at a dard d o m e s t i c t e l e v i s i o n look like one. The keyboard
because the 'feel' of the keys is level suitable to interface with receiver. could be, as I suggested, bet
poor, they tend to rattle and almost any standard video T h e k e y b o a r d is f u l l y ter, but in its present form it is
bounce somewhat, and the monitor. assembled when you get it, but an enormous improvement
box-top is not raked, so you are A nice touch is the LED in- the sticky-backed key labels over Sinclair's one. The extra
working on a flat surface. dicator to show power on. It is have not been attached, so you keys are very useful and make
Despite these minor criticisms, unfortunate that a separate, can follow the suggested game responses much quicker
the keyboard makes working and more robust, power supply layout, or modify it to your own than on the standard keyboard.
with the Z X 8 1 a much more was not provided onboard, as requirements. The Z X 8 1 PCB At £ 4 2 . 9 0 (including VAT and
pleasant occupation than it is this would be likely to be of must be removed from its case, p & p) this is a worthwhile pur
when working Sinclair's stan- more general value, I would and the existing keyboard rib- chase if you intend to make
dard membrane keypad. Once suggest, than the video output. bon cables disconnected from heavy use of your Z X 8 1 and
you get used to the new posi- You still have to use the Sinclair their connectors. The PCB is have access to a video monitor.
tions of some of the keys, and power supply and leads, which then bolted onto the Crofton A kit version is available for
you become familiar with the plug into the Z X 8 1 through keyboard PCB. Short lengths of £ 3 7 . 1 5. If you don't want the
double SHIFT keys and the holes in the Adaptakit's left- ribbon cable then connect the hassle of fitting the whole lot
separate function keys, you'll hand side. two PCBs. Once you've install- together, you can send them an
find you'll be working much The video amplifier circuitry ed your Z X 8 1 into the key- extra £ 8 . 6 2 plus a complete
more quickly than in the past. brings the video signal level up board, your memory pack and cased Z X 8 1 , and they'll send
The computer is bolted into to a standard 1 V peak-to-peak printer may be plugged into the you an Adaptakit with a Z X 8 1
place within the case, produc- composite. This enables the main board via a slot in the back already wired in.
ing a solid package which does output to be fed directly to a of the keyboard case. A RAM Crofton Electronics Ltd., 35
not slide around the desk. There video monitor rather than via support plate is also supplied Grosvenor Road, Twickenham,
is a video amplifier onboard, the internal modulator to a stan- (although one was not provided Middx. ( 0 1 - 8 9 1 19231.

ZX C O M P U T I N G S U M M E R 1982 73
Hardware support

QuicksHva
Quicksilva —
The man behind it
In August 1 9 8 0 , Nick Lambert
wanted additional money for
his Z X 8 0 . Sinclair's 3K pack
was too expensive so Nick
decided to build his own. This
was the beginning
Quicksilva, a company which
of
Tim Hartnell interviews Nick Lambert,
n o w has f o u r full-time
employees, and which has led who started out building electronic
the way in providing im-
aginative hardware modifica- classical organs for a living, and now
tions for the Z X 8 1 .
Nick was an electronics en- runs his own company stretching ZX81
thusiast mainly interested in
electronic music, when he hardware beyond Sinclair's
bought his Z X 8 0 - the only
computer he could afford.
" I realised quickly that the
specifications.
memory as supplied on the
Z X 8 0 was very limited, and be- few more products together to
ing unwilling to endure any go with the Z X 8 1 . "
more Sinclair delivery delays, One of Nick's secret vices is
and because the price was high, arcade games.
I decided to make my own 3K " I thought a good moving
pack", Nick recalled. graphics game would go well,
"It took a couple of weeks to and decided to do Defender,
produce the first prototype, and because it was my favourite. At
I then decided that as I was about the same time, I came up
building one for myself — and with a sound board for the
there didn't seem to be any Z X 8 1 . It had been in the back of
others on the market at the time my mind for quite a while."
— I should make it a real project Nick soon discovered that
and produce the memory packs between admiring a game in an
as a business." arcade, and producing a version
Nick had had some ex- for a somewhat limited home
perience with PCBs, and with computer lies a vast gulf, filled
getting production lines mov- with blood, sweat and tears.
ing. His first advertisement for " D e f e n d e r took three
the 3K pack appeared in the months to write. I did most of it
users' club magazine Interface, myself. By the end I was getting
and Quicksilva was underway. pretty sick of it, and needed
Nick swapped a memory pack considerable moral support to
to pay for that first ad, and sold get the thing completed. Three
around 5 0 of the initial design. months it took, before I finally
" I was charging around £ 4 0 got it running properly."
at first — Clive's 3K pack was But the trouble was worth it.
£ 6 4 at that stage — but after "I reckon we've sold four or
Clive released his 16K for five thousand", said Nick,
£ 4 9 . 9 5 1 gradually dropped the "Most of our subsequent soft-
price. It is now £ 1 5 . Overall I ware products have been based
guess I've sold around 4 0 0 3K on arcade games. After Defen-
packs." der we produced the program-
The electronic organ mable character generator
business was fairly quiet, and
Nick began to see the possibili-
ties of making computer peri-
board. It came out just before
the South Bank Sinclair Show.
It has gone well, just about
/
pherals as a business. anybody seems to buy it.
"Although my memory pack "Schools, in particular, have
business was OK, and it sup- shown great interest in the
plemented my income nicely, it
was not something I could do
character g e n e r a t o r " , said
Nick. "There are many educa-
/
full time at that stage", said tional applications, such as
Nick. "Nevertheless, I was en- drawing equations, where the
joying it. I realised then that character generator goes down
working for myself in this way well."
was the only way I would be \
happy.
" I was doing some contract
High Resolution
testing work on Winchester But white 'just about any-
discs when the Z X 8 1 came body' appeared to find a use for
out. I'd always thought of the character generator, Nick
myself as 'testing the water' by noticed a difference with the
selling the 3K packs, and that next product his company
had gone OK. so I thought I developed, a high resolution
should expand my line and get a board.

74 ZX C O M P U T I N G S U M M E R 1982
Hardware support
"The hi-res board seems to crowded as more and more
go to a noticeably different kind people came in to see the
of 'clientele'. These seem to be marvellous board do its tricks.
people who know more about The board is simple to use.
computing, and have been You call it with a USR com-
waiting for someone to produce mand, and the board follows in-
a hi-res board." Even though structions stored in English in a
the high resolution board costs REM statement. For example,
£85, more than the computer, REM BLACK CLEAR MOVE A A
Nick believes it has sold well DRAW B B, when A is zero and
because it and the computer B is 1 0 0 , will clear to a white
can perform better than many area, and a line will be drawn in
computers costing much more black from the top left hand cor-
than the combined price of the ner (0,0) to somewhere near
board and Z X 8 1 . "Compared the middle ( 1 0 0 , 1 0 0 ) .
with other machines which pro- The graphics commands,
vide the same facility, it is about and what they do, are:
a third of the price", he said. BLACK — sets the pen colour to
Quicksilva's latest project is black.
its most exciting one — a ZX WHITE — sets the pen colour to
colour board. white.
"We'll definitely have one CLEAR — clears the whole
soon", said Nick, " W e ' r e going hi-res display to the opposite of
for eight colours. It is still in the the pen colour.
design stage (early March) but MOVE X Y - This moves the
we're well on the way to having current co-ordinates (the hi-res
a working prototype. cursor) to X Y but does not
" W e hope to have one work- draw anything.
ing at the next Microfair. It will PLOT X Y — This plots a single
probably have two kinds of con- point in the current pen colour
trol. In one, you'll be able to at the X Y co-ordinate specified
specify a particular colour for DRAW X Y - This command
each position on the screen. In draws a line in the current pen
the other, we're going to have a colour from the current co-
character code mode to specify ordinate to the new co-ordinate
a particular colour map. It will specified by X Y.
be controlled by simple POKEs. BOX X Y — This command,
The character code map idea is which is found on few micros,
a good one as it gives you the draws a rectangle from the cur-
same facility as you get with rent co-ordinate to the new co-
the characters board. You can ordinate (X Y) which sets the
use it with existing programs." position of the opposite corner
The Quicksilva idea is to of the box.
allow computer users to load UP, DOWN, LEFT. RIGHT
the colour and/or the character These four commands move
generator software, and then the whole hi-res screen by one
load in any game the user pixel in the direction specified.
already has to take advantage Anything moved off the screen
of the programmable charac- will be lost.
ters and the colour. SCROLL - Scrollsthe lower 24
The company which started lines (3 x 8) by eight lines up-
off with an ad swapped for its wards, one at a time, and sets
first product now is four people the current print position to the
working full t i m e . N i c k ' s start of the bottom line. This
sidekick is John Hollis, who has provides a three-character line
done most of the design work. text window at the bottom of
"He's done everything ex- the display for prompts and
cept the characters demo soft- messages.
ware since the t w o of us started COPY — This c o m m a n d ,
up with Defender and the sound believe it or not, copies the
board", said Nick. " A s well as whole hi-res screen to the ZX
that we have Mark Eyles, the printer.
production manager, Chris Lon- If you want to get an idea of which you trigger with a simple To make this simple system
don who is a permanent 'PCB just how good the Z X 8 1 can USR command, A test pattern even simpler to use, all of the
production engineer' — or at be, take a good look at the pro- is drawn and the message " O S graphics commands can be ab-
least that's what he calls ducts which have come from HI RES T E S T . . ALL O K " ap breviated to the first two letters
himself — along with Ellen the Nick Lambert's fertile mind. pears. The hi-res board's so MOVE X Y DRAW A B
post-person, and Steinar Lund display is on a 2 5 6 by 1 9 2 SCROLL comes out as MO X Y
who does the zappy artwork for matrix. Any particular point DR A B SC.
the cassette covers." Quicksilva — may be white or black, and can
And now what's around the The products be referenced by its X and Y co-
The software
corner for Quicksitva? The col- ordinates.
our board seems certain to be a The High The effects generated by the QS Defender occupies around
winner. Quicksilva has also Resolution board are fantastic. W e had 3K of machine code, and uses a
recently developed an interface
to allow the Acorn Atom to run
Graphics Board some samples running in the ZX
Computing offices when Nick
34 line display file which ex-
tends from the top to the bot-
a ZX printer, and they're work- The hi-res board comes with its brought the stuff in to show us, tom of the television screen. Up
ing on one for the VIC 2 0 . own test program in ROM and my office became very to 8 4 fast-moving characters

ZX C O M P U T I N G S U M M E R 1982 75
Hardware support
are on screen at a time. the board can be used with ex- than just the printer and a RAM Quicksilva are at 9 5 Upper
Although this is not the best- isting software. A lower-case pack onto the Z X 8 1 . The QS Brownhill Road, M a y b u s h ,
looking Defender for the Z X 8 1 alphabet is provided as part of Motherboard at £ 1 2 represents Southampton, Hants.
on t h e m a r k e t , it plays the character generator demon- a very cheap and useful addi-
remarkably well, and is greatly stration. tion to your system. The
enhanced when the sound motherboard is fitted with its
Part of the impressive range
board is connected. The OS Motherboard own 5 V regulator to drive all
external boards. There are two of hardware support provided
QS Asteroids, which needs
a Z X 8 1 or New ROM Z X 8 0 Some kind of motherboard is re- expansion sockets on the by Nick Lambert's company,
with the SLOW modification, is quired if you want to hook more motherboard. Quicksilva.
a pretty good version of the ar-
cade game, despite the odd-
looking asteroids. Quicksilva M M
had 'intelligent' asteroids
which homed in on your ship in
an early version but discovered
that such a game was impossi-
ble to defeat, so the program
you'll get now is a faithful copy
/
wmi
of the arcade game,
QS Invaders is the biggest of
Quicksilva's games, with a full
7K of machine code (plus a little
BASIC). There are seven rows
of 13 invaders. To see this pro-
gram running w i t h user-
programmed invaders on the
character board, with sound, is
to imagine you're watching a
proper arcade machine in ac-
tion, despite the lack of colour.
A number of manufacturers
have produced invader pro-
grams. This one, without the
sound and user-programmed
characters, is pretty much par
for the course.

The Sound Board


The sound chip used in the
board has 1 6 internal registers,
each of which control a dif-
ferent section of the sound
generation. Registers 0 and 1
are for controlling the tone and
pitch of sound channel A,
registers 2 and 3 control chan-
nel B and 4 and 5 the channel C
tone source. Register 6 tunes
the noise generator and register
7 is used to switch the various
sound sources, controls the
switching of the tone gener-
ators, the switching of the two
ports to input or output.
Registers 8, 9 and 1 0 control
the volume of each channel, 11
and 12 set the length of one
envelope cycle and register 1 3
controls the envelope shape
and pattern. A number of sam-
ple routines have been provided
by Quicksilva showing how
flexible and useful the sound
board can be. Music, explo-
sions, trains and phasers can all
enliven programs.

Character
Generator
This is a single circuit board
which plugs directly into the QS
Motherboard, or via the QS
connector directly into the
computer. There are 1 2 8 fully
programmable characters, and

76 ZX C O M P U T I N G S U M M E R 1982
1K ZX81 Programs

Make
the
most
of IK
Chopper Squad
R Morland and M Frobisher of
Chalfont St Giles sent us this
great little program for a 1K
Z X 8 1 . You are in charge of a
cleverly-drawn helicopter. The
" 6 " and " 1 " keys move your
chopper up and down, while
the " F " key fires.
Your helicopter flies in from
the left of the screen, buffeted
by random crosswinds, and air
pockets. You use the " 6 " and
" 7 " to keep your craft in flight,
and from time to time, press
" F " to obliterate an asterisk or
two underneath you. Due to
lack of space, the program is
not perfect, as the helicopter
from time to time leaves an
'image' of itself behind if it
lands on the base, then takes
off again. You may well want to
work on this problem. The
variable S is your score.

1 10 I F I N K E V $ = " F " T H E M G O T O 23 0
* * * * * * * * * * * * * * * * * * * * * 120 PRINT RT H-X,B;"--»--"
130 P R I N T R T H^B;'*""*®"
140 IP H > = 1 4 O R H <S T H E N G O T O
30
150 P R I N T R T H - X , B; "
1 0 LET X =I 1 6 0 PRINT RT H,B;"
2 0 L E T H = LL? 1 7 0 I F 8 = 2 5 T H E N L E T 6 =X
30 L E T S =X — X 1 8 0 IF R N D > . 6 THEN LET H=H*X
40 LET B=X 190 L E T B=0-T-X
50 FOR R=5 T O 25 200 LET R=R + X
60 PRINT BT IS/P;"®" 210 IF R > 7 0 T H E N G O T O 2 6 0
70 P R I N T R T 14- , « > " * " 220 GOTO 100
3 0 NEXT R 230 P R I N T R T 14-,B," "
90 LET R =X-X 240 L E T 5 = S 4 X
100 L E T H = H * T I N K E V $ = **6" - » INKEV 250 GOTO 100
$ = "7 " J 260 PRINT S
KAYDE Elecr
80/1
FULL SIZE KEYBOARDS
WITH REPEAT KEY
comes fully assembled, tested
and guaranteed

foe vat

Fully cased keyboard £37.95


Uncased keyboard £27.95
Keyboard case £10.95

WHY WAIT TO PAY MORE


Fast delivery:
Our keyboard is highly professional using executing type buttons as found on top quality
computers (IN FACT THEY ARE THE SAME AS USED BY THE SECOND LARGEST
COMPUTER COMPANY IN THE WORLD). It also has a repeat key, which is unique to ZX
keyboards. This facility allows you to enter characters at a far greater rate than is possible using
a conventional keyboard. Therefore this makes it ideal for curser control, rubbing out etc.

It comes complete with its own luxury case, (but for those of you with a tight budget this can
be purchased separately at a later date). The keytops are finger shape moulded and are in a
pleasant tone of grey with the repeat key in red, of course all the characters associated with the
ZX keyboard are printed in two colours on the keytops as per your ZX80/1.

The case is moulded in sturdy black plastic and has been designed to complement your ZX81.
The KAYDE PROFESSIONAL KEYBOARD comes at a realistic price and is second to none.

All products inc. V A T are fully built and tested and come complete
with money back guarantee.
78
onic S y s t e m s ^ /

80/1
RAMPACK
MASSIVE ADD
ON MEMORY
FULLY CASED
comes fully assembled, tested
and guaranteed
The 16K Rampack plugs straight into the user port at the rear of your computer. And of course
as in all our products the Rampack is fully enclosed in a matt black slimline plastic case.

This means you can handle it with complete safety and you do not have to stare at ugly
components - as in other makes of 16K. The Rampack NEEDS NO EXTRA POWER and will
operate quite happily on your Sinclair power supply.

Don't forget you can always order on the telephone with your credit card.

6 days a week for a same day service.

WHY WAIT TO PAY MORE


Fast delivery:
Post to:- PIEASESENDME
PLEASESEND ME
RAM PACK/S
CASED KEYBOARD/S
£32 9 6 « e » n
£37 96 each

Dept ZXC1
PLEASESEND ME UNCASED KEYBOARD/S£27.96 « c h
PLEASESEND M E KEYBOARD CASE/S £10 96 each

KAYDE ELECTRONIC I enclose £.

SYSTEMS NAME
ADDRESS.
....

48/49 Exmouth Road,


Great Yarmouth,
Norfolk NR30 3DP Please add £1.50 PErP and m e k e cheques peyeble to
Kayde Electronic Systems,
Tel: 0493 57867
All products inc. V A T are fully built and tested and come complete
with money back guarantee.
79
ZX80 Games
I GOTO 9000
FOR Z » 6 TO 40
IF Z > 37 AND A(Z) = 1 THEN LET
A(Z) = 2
IF Z < 10 AND A(Z) = - 1 THEN
LET A(Z) » - 2
5 IF P > 0 THEN LET SI - SI + 1
6 LET P = 0
21 IF A(Z) - - 2 THEN LET A(Z) = 188'
22 IF A(Z) « -1 THEN LET A(Z) - 180
23 IF A(Z) = 0 THEN LET A(Z) = 128
24 IF A(Z) » 1 THEN LET A(Z) = 189
25 IF A(Z) - 2 THEN LET A(Z) » 186
26 NEXT Z
39 PRINT ABCDEFGH"
40 PRINT "2X80 ";SI;"eight shift A"
(in the next section, 0 equals shift A)
41 PRINT ," 10 ";CHR$(A(40));" ";CHR$
(A (39)If" ";CHR$(A(38));" ";CHR$
(A ( 37))
42 PRINT 2&";CHR$ (A(36)) ;" ";CHR»
(A (35));" ";CHR$(A(34)) ;" ";CHR$
(A ( 33) ) "

DRAUGHTS
43 PRINT 30 ";CHR$ (A(31));" ";CHR$
(A (30));" ";CHR$(A(29)) ;
" ";CHR$(A(28));"0"
This is a full game of draughts for the 4K Z X 8 0 . A complete
board is shown. You are at the bottom of the screen playing up,
and the Z X 8 0 is playing down. You enter each move as a
L E T T E R N U M B E R , then N E W L I N E , of the square you're
44 PRINT ." 4 0";CHR$(A(27));" ";CHR$
moving from, then L E T T E R N U M B E R , then N E W L I N E , of the (A(26));" ";CHR$(A(25));" ";CHR$
square you're moving to. You'll understand this easily once you
see the display. You'll find the Z X 8 0 plays like a reasonable (A (24));" 0"
beginner. Once you've played with it for a while, you might
enjoy trying to improve its standard of play.
45 PRINT ," 5 0 ";CHR$(A(22));" "CHRf
(A (21));" ";CHR$(A(20));" ";CHR$
Although the computer has no strategy as such {other than
look for a capture, and if it can't make one, look for a legal (A (19) ) ; " 0"
move) you'll find it plays as though it had a real method of
46 PRINT ," 6 0";CHR$(A (18)) ;" ";CHR$
looking ahead at the game and where it is developing. Kings
are made automatically. (A(17));" ";CHR$(A(16));" ";CHR$
(A (15));" 0"

47 PRINT ," 7 0 ";CHR$(A(13));" ";CHR$


(A (12));" ";CHR$(A(ll));" ";CHR$
(A (10) ) ; "0"
48 PRINT ," 80";CHR$ (A (9)) ;" ";CHR$
(A (8));" ";CHR0(A(7));" ";CHR$(A(6)) ;
"

49 PRINT "HUMAN "/SI/" 00000000"


50 FOR Z = 6 TO 4 0

80 ZX C O M P U T I N G S U M M E R 1982
ZX80 Games
51 IF A(2) «* 188 THEN LET A (Z) • — 2
52 IF A (Z) SS 180 THEN LET A ( Z ) 3 - 1
53 IF A (Z) SS 128 THEN LET A(Z) 0
54 IF A(Z) =Z 189 THEN LET A (Z) 1

1
55 IF A (Z) m 186 THEN LET A (Z ) = 2
LIST
56 NEXT Z
D
(JB
58 IF SI = 12 THEN PRINT "I WIN"
59 IF SM = 12 THEN PRINT "YOU WIN 1»

60 IF SM = 12 OR SI = 12 THEN STOP

90 IF W = 1 THEN LET C ~ D
95 IF W 2 THEN LET B - D
100 NEXT W

103 IF A BS (C - B) 10 OR ABS (C - B) »
8 THEN LET SM « SM + 1
142 IF B - C = 10 THEN LET A(B - 5) - 0
68 PRINT "LAST TO ";F$;' FROM? (LET 146 IF B - C = 8 THEN LET A ( B - 4) - 0
SUM. 147 IF C - B - 10 THEN LET A(C - 5) - 0
69 INPUT C$ 148 IF C - B « 8 THEN LET A(C - 4) « 0
70 PRINT C$;" TO?

mm
1 50 LET A(B) = A(C) STOP »M
71 INPUT B$ 160 LET A(C) - 0
74 LET F$ = B$ 165 LET U$ » ""
79 FOR W ' 1 TO 2 CUEAP CLS

77 IF W * 1 THEN LET D$ - C$
78 IF W = 2 THEN LET D0 » B$

80 LET D « - 40- (D$ s "Bl") - 39 (DS


a "Dl") - 38 (D$ = " F1 " ) - 37 (D$
= "HI") - 36 (D$ = " A2" ) - 35 (D$
= "C2") - 34 (D$ = " E2 " ) - 3 3 (D$
= "G2") - 31 (D$ SS " B 3" ) - 30 (D$
- "D3") - 29 (D$ «* " F3" ) - 28 (0$
m "H3") _ 27 (D$ = " A4" ) - 26 (D$
= "C4") - 25 (D$ er "E4" ) - 24 (D$
= "G4") - 22 (D$ B " B 5" ) - 21 (D$
* »D5") - 20 (D$ m " F5 " ) - 19 (D$
a "H5") - 18 (D$ = " A6" ) - 1 7 (D$
= "C6") - 16 (D$ s " E6 " ) - 1 5 (D$
= "G6") - 1 3 (D$ = "B7") - 12 (o$
= "D7") - 11 (D$ - "F7") - 10 (D$
* "H7") - 9* (D$ " It
A8" ) - 8 (D$
a » c 8 » ) - 7* (D$ - II
E8 " ) _ 6 (D$
« "G8")

81 ZX C O M P U T I N G S U M M E R 1982
ZX80 Games
170 IF ABS(C - B) - 10 OR ABS(C ~B)
rn 3 THEN PRINT "MULTI-JVMP?"
180 IF ABS(C - B) = 10 OR ABS(C - B)*
8 THEN INPUT U$
1990 CLS
1995 IF U$ > "" THEN GOTO 2
2000 FOR Z • 6 TO 40
200 5 IF Z < 9 THEN GOTO 2015
2010 IF A (Z) < 0 AND (A(Z - 4) " 1
OR A (Z - 4) - 2) AND A(Z - 8)
- 0 THEN GOTO 4090
2012 IF Z < 11 THEN GOTO 2015

2014 IF A (Z) < 0 AND (A(Z - 5) = 1 RANDOM MOVE INTELLIGENT


OR A(Z - 5) = 2) AND A(Z - 10) 4005 LET KK - 0
* 0 THEN GOTO 4200 4007 LET U " 0
2015 IF 2 > 25 THEN GOTO 2020 4010 LET Z «= 6 + RND (35)
4012 LET K - 0
2016 IF A(Z) - - 2 OR (A (Z + 4) = 1
4015 IF U > 199 THEN LET KK = KK + 1
OR A(Z + 4) « 2) AND A(Z + 8) =
4016 LET U = U + 1
0 THEN GOTO 4 300
4020 IF A(Z) < 0 AND A(Z - 4) = 0
2017 IF A(Z> « - 2 AND (A(Z + 5) = 1
THEN LET K * 1
OR A(Z + 5) = 2) AND A(Z + 10)
4026 IF A(Z) < 0 AND A(Z - 5) = 0
= 0 THEN GOTO 4400
AND K ' 0 THEN LET K » 2
2020 NEXT Z
4029 IF K " 0 AND Z < 26 AND A(Z) -
- 2 AND A(Z + 4) - 0 THEN
LET K = - 7
4035 IF Z < 10 THEN GOTO 4040

4038 IF K 1 AND U < 200 AND A(Z


- 10) ' 1 THEN GOTO 4010

4039 IF K - 2 AND U < 200 AND A(Z - 10)

• •
" 1 THEN GOTO 4010
4045 IF K - 0 AND KK < 350 THEN GOTO 4010
4050 IF K " 0 THEN LET SM « 12
4051 IF K - 0 THEN GOTO 2
4072 LET A(Z - (3 + K))- A(Z) TO

407 3 LET A(Z) « 0


4077 GOTO 2 SAVE

4092 LET A(Z - 8) = A(Z)


4095 LET A(Z) - 0
4100 LET A(Z - 4) = 0
4105 LET SI - SI + 1
4107 IF Z < 24 THEN GOTO 2

82 ZX C O M P U T I N G S U M M E R 1982
ZX80 Games
4110 IF (A(Z - 13) = 1 OR A(2 - 13) =
2 ) AND A(2 - 18) = 0 THEN LET
P - 1
4115 IF (A (Z - 12) - 1 OR A(Z - 12) *
2) AND A(Z - 18) - 0 THEN LET P
- 2

4i20 IF P = 1 THEN LET A(Z - 18) »

AfZ - 8)
4130 IF P = 1 THEN LET A (Z - 13) - 0
4140 IF P =< 2 THEN LET A(Z - 16) -
Afz - a;

4J50 IF P = 2 THEN LET A(Z - 12) = 0

4290 GOTO 2
4300 LET A(Z + 8) = - 2
4310 LET A(Z + 4) » 0
4320 LET A(Z) = 0
4330 LET SI " SI + 1

4160 IF P > 0 THEN LET A (Z - 8) = 0 4340 IF Z < 32 AND (A(Z + 3) = 1 OR

4170 GOTO 2
4200 LET A(Z - 10) « A(Z) A (Z + 3) " 2) AND A(Z - 2) - 0
420 5 LET A(Z) = 0 THEN LET P = 1
4210 LET A(Z - 5) ' 0
4350 IF Z < 23 AND (A(Z + 14) - 1 OR
4212 LET SI » ST + 1
A(Z + 14) - 2) AND A(Z + 16) -
4215 IF Z < 2 5 THEN GOTO 2
0 THEN LET P - 2
4220 IF (A ( Z - 15) - 1 OR A(Z - 15)
4360 IF Z < 23 AND (A(Z + 13) - 1 OR
= 2) AND A (Z - 20) = 0 THEN LET
A(Z + 13) = 2) AND A (Z + 18) =
P - 1
0 THEN LET P « 3
4230 IF(A (Z - 14) = J OR A(Z - 14)
= 2) AND A(Z - 18) - 0 THEN
LET P - 2
4240 IF P " 1 THEN LET A(Z - 15) = 0

4250 IF P - 1 THEN LET A(Z - 20)


= A (Z - 10)
4260 IF P " 2 THEN LET A(Z - 14) = 0
4270 IF P " 2 THEN LET A(Z - 18)
* A (Z - 10)
4280 IF P > 0 THEN LET A(Z - 10) * 0

ZX C O M P U T I N G S U M M E R 1382
83
r 4 36 5
4367
IF P 1 THEN
IF P m 1 THEN
LET A (Z
LET A (Z
+

-
3) -
2) - - 2
0
ZX80 Games

4370 IF P m 2 THEN LET A (Z + 14) - 0

4375 IF P - 2 THEN LET A (Z + 16) = _ 2


4380 IF P m 3 THEN LET A (Z + 13) - 0

4385 IF P = 3 THEN LET A ( Z + 18) = - 2


4390 IF P > 0 THEN LET A (Z + 8) " 0
4 395 GOTO 2
4405 LET A ( Z + 10) - - 2
4410 LET A(Z + 5) = 0 PUN CON!
4420 LET A(Z) - 0
4425 LET SI = SI + 1
FOR GOTO
44 30 GOTO 2
9000 DIM A(45)
GOSUB
9005 FOR Z = 1 TO 45
9010 IF Z < 6 THEN LET A(Z) = 9
9020 IF Z > 5 AND Z < 19 THEN LET
A(Z) = 1

9030 IF Z > 18 AND Z < 28 THEN


LET A(Z) = 0
9040 IF Z > 27 AND Z < 41 THEN LET
A(Z) = - 1

9050 IF Z > 40 THEN LET A(Z) - 9


9060 NEXT Z
9070 LET A (14) - 9

9080 LET A (2 3) - 9

9090 LET A(32) = 9

9095 LET V$ -
9100 LET P " 0
9110 LET F$
9120 RANDOMISE
91 30 LET SI = 0

9140 L£T SW = 0

9150 PRINT "DO YOU WANT FIRST MOVE?


(Y OR N)"
9160 INPUT J$
9170 CLS
9180 IF NOT 3$ = "Y" THEN GOTO 2000
91 90 GOTO 2

84 ZX C O M P U T I N G S U M M E R 1982
ZX81 HARDWARE
40 KEY KEYBOARD. Kit £20.50 Built £25.75 (RE77)
* Proper typewriter style keys.
* All legends and graphics in two colours.
* No soldering required to ZX81. Plugs in. (RAM/Printer not affected)
* Complete with all parts, connectors, feet and comprehensive instructions.

24 LINE IN/OUT PORT. Kit £16.95 Built £18.95 (RE98)


* Each line either in or out.
* Controlled by BASIC.
* Allows printer/RAM to be used without a motherboard. (Motherboard version kit £13.50
built £14.50)

3 CHANNEL S O U N D / T I M E R BOARD. Kit £16.95 Built £18.95 (RE161)


* 3 independent channels.
*
Controlled by BASIC.
* Full range of notes.
* Complete instructions with examples provided.
* Can be used as a sophisticated timer/counter.

MOTHERBOARD. Kit £15.75 Built £18.50 (RE82)


* Two connectors on board.
* Six connector board. TBA.

CONNECTORS & PLUGS


* 23 Way female connector for ZX80/1. (RE80) £2.95
* 23 Way male connector. (RE87) £1.30
* 23 Way male connector to fit two female connectors together. (RE90) £1.60
* 30 Way ribbon cable. £1.40 metre.
* RAM pack connector. Allows RAM pack to be remote from ZX80/1. RE170. £6.95 built.
* In/out connector & sound board connector. (RE78B) £2.95.

BOOKS £f TAPES
Getting acquainted with ZX81. £4.95
Mastering machine code. £5.95
Programming for real applications. £6.95
Tape for real applications books. £11.44

Send SAE 5" x 7" for free illustrated catalogue.

All produces available ex stock (allow 7 days extra for built products.

Payment: Cash with order. Or ACCESS/BARCLAYCARD. Official order welcome. Dealers


write for rates.

All prices include P + P and VAT. Overseas add £1.80

REDDITCH ELECTRONCS. DEPT ZX.


21 FERNEY HILL AVE, REDDITCH, WORCS. B97 4RU. Tel: (0527) 61240.
r
Business

I wrigley of Ravenshead draws on his


experience to produce a very useful program,
intended for the small business with around
100 customers.
The program, written for a 1 6K this. Saving the program from 100 DIM A $ ( 1 0 0 , 8 0 )
Z X 8 1 , would be fairly easy to the program means that when it 110 DIM A ( 1 0 0 )
c o n v e r t to run on other is LOADed, it will jump straight 120 PRINT " H O W MANY CUSTOMERS?"
systems. It is meant for small to the menu. 130 INPUT C
businesses with up to 1 0 0 9 0 0 0 to 9 0 4 0 checks that the 1 40 FOR F = 1 TO C
customers. It will print out their program has been SAVE'd on 1 50 PRINT " N A M E AND ADDRESS?"
names and address, tell you tape, and if it has, the machine 1 60 INPUT B$
who hasn't paid their bills, and is NEWed, clearing its memory 1 70 LET A $ ( F ) = B$ + " * • "
other things you'll discover. for other uses. 180 PRINT " A M O U N T OWING?"
It's pretty easy to use the 9 1 0 0 to 9 2 2 0 is a bubblesort, 190 INPUT A(F)
program, because all the t o p l a c e t h e n a m e s in 200 CLS
prompts are self-explanatory. alphabetical order. It can be 210 NEXT F
There's one point to watch, and replaced by any other sort if re- 220 GOSUB 9 1 0 0
this concerns the entering of a quired. However, if you do this, 230 REM MENU
customer's name and address. don't forget to change the 240 CLS
T h e f o r m a t f o r t h i s is: amount owing (held in array A), 2 50 PRINT "ENTER:"
"Customer's name* 1st line of along with the names. 260 PRINT " 1 TO LIST ALL CUSTOMERS"
the address* 2nd line of the ad- 9 5 0 0 to 9 6 7 0 asks the user for 270 PRINT " 2 TO AMEND A CUSTOMER'S NAME OR
dress* . . and so on. . last a customer's name or his ADDRESS"
line of the address NEWLINE". customer number (the 280 PRINT " 3 TO ALTER THE A M O U N T O W I N G "
Entering * (shift B| after each customer number may change 290 PRINT 4 TO ENTER A NEW CUSTOMER"
line of the name and address en- during any run of the program) 300 PRINT 5 TO DELETE A CUSTOMER"
sures that it is correctly format- and returns the customer 310 PRINT 6 TO LIST CUSTOMERS OWING M O N E Y "
ted when dumping on the number in variable G. If the 320 PRINT 7 TO PRINT AN ADDRESS LABEL"
printer. name is not found, the flag F is 330 PRINT 8 TO SAVE THE PROGRAM ON TAPE"
The second point to be set to 1, and the subroutine 340 PRINT 9 TO STOP"
careful of in entering the pro- prints a message. 350 PRINT,, ENTER ONE OF THESE NUMBERS"
gram is that in certain lines a 9 7 0 0 to 9 8 4 0 prints out one 360 INPUT B
double asterisk < * * ) appears. c u s t o m e r ' s n a m e on the 370 CLS
The must be entered as printer. 380 IF B = 8 THEN GOTO 8 0 0 0
SHIFT-H, not as SHIFT-B. The If your computer supports 390 GOSUB B* 1 0 0 0
lines in question are:- 1 7 0 , file handling but does not save 400 GOTO 2 4 0
2050, 2120, 4060and 9750. the variables on tape when the 1000 LET H = 1
In line 5 0 2 0 , 8 0 x Z means rest of the program is SAVE'd, 1010 LET D = 1 TO C
type in the letter Z 8 0 times. then the variables which must 1020 GOSUB 9 7 0 0
Lines 1 0 0 to 2 2 0 are only ever be stored on tape are: 1030 NEXT D
used once, to input all the A $ ( 1 } to A $ ( 1 0 0 ) , the array 1040 RETURN
customers' names and ad- which holds the customers' 2000 GOSUB 9 5 0 0
dresses. names and addresses, 2010 IF F = 1 THEN RETURN
Lines 2 3 0 to 4 0 0 are the menu A( 1) to A( 1 0 0 ) , which holds all 2020 LET X = 0
selection lines. For other the amounts owing, and C, 2030 LEX X = X + 1
BASICS, line 3 9 0 will have be which stores the number of 2040 IF A$(G,X) = THEN GOTO 2 0 8 0
changed to ON B GOSUB customers. 2050 IF A $ ( G , X ) • THEN GOTO 2 1 0 0
1 0 0 0 , 2 0 0 0 . . . 9 0 0 0 Line None of the variables need 2060 PRINT A$(G,X);
3 8 0 is present because the to be stored. 2070 GOTO 2 0 3 0
manual state that a program
cannot be SAVE'd from within using The Program 2090 PRINT
GOTO 2 0 3 0
a GOSUB loop. Using the program is quite easy 21 0 0 PRINT,, " N E W NAME AND ADDRESS?"
Lines 1 0 0 0 to 1 0 4 0 list all the since all the prompts within the 2110 INPUT 8$
customers. program are self-explanatory. 2120 LET A$(G) + B$ +
2 0 0 0 to 2 1 3 0 amend the There is only one point to 2130 GOTO 9 1 0 0
name or address of a customer. watch, and this concerns the 3000 GOSUB 9 5 0 0
3 0 0 0 to 3 0 4 0 alter the amount entering of a customer's name 3010 PRINT "OLD A M O U N T OWING £";A(G)
a customer owes. and address. 3020 PRINT " N E W A M O U N T ? "
4 0 0 0 to 4 0 9 0 enter a new The format for this is: 3030 INPUT A(G)
customer. "Customer's name * 1 st line of 3040 RETURN
5 0 0 0 to 5 0 5 0 delete an old the address * 2nd line of the ad- 4000 IF C < 1 0 0 THEN GOTO 4 0 3 0
customer, dress* . . .last line of the ad- 4010 PRINT " T O O M A N Y CUSTOMERS"
6000 to 6 0 4 0 list all dress newline". 4020 RETURN
customers owing money. Entering the * (SHIFT-B) 4030 LET C = C + 1
7 0 0 0 to 7 0 4 0 print an address after each line of the name and 4040 PRINT " N A M E AND ADDRESS?"
label. address ensures that the name 4050 INPUT B$
8 0 0 0 to 8 0 4 0 save the pro- and address is correctly format- 4060 LET A$(C) = B$ +
gram and its variables on tape. ted when it is output to the 4070 PRINT " A M O U N T OWING?"
Some BASICs may not allow printer. 4080 INPUT AIC)

86 ZX C O M P U T I N G S U M M E R 1982
Business

4090
5000
GOTO 9 1 0 0
GOSUB 9 5 0 0
Software review
5010 IF F = 1 THEN RETURN
5020 LET A${G) = *' [ 8 0 x Z ] " we take a look at one of the leaders in
5030 GOSUB9100 the ZX81 business software field —
5040
5050
LET C = C - 1
RETURN Hilderbay Ltd.
6000 LET H = 0 Hilderbay produce a number of
6010 FOR D = 1 T O C splendid software packs for the ZX81,
6020
6030
IF AID) > 0 THEN GOSUB 9 7 0 0
IF A { D ) > 0 THEN LPRINT, A(D),,,, including STOCK CONTROL and PAYROLL,
6040 NEXT D and their follow-up service and
6050 RETURN documentation is an object lesson in
7000
7010
GOSUB 9 5 0 0
IF F = 1 THEN RETURN how professional software should be
7020 LET H = 0 presented.
7030 LET D = G
7040 GOTO 9 7 0 0 Hilderbay produce a number of one another and must in some
8000 PRINT "SET TAPE TO RECORD A N D PLAY" splendid software packs for the cases be performed in a certain
8010 PRINT "THEN PRESS NEWLINE" Z X 8 1 , including STOCK CON- order. Michael Levy, head of
8020 INPUT B$ TROL and PAYROLL, and their the American firm Mindware,
8030 SAVE " C U S T O M E R " follow-up service and docu- which is concentrating on pro-
8040 GOTO 2 4 0 mentation is an object lesson in viding business applications
9000 PRINT " H A V E YOU SAVED THE PROGRAM O N " how professional s o f t w a r e software for the Z X 8 1 in the
9010 PRINT "TAPE?" should be presented. US, said that the CPA program
9020 INPUT B$ All programs come complete from Hilderbay was one of the
with an extensive instruction best he had seen for any system
9030 IF B$(1) = " N " THEN RETURN
booklet. Hilderbay also offer a — and he added that he'd seen
9040 NEW
backup service, and will replace a large number running on a
9099 REM BUBBLESORT
programs made obsolete by wide variety of machines, from
9100 LET J = 0
legislation changes. We'll look IBM mainframes d o w n to
9110 FOR D = 1 T O C - 1
at their range program by pro- pocket computers. This pro-
9120 IF A $ ( D X A $ ( D + 1) THEN GOTO 9 2 0 0
gram: gram for the Z X 8 1 will deal
9130 LET K$ = A$(DI
with problems including up to
9140 LET K = AID) Financial Pack 1: This pack has 5 0 0 activities in 16K. If you
9150 LET A$(D) = A $ ( D + 1 ) three programs, LOAN, which buy one of the larger memory
9160 LET A $ ( D | = * A ( D + 1 > — for a loan repayable in equal units available, you can easily
9170 LET A $ ( D + 1) = K$ instalments — computes one of deal with many thousands of
9180 LET AID + 11 = K the following in terms of the activities.
9190 LET J = 1 Other three, principal, number
9200 NEXT D of payments, instalment and in- Payroll: This program which,
9210 IF J = 0 THEN RETURN terest; VAT, which works out, like all the others, is supported
9220 GOTO 9 1 0 0 and displays neat tables and by clear and useful documenta-
9499 REM NAME OR NUMBER running totals, as you enter in- tion and comes with a follow-
9500 LET F = 0 formation from a mixture of up service, allows employers to
9510 PRINT " N A M E OR NUMBER (1 or 2)?" bills with and without V A T at keep and update pay records
9520 INPUTJ different rate; and MORT- for up to 3 0 employees. The
9530 IF J = 2 THEN GOTO 9 6 3 0 GAGE, which can be used to basis can be weekly, monthly,
9540 PRINT " W H A T NAME?" get answers to such questions or any other time interval you
9550 INPUT B$ as " H o w much longer will your choose. Mike Salem, head of
9560 FOR K = 1 TO C mortgage take to repay if you Hilderbay, has rightly conclud-
9570 IF A$(K) (TO LEN(B$)| = B$ THEN GOTO 9 6 6 0 pay £ 2 5 less per month?" and ed that many people who use
9580 NEXT K " H o w much of your latest pay- the Z X 8 1 in their businesses
ment went towards interest?" may have no knowledge of, and
9590 PRINT " N A M E NOT F O U N D "
Budget: This program keeps little interest in, computers as
9600 LET F = 1
track of expenses for up to 5 0 such, but still want to be able to
9610 PAUSE 1 0 0
headings over a year. For each use the programs without trou-
9620 RETURN
heading, a budget can be ble. This program was designed
9630 PRINT " W H A T NUMBER?"
entered at any time. A second to cater for these people. You
9640 INPUT G
version of the program is can, if you like, write the results
9650 RETURN
available, which handles the in- by hand on the usual cards,
9660 LET G = K
formation in a different manner. rather than using the printer. As
9670 RETURN
Both versions have a facility to well, you can always revert to
9699 REM PRINT A CUSTOMER doing it all by hand if you like
9700 LET X = 0 trigger the printer for a perma-
nent record. Both versions can You won't become dependent
9710 IF H = 1 THEN LPRINT D; on the computer.
9720 LPRINT TABI5); be used for private or business
9730 LET X = X + 1 purposes. V A T is not included The program is designed to
9740 IF A${D,X) = THEN GOTO 9 7 8 0 explicitly, but can be handled if be saved after each use, thus
9750 IF A${D,X) = THEN GOTO 9 8 1 0 required as one or more saving the current variables on
9760 LPRINT A$(D,X); separate headings. tape, then run next time with
9770 GOTO 9 7 3 0 the command GOTO 1, rather
9780 LPRINT Critical Path Analysis: This pro- than RUN. The current program
9790 LPRINT TABI5); gram allows the user to apply being sold by Hilderbay is, so to
9800 GOTO 9 7 3 0 the critical path analysis tech- speak, obsolete, because of tax
9810 LPRINT nique to any projects which and other changes, but those
9820 LPRINT consist of a well-defined set of having earlier versions wilt be
9830 LPRINT activities which may be started supplied with up to date ver-
9840 RETURN and stopped independently of sions. This fact shows the at-

ZX C O M P U T I N G S U M M E R 1982 87
Business
tention Mike Salem has paid to
ensuring that he provides a pro-
per software service, rather
than just running a "post the
cassette and run" operation.
Ail payroll programs, and not
just ones sold by Hilderbay, will
become obsolete in 1 9 8 3 / 8 4
due to legislative changes
which were due to come into ef-
fect in 1 9 8 2 / 8 3 but were post-
poned. The rules themselves e - TC>
N . I .
- MIKf JALffl T ? S I CODES
will then change, not just the S NO ML
numbers. Until then, however,
STANDARD, NOT C O N T R A C T E D OUT
you can work out your payroll SELECT ONE O F
REDUCED RATE, NOT C.O.
requirements without pro- 3 SRUE R E S U L T 3 ON T A P E . OUER P E N S I O N AGE

1
• DO A N E M P L O Y E E S PAY.
blems, knowing that if — in the 3 SUMMARY ALL. EMPLOYEES. s t a n d a r d , c o n t r a c t e d OUT
meantime — t h e numbers REDUCED PATE, C . O .
change again, Hitderbay will 2 S E TMONTH/UEBK NUMBER.
change your program for you. ENTER NEU CODE N.l.

The Payroll program caters


for all pay levels and all tax MONTH 6
codes consisting of a number TO T.QRO T.TRX PRY CCl'E
STOP (OPT IONAL.) Moitar m«ou
followed by a letter (such as TOM 6_ 3 3„
6 0„ 8 1 6 5 6 0 1 2 7 L
2 1 4 H ) . National insurance con- GROSS 6 S600
3jSS
6 * 6 a
f,oo
tributions may be nil, standard
20HRS 6 aifl ii?fc
rate, reduced rate or whatever,
and there is even provision for ENTER:

contracted-out employees. The NET PRY NI TRX


program will 'watch' what TO ROD RN E M P L O Y E E TOH 4 5 0 , 0 1 3 0 . I S 6 5
you're doing, and query some ruRN T O HR5TER MENU, gross i e a 0 - 1 0 9
input if it believes you are mak- ® TO OCT THE NEXT 30HRS 4.50.6 120.13 66
EMPLOY!
ing an error. It is impossible to Not. thot '20HRS' and 'GROSS'
pay one employee twice in one " • r f «nt«r»d a i
E N T E R NAME O F NCU IHet r At.e\
day period, for example.
Although the program is
l
CONNECT RECORDER, PRESS fi^L..
easy, and self-explanatory to AND R E C O R D , THEN PRESS PtCTB-hl
NI CODE • 1
some extent, Hilderbay will pro-
vide training in its use if you NOMTM x s 6 . MONTH S :
6I NE* VALUE?
want it. GROSS PRY T O ORTE = easeo
TRX P R I D T O DATE • £ 750 " 2 3 4 . 5 6 * 3 *2 . 3 4 *
Stock Control: There are two REGULAR P R Y - £560 NEW NAME ( 3 SPACES TO DELETE|
programs on this cassette, one PRE-TRX
POST-TRX
CHANGES =
CHANGES •
£0
£0 -SMITH,W
designed to hold a relatively REQUIRED NET PAT?
large amount of information NO
CHANGES - COMPUTE PRY JSO.60
about a great many lines. t . R e t u r n
NEXT
t o master
EMPLOYEE
menu.
"Stock I" will produce lists by COPY & n p l o y « « m«nvi, o p t i o n * 6, ! . G
gross u p g i u e n n e t p r y .
supplier, by type, of under- U»*r r««pont« undflirisd
stocked lines, or of all lines.
Lists may be total or may cover CM003E RN OPTION.
BASIS I S WONTM. OK) n
only a certain range of the BASIS IS *E£K. OK? I
alphabetical lists. Lists are LAST RUN FOR * E E * 2 3 .
TOM
a l w a y s displayed on t h e r t e n do r month a THIS RUN FOR " E E * 2 4 . OK? n
screen, and are printed if the ZX £560 PER MONTH+£0 WEEK number? 40
printer is connected. The pro- THE PAY OF SMITH,*
gram occupies 9K, leaving a fair T.GROSS • £3920 (3360)
T.TRX - £904. leto *AS LAST UPDATED TO WEE* 2 3 ,
amount of the 16K for data. N . I . ! SHOULD THIS BE CHANGED TO 3 ? ?
"Stock II" identifies stock lines EMPLOYEE £4-3.4. • te.
by a numeric code in the range
zero to 6 5 , 0 0 0 , storing the TRX £ 168
stock level for each line. You
can handle more than 2 0 0 0 PRY - EHPLOYEE N I - TR* .£34.8 .6
lines with 16K. Both of Hilder- ' u/POST-TA* changes •eaxo.o MONTH 6
bay's stock control programs
are fairly easy to use, and allow
lines to be entered or deleted at DETAILS o r DEDUCTIONS, ETC, CRN RESTART UtTM "GOTO 1"
BE P R I N T E D B Y S T O P P I N G THE
any time. PROGRAM (OPTION X ) , THEN DOING
LPRINT "INFO".
As can be seen from the THEN "GOTO 1 NEULINE" P
Ovilip
above, Hilderbay have an ex-
tensive range of business soft-
ware. Clive should be pleased
that Mike Salem, and others like
him, are doing their bit to con-
vince the world that the 2 X 8 1
is more than a toy. Other
distributors of ZX business
software should be grateful to
Mike Salem for showing how
well it can be done.

ZX C O M P U T I N G S U M M E R 1982
I 1K Games

UFO
This game UFO, written by S
Hassen of Worthing, was writ-
ten to show just how much can
be squeezed into 1K without
resorting to machine code. Mr
Hassen tells us he has used
every trick he knows to get the
program into 1K. The object of
the game is to shoot down the
saucer hovering near the top of
the screen. As you probably ex-
pect, the " 5 " will move you left
while the " 8 " moves you right.
Press " 0 " to fire. As you'll see
when you run the program, the
saucer does not sit still, but
moves back and forth, calling
for all your aiming skill. When
struck (by a little full stop which
zaps up to the saucerl it blows
apart, and your score is shown.
The lower the score, the better.
Any score over 7 2 is lousy. Any
score less than 10, I don't
believe you. The game ends
once you've hit the saucer, and
waits until you press any key to
start again. The PAUSE 4E4
(developed by Trevor Toms,
author of THE Z X 8 1 POCKET
BOOK) is remembered by think-
ing of it as 'pause forever'. It
obligingly waits, more or less,
forever for you to press a key to
get things underway again. If
you have trouble seeing the full
stop as it slowly zaps towards
the target, replace it with a
graphic A.

10 LET X = U R L
20 LET Q -NOT
3 0 L E T 0=Q
4-0 L E T F = Q
50 LET B=X
60 LET Y=X
70 LET Z = 5 G N X+SGN X
3 0 LET K = I N T ( R N D + R N O )
L E T B = B + f K R N O X+X.V - T N O T K
A N D B)
100 LET TINKEY$=" R N O Y <X
+ X ) - ( I N K E V $ = " 5 " R N O Y.I
110 L E T D =D + Z
L E T F =F + Z
PRINT RT NOT X,B," RT
";RT X-D,Y+Z RND
X-D,Y+Z;" " RNO O
O R N D Y = B R N D N O T D-.X T H
210
160 D=X THEN LET O =NOT X
160 D =X THEN LET D=0
170 NOT INKEY$="0" THEN GOTO
80
l a o LET Q=SGN X
1 90 L E T D =NOT X
200 G O T O 3 0
210 PRINT RT N O T X / B ; ".» > # < (
220 P A U S E 4-E4-
2 3 0 C-L'5
24-0 R U N

ZX C O M P U T I N G S U M M E R 1982 89
Games

zx Drawing Board
Sample Program
T h » simple little program, quite 10 LET D = 310
apart from enabling one to draw Try the following data string,
pretty picture* on the screen of the '/* represents the N E W L I N E . A) LET C = 20
one's Z X 8 0 , shows how you can
control on-screen movement. You FOR I = 1 T.O 640
5/128/8/4/2/2/4/4/2/2/2/2/6/6/2/6/8/6/6/6/6/6/ f
can change the symbol in use and PRINT" ";
the direction in which you are 6/2/6/8/6/6/8/4/8/8/8/8/8/6/8/4/4/4/2/2/2/4/4/ £
moving st any time during the NEXT I
program execution. 4/4/4/4/8/8/8/5/8/9/9/9/9. qq POKE PEEKH6396) +
Instructions and Variables 256'PEEK( 16397) + D,C
When the program is R U N an 70 INPUT A
asterisk (star) it displayed on the
screen. To alter the symbol in use
80 IF A = 1 THEN LET D = D + 32l
press '5' then ' N E W L I N E ' followed 90 IF A = 2 THEN LET D = D + 3S
by the code of the required symbol
and ' N E W L I N E ' . Changes in the 100 IF A = 3 THEN LET D = D + 34
direction of movement can be made
by keying the desired direction
110 IF A = 4 THEN LET D = D - 1 I
code ( see Fig. 1.) and the inevitable 120 IF A = 6 THEN LET D = D + 1
'NEWLINE'
The program uses the following 130 IF A = 7 THEN LET D = D - 3 i f
variables: 140 IF A = 8 THEN LET D = D - 3 3 |
D - Position on-screen of current 150 IF A = 9 THEN LET D = D - 3 2 1
symbol.
C Code of displayed symbol. 4 + 6 160 IF A = 5 THEN INPUT C
A Direction code. 170 GOTO 60
I Dummy variable.

From Kowloon, Hong Kong.


H. Hugh McAllum show* ut
a few tricks with the Z X printer

1 REM "5KETCHPPD
5 FR5T
6 FOR N =0 T O 6 3
7 P L O T N., 4-3
8 PLOT N,O
9 NEXT N
10 F O R P = 0 T O 4-3
11 PLOT 0.P
12 PLOT 63,P
13 NEXT P
15 5LOU
20 LET X = 32
30 LET Y = 22
40 GOSUB 500
50 UNPLOT X,Y
60 P L O T X JY
70 G O T O 4-0
80 GOSUB 500
90 GOTO 80 H.H.H.1982
100 GOSUB 500
110 PLOT X,Y
120 UNPLOT X,Y
130 GOTO 100
500 IF I N K E Y * = «« ^ M GOTO 40
510 I F I N K E Y $ = ** 2 " GOTO
520 IF INKEY%= GOTO 600 50 FOR N=0 TO 100©
530 IF INKEY$="0" THEN GOTO 100 M T * J = W T
tRND*22) +10
540 IF I N K E Y $ = " 5 " T H E N LET X =X — 70 LET Y=INT IRND*22)
8 0 I F X + Y <24- T H E N G O T O 5 5
550 IF INKEY$="6" THEN LET Y=Y- 90 PLOT X,Y
1 0 0 P L O T X , 4-3 — Y
560 IF I N K E Y % - *A M THEN LET Y =Y + 1 1 0 P L O T 6 3 — X , 4-3 — Y
120 PLOT S3-X,Y
570 IF INKEY "Q" THEN LET X=X + 130«NEXT N
590 RETURN
• M
90 Z X C O M P U T I N G S U M M E R 1962
Etchasketch
This very short program allows and modify it to (a) give you a
you to use the keys " 5 " , " 6 " , choice of starting position;
" 7 " and " 8 " to move the PLOT and/or (b> 'turn off' the blob
blob around the screen, draw- from time to time tomove it to a
ing pictures of your choice. new position on the screen
Once you've got it running, try without leaving a trail.

10 LET FI=URL "1"


20 LET B
30 LET fi$=INKEY$
4-0 I F = THEN GOTO 3 0
60 LET ( f l $ = " 7 " ) -
70 LET B=B + (P$ = " 8 " )
80 PLOT
100 GOTO 3 0

Keep this handy reference guide t o aid you when programming your ZX81

O
Symbol Code How obtained Symbol Code How obtained

R=5H
0 • or • •••••••• 8 0 133 0

H
SPACE shifted 8

m
shifted A
1 0
0
m
shifted 1 134 0
shifted Y
2 0 10
shifted D
shifted 2 135 0
0
shifted 3
3 0 128
shifted S
shifted 7
136 0
0 shifted H
4 0 129
shifted 4
SPACE
137 0
5 0 130 shifted G
0
shifted 5

6 0 131
shifted Q 138 0
shifted F
shifted T
0
7 0 132
shifted W
shifted E

0 91

shifted 6

0
shifted R
Review

It can be pretty hard trying to


decide which computer you'll How good is the ZX81? How does In SLOW mode operation you
get a flicker-free picture.
buy. For the benefit of those it compare with the ZX80? Does Although the Z X 8 1 does
unlucky souls who do not yet
own a Z X 8 1 , Peter Freebrey it represent a good buy for not have a memory mapped
display, it refreshes and
takes a close look at the
Z X 8 1 , and compares it with
£69.95? we attempt to answer updates the screen
information while still
its predecessor, the Z X 8 0 . these questions for you. proceeding with the program it
is running. This mode is much
The Z X 8 1 gives the
impression of being more slower in operation: a FOR . . .
robust than the Z X 8 0 , and NEXT loop of 1 0 0 0 0 takes
although the keyboard is still 1 7 6 S in SLOW and 4 4 S in
the now familiar 'touch type' comprehensive and is certainly a useful FAST mode. Even though
as on the Z X 8 0 , I find the Sinclair's best yet. The Z X 8 1 improvement. When running in SLOW realty does mean
slightly textured matt finish uses the new 8K ROM which the FAST mode the Z X 8 1 slower operation it gives the
gives me a greater feeling of was announced in 1 9 8 0 . operates in a similar manner to user the option of using
control than its glossy There are some 2 0 the Z X 8 0 '— fast operation, moving graphics-apart from
forerunner. The Z X 8 1 comes commands and/or statements with a very noticeable flicker making the display less of a
complete with separate mains that were not available to the on the display whenever a key strain to the eyes I
power supply and leads to Z X 8 0 . From the list of these in is operated or command Whereas the Z X 8 0 was
connect it to your TV set and Table 1 you can see that they actioned together with a blank limited to integer calculations
tape recorder. The 2 1 2-page include the option of a FAST grey screen while the Z X 8 1 has a full floating
instruction manual is or SLOW mode — this is computations are taking place. point notation and this has

ZX C O M P U T I N G S U M M E R 1982
Review

meant the addition to its Programming RETURN, and so on. Many


keys are multifunction: some
reversed character will appear.
A reversed 'F' indicates that a
repertoire of such functions as
logs and trig. These, together Techniques are capable of generating up further set of keywords such a
with its ability to PLOT pixels For those not familiar with the to three keywords, a letter, SIN, COS, RND will be called
(quarter square graphics) Z X 8 0 , the Z X 8 1 uses a 'one that letter reversed and also a Should a reversed 'S' be
means you can draw, among touch' keyword entry graphics character! displayed then you have a
other things, sinewaves technique — when you have syntax error and the Z X 8 1 will
entered a program line number Initially this can be a little
across your TV screen to your daunting, not to say not 8llow the entry of that line
heart's content! the next requirement must be to the program until you have
a command of some confusing, but you will soon
get used to the operation of made the necessary
Another advantage of the description. The Z X 8 1 correction.
recognises this necessity and the keyboard. It has a fairly
new 8K ROM is the option of logical sequence and like any
adding a printer to your the next single key pressed
new keyboard can pose an
system. The ZX printer offers
full alphanumerics across 3 2
will result in the related
command being entered and unfamiliar operator with a few Reading Matters
appearing on the screen in initial problems.
columns and the Z X 8 1 The manual has 2 8 chapters
has the commands front of you. If you have The cursor takes the form and three appendices. Chapter
necessary to LPRINT and entered a line number and then of a reversed character: if 'K' one gives instructions on how
LUST to the printer. press key 'P' you will actually is displayed this indicates that to connect and set up the
It also has the facility to COPY, enter PRINT, press 'H' and get a keyword will be generated, Z X 8 1 for operation initially. It
which will print out exactly GOSUB, and key 'N' gives should the next key pressed also recommends that those
what is displayed on NEXT. Likewise, after THEN a have such a function. If the already knowing BASIC should
the TV screen without further command is expected: key 'P' cursor displays a 'G' then read Appendix C to familiarise
commands. again gives PRINT, 'Y' gives either a graphics symbol or a themselves with Z X 8 1 BASIC

ZX C O M P U T I N G S U M M E R 1982 93
Review
and use the remainder of the hand, you regularly use a
instruction manual as typewriter keyboard, you will
reference as and when take a few hours to adapt to
needed. The main bulk of the the diminutive size of the
book is for the novice, Z X 8 1 : but then those few
explaining clearly and hours will enable you to
concisely all the statements become accustomed to the
and commands. Most of the fact that some keys may give
chapters are essentially a up to six different results! One
'hands-on' teaching very small but important
programme in 2 X 8 1 BASIC, improvement on the Z X 8 1 is
with a number of useful its rubber feet. The Z X 8 0 and
exercises to extend the Z X 8 1 are both very light in
knowledge gained in the weight, and with its new feet
preceding text. Chapters 2 6 , at least the Z X 8 1 does not
2 7 and 2 8 introduce the idea skate all over the table as you
of machine code, the use it I
organisation of the memory,
and explain what the system All in all, I can recommend
variable are and where they the Z X 8 1 to any intending
are stored. purchaser — it is very good
value for money. It does not
Appendix A lists the have the facilities one would
character set, Appendix B
require for a business machine
gives the Report (Error) codes
but anyone wanting to learn
and Appendix C give a short
personally what a computer
r6sum6 of the Z X 8 1 and its
can do, without initially
individual characteristics
under the heading: "The Z X 8 1 spending a fair amount of
for those that understand money, should seriously
does not have these and
BASIC". The Index is useful consider one. After all, the
commands, the manual "ABCDEF"(3) = " C "
and comprehensive, giving not Z X 8 1 does not cost much
explains the use of simple
only page references but also more than the cassette
routines to obtain access to Different as this may be from
the key sequences required for the first four effectively. The recorder that you will need to
other common micros it is
all keywords and shifted latter four deal with string buy for some makes of micro.
easily understood and will
characters. manipulation, and whereas the readily yield the results you The only personal
Those who already have Z X 8 1 does not have these would expect from the more drawback to the whole Sinclair
some knowledge of BASIC will specific commands the way in usual string commands. ZX episode is that my seven-
note from the which it deals with strings is year-old son tends to look
command/statement list that comprehensive, albeit non- upon the Z X 8 0 and the Z X 8 1
there are a few common standard. It uses a notation
called 'slicing' for describing
using it as more his size! He does not
have quite the reverence for
BASIC commands that are
noticeable by their absence, substrings. This can be applied In use, the Z X 8 1 presents no the ZXs as he does for other
principally DATA, READ, to arbitrary string expressions real lasting problem to micros of the desktop variety.
RESTORE, ON-GOTO, LEFT$, and takes the general operate. If you are new to Demand for its use seems to
MID $, RIGHT $ and TL$. form . . .'string expression using a computer then you be unending and we often
These are listed in the index (start TO finish)' so that have probably used a hear "Press NEWLINE, silly!"
but not in the bold type, calculator and so the keyboard as he instructs his five-year-
indicating that they are Z X 8 1 "ABCDEF" (2 TO 5) spacing wilt not seem all that old sister in the uses of
keywords. Although the Z X 8 1 = "BCDE" different. If, on the other twentieth-century technology.

BETS ••£) BEsS HESS MS3 £2


lira H a Q g EE) bdJ 0 0 Q g 0 0 |S B

B H P R 183 E B H S C S
=\ . ;- -A\ *.* »•.:• t?OF
EB IB\mm
•GEl BQBE3) M^Q 01El 0 :
uB IB1
-.£.. A.-: v K ^ o O * ^ ^ jOSUB ^AC ^ ^
K3Ea Mi^fffli
nil hh B 0 Elj C U E H •
a \ ic; - ap~ .at ,E\ i <.:;
."-• '..i \E*T PAfSt

• SHIFT 1 Z IX I C '| v | b | n | m | f| SPACE |


HE. i- '.-t-: NO*
• 0

94 ZX C O M P U T I N G S U M M E R 1982
Review

SYSTEM/MULTIFUNCTION C O M M A N D S CODE Gives code of the first character in specified


string.
BREAK Halts run and returns to command mode. COS Returns cosine of angle (in radians).
CLEAR Deletes all variables, freeing the space they DIM Dimensions array size.
occupied. EXP Returns exponential of specified number.
CLS Clears screen — clears display file. FOR Used in conjunction with TO and NEXT to
CONT Continues STOPped program. execute a defined loop.
COPY Sends copy of display to printer. GOSUB Jumps to defined subroutine.
EDIT Returns current line (indicated in program list) GOTO Jumps to specified program line number.
to bottom of screen for editing. IF Conditional test, used in conjunction with
FAST Starts fast mode. Display file is displayed only THEN followed by specified statement.
at end of program, while INPUT data is being INKEY$ Reads keyboard, result is character of next key
typed in or during PAUSE. pressed.
FUNCTION Returns alternative keyword set. INPUT Assigns value of keyboard entry to specified
GRAPHICS Returns alternative character set. variable.
LIST Lists specified line(s) of program on screen. INT Returns integer part of number (rounded
LLIST Like LIST but using printer instead of screen. down).
LOAD Looks for specified program on tape — loads it LEN Returns length of specified string,
and its variables. LET Assigns specified value to specified variable.
LPRINT Like PRINT but using printer instead of screen. LN Returns natural logarithm of a number.
NEW Clears memory and awaits new program. PEEK Returns value of specified memory location.
NEWLINE Enters command as statement. PI T l { 3 . 1 4 1 5 9 2 6 5 . . >.
PAUSE Stops computing and outputs the display file PLOT Blacks in pixel at specified co-ordinates.
to the screen for specified time, or until RAND Sets the seed used to generate the next value
another key is pressed. of RND.
RUBOUT Deletes character to left of cursor. REM No effect on program, allows inclusion of text
RUN Executives current program. for comments.
SAVE Writes specified program to cassette interface. RETURN Returns to main program from subroutine.
Records program and variables. SCROLL Scrolls the display file up one line.
SLOW Puts computer into compute and display SGN Returns sign of number.
mode, in which the display file is displayed SIN Returns sine of angle (in radians).
continuously. SQR Gives square root of number.
STOP Stops a program that is RUNning. STEP Used with FOR . . . NEXT loops, defining
STATEMENTS increment between loops.
ABS Returns absolute value of specified variable. STR$ Returns string representation of number.
ACS Returns arcosine (in radians). TAB . Defines column in which PRINT statement will
AND/OR,NOT Comparative tests. begin.
ASN Returns arcsine (in radians). TAN Returns tangent of angle (in radians).
AT Defines position of next PRINT statement (in UNPLOT Like PLOT, but blanks out a pixel instead of
screen lines/columns). blacking in.
ATN Returns arctangent (in radians). USR Calls machine code subroutine.
CHR$ Gives character whose code is specified. VAL Evaluates a string as a numerical expression.
TABLE 1

ZX C O M P U T I N G S U M M E R 1982
HORRORVILLE
Only for the brave! Dare you take on the might of the
8K ROM in this A D V E N T U R E program for the 16K
ZX81, written in gruesome detail by N. Alexander of
Margate. Once you've survived the Alexandran horrors,
you can change lines 6000 to 6500, and 8000 to 8500
t o enter your own adventures.

1 REM flDUENTURE 14-0 IF Y $ = " S " T H E N L E T B = 3 3


2 RRND 150 IF Y $ = " E " T H E N L E T 5 = 1
5
D I M H(3> 160 IF Y $ = " U " T H E N L E T 6 = -l
10
D I M Z (15i 170 L E T ft=ft+B
15
LET R.13S 175 IF P E E K iP+ft) = 0 T H E N G O T O
20
GOSUB 9000 300
30
G09UP 1500 190 If* Rxl75 THEN GOTO Z (1J
4-G
CL9 200 IF ft =4.4.6 T H E N GOTO Z (£>
50
L E T H $ = " 3NftKE " 210 IF ft a 1 6 0 T H E N GOTO Z ( 3)
GOSUB 1000 220 IF R -53 1 THEN GOTO Z (4)
11*3 P R I N T " N , E , 3 O R U 230 IF ft = 2 3 6 T H E N GOTO Z (S)
1 1 5 PftUSE 9 9 9 9 24.0 IF ft = 1 6 6 T H E N GOTO Z (6)
120 L E T Y $ = I N K E Y J 250 IF O=290 THEN GOTO Z (71
130 IF = THEM LET B--33 260 IF ft = 6 1B T H E N GOTO Z CS)

96 ZX C O M P U T I N G S U M M E R 1982
16K Games
270 IF FI=2?5 T H E N GOTO 2 (9) 1630 RETURN
280 IF R =54.0 T H E N GOTO Z ( 10) 2 0 0 0 CLS
2 9 0 IF R = 3 7 1 T H E N GOTO Z t 11) 2005 PRINT "ON YOUR LEFT YOU CRf i
3 0 0 IF R = 2 3 9 T H E N GOTO Z < 12) SEE T W O "."KEYS DO YOU URNT TO
3 1 0 IF R =4-52 T H E N GOTO Z < 13) PICK ONE UP?"
3 2 0 IF fl-161 THEN GOTO 7301 2010 INFUT Y $
330 GOTO 100 20 1 2 IF Y $ = " N " T H E N C L S
1000 P R I N T RT 0 , 0 , ' R D U 2 0 1 5 IF Y $ = " N " T H E N G O T O 100
E N T U R E"
1010 PRINT
2020 PR I N T U H I C H K E Y D O Y O U URN
T . 1 OR 2 ? "
1012 PRINT 3TRRT 2025 INPUT Y
END " 2 0 3 0 LET R $ = "KEY ONE
1014 P R I N T 2 0 3 5 IF Y = 2 T H E N L E T P l = " K E Y TUC
204-0 C L S
1020 PRINT 2 0 4 5 P R I N T ' R E M E M B E R Y O U R R E NO!,
CRRRYIMG"
130 PRINT 2050 FOR 1=1 TO 50
2055 NEXT I
2060 C L S
2065 GOTO 100
2500 CL3
2 5 0 5 P R I N T "ON R I G H T IS R P
L R N K OF W O O D " . DO YOU URNT TO C
RRRY IT° "
2510 INPUT Y $
2 5 15 IF Y $ = " N " T H E N C L S
2 5 2 0 IF Y J = " N " T H E N G O T O 100
2525 LET P$="UOOD"
2530 CLS
2 5 3 5 PR I N T R E M E M B E R Y O U R R E CR»
RYING R$
254.0 F O R 1 = 1 T O 5 0
2545 NEXT I
2550 CLS
2555 GOTO 100
3 0 0 0 CLS
3 0 0 5 P R I N T " R T Y O U R F E E T IS R D 1
R M O N D ,"NECKLACE DO YOU U R N T T O
P ICK" /'IT UP"
3 0 10 I N P U T Y $
3 0 1 5 IF Y $ = " N " T H E N C L S
3 0 2 0 IF Y $ = " N " T H E N G O T O 100
3025 PRINT "DONT FORGET:- YOU HP
1155 LET P=PEEK (16396)+256*PEEK U E P I C K E D ' "UP R N E C K L R C E "
T16397) 3030 LET R $ = " N E C K L R C E "
1160 POKE P T R . 1 6 0 3035 FOR 1=1 T O 50
1165 RETURN 304.0 N E X T I
1500 GOSUB 9 G 5 0 3045 CLS
1 5 0 5 P R I N T *' Y O U R R E CFIPT I U E IN 3050 GOTO 100
R GIANTS" 3500 CLS
1510 GOSUB 9 0 5 0 3 5 0 5 P R I N T "DO Y O U U R N T T O PICK
1515 PRINT "CRSTLE R N D T H E ONLY U P fi P I E C E " . " O F R O P E ? "
WRY Y O U C R N " 3510 INPUT Y $
1520 G O S U B 9 0 5 0 3 5 1 5 IF Y * « " N " T H E N C L S
1 5 2 5 P R I N T " E 5 C R P E IS T O T R R U E L 3 5 2 0 IF Y $ = " N " T H E N G O T O 1 0 0
THROUGH " 3 5 2 5 P R I N T "THE R O P E IS Y O U R S . "
1530 GOSUB 9 0 5 0 3530 LET R $ = " R O P E "
1 5 3 5 P R I N T "R N E T W O R K O F U N D E R G R 3 5 3 5 FOR 1 = 1 TO 3©
OUND CRUE5" 3540 NEXT I
154-0 G O S U B 9 0 5 0 3545 CLS
1545 P R I N T "BUT B E U R R E " 3 5 5 0 G O T O 10©
1550 G O S U B 9 0 5 0 4000 CLS
1555 G O S U B 9 0 5 0 4 0 1 0 PRINT "YOU H R U E TO C L I M B UP
1560 P R I N T "YOU UILL C O M E UP R G R R 3 M R L L " , " C L I F F . HR'JE Y O U G O T R
INST " ROPE?"
1565 G O S U B 9 0 5 0 40L« INPUT Y $
4 U A A IF Y $ = "Y ' R N D R $ = " R O P E " T H E
1570 PRINT "PERILS RND D E C I S I O N S N O O T O 4.200
1575 GOSUB 9 0 5 0 4 0 2 1 IF Y $ = " N " T H E N G O T O 4 0 2 3
4»fi& P R I N T " O H N O Y O U H R U E N T "
1580 PRINT "YOU MRY BE O F F E R E D U 4030 PRINT "THEN YOU MUST BORROW
*RIOUS" O N E O F " , " O U R S O N E IS S R F E R N D
1585 GOSUB 9 0 5 0 O N E IS N O T ' " C H O O S E Y O U R R O P E : - 1
1590 PRINT "OBJECTS BUT Y O U MRY OR 2 "
ONLY CRRRY" 4032 LET H$ ="2"
1595 G O S U B 9 0 5 0 4 0 3 5 IF R N D < .5 T H E N L E T H $ = " l "
1600 PRINT "ONE RT R T I M E R N D M U 4 0 4 0 I N P U T 1$
ST D E C I D E " 4 0 4 5 IF I $ = H $ T H E N G O T O 4 2 0 0
1605 G O S U B 9 0 5 0 4050 PRINT "YOU CHOSE URONG SPLR
T"
1610 P R I N T " U H I C H UILL BE M O S T U 4055 GOTO 9800
SEFUL" 4 206 PRINT "OK.YOU MRY CONTINUE
1615 GOSUS 9050 4 203 FOR 1=1 T O 50
1620 PRINT " R E R D Y ° PRESS RNY f 1210 NEXT I
EY T O S T R R T "
1625 PRUSE 9999
ZX C O M P U T I N G S U M M E R 1982 97
16K Games
4215 CL5 5930 CLS
4220 GOTO 100 594.0 G O T O 1 0 0
4500 CL5 6500 CLS
4 5 05 PRINT "YOU M U S T MEET THE OG 6505 LET T $="TOILET ROLL"
RE" . "HRUE Y O U R G I F T FOR H I M ? " 6 5 1 0 IF R N D < .3 T H E N LET T$ = "SHOE
4 510 INPUT Y$
4 5 1 5 IF V $ = " N *' T H E N G O T O 4 7 0 0
4 5 2 0 IF R N D < . 8 T H E N G O T O 4 S 0 0
4530 PRINT "SORRY THE OGRE DOES 6 5 2 0 IF R N D > . 6 T H E N LET T $= "DERD
NOT L I K E " , R $ FISH"
4 5 3 5 FOR 1=1 T O 90 6 5 3 0 PRINT "RHR Y O U SRY I CRN ",
4540 PRINT "RIP "; " S E E R " .T $
4 545 NEXT I 6540 PRINT "BUT UILL YOU PICK IT
4550 GOTO 9800 UP'*"
4 7 0 0 P R I N T " T H E N BE ON Y O U R U R Y 5550 INPUT Y $
R N D D O H O T " . " T R Y T O C O M E T H I S Ufi 6 5 6 0 IF Y $ = " N " T H E N CLS
V RGRIN" 6 5 7 0 IF Y $ = " N " T H E N GOTO 100
"•SQ0 L E T R « = T S
4705 LET R=R-B
4710 CLS
4715 GOTO 100
4 8 0 0 IF R $ = " 0 " T H E N G O T O 4-530 5590 PRINT "NOU YOU HRUE YOUR UE
4 8 0 5 P R I N T "OK H E L I K E D T H E " ; R $ RY O U N " ; T $
480© FOR 1=1 T O 5 0 5600 FOR 1=1 T O 50
4807 NEXT I 6610 CLS
4810 CLS 6620 GOTO 100
4815 GOTO 100 7000 CLS
5000 CLS 7010 PRINT "YOU R R E C R R R Y I N G ",R
5005 PAUSE (RND*J.0> $;" SO DO Y O U " t " U R N T T O PICK UP
5010 PRINT "YOU HPUE COME T O T H R SOME URCCINE", INSTEAD?"
EE D O O R S " . " C H O O S E Y O U R DOOR,1.,2 7020 INPUT Y $
OR 3" 7 0 3 0 IF Y $ = " Y " T H E N L E T R $ s " U f i C C
INE "
7040 CLS
7 0 5 0 G O T O 100
5020 INPUT Y 7490 GOTO 850O
5030 LET X=RND*4 7 5 0 0 G O T O 8S00
5040 FOR 1=1 T O 3 750 1 CLS
5050 LET X =X + 1 7 5 1 0 F O R 1 = 1 T O 4-2
5050 IF X > 3 T H E N L E T X = 1 7520 PRINT "COMGRflTULRTIONS'
5070 GOSUB 5060+(1+10) 7530 NEXT I
5075 NEXT I 754 0 G O T O 9 9 5 0
5076 LET R=H(Y)
5079 CLS
5080 G O T O 100 5b00 CLS
5090 LET H ( X ) = I 3 S 8 5 0 5 PR I N " Y O U HR'JE C O M E R C R O S 5
5095 RETURN R PLRGUE " . " O F RRTS"
5100 LET H(X)=291 8 5 1 0 IF R » = " U R C C I N E " T H E N P R I N T
5105 RETURN "BUT LUCKILY Y O U CRN USE Y O U R " , "
5110 LET H(X)=519 U R C C I N E .YOU M R Y C O N T I N U E "
5115 RETURN 8 5 2 0 IF R $ i " U R C C I N E " T H E N G O T O 6
5500 CLS 300
5510 P R I N T "RHEfiD I S R D O O R IN F 8 5 3 0 IF R N D < . 2 T H E N G O T O 3 6 0 0
RONT O F " , " U H I C H IS R L R R G E 5LEE 6 5 4 0 P R I N T " Y O U H R U E N O I'RCCINE
PING GIRNT" . "H.qUE Y O U GOT R KEY7 RUN QUICKLY"
354-5 L E T ft=ft-6
8550 GOTO B3O0
86O0 PRINT "THE RRTS SIT YOU AND
5520 INPUT Y $ HRUE"."NO URCCINE SORRY"
S 5 3 0 IF Y $ = " N " T H E N G O T O 5 9 0 0 6610 GOTO 9950
554-0 IF R $ = " K E Y O N E " O R R £ = " K E Y 6 9 0 0 FOR 1=1 T O 50
TUO" THEN GOTO 5600 ©910 NEXT I
5550 PRINT O H N O Y O U HRl'ENT" 6 9 1 5 IF R $ s " U A C C I N E " T H E N L E T R $
55B0 GOTO 5900 = "O"
S60O LET T = RND 8920 CLS
5 6 1 0 IF T < . 2 T H E N P R I N T THE GIR 8 9 3 0 G O T O 100
N T R T E Y O U 11 9 0 0 0 L E T X s R N D 1 4.
5 6 2 0 IF T < . 2 T H E N G O T O 9 9 5 0 9 0 0 2 F O R N = 2 0 0 0 TO 6 5 0 0 iTEP 5 0 0
5 6 3 0 IF T > . 7 T H E N P R I N T " S O R R Y Y 9005 LET X=Xtl
OUR KEY D ID N T F I T N O U "."THfiOU I
T RURY"
5 6 4 0 IF T > .7 T H E N L E T R $ = " O "
5 6 5 0 IF T > - 7 T H E N L E T R = R - B
5 6 6 0 IF T > . 7 T H E N G O T O 5 9 0 0 9010 IF X > 1 3 T H E N L E T X =1
5 6 7 0 P R I N T "OK Y O U R K E Y F I T S Y O U 9015 LET Z(X)-N
MRY " , " C ON T I N U E " 9020 NEXT N
9025 RETURN
9050 SCROLL
9055 FOR N=1 TO ©
5630 GOTO 5910 9060 NEXT N
5900 P R I N T "SO BE ON YOUR URY 9065 RETURN
5905 LET R=R-B 9950 P R I N T " RGRIM"* '*
5910 FOR 1=1 T O 50 9960 INPUT Y *
5920 NEXT I 9970 IF Y * = " V " T H E N R U N

98 ZX C O M P U T I N G S U M M E R 1982
Make sure you get every issue of Z X Computing.

Just £7.00 will ensure the next four issues will be


lovingly wrapped and posted to you. Just fill in the
form below, cut it out and send it w i t h your cheque
or postal order (made payable to ASP Ltd) to:-

ZX Computing Subscriptions
513 London Road,
Thornton Heath,
Surrey CR4 6AR

Alternatively you can pay by Access or Barclaycard


in which case simply fill in your card number, sign the
form and send it o f f . Do NOT send your card!

Make the most of your ZX computer w i t h ZX Computing

Subscription Order Form I am enclosing my (delete a* necessary)


Cheque/Postal Order/International Money
Order for £
(made payable to A.S.P. Ltd)
Cut out and SEND TO: OR
Debti m y Access/Barclaycard'
('delete as necessary)
ZX COMPUTING Subscriptions
513, London Road,
Thornton Heath,
Surrey, England. Please use B L O C K C A P I T A L S a n d include post codes.

Please commence my subscription to ZX Computing Name! Mr/Mrs/Miss)


with the autumn issue. delete accordingly
Address

SUBSCRIPTION £7 for 4 issues


RATES UK
£15.15 for 12 issues
(tick — as Overseas and air-mail Signature

appropriate) rates upon application. Date

99 ZX C O M P U T I N G S U M M E R 1982
( M a i l Order DeptE )
99 East St, Epsom Surrey, Tel 03727 21215
quoting your credit card 24 hr phone service
* REQUIRE 16K RAM A i r IVIail Europe plus 70 p Elsewhere plus 111.7i)J

HEWSON Just look at these features


* 8 16K can be switched in and out in 4K blocks to leave space
for memory mapping.

CONSULTANTS * 12-16K can be proiected against overwriting during loading


from cassette.
' Directly addressable and user transparent
H I N T S A N D T I P S f o r t h e 2 X 8 1 by A n d r e w Hew- * Up to 15K of basic program area
son £4.25 " 32K or more of variable area
"Good value and quite fascinating a very inexpensive way ol P R O G R A M M E R S TOOLKIT £6.50
acquiring months of programming experience" YOUR Are you writing your own programs for the ZX81? Then use our
COMPUTER Nov 81. TOOLKIT to do the donkey work Copy into RAM before you
"Excellent very good value for money" SYNC start work and then you will have it at your fingertips
Saving Space Understanding the Display File Converting Comprehensive LINE RENUMBER including GOTOs and
ZX80 Programs Chaining Programs (pass data between GOSUBs; LOAD. EDIT and RUN machine code programs.
programs, call subroutines from cassette, establish data files* INSPECT the ZX81 system routines; COPY them mio R A M and
Machine Code Programs (write, load, edit, save and debug PATCH and/or EXTEND them, FIND a given piece of Basic code
machine code) and REPLACE all occurrences of it, move blocks of Basic lines
Routines and programs are scattered liberally throughout the text with EDIT.
and the final chapter consists of twelve useful, interesting and
entertaining programs SPACE INTRUDERS £5.95
40 alien ships in each squadron. All acnon 1
16K R A M P A C K £37.50 display Automatic option the machine
/ «"
A top quality add-on 16K dynamic memory specially designed tor plays itself - can you do better? Written in
the ZX81 Simply plugs into the port at the back of your Sinclair machine code for super fast lun. Squadron ^ U'
Can be used in conjunction with the ZX printer Neatly packaged after squadron attack your position Three .
in a black plastic she'1 to match your ZX81 incredible value, why laser bases. Full score display.
pay more? STATISTICS £3.75
SPECIAL OFFER a free copy of our super Space Intruders Three programs on the one cassette
cassette will be sent with every 16K RAM order before 1 5 82 1) il Statistics — prints the curreni mean and standard deviation
after each value ts entered
Z80 O P C O D E S £1.45 ill Regression prints the current mean and standard deviation
A must for the beginner and the experienced programmer alike of the y and x values and the intercept and slope of the
This handy ready reckoner lists all 600 plus Z80 machine code iegression line.
instructions in decimal and hexadecimal with their mnemonics. nil Trend - prints the current mean and standard deviation of
Each Op code is succinctly explained and cross-referenced the y and x values and the intercept and slope of the trend
Supplied m a protective transparent wallet for easy reference and lines.
durability. 2) CHI SQUARED TEST - prints the current value of the Chi
squared statistic and the current sample size
M E M O P A C K 64K R A M £79.00 3) GRAPH PLOT plots a graph cf data entered from the
keyboard.
Developed by Memotech this amazing 64K RAM needs no extra
power supply Simply plugs neatly and lirmly into the rear port of Cheque w i t h order or quote Access or Barclaycard number
your 2X81 Can be used with the ZX printer and other add on to: H E W S O N C O N S U L T A N T S Dept L. 7 G r a h a m s Close.
hardware B l e w b u r y , Didcot. O x o n OX11 9QE. TEL: (0235) 850075

100 ZX C O M P U T I N G S U M M E R 1982
ZX80 Programs

ZX80 fights back


Music
Kev Molloy decides the days of silent
movies are over, and produces a
routine to turn your ZX80 into a music
machine.
Kev's program plays a passable N; F sharp — L; G — J; G sharp 10 LET B$ = " 2 4 2 3 1 2 4 2 3 1 2 4 2 3 1 2 4 2 4 2 4 2 3 1 2 4 2 3 1
version of Greensleeves in this - M; A - G; 8 flat - E; B - C; 2312312426692242312423124266922423124
program, which is stored as a C — A; C sharp — 8; D — sharp; 2312C"
string. The length of each note D sharp - 6; E - 5; F - 4; F 20 LET T $ = " G A 7 5 4 5 7 C J G C A G G H G C H P G A 7 5 4 5 7 C J G C
is stored in another string. The sharp - 3; G — 1; G sharp - 0 . ACGHLHGGG1 1 357CJGCAGGHGCHP1 1 3 5 7 C J G C A G
higher the number (from one to Although this is only a rough HLHG
eight) the longer the length of guide, it works on most occa- 30 IF B$ = " " THEN STOP
the note. The key for notes is as sions and whenever it sounds a 40 LET N = CODE{T$) - 2 8
follows: bit off, all you need to do is add 50 LET P = (CODE(B$) - 2 8 ) * 10
D - V; D sharp - R; E - P; F - or subtract one or two. 60 FOR I = 1 TO P
70 LET D = 1 * * N
80 NEXT I
90 LET 8$ = T L $ ( B $ )
100 LET T$ = TL$(T$)
110 GOTO 3 0

ZX C O M P U T I N G S U M M E R 1982 101
mmm

ZX80 Programs

Battleships
A boom, boom here, and a bang, flash
there, and devastation covers the
seas, in J Calderwood's version of the
old pencil and paper game.
Here's your chance to play puter will then show where 70 LET Z(Y) = 1 0
battleships against the Z X 8 0 . your bomb landed. If you hit a 80 LET Z(Y - 1) = 1 0
The programs asks you to enter ship, it will be shown in inverse
90 LET Z(Y + 1) = 1 0
a number up to 10, and a letter otherwise it shows as an
100 NEXT X
to J. These are to be entered asterisk. You have to try and
110 INPUT A
one at a time. The clever com- land three bombs on each ship.
120 INPUT B$
5 RANDOMISE 130 LET B = CODE (B$)
10 PRINT "BATTLESHIPS" 140 LET B = ( 1 0 * ( B - 3 8 ) ) + A
20 PRINT 145 IF Z(B) = - 1 OR Z(B) = 9 THEN GOTO 1 10
21 PRINT "THERE ARE 8 SHIPS EACH 3 SQUARES LONG" 150 LET Z(B) = Z(B) - 1
22 PRINT "ENTER A NUMBER UP TO 1 0 " 155 CLS
24 PRINT " A N D A LETTER UP TO J " 160 PRINT " 1 2 3 4 5 6 7 8 9 1 0 "
30 DIM Z( 1 0 0 ) 200 FOR T = 1 TO 1 0 0
40 FOR X = 1 TO 8 210 IF Z(T) = 0 OR ZIT) = 1 0 THEN PRINT " " ;
50 LET Y = RND(99) 220 IF Z ( T ) = - 1 THEN PRINT " * " ; •
60 IF 1 0 M Y / 1 0 ) = Y OR 1 0 " ( ( Y - 1 )/10) = Y - 1 THEN 230 I F Z | T ) = 9 THEN PRINT C H R $ | 1 4 8 ) ;
GOTO 5 0 235 IF ( T / 1 0 P 1 0 = T THEN PRINT C H R $ ( 3 7 + T / 1 0 )
6 5 IF Z(Y) = 10 OR Z{Y - 1 ) = 1 0 OR Z(Y + 1) = 1 0 THEN 240 NEXT T
GOTO 5 0 250 GOTO 1 1 0

102 ZX C O M P U T I N G S U M M E R 1962
ZX80 Programs

Catch 80
90
LET Z = Z + 1
INPUT C
Avoid being trapped by your sneaky, 100
110
GOSUB 5 0 0
GOSUB 6 0 0
little ZX80. 120 POKE M , 0
130 IF C = 6 AND A < 1 0 OR C = 7 AND A > 1 THEN LET
The object of this game by position. A = A — 1*C+13
I Soutar is to avoid getting nab- If you move onto the black 140 IF C = 5 THEN LET B = B - 1
bed by the computer. You square, all hell will break loose. 150 IF C = 8 THEN LET B = B + 1
move by entering " 5 " to move Well, actually it won't, but the 160 GOSUB600
left, " 6 " to move down, " 7 " game will end, and the Z X 8 0 170 IF PEEK(M) = 1 2 8 THEN GOTO 4 0 0
to move uo or " 8 " to move will tell you how many moves 180 POKE M , 2 0
right. When you've moved, the you survived. Anything over 9 5 190 LET D = RND(4)
Z X 8 0 will place a black square is very good, and you'll be 195 IF A = 1 0 AND D = 4 OR A = 1 AND D = 3 THEN GOTO
on one of the four sides of your awarded a gold star. 190
200 LET D = (D = 1) - 1 • (D = 2) + 3 3 # < D = 3) + 3 3 ' I D - 4 )
210 GOSUB500
1 RANDOMISE 220 GOSUB600
2 LET B = 1 6 230 POKE M + D, 1 2 8
4 LET A = 6 240 GOTO 8 0
6 LET M = 0 400 CLS
8 LET P = 0 410 PRINT " Y O U LASTED FOR";Z;*'MOVES"
10 LET W = 0 499 STOP
12 LET D = 0 500 LET P = PEEK(1 6 3 9 7 1
14 LET C = 0 510 IF P > 1 2 7 THEN LET P = P - 2 5 6
20 LET Z = - 1 520 LET W = PEEKd 6 3 9 6 ) + P * 2 5 6
25 GOSUB700 530 RETURN
30 FOR I = 1 TO 9 600 LET M = W + ( A - 1 ) * 3 3 + B
40 PRINT,,,, 610 RETURN
50 NEXT I 700 FOR 1 = 1 TO 3 2
52 GOSUB 7 0 0 710 PRINT C H R $ ( 1 2 8 ) ;
60 GOSUB500 720 NEXT I
70 POKE W + 1 8 1 , 2 0 730 RETURN

Shift
190 FOR C = 0 TO 3
200 LET D = B * 4 + C
210 IF A I D X 1 0 THEN PRINT " " ;
winging across the seas from New 220
230
IF NOT A ( D ) = 16 THEN PRINT " ";A(D);
IF A(D) = 1 6 THEN P R I N T " ";CHR$(128);
Brunswick, Canada, is Joseph Ho's ZX80 240 IF AID) = 1 6 THEN LET G = D
game based on the slide games in 250 NEXT C
which tiles with the numbers one to 260
270
PRINT
PRINT
15 have to be arranged in order. 280 NEXT B
290 LET E = G / 4 + 1
When you press RUN, you'll see appears if you try to cheat. The 300 LET F = G - ( G / 4 ) * 4 + 1
a 4 x 4 grid. On it are the number you've entered, if you 310 FOR B = 0 TO 15
numbers one to 1 5, and an in- haven't cheated, and all the 320 IF A(B) = B + 1 THEN NEXT B
verse space. The numbers are numbers between it and the 325 IF B = 16 THEN GOTO 2 0 0 0
scrambled, and you have to try space will shift one place 330 PRINT
and put them in order with the towards the space and the 340 PRINT "NUMBER?"
black square in the lower right- space will appear in the place of 350 INPUT B
hand corner. The black square the number entered. Once 360 IF B < 1 OR B > 1 5 THEN GOTO 1 0 0 0
represents an empty space. you've solved the problem, the
370 FOR C = 0 TO 15
The numbers can be moved Z X 8 0 will tell you how long it
380 IF NOT A(C) = B THEN NEXT C
around by entering a number took you to do it. You'll find it
390 LET B = C / 4 + 1
that is directly above, below, fairly easy to convert this pro-
400 LET D = C - ( C / 4 ) * 4 + 1
directly to the left or to the right gram to run on a Z X 8 1 ,
410 IF NOT B = E AND NOT D = F THEN GOTO 1 0 0 0
of the space. A rather quaint although it will not fit within 1K
420 LET l = A B S ( C - G )
error message — DO OVER — as does the Z X 8 0 version.
430 IF D = F T H E N LET U I / 4
10 DIM A l l 5) 440 FOR H = 0 TO I - 1
20 FOR A = 0 TO 15 450 IF D > F THEN LET A(G + H) = A(G + H + 1)
30 LET A(A) = A + 1 460 IF D < F THEN LET A(G - H ) » A ( G - H - 1)
40 NEXT A 470 IF D > E THEN LET A(G + H * 4) = A((G + H • 4) + 4)
50 FOR A = 2 TO 15 480 IF D < E THEN LET A ( G - H * 4 ) = A((G - H * 4 ) - 4)
60 LET B = R N D | A > - 1 490 NEXTH
70 LET C = A(A) 500 LET A(C) = 1 6
80 LET A(A) = A(B) 510 NEXT A
90 LET A(8) = C 1000 PRINT " D O OVER"
100 NEXT A 1010 GOTO 3 5 0
110 FOR A = 0 TO 1 0 0 0 2000 PRINT " Y O U DID IT IN " ; A ; " M O V E S "
140 CLS 2010 CLEAR
150 PRINT" SHIFT" 2020 PRINT "TYPE Y TO PLAY A G A I N "
160 PRINT " " 2030 INPUT A$
170 FOR B = 0 TO 3 2040 IF A$ = " Y " THEN RUN
180 PRINT 2050 PRINT " HOPE YOU HAD FUN"

2X C O M P U T I N G S U M M E R 1982 103
Software

Down
If I had to choose just one pro- copy the screen to a printer to
gram to impress an audience prove to myself that these
with the capabilities of the amazing pictures were made up
Z X 8 1 , then J K Greye's " 3 - D from the standard Sinclair

in t h e
Monster M a z e " would be the character set.
one without a doubt. Written So the graphics are great,
mainly in machine code, this but how good is it as a game?
9ViK game includes graphics I'm pleased to be able to say
which had me checking that the that it is very good indeed.
program was really being run on There is on-screen scoring as

Depths
a Z X 8 1 , rather than one of the you move around, plus bonus
micros that measure their price, points if you find the exit, which
as well as their memory, in Ks. involves yet more graphics ef-
The impressive features of fects. The exit is a moving
this program start even before kaleidoscope of letters and
the game itself begins. A symbols which grows as you
c l e v e r l y - d r a w n c l o w n an- approach it. But beware of
nounces the instructions which being hypnotised by it, as Rex is
scroll up the right-hand side of always close by to wake you
the screen. The clown even up.
doffs his hat (although I must Phil Garratt takesU the plunge If you find the exit, a new
admit that at first I thought his
head had fallen off, even these
with J K Creye's 3-D Monster maze is created and your score
is carried forward. If you do
graphics have some limitations).
Any program which can liven
Maze". happen to end up in Tyranno's
tummy, you get the opportuni-
up the presentation of the in- response is instantaneous. y o u . . . or when you find the ty to start again with the same
structions has to have a lot go- There is a real sense of motion e x i t . . . so this is no game for maze, so you can build up your
ing for it. through the maze if you keep the faint-hearted. You are told if chances of escape.
The Z X 8 1 goes into FAST your finger on 'forward'. Hav- he is getting close, although if With such a professional
mode to set up the maze, and ing played a couple of very slow you're lucky (?) you'll see him standard of presentation main-
when it is complete, you are 3-D mazes written in BASIC, lumbering towards you, getting tained throughout the program,
g i v e n an e x c e l l e n t 3-D this program would have been bigger and bigger, the jaws it deserves to do very well in-
representation. All walls are streets ahead . . .if it wasn't opening wider and wider. Even deed. I certainly haven't seen
shaded and passages to the left for Rex, after playing the game many anything like it before, but I
and right can be seen clearly Rex is t h e u n f r i e n d l y times, the sight of him still hope it is just the start of
quite a way ahead. Keys 5, 7 neighbourhood dinosaur who makes me jump. Truly the stuff 'realistic' graphics games for
and 8 are used to turn left, go inhabits the maze. You only of nightmares. The graphics are the Z X 8 1 . " 3 - D Monster
forward and turn right, and the score points when he is chasing incredible and I found I had to M a z e " is E 5 . 9 5 .

SCGRSE SCORE
5.3 75

YOU
HRUE
ELUDED
J i i i f i s HIM
RND
SCORED
POINT S
SCORc
105 R E X IS
UERY
RNGRY.
YOU,LL
NEED
MORE
LUCK
THIS
TIHE .

104 ZX C O M P U T I N G S U M M E R 1982
Software

Orwin strikes again


Cassette T w o contains 1 0 Graham Charlton spends an afternoon LASER BASES: You and the
games in BASIC, dubbed on
each side of the cassette in a with Michael Orwin's Cassette Two and Z X 8 1 each have 1 0 laser
bases. The object — needless
different order. My first impres- finds that although the graphics for to say — is to destroy your op-
sion of Cassette T w o was one
of slight disappointment after
all the programs are good, the games ponent's bases. On each turn

reading highly enthusiastic themselves are a mixed bag. you have the option to fire,
shield or do nothing at all. You
reviews of Cassette One. are supposed to make your
However, after going through decisions at the same time as
the programs for a second time, the Z X 8 1 , when it displays its
and taking a closer look at decision and then asks for
them, I feel there is much to be
said for Cassette Two. There is
OTHELLO
J yours. After this it displays
what has happened to each
a good selection of games, and base and the new positions. I
the clear graphics show what IT"5 MY TURN found it hard to resist the temp-
can be done when you have tation of cheating by changing
1 6K to play with. All programs my decisions after seeing what
need more than 1K. YOUR LRST the Z X 8 1 had done. Perhaps
The games on the cassette
MOUE URS: the game could be written so
are by P.Canter and C.Panayi, that this cheating was not
IR-H) possible.
except for Laser Bases and Rec-
tangles by Mr Orwin himself, 3 3 ® t o - © ) = g WORD MASTERMIND: This is a
and P.Rushton's Roulette. I nice variation on the numerical
found no trouble loading the Mastermind games. It has a
programs, which all start MY LRST NOUE vocabulary of over 1 0 0 words
automatically. The instructions URS TO 8 0 which can be changed fairly
are included in the programs for easily. The vocabulary is not in
all but two of them, and rules the visible program, but you
for these are supplied in an ac- won't find it very hard to get the
companying leaflet. >>> I RM THINKING < < Z X 8 1 to reveal what words it is
I'll go through the games one holding. This is a very good pro-
by one. gram, and it really got me think-
OTHELLO: The programming in THE GAME OF RUhRI ing.
this case is unwise (as in most RECTANGLES: Horrorsl The in-
of the other games on the structions for this game come
cassette) with the rules at the on a separate sheet. They read
beginning of the listing, rather like a script for the Monty
than the end, thus slowing Python Show. I haven't a clue
down every GOTO and GOSUB how to play the game, despite
access. You get four options at repeated attempts, and I can't
the beginning of the game: " D o work it out from running the
I play my best?", "Fast or program. Perhaps an example
slow?", "White or black?" and in the rules would have helped a
"Do you want to go first?". The little. In its favour, this program
square chosen by the Z X 8 1 is has a full-screen display, and a
flashed off and on a few times little machine code is included
before it makes its move, to to speed it up.
show clearly where it is playing. CRASH: You use the cursor
The program points out how YOUR SIDE keys to steer your chequered
many pieces the Z X 8 1 is cap- YOUR MOUE
worm to try and trap a black
turing. There are polite com- worm, controlled by the zany
ments on attempted illegal ZXB1, to ensure that it cannot
moves and a comment on the HI - IT"S RRINING PENNIES TODRY move without hitting you or
game when it is finished. The itself. It is trying to do the same
program display is great, but . 3U MRKE ME SHOOT RT THEM EX- thing to you. Very addictive,
the program does not play par- although a touch on the slow
ticularly well. There are much PRESSING RNY KEY AFTER THEY
side. However, if it was any
stronger (and more expensive) faster, I'm sure I'd lose every
Othello p r o g r a m s on the
EEGIN TO DROP.
time.
market. . -JU HFIUE SO SHOTS TO FIRE. ROULETTE: This is a great way
AWARI: This is a game of to try out your betting system
strategy, again with a clear, HFTESS ANY KEY TO PLAY before going to Monte Carlo.
full-screen display. The Z X 8 1 O There are 10 different ways of
plays quite well, but there is no betting, and the system to
option on the level of play, and enter your bets is easy to under-
the whole game is over fairly stand. Although the game
quickly. This program is fairly seems to simulate the rules of
easy to beat. It provides a good 'proper' roulette properly, I
game if you don't think too found that a system I invented
hard. enabled me to amass a vast for-

ZX C O M P U T I N G S U M M E R 1982 106
s o f t w a r e

tune. I'm tempted now to try done using good graphics


the system in real life. When the when you have 16K to play
'wheel' is spun in this program, with.
I think it would be good for the PENNY SHOOT: In this pro-
squares on the board to flash or gram, you make a robot shoot
something, rather than just at pennies which are raining
overprint a series of random down from the sky. The intro-
numbers below the board. duction to the program was a
PONTOON: Ho hum, you might nice touch, more fascinating
think. But you'd be wrong. This than the game itself. A little
program — which features an figure appears to read the in-
excellent display of the cards — structions as they appear, then
shows just how much can be turns and shoots a sample pen-

ROULETTE
ODDS
A N Y N U M B E R = 3 5 T O 1
ANY T U O s l ? T O 1 U E L L D O N E . T H A T U R S R R T H E R Q U I C K .
ANY ROU(3)=11 T O 1 A N O T H E R G R M E ?
.qSGR OP «i=S T O 1
2 R O U S O F 3 = 5 T O 1
1 S T T U E L U E = 2 TO URITE D O W N Y O U R M D U E 5 F O R T H I i
S N D T U E L U E = S T O 1
3 R D T U E L U E = 2 T O 1
T O 1 3 1 3 3 3
ANY C O L U M N = 2
O D D OR E U E N = 1 T O 1 II S S 0 S B m
B L A C K • U M XT E - 1 T O
M R N O U E ( 1 - 1 S ) = 1 TO AY LOT
P f i S S E ( 1 9 - 3 6 ) = 1 T O M N O

Y O U H A U E G O T £ 1 0 0 ©

WANT B E T T I N G I N S T R U C T T O N S ' ? F.Y ,' N I

THE BPWK HAS.


YOUR CREDIT I 3 : £ 1 0 0 0 a a a a E 2
I 1 3 i 1 3 3

JU S T U C K RT 1 3
I l I ^ S l L E S 6 S C O R E £ 3 1 M A X .
YOUR STAHC
1 5 : £ 1 & &

~ UILL STICK WITH 13

I H A U E U O N £l(3tf

S-SHOU
X X XX
X X X X
X X X X
x x x x
X X XX POOO ny. This program is not par- really good additions to the
x x x x b o c ticularly challenging. package. The programs alt
X X X X b o o G U N C O M M A N D : This is show how well the somewhat
x x x x b o o another moving action game limited graphics of the Z X 8 1
x x x x b o o where you try to intercept can be made to perform,
X X X X p o o
missiles traversing the screen. although they also indicate that
x x x x p o o
It's OK, but like PENNY SHOOT
x x x x boo could be a bit more challenging.
there is a temptation to 'dress
up' fairly shallow programs in
p o d S E E
o o o Overall, for the £ 5 this pro- fancy clothes to disguise them.
o o o gram costs, ft represents good Despite all these comments, it
p ot value for money, with the good represents a good selection of
p o i programs outweighing the games. You're sure to find one
p o o weaker ones. However, I feel or two favourites which you'll
that a few of the lower standard play over and over again.
3 games were added more to Cassette T w o is £ 5 from
NOPOR'5TL* f
wxvz make up the numbers than be Michael Orwin.

106 ZX C O M P U T I N G S U M M E R 1982
H i

ZX81 Software

LARGE CHARACTERS
David Kelsall of St. Albans has provided programs to
print wide and double height characters on the ZX
printer. The programs can be combined to produce
16 large letters per line.

REM
REM COPYRIGHT D.U KELSRLL
REM U R N U R R Y 1962
REM
REM PRINT R$
REM STATEMENT IN HEX FOR U=1 T O 32
FOR K = 1 T O ©
P O K E 3 S 2 5 5 f K f 6 » - U - l J ..COL
21 7C 4© CD 91 4© 41 CD
NEXT K
91 4© ED 43 7S 4© G9 ©E NEXT U
FOR H=© TO 31
FF ED 6F CB 47 2© ©4 CB P O K E 16444. + H . H
NEXT H
81 CB 89 CB 4F 2© ©4 CB LET HPRINT=USR 31744
91 CB 99 CB 57 2© ©4. C B
R1 CB R9 CB 5F 2© ©4 CB
SPRINT DOUBLE HEIGHT CHRRRCTERSi
1 IF P E E K 1 6 3 6 6 + 2 5 6 * P E E K 1636
B 1 CB B9 C9 9=31744 THEN GOTO 5
2 R E M P O K E 16369.124-
U : : O EE Q t -I R R R <=;NR E : 3 PRINT "MEMORY NOT R E S E R V E D "
4. S T O P
1 REM 5 7 R N D L N NDIWKEYfLN 5 FOR 1=0 TO 112
*D G O S U B ??RNDTftN CDPV GOSUB 6 P O K E 3 1 7 4 4 +1..PEEK (2161+1)
<-4,?S R C S jjRCS «fRC5 R C S if*RC«b 7 NEXT I
M P C S ?4» R C T Q R C S 0 R C 5 7 4 , fiC5 » « 6 P O K E 31600., 6 3
C S jfpT
iJTRN 9 POKE 31657.201
5 IF PEEK 1 6 3 6 9 = 1 5 4 T H E N GOTO 90 D I M R $ ( 3 2 . 16)
"00 LET B $ = " * P R I N T D O U B L E H E I G H
3 PRINT R E S E R U E M E M (POKE 16 T CHRRRCTERS*"
, 124.) " 110 FOR Y * 1 T O 3 2
4. S T O P 1 2 0 F O R X>=0 T O 1 5
5 FOR 1=0 T O 112 .\30 L E T R $ ( Y ^ X + 1) s C H R % P E E K (76
6 P O K E 3 174-4 +1 , P E E K ( 2 1 6 1 + 1 * 3^+Q*CODE 6*<Y)+XNT (X/fi))
7 NEXT I l'-0 N E X T X
8 POKE 31800 f63 150 NEXT Y
9 P O K E 31657.. 2 0 1 9 9 3 6 REM P R I N T R $ . 6 L I N E S RT R
100 L E T B $ = " U I D E CHRRRCTERS" TIME
1 1 0 D I M R$<32.. 6 ) 9 9 8 9 F O R 1 ^ 0 T O 1© S T E P 6
120 FOR X =2 T O 3 2 STEP 2 9990 FOR J»1 T O 3 2
130 FOR Y * 1 T O 6 9991 FOR K = 1 T O 8
14-0 L E T P s P E E K (7679+6+CODE 9992 POKE 32255+K+6*IU-1>.CODE R
X/2)+Y) $ ( U K+I)
150 P O K E 1 6 5 0 8 . P 9995 NEXT K
160 R R N D U S R 1 6 5 1 4 9994 NEXT U
170 LET R $ J X - 1 , Y ) = C H R * P E E K 156 9 9 9 5 FOR H =0 T O 31
08 9 9 9 6 P O K E 16444+H..H
180 L E T R « (X ,.Y) = C H R * PEEK 165©^ 9997 NEXT H
190 NEXT Y 9998 LET HPRINT=U5R 3174 4
200 NEXT X 9999 NEXT I

ZX C O M P U T I N G S U M M E R 1982 107
1 1 1 l , ,
• J L X t . * • • • m.M-». * .1 JLJLJt .1 t • • • » • * ' r * *-'-'.,T,.'.'.'r'-
1

H .
.v.1..
. ' . V . W
• • • • • • I I
• •
• • • • • • • •ll'
".V
y.S • • • • • • • I
• • • • • • • • I
• • • • • • I I
• • • • • • • • • • • • II
• • • • • * • I
• • • • • • • I I
I • I I I I II
• • • • • • • • •• •• •• I• I'
• • • • • • • I
• • • • • • • •
• • •• •* •• •• •• •• I
• • • •• • • • • • • • • • II
• • • «• *• •• • . •a l Il
•v.v.v
a •- • • l 1l • • a a • • if
I• • •11
I • • * • *• • • •I <1
• a • • • • 11
II •I IM
I • II'
• • •• •• •• •• • •l iI f tl l

• • • • ll

• • * • I I 11
k i l l I I <
\ * a • • l 11

• • • • •
• t •a • * *t l •* «* * t * i • »* »> •i <

h t « * t l i | l * * * l

• •
• •
• •
• •
108 • *
ZX C O M P U T I N G S U M M E R 1982
Moving graphics

Getting into
the Movies
What do you do when you want becomes. This can be over-
come to some extent by assign-
old position while the new one
is being worked out, and these
aliens and asteriods to burn ing two other variables to the are used not as an 'unprint' but
around your TV screen? The PRINT AT position which hold it
for unprinting while the com-
rather to print a trailing series of
full stops, as you can see in
PRINT AT on the ZX81 gives you puter is working out new posi-
tions.
diagram one. Run these pro-
grams a few times, and ex-
one solution. Change the program so it amine the listings, and you're
reads as the listing for program sure to be able to work out
two. Run this, and you'll see ways to make them more effec-
how much more satisfactory it tive.
You make an object move — or although far from satisfactory is. If you want it to run forever, A second way of approach-
appear to move — on the TV in terms of the result displayed add 5 7 IF X greater than 1 9 ing the moving graphics pro-
screen by printing it in one posi- on the screen, at least it should THEN RUN. blem is to use SCROLL to move
tion, holding the display for a give you a clear idea of how to Now moving a blob down the screen up a line, before
moment, then unprinting the produce one kind of effect. Its the screen in an irregular slide is reprinting what you need on the
old position just as you reprint main disadvantage is that the not of much use to anyone. line it has just left. Enter and run
in a new position. screen is blank while the com- Enter and run program number program five, HAILSTORM,
The PRINT AT function on puter is working out the new three, which makes a ball and you'll see how it works in
the Z X 8 1 , although it is slow, PRINT AT position for the black bounce around the screen. practice. In this program, you
makes it easy to position an ob- blob. As you can see from runn- Although this does not use a se- are the black block, PRINT AT-
ject just where you want it. For ing this program, the RND func- cond set of variables to unprint, ted in line 3 0 . You control the
our first simple program, enter tion — when running the com- it is fairly satisfactory. You'll position of the blob by using IN-
PROGRAM ONE and press RUN puter in SLOW — is particularly see that lines 7 0 and 8 0 check KEY$, pressing on keys " 8 " (to
to see it in action. What you'll slow. As you begin to elaborate each time through the program move the blob right) and " 5 "
see, all being well, is a black the program you're working on, to ensure that the ball has not (to move it left). The whole of
square move down the screen and you want the computer to 'hit the sides', and if it has done line 8 0 ensures that the blob
diagonally. Note that you can do more and more, you'll find so, ensures that the variables will not move off the screen,
'chain' PRINT AT commands as this blank between subsequent which determine the next posi- and saves valuable memory by
in line 3 0 . PRINT ATs of the blob becomes tion of the ball (C and D) are placing the interpretation of
This program shows the intolerable. Try, for example, changed. both INKEY $ and checking the
simplest kind of m o v i n g adding 3 5 LET Z = X ' "Y and Program four does use new screen limits on either side,
graphics programming, and see how slow the program variables (E and F) to hold the within one line. Line 9 9 0 prints

5 REM *MOUING GRAPHICS 5 REM *HOMING GRAPHIC


PROGRAM ONE* PROGRAM TWO*
1® L E T X = © 1 0 LET X=0
L.ET Y = 0 20 LET Y = 0
3 0 P R I N T A T X..Y; ' AT X ,Y ; * • *
25 L E T A =X
LET X s X f R N D 27 L E T B =Y
5 0 LET Y=YfRND 3 0 PRINT A T X/Y;"B"
50 GOTO 3 0 4 0 LET X - X + R H D
5 0 LET Y=Y+RND
5 5 P R I N T A T A,, 8; " "
60 GOTO 2 5
• Program one • Program t w o
2 0 LET A=UFiL " 1 0 * R N D + 5
30 L E T B='vhL " A ^ R N D + S "
1 0 REM * B O U N C I N G B R L L -• 1 * 4 0 LET' -A
LEI A = 10*RNL>+5 4 5 L P T G - C +C
3 0 LET 6-P*RND+5 5 0 L F T D =C
4.0 L t£T C=1 55 L^T E=R
5 3 L E T D=1 5 6 L. fiT F s=B
5 0 P R I N T f*T P . B ; 0 60 PRINT R T R , B , " 0 '
7 0 I r A <2 O- A > 1 9 T H E N L E T C=- 7 0 IF R <G O R R > 1 9 T H E N L E T
3 0 IF 8<2 OR B>29 THEN LET D=- 60 IF B <G OR B>29 T H E N LET D^-
o
3 5 P R I N T R T A . . B.: " " 90 L E T A = A 4-C
9 0 LET R=R*C 100 LET B=B+D
1 0 0 L E T S = B + D 105 P R I N T A T E F; " . "
1 1 0 GOTO 5 0 110 GOTO UAL "SS"
Program three Program four

ZX C O M P U T I N G S U M M E R 1382 109
mm

Moving graphics
the blank to remove the black file, to see if anything is there. If VAL " 1 " , and CODE " 0 " is Line 5 initialises the vertical
blob. This blank is printed just it finds the code for' 0 " in that cheaper than the number 2 8 . position of the ball, and line 10
before the screen SCROLLS up- position — that is one line In our f i n a l p r o g r a m , sets up the player (black blob)
ward, to move all the zeroes up- below the black blob — it S Q U A S H (program number starting position. Line 1 5 starts
ward. Your aim in the game — knows the black blob is going to six), a ball ( w h i c h looks the count at - 1, which quickly
needless to say — is to avoid hit a hailstone, and prints out remarkably like an asterisk) is becomes zero at line 30, before
the hailstones, as you can see your score, the value of the bounced off a black blob at the the first score is printed. Line
from diagram t w o . You'll variable S. The Q at the end of bottom of the screen, which 2 0 initialises the ball's horizon-
remember that at the start of this line causes the Z X 8 1 to you move right and left by using tal position, and 2 5 initialises
this article we mentioned that stop with a 2 error code, mean- the " Q " and " P " keys. If you the horizontal direction of the
the RND function was fairly ing an unassigned variable has manage to 'bounce it', your ball. Minus one sends it left,
slow. To minimise the delay, been encountered. This is score (shown in the top right zero sends it straight up and
we've used a single pair of ran- 'cheaper', in memory terms, hand corner of the screen) in- plus one sends it right. Line 3 0
dom numbers (generated in than running the line twice, creases by one, and the game increments, the score count.
lines 6 0 and 6 5 ) four times in with THEN STOP at the end of continues. Miss the ball, and Line 8 5 checks to see if the ball
line 7 0 . the second line, or of saying the fun is over. Enter and run and the bat are fairly close, and
Lines 1 0 0 and 1 1 0 are very IF . . . T H E N G O T O 1020, this program to see how it if they are, allows the game to
interesting, and are crucial for where line 1 0 2 0 reads PRINT works. Note that because a ran- continue.
producing a worthwhile pro- S. O t h e r memory-saving dom number does not have to There are a number of simple
gram using the SCROLL facility. devices you can glean from this be generated between suc- ideas presented in this article
Line 1 0 0 moves the PRINT AT listing include the use of VAL a cessive reprints off the ball, the for you to implement in your
position to A + C, B which is a string, instead of using a time the screen is blank is very o w n moving graphics games on
line down from where the black number. Believe it or not, LET P short (only while the computer the Z X 8 1 . We'd be pleased to
blob is at present. Using line = 1 uses up more memory, processes lines 6 5 and 70), so see your favourite program
1 1 0 , the computer then looks because of the way the Z X 8 1 a second pair of variables to which you've developed after
up this position in the display memory works, than LET P = 'hold the ball' are not needed. reading this article.

5 LET S =VRL *"0"


10 LET R = URL " 8 "
15 LET
LET
T = U f t L "30
B = R 0 0 0 0 0
£ 0
0
25 LET C = B / B
D = C +c 0 00 0 0
27 LET
0 0
30 PRINT RT '
000 0 0
4-0 L E T X=R
0
50 LET Y = 6
0 00 0
60
65
LET
LET
M=RND*6 +11
N = P N D * 1 3 0 0 0 0 0
70 PRINT RT M + D , N - C , " 0 " ; RT M , N 0 0
j " 0 " ; R T M - N . N ; " 0 ' ; P T M , M + N ; " 0 " 00 0 0 0
60 LET B=B+D* (INKEY$ = " 8 " .RNT> f
v'T) - D * ( I N K E Y $ - " 5 " RND B >D) 0 0 0
S = S+C
90 LET
0 0 0
100 PRINT RT R + C , B ;
0 00
110 IF PEEK
1 6 3 9 9 ) =CODE
(PEEK
" 0 "
1 6 3 9 8 + 2 5 6
THEN PRINT
frPEf
5 , CV 0
K
990 PRINT RT X ^ Y ; " " 0
1000 SCROLL
1010 GOTO T Diagram t w o

• Program five

5 L E T Y - 1 6 "
10 LET R =
P • 1 5 LET U =
• » • • 20 LET X — ( R N D * 2 5 +3)
• * • • 2 5 LET D = <RND*3-1)
• • 3 0 LET U =
• • • 3 1 PRINT
0 • 3 5 F O R C =
m 4-0 IP INK = THEN LET R = R -
ft 1
• • 4 5 IF INKE Y $ = " P " THEN LET R = R<-
• a 1
• ft 5 © PRINT RT 21., R - l . ; RT 2 1 , R
* * — 1; "
• • 5 5 IF X-0
ft *
D
• * •
6 0 P R I N T lH T V.. x.;
« • •
6 6 LET Y = » C
m •
7 0 LET X=
• • ft
7 5 PR INT (
• v
8 0 NEXT C
8 5 IF R B S
• Diagram one • Program six

110 ZX C O M P U T I N G S U M M E R 1982
Specialist Book§
i
Choosing program* for microcomputers Introducing computer programming Student notes on NCC OP documentation
1980 J E Lsns £9.00 1979 Reprint W G Collin £11.50 standards
A5 138ppP ISBN 0 8 5 0 1 2 255 4 AS 364ppP ISBN 0 8501 2 2 1 0 4 1978 NCC £5.50
Looks at application packages for micros A machine language independent textbook for A5 10Opp P ISBN 0 8 5 0 1 2 339 9
describing what they ere, the benefit* they offer the beginner, providing all the necessary basic A subset of the full documentation standards for
and their use on microcomputers Guidelines tor information needed by someone starting on a use by students on courses where NCC
obtaining packages and for identifying the best computer programming career. standards are part of the syllabus.
product are given.
Introducing data processing The robots are coming
Elements of BASIC 1980 NCC £6.50 1 974 F H George & J 0 Humphries ledsl
1 979 R Lewis and B H Blakeley £9.00 A5 237pp P ISBN 0 8501 2 245 7 £ 10.00
A5 200pp P ISBN 0 8 5 0 1 2 118 3 Covers the requirements of syllabi for A5 188ppPISBN 0 8 5 0 1 2 1 1 4 0
Introduces the BASIC language, covering the introductory course*. Provide* a comprehensive Gives a general background to current
mathematical, non-numeric and data processing and accessible introduction to data processing. developments in artificial intelligence research
facilities. Generally machine independent with Assume* no previous knowledge of the subject. and looks at where these development* could be
supplements to show the effeci of a number of leading
different implementation*. Introducing microprocessors
1 9 7 9 GL Simons £9.00 Using computers - • manager's guide
Graphics on microcomputers A5 1 77pp P ISBN 0 8601 2 209 0 1 9 8 0 M P e i t u f 7.50
1981 JE Lane £4.00 Gives a profile of the microprocessor scene A5 180ppP ISBN 0 8501 2 241 4
A5 44ppP ISBN 0 8 5 0 1 2 333 X paying attention to typical application areas Intended to help msnager* implement computer
Explores the type of graphics becoming together with hardware and software systems effectively in an organisation. Provides
increasingly available in low cost systems. information. an introduction for user management covering
Illustrates the facilities available and takes a the topics of planning and control plus human
closer look at graphics picture building Introducing word processing factors
techniques. 1981 G L Simons £8. SO
A5 1 BOpp P ISBN 0 8 5 0 1 2 3 2 0 8 Working w i t h computers: a guide to jobs
Information handling by microcomputers Describes the main characteristics of word and careers
1981 JE Lane £4.00 processing and discusses its advantages over 1975 £2 50
A5 60pp P ISBN 0 8501 2 334 8 conventional typewriting. Communication, A5 86pp P ISBN 0 B501 2 126 4
Examines the field of information handling on maintenance, security and costs are considered A general introduction to computing as a career
microprocessor* across the whole spectrum of for school leavers. Cover* how a computer i*
micro applications Aims to promote an Operating systems for microcomputers used, what types of job exist and how lo irem
awareness of current practices and trends 1981 J E Lano £3.50 for them.
A5 77ppP ISBN 0 8501 2 277 5

NCC N C C £6
Establishes the requirements of operating
systems for microcomputers in both commercial
and industrial application areas and examines
the facilities provided in a number of current
THa hbtanai Compitng Cffflr* products. Th» (Miami Cotpum*

W e ere now able to offer, in addition to our usual selection of books on computers, a number of specialist titles from the National
Computing Centre.
Rather than taking their entire list of some 1 1 0 titles, w e have selected those most relevant to the microcomputer market and these are
listed w i t h their precis.
Ordering couldn't be simpler, just tick the boxes in the form below, enclose a cheque or postal order to the total amount tor make use of
the Barclaycard end Access facility) and send it all off to:

SPECIALIST BOOKS,
ZX COMPUTING
145 CHARING CROSS ROAD,
LONDON W C 2 H OEE.

If you are using your credit card to order please don't send it, |ust fill in the number and sign on the dotted line.
Please allow 2 8 days for delivery of your books.

C CHOOSING PROGRAMS FOR O INTRODUCING COMPUTER • O P E R A T I N G S Y S T E M S FOR


MICROCOMPUTERS £9.00 PROGRAMMING £11.50 MICROCOMPUTERS £3.50
• ELEMENTS OF BASIC €9.00 O I N T R O D U C I N G D A T A PROCESSING • STUDENT NOTES ON NCC DP
• GRAPHICS ON MICROCOMPUTERS £6.50 DOCUMENTATION STANDAROS £5.50
£4.00 • INTRODUCING MICROPROCESSORS • THE ROBOTS ARE C O M I N G £10.00
C INFORMATION HANDLING BY £9.00 • USING COMPUTERS - MANAGER'S
MICROCOMPUTERS £4.00 • INTRODUCING WORD PROCESSING GUIDE £7.50
£8.50 • WORKING W I T H COMPUTERS: A
GUIDE T O JOBS A N D CAREERS £2.50

Name: .

Address;

Amount:

M a k e cheques payable t o A S P Ltd.

ZX C O M P U T I N G S U M M E R 1982
m 111
Review

Mewson's hints
cmdjtips

Hewson Consultants
have a variety of ZX81
products — including
games software,
'serious' software, and
andrew Hewson's book
'Hints and Tips for the
ZX81'. Graham Charlton
puts them through their
paces for zx Computing.

mm • »t
' • ; •^ J

ZX C O M P U T I N G S U M M E R 1982 112
Review

••.v.-
•v.v
/.V.' - RJ J itti
•88
• •»
A."--." .v»v •V/-

* rt k «• « . !& it till uu » »

A * • •

a?}
III! 1111 (III IJJj

i! ii cili
ill!
Hit Hi! ill!

O Z J I J L I* » JTA. _

y i g t 5 P A G E X N 7 R U D E RE-
SUCRE = 2 5 8 B E S T S C O R E = "7"? 7

A big bundle of material from cross-referenced. The book Language paper could achieve — and
Hewson arrived at my home,
and I spent a long weekend
eases the user into the idea of
using machine code, with
Dictionary probably in less time than it
takes to locate and load the
working through it. The many examples of its use in Written for a Z X 8 1 with 1 6K, required program. Of course, it
products I looked at. and their the book. Language Dictionary is an would be valuable if a large
prices, were the book 'Hints As well as this, I found the easy-to-use program, with a number of similar problems
and Tips for the Z X 8 1 ' chapter on chaining programs number of options. It can had to be worked through. At
( £ 4 . 2 5) Space Intruders quite enlightening. I didn't search for a word in either of the very least, the programs
( £ 5 . 9 5 ) , Language Dictionary know, until 1 read it here, that the languages used, allows prove convincingly that the
( £ 3 . 7 5 ) and Planet Lander it was possible to pass data you to update or dump the Z X 8 1 can be used for more
(£3.75). between programs. In all, this entire contents or to save than games. Perhaps a 16K
The area covered by the slim volume is good value, and these on cassette. Although maths tape would be more
hints and tips book is shown an essential aid to those with the method used to store the useful, and would provide a
clearly by the chapter titles: an unexpanded Z X 8 1 . words packs them tightly it better indicator of the Z X 8 1 's
Saving Space; Understanding appears it would take a long abilities.
the Display File; Converting time to find a word stored near
2 X 8 0 Programs; Chaining
Programs; Machine Code; plus
Space intruders the end when the dictionary
was full. Planet Lander
a mixed bag of twelve 1 K
programs. This program, for a Z X 8 1 with
16K, comes dubbed once on Statistics This tape contains four 1K
programs. In Planet Lander
The book appears to be each side of a cassette, along This pack consists of three 1 K you have to (yawn) land your
aimed mainly at those with with full instructions. Even if programs — Graph Plot, which spacecraft on a planet's
only 1 K RAM. if you have only you'd never used a Z X 8 1 does exactly as the title surface. Stopwatch is self-
1K, I'm sure you realise how before you got this program, suggests, .using data entered explanatory. The third
difficult it is to run even the the instructions would enable from the keyboard; Chi program is Space Docking, in
smallest of programs. you to load and use the Squared Test, which which (yawn again) you have
Therefore it is essential to computer. Written in machine "calculates the value of the to dock your spacecraft with
understand how your Z X 8 1 code for fast action, the chi squared statistics for the space station. The final
works, and know some short program has 4 0 alien ships in comparing observed and program is Clock, in which you
cuts to help you in each squadron, three laser expected values"; and set the time and then sit back
programming. This book guns and full score display. As Statistics, Regression, Trend and watch the display
should help you. 'Hints and well as this, the Z X 8 1 can which is used to calculate increments each five seconds.
Tips' contains an extensive play itself — although not very mean and standard deviation T w o of these programs are
2 7-page chapter on machine successfully. Continuous firing and a least squares regression available from the book Hints
code, although it doesn't give is available, and you have to line or trend line. I am sorry to and Tips' so I suggest you buy
a full list of codes. Hewson be quite quick to avoid the say that these programs the book. You'll learn a fair
Consultants do supply, for aliens' bombs. All in all, this is appear to do little more than amount, and enjoy using the
£ 1 . 4 5 , a full list, in which an enjoyable version of the someone with a pocket book far more than you will
each Op Code is explained and popular arcade game. calculator and a piece of graph this last pack.

ZX C O M P U T I N G S U M M E R 1982 113
Machine code

saving machine code


As a self-confessed machine code
freak, who gets withdrawal symptons
without a daily shot of bytes, Mike
Bidden decided to push some code up
the ZX81, only to discover that it was
a totally different machine from the
ZX80. and that he was unable to use
his tried and tested favourite
methods. This was due to lack of RAM
or because the overseeing 8K ROM did
naughty things to the code he POKEd
in. Let Mike tell you the story...

Summary Of code (read Chapter 26), but to


be fair, it's directed at those
(no TL$ on the 8 1 you have to
use (2 to ) instead). Having
ed this as not being a possible
favourite.
Possible Methods new to programming and in this got the program in and running, Method 4 really is a bit hit
I first considered all the it succeeds. The Sinclair I discovered that there were on- and miss and Method 5 uses
possibilities: Manual mentions methods 2, 3 ly about 5 0 bytes left for the too much memory. That left
1. Establishing a dummy array and 5 with scant detail, but I code and that DIM A ( 2 5 ) was Method 3 POKEing into REM, a
with DIM A(x) and then began to wonder why there about all that was possible. Not method I have not favoured in
POKE into VARS. was no mention of a dummy only that, I could not POKE into the past due to the
2. Moving RAM TOP down (as array and VARS. the VARS area, all my carefully display/system crash problem.
Mr. Sinclair has provided considered bytes were over- However, not to be daunted by
this, I wrote a program for ex-
two nice little POKEable
bytes 1 6 3 8 8 / 1 6 3 8 9 for
Experimentation written to zeros. Perhaps I was
doing something wrong, but at perimentation.
just this purpose) and then So I set out to try this method this stage I stopped trying to
POKEing the code into the first. I have always favoured POKE into VARS Experimental
available space NEW and
CLS can't touch it, which is a
MICROMON (the Z X 8 0 magic
book) for this purpose. Micro-
Method t w o worked as
d e s c r i b e d in t h e Sinclair
Program
major advantage. mon pokes hex code into VARS Manual, but what's the use of
(system variable area). I con- I decided that severe memory
3. POKEing into a REM state- code you cannot save, without
verted Micromon into some- limitations on the basic Z X 8 1
ment. Here at least, the code a special routine that consumes
thing the Z X 8 1 could recognise meant that the program must
would be saved and safe precious memory. So I discard-
use decimal addressing and
from attack, but I was wor- that the code should also be
ried about displaying the decimal. Having decided this,
REM and t h e d r e a d e d the program below was produc-
system crash that would ed, to load 1 0 0 bytes of
follow when the basic inter- machine code.
preter found naughty, non-
displayable codes for it to Do not try to run machine code
put on the screen. 1 P E N 1 0 0 C H A R A C T E R S O F whilst compute and display is
4. POKEing above program and Y O U R C H O I C E operating if you are going to use
display file, but far enough L O L E T A = 1 5 5 : L 4 - the accumulator; it won't RET.
below the stacks, to prevent 1 5 CLS Hence line 1 2 5 .
collision with the "calcu- P R I N T A ; " " ; P E E K R
i FT A=A-H The program is started using
lator stack". At least the
code is immobile here, but I 3 INPUT GOTO 1 0 and prints the ad-
never liked this one with the - *'" T H E N G O T O I S dress of the first available byte
Z X 8 0 , as it's a bit " b y
1,0 IP >,$= M " T H E N G O T O 9 0 after the REM s t a t e m e n t ,
guess" as to whether the
C 0 IF = THEN GOTO 120 together with the contents,
code gets overwritten or 7-2- P O K E R 1 j. U A L A* which will be the code of your
£ O T O 1 5 chosen character. I used one
not.
INPUT A hundred letter As and therefore
5. Setting up a string array to 100 GOTO 15 found 3 8 returned at address
contain the code and stripp- 3 2 0 C L S
1 6 5 1 4. Pressing NEWLINE on-
ing it out byte by byte. This 125 FAST ly, steps through memory one
gobbles up memory at a 1 3 0 L E T U - U 3 R <RJ
phenomenal rate, plus the 135 I FT A =A-1 byte at a time. " R " NEWLINE
fact that you are tied to 14 0 GOTO 15 (RUN) runs the machine code
relative code as the strings from the address being
shift. displayed on the screen and
returns to that address (assum-
The Sinclair Manual ing your code RETs successful-
ly). " N " NEWLINE (NEW)
The Sinclair Manual is as good allows you to jump to a new ad-
as useless on using machine dress in memory. Simply enter

114 Z X C O M P U T I N G S U M M E R 1982
Machine code
the new address (in decimal)
followed by NEWLINE. I spent
It didn't Crash In Summary 3. It can be saved.
Using the experimental pro-
many happy minutes stepping gram also allows you to step
through Clive's ROM after I accidentally displayed the This will definitely be my through and examine the ROM
entering " N " NEWLINE, 0 REM statement with the code in favourite method of entering and incidentally, run parts of
NEWLINE, followed by a suc- it and to my amazement it machine code since: the ROM, to find out start ad-
cession of NEWLINEs. If you didn't crash. Where it en- 1. It's immobile and absolute dresses of useful subroutines.
have the patience you could list countered a naughty code, addressing can be used. Use the program and have a
and disassemble the ROM clever old Clive's ROM simply 2. It's crash proof even if REM dabble with machine code
(please send me a copy). Any told it to display a question is displayed. yourself.
area of RAM or ROM can be ex- mark.
amined in this way. If you have
the program operating correctly
the first ten bytes of ROM
should read:

Address Decimal Content


0 211
1 253
3 255
4 127
5 195
6 203
7 3
8 42
9 22
10 64

The next step was to try some


machine code that actually did
something, so I decided to pro-
duce a short tone for my add on
sound box. (Use any amplifier
of 2 mV sensitivity plugged in-
to mic. socket of your com-
puter.)

Producing a Bleep
So GOTO 1 0 followed by
NEWLINE produced 1 6 5 1 4
3 8 . The 3 8 was simply the first
letter A of my REM statement.
The following code was then
written in:

Address Decimal Byte


16514 14
16515 255
16516 6
16517 112
16518 211
16519 255
16520 16
16521 254
16522 6
16523 112
16524 237
16525 64
16526 16
16527 254
16528 13
16529 32
16530 241
16531 201

With some trepidation, I set the


address to 1 6 5 1 4 and pressed
" R " NEWLINE. My sound box
bleeped happily and I heaved a
sigh of relief. (Use appendix A
of the Sinclair Manual, if you
want to convert the code to hex
and unravel the bleep program.)

ZX C O M P U T I N G S U M M E R 1982 116
Programs

BIORHYTHMS

The 'science' of bio-rhythms is 1
based on the belief that each of I * * * I I 1 I ! I !
us is in the throes of three cycles
which start at the moment of birth • 1 * 1 * 1 1 1 1 ! ! * ! # * * I 1f * :
and continue until death. Hfl I * i ! ! * ! ! I ! I t * M I
PHYSICAL: The 23-day physical
cycle relates to endurance, aggres- * * 1*1 I * I f I * I * ! t *
siveness and physical strength. 1 I * I !* * I ! t * I i* I i
EMOTIONAL: The 28-day !
emotional cycle governs emotions, * * I I i V 1
H *
optimism/pessimism,
temper and moodiness.
frustration, I ! i* ! I I
MENTAL: The 33-day mental * I t i I i 1 1 I I I I--' i»f H i l*$ HIM4*+++-1 -H-H
rhythm is related t o logic, reason- ! j * i : i It ! f ! it I
ing, ease of expression and common
sense. It i i I ! * I * I I * ! I I -
! ! I * 1*1 i f t I + i i* I I *
This program takes your date of
birth, then the date of the day !# ' * i I I * 1 * !
which interests you, and works out I .+ i I ! I I i v l I I 1
the 'worst point' on each of the
three cycles in relation to the day ! I ! i ! + I* I i * 1 * 1 1 f
you have nominated. I ! ! I*** 1
I I I I I f *

20 GOTO 210 375 LET Z=A


30 LET T =0 380 IF A < 1 9 0 0 OR A>1999 THEN GO
4 0 I F B - 3 > ~0 T H E N L E T T = 2 T O 3 7 0
5 0 IF T =2 T H E N L E T B = B + 1 390 PRINT " M O N T H C A S 11J 7 "
6 0 IF T = 2 T H E N G O T O 90 4-00 INPUT B
70 LET R=R-1 405 LET Q=B
80 LET B=B+13 410 PRINT "DRV (OS 2 4 J 7
90 LET E = INT 1 3 6 5 . 2 5 * A.I F I N T F3 4-20 INPUT C
0,6*B)+ C 4-21 GOSUB 8000
100 R E T U R N 4.22 LET P=C
110 LET T =0 4-25 GOSUB 30
120 LET F =G — INT (G,'D) * D 430 CLS
13© IF F ) 0 / 8 T H E N L E T T = 2 4-4.0 L E T G = E -<J
14.0 I F T = 2 T H E N L E T H=D-F 450 PRINT "BIO-RHYTHM FOR ". P ; "
^ I* • Q • •» ^ »» »
1 5 0 IF T = 2 T H E N G O T O 180 " 0 "
160 IF F = 0 O R D / 3 = F T H E N PRINT 452 IF 2 — 1 9 0 0 <10 THEN PRINT
1 7 0 IF F = 0 O R D / 2 = F T H E N RETURN 455 PRINT Z — 1900
460 PRINT
180 L E T H=D^2-F 470 PRINT
190 P R I N T " A F T E R " ; H ; " DAYS" 480 LET D =23
200 RETURN 490 PRINT "PHYSICAL"; X$
210 LET Y$ A"THE UORST DAY IS " 500 PRINT Y %
220 LET X$=" CYCLE" S10 GOSUB 110
230 CLS 520 PRINT
240 PRINT "ENTER YEAR OF BIRTH 530 LET D =28
CRS 1950)" 540 PRINT "EMOTIONAL";X$
250 INPUT A 550 PRINT Y$
260 PRINT " N U M B E R OF B I R T H MONT 560 GOSUB 110
H (AS 12)7" 570 PRINT
270 INPUT B 580 LET D =33
^280 PRINT "DAY OF B I R T H CAS 3 0 ) 590 PRINT "MENTAL";X $
600 PRINT Y$
290 INPUT C 610 GOSUB 1 1 0
300 CLS 620 PR INT
310 GOSUB 30 630 PRINT "ENTER Y FOR ANOTHER
320 LET U=E DRTE'
330 PRINT "NOU, TO FIND YOUR BI 640 INPUT U*
O-RHYTHM","FOR A SET DAY. ENTER 645 CLS
THE" 650 IF U $ = " Y " T H E N GOTO 330
340 PRINT "DATE THAT INTERESTS 8000 CLS
YOU" 8010 FOR 1=1 TO 96
350 PRINT 8015 PRINT " B";
360 PRINT "YEAR CAS 1960.)?" 8040 NEXT I
370 INPUT A 8050 RETURN
WHAT CAN I DO WITH 1K?
If your answer is "not much", then you must read
the new book from V&H, 'What Can I Do With IK?
(40 programs and routines for the 1K Sinclair ZX81)'.

Here at last are some serious (and some fun!) T W O GREAT ZX81 16K
programs which all run in IK. CHESS G A M E S
Don't be misled by the titles: 'Roulette' actually
ZXCHESS( ENHANCED)
* Written totally in machine code
analyses gambling systems; 'Chinese Horoscope' * Full graphic display o l Chess board.
reveals your birth sign, month sign, element and * Six levls of play Two play within competition time limits
ascendant; 'Payroll' handles ALL tax bands. These * Option to play Black or White
are not just simple programs. * Plays all legal moves including castling and en passent
* Cassette routines for saving unfinished game and returning to
later.
FREE OFFER!!! * Displays moves of game on screen or printer for analysis
A free listing of 'Chess in IK' is included with all * Print a copy of the Chess board onto the printei
* Board can be set up in any position, you can even swap sides
mail-orders mentioning this magazine! midgame
* clear whole board with one command for end game analysis
'What Can I Do With 1K?' is available from most £6 50
bookshops, computer shops, or direct frorn:-
ZXCHESS II W e
W i e v e the strongest ZX81 Chess game as
V & H Computer Services no other has beaten ill I
* All the features of ZXCHESS plus
182c Kingston Rd. * Book of 32 opening moves
* Seven levels of difficulty: FOUR play within competition time
Staines Middx. limns
* A move is suggested by the ZX81 if wanted
Tel: Staines 58041 * Optional Full Graphic version using the QS CHRS Board
£1299
2 copies supplied on cassette with full instructions
Price £4.95 (inc. p&p). Cheques and postal orders payable to

Also available on ARTIC C O M P U T I N G


396 James Reckitt Avenue
cassette £4.95. Hull, North Humberside
HU8 OJA

TURN 'LISTINGS'INTO DYNAMIC ZX GRAPHICS


All you need s a pencil, ingenuity, and Print V Plotter Products'
Within hours you'll discover all sorts of ways to change "words" into computer "pictures
and produce really dynamic programs1 •
You can do it easily with the help ol e PRINT 'N' PLOTTER
JOTTER and FILM.
The JOTTER is a 100 page Graphics Pad designed lor the
ZXB1/80 Every page has a PRINT and P10T grid showing
the screen locations. It tells you any part of the screen in
seconds, and gives you a 'sketchpad* to produce incredible
graphics for games, business programs, information
GOOOflEWS
panels, tabulations — everything the normal 'listing' lacks! [ * FOR
PRINT 'N' PLOTTER FILM is used with the JOTTER and is a matt, transparent, film PRIRTER
vers>on with «Jentcatty saed grids Use it to co ordinate PRINT or PLOT. or use it to 'copy' OUinERS
photographs, maps, charts, lettering or illustrations to use in programs You can draw on the matt
surface, and rub-out or wash it and use again! Prim n' Plotter products will help you produce
dynamic programs, whether you're converting existing listings or wtmng an original
Ask lor them at your local Comp Shop, or send today for mail order

II you do not wtsh to use ths coupon write, staling your requirements.
To Pnnt Y Plotter Products ZXllS Borougfi Hqh Strut" London SM 9SF
• Please send me . JOTTERS @ f 3 50 • Please send me. fllMS @ f ? 25
• Please send me MANUALS @ CI 00 (CI SO if ordered without JOTTER or f l l M )
• Remittance endosed • ftn my Access/Visa No
• ZX81
2hole* # ^ Keyboard.
punched. ^ Numbered
PRINT Grid. Program Address
Numbered notes space
PLOT Grid.
100 Sheets. S i » A 4 . Hon Ordm i n ututih petnd MHA* I I kauri el m > ) i II r*> rt^unt IK Clan m i p«tn (M Mo to orfei
Board backing.
Av«KH**l< M h Men »4iWhan H U London SWlt • O n v > Bootiaat'i 2Cwltmwn Si London EC 1 • M*'o-»« 1)1 • »D m « l r

ZX C O M P U T I N G S U M M E R 1982 117
Computer Glossary

COMPUTING GLOSSARY

Batch (Processing) A method Block A sequence of data Bus (sometimes spelt Buss)
of computer working in which words or bytes treated as a Basically means the multiple
a large number of unit, especially when working wiring common to several
transactions are grouped with magnetic tape. parts of a computer and the
together before processing number of channels therein —
(so that control totals, etc Boot An instruction or very eg a 16-bit bus addressing
Address The number, eg can be taken) and which are short program which will 6 4 K memory locations or a
6 2 7 6 8 , identifying a place in then passed through the initiate a computer's 2 0 - w a y bus addressing 1
memory, various stages of processing operating system (short for megabyte. Bus is now
as a group or batch. This was bootstrap). generally identified with the
Aluminised (paper) Printer the original method of data pattern of connections to the
paper surfaced with a thin processing for commercial bps Bits Per Second — a rate plugs and sockets whereby
deposit of metal. The work and contrasts with of data transmission between optional units (eg more
characters are formed by interactive and demand devices. Eg 3 0 0 bps is a memory) may be connected
darkening caused by electric processing. popular rate for some to a computer.
current flowing onto the terminals, roughly equivalent
paper from the pins of a Baud A rate of data to 3 0 characters per second Byte A unit of data 8 bits
matrix print head. transmission commonly, (cps or chps). long.
though strictly not correctly,
ASCII American Standard taken as synonymous with Bubble memory A compact,
Code for Information bits per second. high-capacity random access
Interchange — representing memory device which holds
letters, numbers etc by 1 2 8 BCD Binary Coded Decimal - data as minute magnetic
permutations of a 7-bit code. a 4-bit system for domains or 'bubbles'. The
representing the 1 0 decimal data is not lost when power
Assembler Program which digits. is removed. C A D / l / l Computer Aided
converts the low-level Design/Instruction/Learning.
mnemonic instructions of Benchmark A standard Buffer (1) An area of memory
assembly language to the computing task used to designated to hold data being Cartridge A protective carrier
binary machine language measure the relative speeds transferred between devices of magnetic tape (a variant of
instructions required to drive of different processors. working at different speeds, the familiar cassette) or disc.
a centra! processor. eg the fast processor and the
Binary Numbering system slower keyboard, printer or Central processor The heart
with the base 2. using the disc. of a computer in which the
digits 0 and 1 instead of the (2) An electronic actual program instructions
decimal series 0 to 9. All device in a signal path are effected.
digital computers work on designed to allow signals to
data and instructions pass in one direction but to Chain A process whereby one
presented as binary numbers. hold back unwanted reverse computer program
BASIC Beginners' All-purpose voltages which might damage automatically follows another.
Symbolic Instruction Code — Bit Binary digit (contraction). the sending apparatus.
a popular high-level Must be 0 or 1. COBOL Common Business
programming language Bug An error in software. Oriented Language.
developed at Dartmouth
College, USA.

118 ZX C O M P U T I N G S U M M E R 1982
Computer Glossary
Compiler A program whose
function is to read another
program written in a high-
level language, such as
COBOL or FORTRAN, and
convert it to machine code
which a computer can obey.

CP/M Control
Program/Microprocessor. A
popular disc-based operating
system for microcomputers
using the 8 0 8 0 and Z 8 0
processors.

cps Characters (rarely cycles)


Per Second (sometimes chps).

CUTS Computer Users' Tape


System — a standard for
recording data on cassette
tape.

Daisy Wheel The typehead


component of a sequential
printer — like the go/fball but
faster — whose characters
are held on the periphery of a
serrated plastic disc.

Data base A system for


organising elements of
information in a machine code
file so that a program can
readily select from this data
any particular abstraction or
combination of information
that may be called for. For
instance, a customer data
base might include full details
of all customers (as required
for service and distribution
departments as well as sales
and marketing) and also of
every service call and delivery
as well as each item invoiced
to these customers during a
year or longer. A suitable
program could access that
data base to answer such
questions as "identify the
customers buying more than
£ 1 , 0 0 0 of item A' in less
than five deliveries and
receiving less than two
service calls in the year."

Debug To correct the errors in


a program.

Disc (Disk) Magnetic storage


device allowing fast random
access to any selection from
a large volume of data. A full-
size hard disc will hold say 5
megabytes or more, a smaller
floppy disc typically holds
from 8 0 to 2 5 0 kilobytes but
in either case the capacity is
being increased all the time.

Diskette A floppy disc,


especially the smaller 5 % "
size.

ZX C O M P U T I N G S U M M E R 1982 119
DOS Disc Operating System FORTRAN Formula
— a computer operating Translation, an early and still
system held on magnetic disc popular high-level
rather than in ROM. An programming language,
initialisation process will copy mainly used for scientific
the operating system into purposes.
memory whenever the
computer is first turned on.
Also an operating system
which controls the disc
themselves and may
supplement, rather than
replace, the computer's
original operating system. Golfball A type of typewriter
(or the print head from which
Duplex A mode of data it gets its name) in which the
transmission where each print characters are embossed
station can send and receive on the surface of a sphere
simultaneously. very similar in size to a
golfball. Rotation of the
Dynamic (Memory) Random sphere brings the appropriate
Access Memory (RAM} character into line for each
requiring constant refresh required impression. The
signals but normally using process is usually slow (1 5
less electrical power than cps) but of good quality.
static memory,

Hard Copy A
computer printout or
EAROM Electrically Alterable listing on paper.
Read Only Memory. Typically
taking 10 mSec to erase and Hardware The
1 msec to write, this non- physical elements of a
volatile storage might be computer (contrasted
better considered as 'Read with software).
Mostly Memory' as the write
capability is likely to be High-Level Language
limited to say 1 0 0 , 0 0 0 Programming
cycles. language usually
claimed to resemble a
Edit Alteration of text in natural language, and
program or data files. Often with powerful
necessary, some systems instructions, each
make editing easier than generating several
others. machine language
instructions. Examples include
EPROM Erasable BASIC, COBOL and
Programmable Read Only FORTRAN.
Memory. Writing typically
takes one minute and erasing,
by ultra-violet light, 10
minutes or longer.

Intelligent terminal An
input/output device
which includes its
own logic circuits and
memory so that, for
Firmware Instructions or data instance, data may be
permanently stored in ROM. validated or changed
in format before
Floppy (disc) A mass-storage transmission to the
device comprising a soft main computer.
(floppy) plastic disc with
megnetisable surface on Interactive A working
which data is recorded and arrangement under
may be accessed rapidly by a which the computer
moving read/write head. The reacts immediately to
disc, either 8 " or 5 % " respond to any
diameter, rotates inside a mistakes which may
protective cardboard sleeve. be made by the user

120 ZX C O M P U T I N G S U M M E R 1982
Computer Glossary
or to reply to his
enquiries as soon as
they are expressed. In
some business
activities, as also in
program writing, this
leads to much faster Light Pen A stylus with a light
progress than would sensor which allows a
otherwise be possible. computer to identify the point
at which a Video Display Unit
Interface The fVDUJ screen is being
interconnection touched.
arrangements
between a computer Line Printer A computer
and devices, such as peripheral which prints a
printer or modem, whole line at a time, instead
attached thereto. of doing each character
sequentially.
Interpreter A program
to translate a high Load To copy a program leg
level language from tape or disc) into
(typically BASIC) to memory, ready for execution.
rpachine language and
to execute each LSI Large Scale Integration
instruction, line by the combination of circuit
line, immediately. elements in a small silicon
chip.
Interrupt A signal
which suspends
processing to allow
some other command
to be obeyed.

I EEE Institute of
Electronic and
Electrical Engineers (in Machine Language (code) The
USA) — a body which lowest (and tediously
has set a number of detailed) level of program
standards for more instructions. All higher level
orderly interchange of coding must be converted to
information between machine language (by
various electronic compiler or interpreter) before
devices, including a processor can obey it.
computers.
Mainframe A relatively large
I/O Input/Output. computer.The term derives
from times before integrated
Impact (printer) One circuits, when processors
which forms were wired up with large
characters by striking numbers of separate
a ribbon on to paper components mounted on
and can therefore circuit cards or boards which
produce carbon were in turn mounted in metal
copies. racks or frames enclosed in
one or more large metal
Integer BASIC cabinets.
Concerned only with
whole numbers, Matrix (printer) Printer whose
cutting off any characters are formed by
fractions or decimal parts. selecting a pattern of dots
from a matrix typically five
dots wide and seven high.

Memory Immediate access


data storage, directly
addressable by a central
processor and typically
comprising a combination of
Kilo (K) Abbreviation RAM and ROM.
of Kilo, normally
meaning 1 0 0 0 , but Micro (also u) Prefix signifying
1 0 2 4 ( 2 1 0 ) when referring one millionth. Also used
to memory. descriptively of something
very small, though not as
Kansas (City) A standard for small as nano- or pico-.
recording programs and data
on cassette tape, named after Microprocessor An LSI chip
the city where a conference holding a complete processor
was held, at which the (arthmetic logic unit and
standards were agreed. control unit).

ZX C O M P U T I N G S U M M E R 1982 121
Computer Glossary
Microprogram A very low Pascal Program language,
level Of programming, designed to facilitate
normally implemented in ROM structured programming
by the processor's especially on small interactive
manufacturer, to increase in machines. Named after
effect the set of instructions Gabriel Pascal.
which the processor can
obey. Patch A small piece of
computer program inserted in
Minicomputer A somewhat a longer program to remedy
vague term for the middle some bug or defect in it.
range of computers.
Machines addressing up to Peripheral Device attached to
64K bytes or words of a computer, eg printer,
memory tend (at the present plotter, disc unit, but not
time) to be called necessarily essential to its
microcomputers and use.
machines able to address
more than 64K memory PILOT A programming
locations tend to be called language for small computers,
minicomputers unless they designed to be particularly
separate into distinct parts, in appropriate for teaching in
which case it may be called a schools.
mainframe.
Plotter Computer-driven
Mini floppy The smaller size graphic display using pen on
of floppy disc. 5'/« " paper.
in diameter.
PROM Programmable Read
Modem Acronym for Only Memory.
MOdulator/DEModulator — a
device adapting computer
data for transmission by
telephone line and vice versa.

Monitor The first level of


computer operating systems:
the program which turns RAM Random Access
machine code commands into Memory. Read write memory.
action, managing input, Data may be written to or
output etc. read from any location in this
type of memory.

Reset (button) A switch


whereby computer control is
returned to the monitor or
low-level operating system
and all internal variable values
Operating System The are changed to zero. This
computer's resident program may be the only way of
getting out of some endless
which determines how
loop which has arisen from a
instructions, input and output
programming error.
devices, etc are managed.

Overlay A program too long Return Return the key and


for the available memory may corresponding computer
be entered and processed by instruction which sends the
instalments, each segment contents of keyboard buffer
overlaying or replacing the into a computer's memory for
code previously stored while execution (term derives from
the various values allotted to 'carriage return' on a
common variables would typewriter).
continue from one program to
the next. ROM Read Only Memory.

R S 2 3 2 A communications
interface used for modems
and for serial printers.

Run The instruction to


execute a program.

Package A set of programs n-sec Nanosecond, one-


designed to perform a thousand-millionth of a
common task, eg payroll, second.
generalised to suit a variety of
users. A turn-key package
may comprise both the
programs and the equipment
on which they run.

122 ZX C O M P U T I N G S U M M E R 1982
Computer Glossary

Thermal (Printer} A matrix


printer wherein the print
impression is made by heating
a selected pattern of wires
within a matrix (say 5 x 7) so
that the heat causes points
on the specially-treated paper
to darken, to form the
selected character.

Time-Sharing A method of
operating a computer
whereby two or more users
apparently enjoy simultaneous
access to and control of the
machine. In practice what is
happening is that the
computer is attending to the
users one at a time, but in a
sequence of time intervals so
short that none is normally
aware of any delay.

V D U Visual Display Unit - a


television-type screen on
which computer messages
can be displayed.
and not for general purpose and still loses its contents
use. when power is removed.

Software The different kinds String A sequence of


of program required to work a alphanumeric characters.
computer.
S - 1 0 0 Name of a bus or Word The specified number of
connection standard shared Source code A program bits that a computer is
by many manufacturers and written in one of the high- organised to process as a
employing 1 0 0 connection level languages and requiring group — eg 1 6 bit word: but
positions. Unfortunately, compilation into machine the popular 8-bit word is
there are some minor language before use. called a byte.
variations between different Terminal A device, normally
manufacturers' versions of Static RAM Random Access remote from the computer, at Word Processor A computer
the S - 1 0 0 bus but the l-EEE Memory which does not which data can enter or leave with software for entering,
has now defined a universal require continuous refresh a communication network — editing, storing, formatting
standard for it. Primarily signals but tends to use more eg a tele-typewriter working and printing text, rather than
designed as a memory bus power than Dynamic RAM, over telephone lines. processing figures.

ZX C O M P U T I N G S U M M E R 1982 123
SQUAREOLOGY

J A Enness, Poole, In this version the player plays


against the computer, and a
Dorset, has written pattern of lines is drawn up to
start the game off at a more in-
a well-documented teresting level. The matrix is 1 2
x 9 dots giving 1 9 5 possible
program which moves, the score and "whose
turn", etc is printed below. The
plays a game based on the old pattern choice is not random in
any manner and the same

favourite where two players take choice of pattern number will


result in the same pattern.

turns to link dots in a matrix, with The patterns 1-9 will fill up
6 0 or so moves in the matrix
each player trying to avoid placing and then return to "Your
move". Patterns from A-Z may
a line in such a manner as to allow or may not start with "Your
move", and some squares may

the other to complete a square. If be "claimed" by the pattern.


These will be marked with an

a player completes a square, it is " / " in the centre and are not
counted on the score. If 0 is the

marked for the player, who then choice of pattern then no pat-
tern will be produced and the

gets a second turn. game will start with "Your


move".

124 ZX C O M P U T I N G S U M M E R 1982
16K Programs.
After taking your move the becomes Q and vice versa.
c o m p u t e r will react " M y Lines 1 3 0 - 1 3 4 sort out the
move" followed by "Search". score. If all 8 8 squares are
The search routine then checks taken then the game finishes at
all 1 9 5 possible moves to see if line 1 4 4 where pressing any
it can claim any squares. If it key starts another game.
can, it will complete the square Otherwise line 1 3 6 starts the
and start again with " M y next turn by jumping back to
m o v e " . Unfortunately the line 6 4 .
search takes approximately 1 2 Lines 1 5 0 - 1 6 6 Starts the
seconds. This routine may be search routine during " M y
altered to a FAST mode by in- turn" using part of Sub 4 4 0 ,
serting a new line 1 5 3 FAST only this time Q = 3. If L or
followed by a new line at 1 6 7 M = 1 then its found a three-
SLOW. sided square. In this case line
This means that the screen 2 0 0 - 2 1 0 loop around until the
will blank out for a couple of missing side position is found.
seconds during the search, Since " M y turn" looks directly
which in my opinion is not so at a position (I) and doesn't
good. If the search is unsuc- choose X, Y co-ordinates then
cessful the word "Search" is sub routine 4 7 0 supplies X, Y,
followed by an " X " after which and E. it then jumps back into
it makes its choice of move. the original program at Line
This is reasonably fast and nor- 1 0 6 having worked out its
mally takes only a second or move.
two depending on the complex- Lines 1 6 8 - 1 9 6 constitute the
ity of the situation. It does this computer's turn if the search
by the simple reasoning: if one for three sides is unsuccessful.
of its choices is impractical then This will choose any untaken
it will not take that move into position. G:-lndicates if there sides altogether (eg in this case position other than one which
account again. are any safe moves left. I:-Is us- Q = 4 thus any four sides in any will make up more than two
When the grid becomes so ed to search/ modify the data in four directions will let J, K, L or sides in any square. (Q = 2 this
full that it is impossible to move A. M at least equal 1). time.) It starts at position two
without giving any squares Lines 2 8 - 5 2 set up the display Lines 1 1 8 - 1 2 6 If the four sides (I) and jumps in steps of 6 0 , to
away, the program is not able to grid etc. of a square are present, then find a suitable position. If
take into account how many Lines 5 4 - 6 0 set up D which is the program will go to various l > 1 9 5 then let 1 - 1 - 1 9 3
squares you can claim from its used for the pattern routine. parts of subroutine 4 8 0 . This keeps this within the " A "
move. For this reason the com- Lines 6 2 - 6 4 set up " M y routine works out by J, K, L or boundary. This tests each
puter scores two points for score", "Your score". These M, the direction of the print number from 2 to 1 9 5 without
every square it takes. look better in inverse charac- statement, which will 'black' repeating, looking reasonably
The ultimate object being ters. Sub 4 2 0 simply blanksout the squares and insert an "*" a at random.
not only to win, but to beat the the line at 1 9, 0; and sets the " - " or a " / " depending upon Once 1 9 5 is reached G = 1
computer 8 8 to 0 , which is next print position again for this w h o s e m o v e c l a i m e d the and Q = 4 allowing the next
almost impossible. If, however, line. square. available position to be taken.
you beat it by 5 0 points (which Lines 6 6 - 7 2 sort out whose This simply takes the value This time at line 1 9 6 we return
is very difficult), the coveted move. (The pattern starts at of whose turn (in C) adds 2 2 to the main program 104, to
"Congratulations" line prints 2 2 0 . The " M y m o v e " starts and prints the CHR $. U is simp- allow a little longer to display
up. at 1 50.) ly used to help simplify the print the " M y moves" choice (line
The BREAK key will stop the Lines 7 4 - 1 0 0 set up all the statements. 1 9 4 ) . (X * 2 + 3 7 + E) works
program at any time. (This can variables and traps for "Your Line 1 2 8 If there is no pattern or out the relevant letter.
be useful for sampling the pat- moves" choice. X - Value for winning move then let C = ABS Note: If you wish to set up
terns by simply: BREAK, RUN, the position acrots the grid. ( C - 1 ) . This changes the the pattern fast then insert Line
another choice of pattern This can be from 0 to 11. (0 for player's turns. If C = 1 it 2 2 1 FAST and line 6 9 SLOW.
number.) Working out where A, 1 for B and C, 2 for D and E
the computer is going to move etc.) This, together with infor-
next has been deliberately mation of whether an odd or
made difficult to follow after its even line number down, sorts
first couple of moves. out the print position. This ar- 2 CLS
rangement prevents illegal en- 4 PRINT " S Q U A R E O L O G Y " , „ " B Y J. ENNESS"
The Program tries on the dots or in the middle
of the squares. Y = the up/
6 PRINT AT 3 , 3 ; " T H E OBJECT OF THIS GAME IS TOJOIN
THE DOTS AND COMPLETE A S " , " M A N Y SQUARES AS
Lines 2 - 1 0 set up the instruc- down position. POSSIBLE. T H E " , " COMPUTER ALSO TRYS THIS: AFTER
tions. Note:- Double words, (eg Line 1 0 2 goes to the last line of " , " MAKING THE FOURTH MOVE ON A N Y ' V ' T H I R D
fora) are separated by the end Sub 4 7 0 to get the odd or even SIDE."
of one line and the beginning of number which is stored in E. 8 PRINT " [ ] ( ] [ ] THE COMPLETION OF A SQUARE
the next. E = 0 for even, 1 for odd. " / ' W I L L BLACKEN THE GREY LINES A N D " , " P U T AN
Line 12 goes to an inkey $ trap. Lines 1 0 4 - 1 0 6 again prevents . » O R " " - " " IN ITS CENTRE"," NOTE:-THE
(Sub 4 0 0 . ) The program will illegal entries and prevents COMPUTER SCORES T W O ' Y ' P O I N T S PER SQUARE YOU
not continue until a key is press- entering a move already taken. LOSE."
ed. The value of the key is Lines 1 0 8 - 1 1 0 store and print 1 0 PRINT " [ ] [ l t ] TO START SELECT A PATTERN
recorded in Z $. Not used in this a move. 1 - 9 0 R " " 0 " " FOR NO PATTERN OR A-Z FORA
case. Line 1 1 2 Q = The number of MYSTERY START. TO ENTER A MOVEPRESS THE
Lines 1 6 - 2 6 set up the sides to be taken into account in LETTER THEN N U M B E R / S ' V ' O F THE REQUIRED
variables. A:- Keeps a record of Sub 4 4 0 . Sub 4 3 0 simply zeros POSITION. T H E " , " W I N N E R OF A SQUARE HAS A
the 1 9 5 possible moves. J, K, L and M in Sub 4 4 0 these SECOND M O V E . " , , " [ ] [ 1 [ ] ( ] PRESS ANY KEY
V:-Records the score. C:- variables change to 1 if anytjf TO START"
Defines "whose m o v e " . F:- the four directions possible 12 GOSUB 4 0 0
Starts the computer's turn from a position has Q number of 14 CLS

ZX C O M P U T I N G S U M M E R 1982 125
16K Programs.
16 DIM A ( 1 9 5 ) 160 GOSUB452
18 DIM V(3) 162 IF L OR M = 1 THEN GOTO 2 0 0
20 LET C = 2 164 NEXT I
22 LET F = - 5 8 166 NEXT A
24 LET G = 0 168 PRINT " X " ;
26 LET 1 = 0 170 LET Q = 2
28 PRINT " [ ] [ } [ ] [ ) [ ]"; 172 LET F = F + 6 0
30 FOR A = 3 8 TO 6 0 174 IF F = 1 9 5 THEN LET G = 1
32 PRINT CHR$ A; 176 IF F > 1 9 5 THEN LETF = F - 1 9 3
34 NEXT A 178 IF A ( F ) > 0 THEN GOTO 1 7 0
36 PRINT 180 LET I = F
38 FOR A = 2 TO 18 STEP 2 182 GOSUB470
40 IF A < 1 0 THEN P R I N T " [ ] " ; 184 IF G = 1 THEN GOTO 1 9 4
42 186 GOSUB 4 3 0
• • 188 GOSUB 4 4 0
44 IF A = 18 THEN GOTO 5 2 190 I F J + K + L + M > 0 THEN GOTO 1 7 0
46 IF A + 1 < 10 THEN P R I N T " [ J"; 192 GOSUB430
48 P R I N T " [ ] [ ] [ ] " ; A + 1,, 194 PRINT '* [ 1"; CHR$ ( X * 2 + 3 7 + E ) ; " - " ; Y
50 NEXT A 196 GOTO 1 0 4
52 PRINT A T 19,0;"PATTERN REQ. 1 -9: OR MYSTERY 198 REM SEARCH SUCCESS
A-Z" 200 IF L = 0 THEN LET L = - 1
54 GOSUB 4 0 0 202 IF A(l> = 0 THEN GOTO 2 1 2
56 LET D = C 0 D E Z $ 204 LETl = l + 1 1 *L
58 I F Z $ = " 0 " THEN LET C = 1 206 IF AO) = 0 THEN GOTO 2 1 2
60 IF Z$ > " 0 " AND Z$ < " A " THEN LET D = VAL Z$ * 4 + 3 8 208 LET 1 = 1+ 1 *L
62 PRINT AT 2 1 , 0 ; " M Y SCORE"; AT 2 1 , 1 5; "YOUR 210 GOTO 2 0 2
SCORE 212 GOSUB 4 7 0
64 GOSUB 4 2 0 214 GOTO 1 0 6
66 IF C = 1 THEN PRINT "YOUR M O V E : " ; 218 REM PATTERN CHOICE
68 IF C = 2 THEN GOTO 2 2 0 220 IF 1 > 0 THEN NEXT B
70 IF C = 0 THEN PRINT " M Y M O V E : " ; 222 IF l > 0 THEN LET C = 0
72 IFC = 0 THEN GOTO 1 5 0 224 FOR B = 1 TO 6 0
74 GOSUB 4 0 0 226 LET 1 = I + D
76 IF Z $ < " A " OR Z $ > " W " THEN GOTO 7 4 228 IF I > 1 9 5 THEN LET I = I - 1 9 3
78 PRINT " [ ] " ; Z $ ; " - " ; 230 GOSUB 4 7 0
80 LET X - INT ((CODE Z$ - 3 7 ) / 2 l 232 GOTO 1 0 6
82 LET Y = 0 398 REM INKEY$
84 GOSUB 4 0 0 400 IF INKEY$ < > " " THEN GOTO 4 0 0
86 IF Z$ < > " 1 " THEN GOTO 9 4 402 IF INKEY$ = " " THEN GOTO 4 0 2
88 LET Y = 10 404 LET Z$ = INKEY$
90 PRINT " 1 " ; 406 RETURN
92 GOSUB 4 0 0 418 REM PRINT BLANKS
94 IF Z$ < " 0 " OR Z$ > " 9 " THEN GOTO 6 4 420 PRINT AT 1 9 , 0 ; " I ] [ ] [ ] [ ] [ ] [ 1 - Line of 3 2
96 LET Y = V A L Z $ + Y spaces — [ 1"
98 PRINT Z$ 422 PRINT AT 1 9 , 0 ; " [ 1 [ ] [ ] " ;
100 LET l = X + ( Y - 2 ) * 1 2 - INT ((Y - 21/2) ' 424 RETURN
102 GOSUB474 428 REM ZERO SEARCH VAR.
104 IF Y < 2 O R Y > 1 8 OR E = 0 AND X = 0 THEN GOTO 6 4 430 LET J = 0
106 IF A ( l ) > 0 THEN GOTO 6 4 432 LET K = 0
108 LET All) = 1 434 LET L = 0
110 PRINT AT Y - 1 , X # 2 + 4 + E ; " # " 436 LET M = 0
112 LET Q = 4 438 RETURN
114 GOSUB430 439 REM SEARCH AROUND 1
116 GOSUB440 440 IF E = 0 THEN GOTO 4 5 2
118 LET U = X * 3 + 4 442 IF X > 1 0 THEN GOTO 4 4 8
120 IF M = 1 THEN GOSUB 4 8 6 444 IF A(l) + AO + 1) + A(l + 1 2) + AO - 1 11 = Q THEN LET J - 1
122 IF L = 1 THEN GOSUB 4 8 4 446 IF X < 1 THEN RETURN
124 IF K = 1 THEN GOSUB 4 8 4 448 IF A(l) + AO - 1 > + AO - 12) + AO + 1 11 = Q THEN LET K = 1
126 IF J = 1 THEN GOSUB 4 8 0 450 RETURN
128 IF C < 2 AND J + K + L + M d THEN LET C = ABS (C - 1) 452 IF l > 1 7 2 THEN GOTO 4 5 8
130 LET V(C + 1 ) = V(C + D + J + K + L + M 454 IF A(l) + AO + 1 1 ) + AO + 12) + A(I + 2 3 ) = Q THEN LET
132 PRINT AT 2 1 , 9; V ( 1 ) ' 2; AT 2 1 , 2 7 ; V ( 2 ) L= 1
134 IF V(1) + V(2) + V(3) = 8 8 THEN GOTO 1 3 8 456 IF I < 2 4 THEN RETURN
136 GOTO 6 4 458 IF A(l) + A(l - 1 1) + AO - 12) + AO - 23) = Q THEN LET
138 GOSUB 4 2 0 M =1
140 PRINT " I W O N - HARD LUCK" 460 RETURN
142 IF V ( 1 ) * 2 < V ( 2 ) THEN PRINT AT 1 9 , 3 ; " Y O U W O N - 468 REM FIND E.X.Y. FROM 1
WELL DONE" 470 LET Y = INT (0 + ( 0 + 1 1 ) / 2 3 - 1 ))/12) + 2
IF V ( 1 ) * 2 + 5 0 < V ( 2 ) THEN PRINT AT 1 9 , 0 ; " W O N BY 472 LET X = I - ((Y - 2) • 1 2 - INT «Y - 2 ) / 2 »
CO

OVER 5 0 " " C O N G R A T U L A T I O N S 474 LET E = INT (Y/2 + 0 . 5 ) * 2 - Y


144 GOSUB 4 0 0 476 RETURN
146 GOTO 14 478 REM PRINT WINNER
148 REM MY TURN CHOICE 480 IF K = 1 THEN LET Y = Y - 1
1 50 GOSUB430 482 LET U = U + 2
152 PRINT AT 1 9 , 1 2 ; " S E A R C H " ; 484 LET Y = Y + 2 - E
154 LET Q = 3 486 PRINT AT Y = - , U ; " B " ; AT Y - 2 , U - " ! ; " • " ; AT Y - 2 ,
156 FOR A = 2 4 TO 3 4 U + 1 ; " B " ; AT Y - 3 , U ; " B " ; AT Y - 2,U;CHR$ (C + 2 2 )
158 FOR l = A TO 1 7 2 STEP 4 6 488 RETURN

126 ZX C O M P U T I N G S U M M E R 1982
WHAT'S ON NEXT?
IN HOBBY ELECTRONICS

• • 15 • 3Er The HE
• 1 E• 1 FFC3 MicroTrainer.
mm n a • n m • H• D
mM i i 1B •k C3B5
• a • a a 3FF
W1
n. i E ED H K n i* PROJECTS FOR
— • a • c s a • E
EVERYONE
«

w F E Dc • • • D
or 1— 3 H •
XI T3E
X if • • • • FB * Light-Operated Power Switch
p 1 K E• 1 FC * Auto-Wah Effect
n DX % E • * Greenhouse Monitor
#
Telephone Timer
* Power Supply Design Project

Next month we begin a brand new computer


PLUS
hardware project, the HE MicroTrainer. Based A New Feature Series
on the 1802 microprocessor, it is simple to The Electronic Revolution
construct and easy to operate, the perfect The development of electricity and electronics,
machine to introduce the 'nuts and bolts' of from Vota to Video.
microcomputer technology. The MicroTrainer
has been designed specifically for Hobby AND
Electronics' readers, and offers a number of
distinct advantages over other development All our regular stars
systems: MONITOR
* Low cost. POINTS OF VIEW
* Modulated video output for direct input to a INTO RADIO
domestic television receiver, permitting more CLEVER DICK
information to be displayed than is possible
with LED readouts. The 1 2 line x 12 The June issue of Hobby Electronics will be in
character display shows the complete set of your newsagents on May 14th
1802 registers or 32 bytes of program DON'T MiSS OUT . . . . PLACE YOUR ORDER
memory. NOW
* Displays the current instruction, in mnemonic Simply fill out the coupon and hand it to your
form. local newsagent so that your copy will be
* Unique single-step operation from RAM or reserved for you.
ROM based software.
* Cassette tape storage of user programs.
* Twenty command functions, eg RUN, STEP, Ptease reserve copies of the June issue of
STOP, RESET, INTERRUPT, INSERT, DELETE,
SAVE, LOAD, Hobby Electronics
* Twenty key keypad for direct input of for
Hexadecimal data or Name
command functions. Address
* Includes 1.5 KBytes of RAM for user
programs.
* Optional 2 4 line I/O port
* High quality, double-sided through-hole-plated
printed circuit board simplifies construction.

ZX C O M P U T I N G S U M M E R 1982 127
Specifications

MACHINE
SPECIFICATIONS
ZX80 Immediate mode
The Z X 8 0 will function in the "calculator mode" by immed
iately executing a statement if it is not preceded with a line
number.
Dimensions Cassette interface
Width 174mm (6.85 in) Works with most domestic cassette recorders. The transfer rate
Depth 218mm (8.58 in) is 250 baud using a unique tape-recording format. Other
Height 38 mm (1. 5 in ) systems are not compatible with the ZX80's. The Z X 8 0 also
Weight 300g (10.5oz> SAVEs the variables as well as the program on cassette. There-
fore you can save the data for updating next time the program
Microprocessor/Memory is executed. The Z X 8 0 does not support separate data files. The
Z80A 3.25 MHz clock lead supplied with the Z X 8 0 is fitted with 3 . 5 m m jack plugs.
ROM: 4K bytes containing BASIC Expansion bus
At the rear has 8 data, 16 address, 13 control lines from the
RAM: I K bytes internal, externally expandable to 16K bytes. processor and Ov, 5v, 9 11 v, 0 and internal memory control
line. These signals enable you to interface the Z X 8 0 to your
own electronics, PIO, CTC, SIO if you want I / O ports etc.
Display Power supply
Requires an ordinary domestic black and white colour T V . The The Z X 8 0 requires approximately 4 0 0 m A from 7 - 1 1 v DC. It
lead supplied connects between the Z X 8 0 and your TV's aerial has its own internal 5v regulator.
socket. The display organisation is 24 lines of 3 2 characters T V standard
per line showing black characters on a white screen. The Z X 8 0 The Z X 8 0 is designed to work with U H F TVs (channel 36)and
does not connect to a printer. is the version required for use in the United Kingdom. The
Programming Z X 8 0 USA is designed to work with a V H F TV<American
Programs can be entered on the keyboard or loaded from channel 2. European channel 3) and is the version required for
cassette. The Z X 8 0 has automatic "wrap round" so lines of the American T V system, also for countries without U H F ,
program can be any length but not multi-statement lines.

ZX81
Syntax check
The syntax of the entered line is checked character by char-
acter. A syntax error cursor marks the first place the syntax
breaks down if there is an error. Once any errors have been
Dimensions
edited out the syntax error cursor disappears. Only syntax
Width 167mm (6.32 in)
error free lines of code are accepted by the Z X 8 0 .
Depth 175mm (6.80 in)
Graphics
Height 4 0 mm (1.57 in)
Total of 22 graphics symbols giving 4 8 x 64 pixels resolution
Weight 350 gms (12.15 oz)
consisting of 10 symbols plus space and inverses. Includes
symbols for drawing bar charts. Under control of your BASIC
Microprocessor/Memory
program any character can be printed in reverse field.
Z 8 0 A 3.25 MHz clock
Editing
ROM: Containing 8K BASIC interpreter
The line edit allows you to edit any line of program or input
including statement numbers. The edit and cursor control RAM: 1K bytes internal, externally expandable to 16K bytes.
keys are E D I T , R U B O U T , H O M E .
Arithmetic Keyboard
Arithmetic operators + , - , x , exponentiate. Relational oper-
4 0 key touch-sensitive membrane. Using function mode and
ators < , > , = , yielding 0 or — 1. Logical operators A N D OR
single press key-word system, this gives the equivalent of 91
NOT yielding boolean result. Relational operators also apply to
keys and also graphics mode allows an additional 20 graphical
strinqs. Z X 8 0 BASIC uses 16 bit two's complement
and 54 inverse video characters to be entered directly.
arithmetic ( + 32767 ).
Display
Variables
Requires an ordinary domestic black and white or colour T V .
Numeric variable names may be any length, must begin with a
The aerial lead supplied connects the Z X 8 1 to the T V aerial
letter and consist of alphanumerics. Every character in the name
is compared thus an infinity of unique names is available. socket. The display is organised as 24 lines of 32 characters
String variables may be assigned to or from, shortened but not with black characters on a white background.
concatenated. String variable names are AS — ZS. Strings do not Two mode speeds
require a dimension statement and can be any length. The Z X 8 1 can operate in two software selectable modes FAST
Arrays have a maximum dimension of 255 (256 elements) each. and N O R M A L . FAST is ideal for really high-speed computing.
Array names consist of a single letter A - Z . In N O R M A L mode however the Z X 8 1 allows continuously
Control variable names in FOR. . . N E X T loops consist of a moving, flicker free animated displays
single letter A—Z. Printer
The 8K ROM will permit instructions ( L P R I N T . LLIST and
Expression evaluator COPY) to drive the Sinclair Z X Printer
The full expression evaluator is called whenever a constant or Programming
variable is encountered during program execution. This allows Programs can be entered via the keyboard or loaded from cass-
you to use expressions in place of constants especially useful in ette. Programs and data can be saved onto cassette so that they
GOTOs, GOSUBs, F O R . . . N E X T etc.
128 ZX C O M P U T I N G S U M M E R 1982
Specifications
are not lost when the Z X 8 1 is turned off. Arrays
Syntax check
The syntax of a tine of program is checked on entry. A syntax Arrays may be multi dimensional with subscripts starting at 1,
error cursor marks the first place the syntax breaks down if
there is an error. The syntax error cursor disappears when errors Expression evaluator
have been corrected. Only lines free from syntax errors will be The full expression evaluator is called whenever an expression,
entered into the program. constant or variable is encountered during program execution.
Graphics This powerful feature allows use of expressions in place of
Apart from the 20 graphics characters, space and its inverse, the constants and is especially useful in G O T O , GOSUB etc.
display may also be divided into 64 x 44 pixels, each of which Command mode
may be 'blacked' in or 'whited' out under program control. The Z X 8 1 will execute statements immediately, enabling it to
Editing perform like a calculator.
A line editor allows you to edit any line of program or input, Cassette interface
including program line numbers. Lines may be deleted, in- Works using domestic cassette recorders. The transfer rate is
creased or decreased in size. 250 baud and uses a unique recording format not compatible
Arithmetic with other systems. The Z X 8 1 will save the data as well as
Arithmetic operators +, —, x, , exponentiate. Relational oper the program to avoid the need to re-enter the data when the
ators =, < > , > , < , < = , > = , may compare string and arithmetic program is next loaded.
variables to yeild 0 (False) or 1{True). Logical operators A N D , Z X 8 1 will search through a tape for the required program).
OR, NOT yield boolean results. The cassette leads supplied have 3.5 mm jack plugs.
Floating-point numbers Expansion port
Numbers are stored in 5 bytes in floating-point binary form At the rear, this has the full data, address and control buses
giving a range of i 3 x 10 ' " t o i 7 x 10 "accurate to 9V4 from the Z 8 0 A CPU as well as O V , + 5 V , + 9 V , 0 and the mem-
decimal digits. ory'select lines. These signals enable you to interface the Z X 8 1
Scientific functions to the Sinclair 16K R A M pack and ZX printer.
Natural logs/antilogs; SIN, COS, T A N and their inverses;SQR; Power supply
e*. The Z X 8 1 requires approximately 4 2 0 m A at 7 - 1 I V DC. It has
Variables its own internal 5V regulator. The ready assembled Z X 8 1 comes
Numerical: any letter followed by alphanumerics complete with a power supply. The Z X 8 1 kit does not include
String: A* to Zi a power supply.
FOR N E X T loops: A - Z (loops may be nested to any TV standard
depth. The Z X 8 1 is designed to work with U H F TVs (channel 36) 625
Numerical arrays: A—Z lines.
String arrays: Ai to Zi

ZX C O M P U T I N G - A D INDEX ZX80 - ZX81


Artie Computing
Andrew Developments
Bridge Software
.117
66
47
HARDWARE
D . Bruce Electronics 129
Buffer M i c r o Shop 60 Tape recorder interface unit. Designed
Bug Byte 2
Butler Currie & H o o k 117 to help those with L O A D I N G dif-
C o n t r o l Technology 65
D'K Tronics 3
ficulties. Self contained at £12.50 inc.
Fuller M i c r o Systems 130 Video amp. unit to allow ZX80/81 to
J.K. Greye Software 16
Hewson Consultants 100
drive standard video monitor. Much
Hilderbray Ltd 48 better pictures than on the T.V.'s self
Interface 131
Kayde 78A79
contained at £12.50 inc.
Memotech 10
Microgen 48 Details a v a i l a b l e on Keyboard
M i n d of I n f o r m a t i o n 26
M . O r win 16 Sounders, SAE for more information.
Peter Furlong Products 26
Phipps Ass
Quicksilva
100
132 D. BRUCE ELECTRONICS
Second F o u n d a t i o n
Shiva Publishing
47
130
THE BEACON
Sinclair Research
Timedata
6&7
16
BLACKHALL ROCKS
V & H C o m p u t e r Services
Video Software Ltd
117
26
CLEVELAND TS27 4BH
TEL. 0783 863612.

ZX C O M P U T I N G S U M M E R 1982 129
A
FULLER FD SYSTEM FOR ZX80/81-x
THE MOST VERSATILE SYSTEM FOR EXPANDING YOUR ZX

STANDARD KEYBOARD AND CASE This s p l e n d i d k e y b o a r d a n d case houses y o u r Z X 8 1 p r i n t e d


c i r c u i t b o a r d , w h i c h is s i m p l y s c r e w e d i n t o place, t h e
k e y b o a r d p l u g s i n t o t h e ZX. Y o u c a n n o w e n t e r data w i t h
ease. The 4 0 key s w i t c h b o a r d is a c u s t o m u n i t n o t m a d e up
Fuller o u t o f o t h e r m a n u f a c t u r e r s parts. The k e y t o p s are our o w n
d e s i g n a n d have t h e ZX Q w e r t y a n d f u n c t i o n s f o i l p r i n t e d
1 1 1
o n t o t h e m . A c c e s s t o t h e user p o r t , TV, M I C , a n d ear s o c k e t s
' I ' l ' l ' l V l , , , 1 ! 1 !
M i l l M M are as per t h e ZX case.
1 1 1 1 M I I 1 1 1 Built keyboard and case £36.70 or £30.70 as a kit plus £2.10 postage
/
and packing.

EXTENDED KEYBOARD AND CASE The case is d e s i g n e d t o h o u s e n o t o n l y t h e k e y b o a r d a n d ZX


b u t also o u r m o t h e r b o a r d , p o w e r s u p p l y , R A M c a r d s a n d
t w o o t h e r b o a r d s , n o t necessarily o f o u r m a n u f a c t u r e . The
i n j e c t i o n m o u l d e d case m e a s u r e s 2 0 0 m m x 3 5 0 m m x
6 0 m m a n d h o u s e s a 4 2 k e y s w i t c h b o a r d , t h e extra keys
c a n be assigned t o o t h e r f u n c t i o n s . The case is s u p p l i e d
w i t h a " P o w e r O n " LED.

Built keyboard and case £39.95 or kit £33.95 plus £2.50 postage
and packing. Motherboards £15.95 plus 80p postage and packing.
16k RAM board £35.95. 64k RAM board £79.95.

Keyboard Only Available! Send S A E for details t o : -


Built £24.95 FULLER MICRO SYSTEMS, The ZX Centre,
Kit £18.95 ( + P.P.80p) Sweeting Street, Liverpool 2.

a must f o r
17-111 W+A
Authors: Ian S t e w a r t ft Robin Jones
The reader-friendly guide to getting started w i t h the
Sinclair Z X 8 1 . Includes an introduction to looping and
branching, graphics, subroutines, and debugging
techniques, w i t h over 5 0 programs designed to run
on the standard 1K memory.

Approx. 1 3 0 pages Paperback £ 4 . 9 5


ISBN 0 9 0 6 8 1 2 17 8

Published by: Shiva Publishing Ltd., 4 Church Lane,


Nantwich, Cheshire C W 5 5RQ Telephone: ( 0 2 7 0 1 6 2 8 2 7 2

P l n u tupply coov C O I W I I D I P(EK COKt 8*'E(fKAM


Pnc« 14 96 P4> cop* Chaquat ttaxjid Ha m*t» tuvabl* la PuMi&hmg Lid
NAME (Capitals please) _
Full postal address „

Order from your Bookseller„ or fill in the coupon.


130 ZX C O M P U T I N G S U M M E R 1982
ZX Users' Club
JOIN YOUR USERS' GROUP - AND MAKE THE
MOST OF YOUR MICROCOMPUTER
Join the National ZX80 and ZX81 Users' Club, by subscribing to the official monthly club magazine
INTERFACE.
( ) Please send me the next 12 issues of INTERFACE, containing many programs for each machine in each
issue, plus hints, tips, software, hardware and book reviews, plus special offers for members. I understand
you will be able to help me with problems regarding my computer, and let me know of any local branches i
of the club in my area. I enclose £9.50 (UK), £12.50 (Europe) or £16.00 (elsewhere).

Please send m e the f o l l o w i n g books:

I ) GETTING ACQUAINTED WITH YOUR ZX81 - by Tim Hartnell - £5.95 This great ZX81 book contains
over 80 programs in its 128 pages. Takes you from the first steps of programming your ZX81 to quite com
plex programs such as WORD PROCESSOR, DRAUGHTS and LIFE. You'll find a host of programs to get
your ZX81 up and running with worthwhile programs, right from day one. Other programs include SPACE
BOY, ROLLER-BALL, CHEMIN DE FER, GRAFFITI, MICRO-MOUSE, POGO, TOWERS OF HANOI,
BLOCKOUT, SALVADOR, BANDIT and DODGE CITY.

As well as programs, there are sections to explain the use of PLOT, UNPLOT, PRINT AT, MAKING THE
MOST OF 1K, ARRAYS, WRITING PROGRAMS, BIO-RHYTHMS, ARCADE GAMES. RANDOM
NUMBERS, PEEK AND POKE, HOW TO CONVERT PROGRAMS, USEFUL ADDRESSES, SPECIFICA
TIONS, THE NEW ROM.

) THE GATEWAY GUIDE TO THE ZX81 AND ZX80 - by Mark Charlton - £6.45 Explains ZX BASIC from
first principles. 180 pages, more than 70 programs. Recommended by Creative Computing

) MASTERING MACHINE CODE ON YOUR ZX81 OR ZX80 - by Tony Baker - £7.50 Warmly welcomed
by the computer press, this book has continued to attract praise, because it does exactly what it claims to
do in the title.

) 49 EXPLOSIVE GAMES FOR THE ZX81 (and 29 for the ZX80) - edited by Tim Hartnell - £5.95 Every
game you need: DRAUGHTS, GALACTIC INTRUDERS, STAR TREK, DEATH MAZE, 4-IN-A-ROW and
an 8K ADVENTURE-type program SMUGGLERS BOLD.

) 34 AMAZING GAMES FOR THE 1K ZX81 - by Alastair Gourlay - £4.95 All programs dumped from the
printer and guaranteed to run. This book is the key to making the most of 1K.

> GETTING ACQUAINTED WITH YOUR VIC20 - by Tim Hartnell - £6.95 This book is the ideal one for
first-time users of the VIC 20, with over 60 programs.

) SYMPHONY FOR A MELANCHOLY COMPUTER and other programs for the VIC20 - £6.95 A great col-
lection of 24 great games - all dumped direct from the printer - for the VIC20.

) GETTING ACQUAINTED WITH YOUR ACORN ATOM - by Trevor Sharpies and Tim Hartnell - £7.95

) 39 TESTED PROGRAMS FOR THE ACORN ATOM (the best of INTERFACE) - £6.45

) PASCAL FOR HUMAN BEINGS - Jeremy Ruston - £6.45

INTERFACE,
44-46, Earls C o u r t Road, D e p a r t m e n t ZC, L o n d o n W 8 6EJ.

Please send m e the indicated i t e m s . I enclose £ .

Name

Address
Q8 D E F E N D E R . Q8 INVADERS. Q8 A S T E R O I D S
trp DOWN THRUST-FIRE LEFT RIGHT FIRE LEFT RIGHT THRUST FIRE
First and onJy ftill screen display 13x7 INVADERS; High score; 3 Software to drive QS SOUND BD
Software to drive QS SOUND BD levels of play. RND saucers; Bonus Multiple missiles firing in 8
Moving Planetary surface. Up to base. Drives Sound bd fifCHRS bd directions On screen scoring
84 fast moving characters on Requi res 7K RAM. 8K ROM v Slow Increasing number of asteroids
screen at once On screen scoring 4B.80. Full mobility of ship to all areas of
Ten missiles at once Increasing the screen Two asteroid sizes
attack patterns Requires 8K Bonus ship at 10,000 points
ROM. and 4K mln of RAM £>5.50. Requires 8K ROM. 4Kmin of RAM
+ SLOW function A8.BO.
Q6 S O U N D BD. Q8 3 K R A M Bd.
A programmable sound effects An extremely reliable static RAM
board using the AY-3-8910 3 Bd which combines with the
TONES. 1 NOISE, ENVELOPE computer's memory to give 4K
SHAPE R • TWO 8 BIT I/O PORTS total Plugs direct in to the rear
Easily programmable from port on your ZX Computer
BASIC, the A Y chip does most of £18.00.
the work leaving your computer
free for other things Signal 0/P QB M O T H E R B O A R D BD. & Q8
via 3 6 mm Jack socket Ports 0/P CONNECTOR.
via a 16 pin I.C Socket A86.00. A reliable expansion system
allowing a total of any RAM pack
Q8 H I R E S BD. plus twoother plug in boards to be
Q8CHBSBD./
A Hi - res graphics board g: /ing in use at once On board SV
A programmable character
256 x 192 PIXELS 6K ON BD regulator drives all external
generator givmg 128 SEP- boards Fitted with two 23 way
RAM SOFTWARE SELECT/
ARATELY PROGRAMMABLE double sided edge connectors
DESELECT MIXED TEXT AND
CHARACTERS ON/OFF .TWITCH Connector is 2 x 23 way edge
GRAPHICS 2K ON BOARD ROM
IK ON BOARD RAM Enables conns soldered back to back
Resident fast machine code
creation and display of your own graphics software ( i n ROM) Expansion can operate in two
characters to screen or printer provides the following HI RES ways - < 1 ) COMPUTER —
Demo cassette of fast machine Commands MOVE x.y. PLOTx. CONNECTOR — Any QS add on bd
code operation routines and lower y. DRAW x.y; BOX x.y, UP, DOWN (but no extra RAM pack > ( 2 )
case alphabet included See below LEFT. RIGHT. PRINT A « , SCROLL; COMPUTER — CONNECTOR
for ZX PRINTER listing A 2 6 . 0 0 . BLACK. WHITE CLEAR COPY See MOTHER BD — ANY RAM PACK
Q 5 - LOUCR c«se above for ZX PRINTER listings ( 2 b d s t o f l t m mother bd 1 Mother
i b cd « « 9 h • j t n i n o M r n u v u x ^ i using COPY £ 8 5 . 0 0 . board A 1 a.OOConnector A4.00.

Special o f f e r s & news


( 1 ) Q S Mother bd + connector ^CHRS bd. • The special Graphics version of
ARCTIC C O M P U T I N G ' S ZX CHESS I I . A 4 8 . 0 0 .
The strongest chess program with 7 levels of play
( 3 ) QS MOTHER BD * CONNECTOR + either SOUND or C H R f b d A 4 0 . 0 0 .
We will be at the following shows Come and see us
THE COMPUTER FAIR, Earls Court, 23rd t o 88th April • r .
3rd ZX MICROFAIR, Central Hall, Westminster.
30th April & 1st May
POSTAL AND MONEY ORDERS TO: / ALL PRODUCTS FULLY GUARANTED.
Q U I C K S I L V A : 98, U P P E R B K P W H I L L RD. : M A Y B U 8 H : SOTON : H A N T S : E N G L A N D
Please state Type of machine. Which ROM, Memory si/.J, when ordering

You might also like