A&B Computing


Electron Machine Code For Beginners

Author: Peter Mujtaba
Publisher: Granada
Machine: Acorn Electron

 
Published in A&B Computing 1.08

The Electron has one big advantage over the vast majority (if not all) comparable home computers and that is the inclusion of an assembler. There will come a time that most users will want to delve into the world of accumulators, X registers, Y registers, stacks and the many wonders of assembler programming.

The reasons for this venture may be varied, be it in order to increase execution speed, to conserve precious RAM or just for the delight of learning the machine's increase execution speed, to conserve precious RAM or just the delight of learning the machine's inner workings. An introductory text is essential and this book by Ian Sinclair (where does he find the time to write all these books?) qualifies for consideration.

It is often the case that machine code/assembler books for beginners pay only lip-service to the task of easing learners into the precise area of machine-code programming, falling into the trap of rushing on too quickly and trying to cover too much. Ian Sinclair has managed to give us a delightful book with the odd touch of humour, but with a lot of information, depending only on a reasonable knowledge of Basic.

The book's opening chapters are priceless to novices in the field of computer innards. Sinclair takes the trouble to introduce the computer jargon (ROM, RAM, bit, byte, MPU, etc) continuing with an introduction to a block diagram of the Electron, considering the links between the ROM, RAM and MPU. Next to get the Sinclair treatment is Basic and a very useful description of how keywords and variables are stored appears in chapter two. The blend of information and comprehensibility has been judged well and though covered in detail, these important topics do not bog down the reader.

The central chapters of the book give the meat of the information on assembler programming. Covered are topics such as hex, addressing methods, the PC, A, X, Y, S and P registers, the basic actions on them, flow-charting, calls to subroutines, very simple movement on scree machine-code loading and saving. These topics are dealt with in a pleasant, readable manner, at all times encouraging the reader to follow the good example programs given.

It's a shame that there are no suggested exercises since I'm sure that beginners reading this book need guidance in developing the basic skills covered and, as such, short exercises would have proved invaluable.

The book's finishing chapters look at the problems involved with debugging programs. Unusually, Sinclair goes into the details of a commercially available took, Orbit's Exmon machine-code monitor, doing a very good selling job on its debugging facilities. Sinclair very briefly covers breakpointing, single-stepping and relocating programs and ends the main part of the book with a taste of what may be done with the stack, having introduced various Operating System calls such as OSRDCH, OSWRCH and OSWORD. At the back there are five appendices covering how numbers are stored in the Electron, hex and denary (decimal) conversion, the instruction set, addressing methods on the 6502, and a section on useful magazines and books.

There is a lot of information in this offering from Sinclair, but it is well presented and extremely well-written. This book does not fall into the trap of trying to put too much into too little space and, as such, at £6.95, is an excellent introduction to Electron machine code. This is a book for beginners and as such the gradual introduction to the subject may prove to slow for a programmer with any 6502 machine-code experience.

Peter Mujtaba