More Real Applications for the ZX 81 and ZX Spectrum Macmillan Computing Books Programming for the BBC Ian Birnbaum Advanced Programming for the 16K ZX81 Mike Costello and - their use and programming Eric Huggins The Alien, Numbereater, and Other Programs for Personal Computers­ with notes on how they were written John Race Beginning BASIC Peter Gosling Continuing BASIC Peter Gosling Program Your Microcomputer in BASIC Peter Gosling Practical BASIC Programming Peter Gosling The Sinclair ZX81 - Programming for Real Applications Randle Hurley More Real Applications for the Spectrum and ZX81 Randle Hurley Assembly Language Assembled - for the Sinclair ZX81 Tony Woods Digital Techniques Noel Morris and Microcomputer Technology Noel Morris Understanding Microprocessors B.S. Walker Codes for Computers and Microprocessors P. Gosling and Q. Laarhoven Z80 Assembly Language Programming for Students Roger Hutty More Real Applications for the ZX81 and ZX Spectrum

Randle Hurley

M © Randle Hurley 1982

All rights reserved. No part of this publication may be reproduced or transmitted, in any form of by any means, without permission.

Published by THE MACMILLAN PRESS LTD and Basingstoke Company and representatives throughout the world

ISBN 978-0-333-34543-6 ISBN 978-1-349-06604-9 (eBook) DOI 10.1007/978-1-349-06604-9

The paperback edition of this book is sold subject to the condition that it shall not, by way of trade or otherwise, be lent, resold, hired out, or otherwise circulated without the publisher's prior consent in any form of binding or cover other than that in which it is published and without a similar condition including this condition being imposed on the subsequent purchaser. Contents

Page

Int roduct ion

2 Basic Differences 4

3 At Least As Good 7

4 Ti 11 20

5 A Fi le Handling Survival Ki t 36 6 Super Storage and Statistics 47

7 Cricket 69

8 Draw and Move 93

9 Effective 1K Programmi ng 114 10 Bui 1ding Block Programming 129

11 Music 150

Appendix ZX81 Hardware Modifications 171 The idea for this book must be the result of my contacts with other ZX enthusiasts. It is difficult to trace the material back to source, but I am very grateful to all who helped, consciously or otherwise.

Particular thanks must go to two people. John Watson supported the venture from the start and contributed many helpful suggest­ ions. It was he who provided the final solution to the ZX Merge problem in the form of a ROM address which allowed the computer to re-initialise itself. Linda, my wife, provided the valuable criticism which has allowed me to keep the book as free from jargon and as readable for the beginner as it is. Without her support in the bleak periods and her constant attention to detail the final result would have been much less good.

However you helped, thank you.

Cover photographs of Sinclair equipment kindly supplied by Ltd.