A&B Computing
1st January 1985
Author: Peter Mujtaba
Publisher: Granada
Machine: Acorn Electron
Published in A&B Computing 2.02
This book sets out to tackle the problems of writing larger BASIC and Assembler programs on the Electron. The authors' approach is designed to produce organised programs, carefully planned and designed before coding. They look for reliability through the use of the natural structures of BASIC, like REPEAT...UNTIL and FOR...NEXT, and through the use of functions and procedures.
The key to this organisation is the modular structuring and building of programs - a theme which crops up throughout the book. The authors go into "stepwise refinement", testing and perfecting the individual components of the program. They discuss the use of parameters and local variables as well as the physical appearance of listings, formatting and use of REMs.
On the Assembler side, there are discussions on the natural structures of assembly language, details of how the Electron assembler can be used and a few paragraphs on Macros and some of the problems associated with implementing them.
As the book gets more involved, and the O Level Maths get a bit strained, we move onto data types, arrays, look-up tables, handling a stack structure; everything you need to know about storing and accessing information on your Electron. This sections is very important and well explained, with lots of examples and step by step runs through. These techniques are used by every program worth its salt, from databases to arcade thrillers. A section follows on both BASIC and Assembler control of sequential filing.
An interesting contribution appears in the form of "Making Programs Work" - pretty important! It looks at the testing of programs, the location and eradication of bugs, common errors and program presentation.
Chapters eight, nine and eleven are based upon full-scale programs, Spelling Checker, Execution Tracer and Disassembler. Each is built in stages, including design. All have major elements of Assembler (spelling checks are useless if they are slow) but use BASIC to hold them together and present them in an organised and understandable fashion.
Unfortunately the Spelling Checker, though it works, is, by the authors' own admission, not a completely finished version. Still, if you take all the rest of the information in, you may well be in a position to do something about it! The Execution Tracer takes up the theme of debugging and could be a useful program for the new programmer.
On either side of the Disassembler project are chapters on the MOS and on fundamental background in Bits, Binary and Boolean. The Machine Operating System and the part it plays in the everyday functioning of the Electron is explained. Work on OS calls and interrupt handling lead to the construction of a background clock.
The final chapter looks at binary hex and logic in relation to the way Acorn BBC BASIC and Assembler handle numbers.
The Disassembler itself does not have enough useful facilities to be really useful (but is open to improvement), but introduces some more complex programming techniques and the final result is good enough for "Leafing through" Electron software.
The book is for the programming enthusiast. Although the techniques discussed, and practised throughout, would enabled the writing of efficient programs of all types, the approach is entirely from the point of view of writing code. It will be beyond anyone who is not already an interested and fairly experienced programmer. For the ambitious Electron programmer, who wants to acquire the skills of a professional, this book is an excellent start.