REVIEWS COURTESY OF ZXSR

Understanding Your Spectrum
by Ian Logan
Melbourne House
1982
Sinclair User Issue 14, May 1983   page(s) 89

TALKING IN LANGUAGES THE COMPUTER UNDERSTANDS

John Gilbert reviews the latest books on machine code.

Many Sinclair owners are turning their attention to machine code and trying to program either in direct Z-80 low-level code or in assembly language. Publishers have also entered that area of the market and several good books have been produced.

Melbourne House has two new books which cover machine code and related subjects more than adequately. The first is by Dr Ian Logan, author of several books and pamphlets on the ZX-81 ROM. Understanding Your Spectrum covers both Basic and machine code programming. Its aims are to show how the Spectrum works, to teach Z-80 machine code, and to give the reader an understanding of the ROM operating system in the machine. Logan does all those things in a very expert manner which even the beginner should understand.

The other book from Melbourne House is Spectrum Machine Language For The Absolute Beginner. It is even easier to understand than Logan's. It starts from a very simple base and takes the reader through most of the Z-80 instruction set as implemented on the Spectrum.

The theory is supported by practical examples which can be entered and run by anyone. The book is completed by taking the reader from conception to the completion of an arcade game, Frogger, written all in machine code.

Both books are excellent in content but a little over-priced. Understanding Your Spectrum costs £7.95 and Spectrum Machine Language For The Absolute Beginner £6.95. If you are thinking of programming in machine code, the books will teach you almost everything you want to know.

A good alternative is introducing Spectrum Machine Code by Ian Sinclair. It provides an easy introduction to machine code but does not offer so much in terms of content as the Melbourne House issues.

Sinclair begins by introducing the reader to ROM and RAM. He shows how both those systems are used to give the user an easy way of programming. He then provides a long discussion of Z-80 programming. The book is sprinkled adequately with examples and many of the machine code routines explained are put into Basic listings in the form of DATA, to allow the user to enter them quickly. Introducing Spectrum Machine Code, from Granada Publishing, costs £7.95.

The range of books not aimed at a particular computer is growing. Several will prove useful to Sinclair owners.

Some Useful Basic Subroutines again is written by Ian Sinclair. He uses MicroSoft-type Basic and some of the routines will need re-writing to work on Sinclair machines. The book would be of great value to ZX-81 users, as it includes Basic routines for flashing, scrolling and centering titles, underlining titles and sorting data. From Newnes Microcomputer Books, it is good value at £4.95.

Get More From Your Personal Computer is another title from Newnes. The author is Ian Hickman. It deals with the development of the computer, explains Basic programming and then the principles behind number systems, logic diagrams and, finally, machine code.

It works well as a general guide to the principles of computing and the way in which humans and computers interact. It costs £5.95.

Another general book of interest to Sinclair users is Programming With Graphics by Garry Marshall. It takes the reader through the various types of graphics on computer systems - block, pixel and high resolution. There are also chapters dealing with the production of graphic displays, three-dimensional representation and animation.

For those wishing to produce arcade games or who want to demonstrate physics experiments on the screen, the book is ideal. If you want to know how those images on TRON were created, but at a much simpler level, you will get some idea from the book. It is available from Granada and costs £5.95.

The Youngs Computer Register for the ZX-80 and ZX-81 has just been republished. It now contains an extra supplement with invaluable information on the Sinclair market.

The guide lists the names and addresses of most software and hardware companies and also provides information on products. As with the previous issue, the register is split into sections for easy reference.

Together with the supplement, it can be obtained from Youngs Computer Publications for £3.95. The supplement is also available separately for £2.

The quality of books both in content and packaging is improving as the market expands. Computer books are now finding their way from the technical to the general sections of bookshops. That is a good move, as it will make more people aware of the computer market.

Melbourne House (Publishers) Ltd, Glebe Cottage, Glebe House, Station Road, Cheddington, Leighton Buzzard, Bedfordshire LU7 7NA.

Granada Publishing, PO Box 9, Frogmore, St Albans, Hertfordshire AL2 2NF.

Newnes Microcomputer Books, The Butterworth Group, Borough Green, Sevenoaks, Kent TN15 8PH.

Youngs Computer Register, 2 Woodland Way, Gosfield, Halstead, Essex CO9 1TH.


REVIEW BY: John Gilbert

Transcript by Chris Bourne

ZX Computing Issue 5, Feb 1983   page(s) 103,104

WITH SO MANY PUBLICATIONS BEING WRITTEN FOR THE SPECTRUM WHICH ONE SHOULD YOU LOOK AT FIRST? OUR REVIEW PANEL TAKE A BRIEF LOOK AT TEN OF THE NEW TITELS TO HELP YOU MAKE YOUR CHOICE.

Dr. Logan claims this book has three main aims: to explain, in simple terms, how the Spectrum works; to teach Z80 code from first principles; and to give details of monitor entry points so that efficient programs may be written.

And the author does his best to explain all of it - no easy task! The first two chapters introduce commands and functions which Sinclair BASIC has to offer. Programming examples are provided throughout to aid readers in their understanding.

The third chapter moves into the realms of machine code providing an introduction to the Z80 microprocessor. Illustrations are used where possible to help with this explanation. This is followed by a section on the mathematics of machine code programming and one on the Z80 machine code instruction set.

It is at this stage that you are provided with some sample programs to use and understand. Twenty-two programs are provided in total. The final two chapters of the book concentrate on an outline of the 16K monitor program resident inside the Spectrum and how to utilise the monitor program's subroutines.

Four appendices are included at the back of the book complete with useful reference tables for Z80 machine code instructions, and decimal to hexadecimal conversion. There is also a list of the currently available machine code handling programs. The last appendix is a list of 11 programming errors in the 16K monitor program in the Spectrum, at least two of which are very useful to know.

Understanding Your Spectrum, written by Dr. Ian Logan, is published by Melbourne House. The book has 190 pages and is priced at £7.95.

ISBN 0 86759 114 5


Transcript by Chris Bourne

Your Spectrum Issue 2, Mar 1984   page(s) 73,75

CRACKING THE CODE

Machine code is often the stumbling block that stands int he way of those looking to take a more serious approach to Spectrum programming. Books there are a' plenty, but as ever it's horses for courses. Gary Marshall looks at the form.

It's an indisputable fact that the Spectrum can be made to do just about everything that's possible by programming it in machine code. A claim like that is much harder to make for other programming languages, for instance Basic, because although any computational task can be described, it may not always be performed fast enough.

A program written in any other language than machine code must first be translated into code by the computer before it can be executed - a task which inevitably takes some time. And speed of execution can be reduced further still in circumstances where the computer's translated code has failed to achieve the standards set by an expert human machine code programmer. Consequently, when it comes to speeding things up a bit, machine code is still the best answer. There's also the added advantage that machine code programs are a good deal harder to copy.

Input machine code programs to your Spectrum and you are presenting instructions direct to the Zilog Z-80 microprocessor in the language it understands. The number of instructions in this language is fairly limited and corresponds to the number of operations the microprocessor can perform. But the point is that the programmer deals directly with the electronic hardware, without any recourse to the Basic interpreter. That alone is a very good reason why Spectrum owners should get their hands dirty and find out exactly what's going on in that nifty little box of tricks.

But if all this sounds a bit complicated, not to worry because considerable benefits can be acquired without necessarily going the whole hog. Most Basic programs contain sections which take up a high proportion of the processor's time - elements known as 'critical segments' in the jargon. Programs can be speeded up considerably just by writing these critical segments in machine code.

Finally, before examining the outpourings of various writers on learning the art of machine code programming, it may be worth speculating on whether we ought to be using machine code at all!

In the non-microcomputer world of mainframes and the like, the trend is away from the use of machine code and more towards the structured high level languages. There could be a lesson to be learnt from this, especially with the launch of the Micro Prolog package - a version of the fifth generation language, Prolog (see Frontlines this issue). Overall, however, it's fair to say the facilities offered at present by the fifth generation languages are not entirely suitable for the Spectrum user - so there are still one or two good reasons for learning how to program in machine code.

MAKING THE INTRODUCTIONS

There are already a large number of books available to help enthusiasts program the Z-80 processor, mostly written by electronics engineers and hobbyists. A starter book for Spectrum owners should be as good as these, while at the same time staying relevant to the Spectrum and showing readers how to manipulate the hardware.

And, as always, the newcomer also needs a finely structured and carefully paced presentation of reliable information. Of course, encouragement to actually set the fingers tapping is another basic necessity - the best way to learn program writing is not by sitting down and reading about it. Motivation is another problem area - learning about machine code programming is no bed of roses and even the most manically keen can become discouraged.

Introducing Machine Code by Ian Sinclair provides a gently paced introduction that takes Basic programming as its starting point. Then, by showing how Basic programs are stored and run, it carries on to cover the same areas for machine code. The book introduces a wide range of instructions which are illustrated by way of programming examples. Unfortunately, these example programs rarely turn the spotlight on aspects specific to the Spectrum; in fact, many seem downright incestuous as they are used to examine Basic programs.

The Ultraviolet assembler from ACS Software gets a mention and although its use is quite well demonstrated, a more detailed treatment of hand assembly methods would have been better still. Nevertheless, this book would certainly take the reader from zero knowledge to the point where the more advanced machine code texts could take over.

Another introductory tome comes from James Walsh in the shape of Spectrum Machine Code Made Easy, Volume One. He includes a number of potentially useful machine code programs for activities specific to the Spectrum - such as scrolling the screen and manipulating colours. He's also not afraid to make good use of some intelligent machine code tricks.

However, despite the quality programming, it would have been better if the author had taken the reader further into the subject. The coverage is not very well structured and the pacing leans towards the erratic; for example, after being lulled into the false sense of security that machine code is really easy, after 30 pages the unprepared reader is abruptly launched towards the fairly weighty concepts of Carry, Borrow, Minuend, Subtrahend and two's complement notation!

Most of the programs use instructions before they've been properly introduced and some are not covered at all. For this reason, Volume One on its own is rather limited. Volume Two (surprise, surprise) is the second and more advanced tutor in the series, which provides much of the necessary reference material you need to fully understand Volume One.

In fact there's something of a striking contrast between Volume One and Two in the Spectrum Machine Code Made Easy series. Whereas Volume One strolls at a leisurely pace, and is very chatty and highly inventive in its risque chapter and section headings, Paul Holmes' Volume Two proves altogether more brisk and workmanlike. It comes packed with machine code routines, and that alone makes it a valuable source of information. The only worrying aspect is whether Volume One is fully able to prepare new riders of the machine code plains for the coming demands of Volume Two.

But for the complete novice, there's Spectrum Machine Language For the Absolute Beginner and although little of it is in fact specific to the Spectrum, the book's treatment of Z-80 code is entirely adequate and there's some useful reference material thrown in for good measure. The text is well sprinkled with examples of machine code used well, and also includes a sizeable games program, along with valuable notes on its development. Your author, however, will decline entering it without an assembler!

Toni Baker's Mastering Machine Code On Your Spectrum proclaims itself as championing those who, although familiar with Basic, have no knowledge at all of machine code. But the text fairly rattles along, covering acres of material in a relatively brief time. While there's absolutely nothing wrong with this kind of approach, the feeling is that, rather than a beginner's book, this is for people who know rather more than they're letting on.

Toni conjours up some good programs with interesting applications, including one that produces music from the Spectrum's own speaker. Incredible!

Before moving on to the more advanced titles, there is one last text that you may like to consider should you be starting your machine code career. Tony Woods' Learn And Use Assembly Language On The ZX Spectrum provides a complete course in Z-80 assembly language, complete with many illustrative program examples.

MOVE ON UP

The programmer who has paid his or her base level machine code dues may well like the idea of a book that includes ideas for further programs and new techniques, as well as providing a good source of reference. If you manage to find it, let us know! The trouble is that budding beginner's book start to branch out and a great degree of specialisation occurs.

Ian Logan and Frank O'Hara explain exactly what's inside every Spectrum ROM in their book The Complete Spectrum ROM Disassembly. It's all there, from how the screen is handled to the way Basic actually works. The book shows the location of all the routines in the ROM, so that programmers are able to call them into their own programs. And because the programs are all listed, the book is also a storehouse of programs and techniques.

Another publication that strikes the same vein is The Spectrum Machine Code Reference Guide. Although it didn't arrive in time for review here, the word is it contains a full disassembly listing of the 16K Spectrum ROM as well as a machine code programmer's guide to the Microdrives and Interface 1 unit; it sounds as if it could be worth a look.

Much of the material in Ian Logan and Frank O'Hara's ROM disassembly book appears again in Dr Logan's Understanding Your Spectrum. However, there s also useful stuff on how to use subroutines in the ROM, and by far the best reference section on the Z-80 instruction set your author has seen. The text also provides valuable data on the avail- able assembler and disassembler packages.

Last of all in our round-up, there's Super Charge Your Spectrum by David Webb. This is essentially a library of machine code programs, on hand for liberal sprinkling into Basic programs as and when required. Included amongst this amazing collection is a routine for developing Basic programs, and a number of useful utilities, for instance, a renumberer.

CONCLUSIONS

Your author has to admit a slight disappointment with the beginners' books. None seemed as good as the 'professional' Z-80 texts available, although in fairness this is compensated by the fact that they are specifically designed to be used with the Spectrum.

The more advanced books, however, have no apologies to make. They show exactly what the Spectrum can do, and how it can be made to do it, and all are intimately linked to the Spectrum. If ever you feel in need of encouragement as you stumble slowly through the early steps, check out the more advanced titles and see what you're missing. Inspiration - and motivation should soon follow.


REVIEW BY: Gary Marshall

Blurb: WE LOOKED AT... Introducing Spectrum Machine Code by Ian Sinclair. Granada ISBN 0 246 12082 7. £7.95 Spectrum Machine Code Made Easy, Volume One by James Walsh. Interface Publications ISBN 0 907563 43 0. £5.95 Spectrum Machine Code Made Easy, Volume Two by Paul Holmes. Interface Publications. ISBN 0 907563 44 9 £5.95 Spectrum Machine Language For The Absolute Beginner by William Tang Melbourne House ISBN 0 86161 110 1 £5.95 Mastering Machine Code On Your Spectrum by Toni Baker. Interface Publications ISBN 0 907563 23 6 £9.95 Learn And Use Assembly Language On The Spectrum by Tony Woods. McGraw-Hill ISBN 07 084705 3 £6.95 The Complete Spectrum ROM Disassembly by Ian Logan and Frank O'Hara. Melbourne House ISBN 0 86161 116 0 £9.95 The Spectrum Machine Code Reference Guide by Richard Ross-Langley. Interface Publications ISBN 0 907563 51 1 £4.95 Understanding Your Spectrum by Ian Logan. Melbourne House ISBN 0 86161 111 X £6.95 Super Charge Your Spectrum by David Webb. Melbourne House ISBN 0 86161 1128 £5.95

Transcript by Chris Bourne

All information in this page is provided by ZXSR instead of ZXDB