This is the second of two books on machine code for the BBC Micro. Because the first, Discovering BBC Micro Machine Code, assumed only minimal prior knowledge of the subject, no attempt was made to delve into the more difficult (but powerful) addressing modes offered by the 6502 assembler. Neither was it considered prudent to devote space to hardware, even those aspects which directly influence application software such as the user port, the Tube and the 1 MHz bus.
For continuity reasons, this book, besides repairing some of the omissions mentioned above, treats many of the relevant subjects again but in more detail and, as the title suggests, from a more advanced viewpoint. The word 'advanced' should be interpreted in the relative sense - relative, that is, to the level maintained in the first book.
The elements of binary have been relegated to an appendix to prevent polluting the main text yet again. Binary, to machine code enthusiasts, is rather like the repeal of the corn laws to students of history lacking in glamour but necessary for continuity. Many microcomputer enthusiasts have come from the ranks of the electronic hobbyist and will have an interest in computer control of electronic gadgets. However, not all readers would share their enthusiasm so, like binary, the treatment of TTL logic devices is given in an appendix also.
The self-test questions may help those who may not be too sure whether they have understood what they have read . . . a situation quite common when reading any 'explanation' of microprocessor behaviour patterns.
Numerous machine code routines are included which should help readers to understand the more difficult parts of the text. Some of the lengthy programs will be found to have direct practical value, in business, educational or leisure fields. However, because it is impossible to anticipate bizarre applications, they have been written in a way which should encourage individual tailoring.
The sensible way to employ machine code in the BBC machine is to use it in segments within a BASIC program. It would be pointless, and certainly masochistic, to write entire programs in machine code. The BASIC in the BBC machine is good but there are times when the demands of speed and memory economy justify a temporary leap into machine code and back. The programs in this book, which have been well-tested, are primarily designed to be used in this way. They are indeed, no more than machine code segments. However, in order for them to RUN and to encourage experimentation, they have been spliced into an outer BASIC framework, As for the choice of programs, no apologies are made for the almost total absence of arithmetical routines. Although it is traditional to include routines for multiplication, division, etc., it is doubtful whether they are of much interest to microcomputer users.
An entire chapter, however, is devoted to sort routines because this is one of the areas where the advantage of machine code over BASIC becomes most impressive.
With regard to graphics, the reader is presented with two options, one using the resident service routines and the other using direct screen addressing. The latter option is recognised as being contrary to establishment guidance but, if there are some beneficial results to justify the risk, who cares?
A. P. and D. J. Stephenson