REVIEWS COURTESY OF ZXSR

The Complete Machine Code Tutor
by Malcolm E. Evans
New Generation Software
1984
Crash Issue 8, Sep 1984   page(s) 93,94

THE MACHINE CODE TUTOR

You are sitting in the cockpit of a Lear jet at 1000 feet and approaching the runway at a sickening speed. Damn the instructor! Okay, so he had given you the instruction manual on how to land this bird a fortnight ago, and you have read it over and over again and think you know the proper procedure, step by step, on how to approach the land. The instructor had said it would be dead easy and yet, where is he? He isn't sitting in the co-pilot's seat, talking you gently down, guiding you along and making sure that you develop a hands down experience and live to see it... He knew your survival chances were zero and that the result would be a CRASH!

Learning machine code may not be as dangerous as learning to fly, but the same principles apply. You may buy a book on how to learn machine code, read all about the different commands and their effects, then try them out entering the mnemonics, assembling and running them by entering the famous last words: RAND USR... CRASH!

A long wait... Nothing. A sigh and a reach for the Spectrum power plug. You may not die, only your pride is hurt and you do get another chance, after loading the assembler again. The trouble is you don't know what went wrong and begin to have doubts about your ability to learn machine code. Worst of all you will only enter the examples following the book word by word, for safety reasons, but without really knowing what you are doing. You won't stray and experiment, because you could CRASH again...

Well, why risk life and limb, when you can earn your wings in a flight simulator. No danger here, your approach is recorded, all the instrument readouts monitored and if something goes wrong, such as forgetting to lower the landing gear, you just step out, get told off by the instructor and have another go. Wait a minute, why not develop a simulator for machine code tuition?

Well, Malcolm Evans has done just that. Stick the L-plate on your Spectrum and follow the leader:

THE COMPLETE MACHINE CODE TUTOR

The first aid kit comes in a plastic enclosure and consists of two cassettes and, oh no, the dreaded manual.

The assembler/simulator program is recorded on each cassette followed by groups of lessons which you are asked to load from within the program. You can also select not to load any lessons and proceed to experiment on your own using the assembler and simulator as a general purpose training ground, but if you are a newcomer, you'd best stick to the lessons to start with.

PROCEDURE

The Complete Machine Code Tutor (TCMCT) covers in 35 lessons all the instructions on the Z80 microprocessor. Each lesson consists of a detailed description of the instructions with all their effects registers and flags, followed in most cases by an example program. This example shows an application of the instruction and forms the basis of the exercises. The example is displayed as an assembler listing with memory address, object code and source code. To see the effect of the commands, the program may be 'run'. The simulator takes charge and lets you single step through the program, displaying after every step the latest register, flag and stack contents on the lower part of the screen. The example may be rerun several times and when understood there is the option of editing the existing source code of the example and experimenting with the commands to hearts delight. The code is reassembled and the simulator activated. It is here that you will notice that the simulator is highly intelligent, avoiding any program crashes and displaying your lapses with English error messages.

It is this feature which can endear the TCMCT even to experienced machine code programmers, as it allows you to experiment without ever getting into serious trouble. It eliminates the reluctance to risk daring manoeuvres and gives you the necessary confidence to learn machine code.

THE MANUAL

The manual need only be read at the beginning. A list is given of the assembler instructions recognised. These pseudo-ops are commands to the assembler instead of to the processor and consist in this case of DEFC N (Define byte), DEFW NN (Define word) and BIN N (same as DEFB N, but the simulator will display the memory contents in binary rather than hex or dec code).

Next to this list thirteen error messages are listed, which the assembler will display upon aborting the assembly. These include error trappings such as unknown instructions, missing spaces, brackets or numbers, too large or labels too long or not found etc, are very comprehensive and should pinpoint the offending item quite clearly. There are also six different error messages listed which will appear when the simulator tries to run runaway assembled code. These include useful items such as:

PROGRAM COUNTER HAS JUMPED TO NON VAUD ADDRESS: PC jump to an address which is not the beginning of an instruction line.

YOU ARE TRYING TO RUN CODE IN ALLOCATED STORAGE AREA: PC jump to a storage area.

YOU ARE ABOUT TO AFFECT MEMORY AREA NOT ALLOCATED TO YOU: You are trying to load a memory location to the work area (16384 to 23295 and 32000 to 32192 respectively)

YOU ARE ABOUT TO WRITE MEMORY WHICH WiLL AFFECT YOUR PROGRAM: You are trying to load a memory location within your program instructions.

ThE STACK POINTER iS OUTSIDE ALLOCATED MEMORY AREA: SP outside 32193 to 32255.

THERE ARE TOO MANY REGISTERS CALLED UP: Too many registers are used, but the simulator will run displaying only part of these registers.

A list of all keys used at various stages of the assembler/simulator with a full description of their functions is given, but the layout is so logical that after two minutes of use you will feel at home and be able to concentrate on the lessons.

Of beneficial use is the list of all the lesson headings together with a summary of the Z80 instructions, so that at any time the appropriate lesson may be recalled for further study of a particular instruction. The appendix contains tables for the effect of instructions on flags and the obligatocy pictorial doscription of the shift and rotate functions. A very useful idea is the glossary, which should help the beginners understand the necessary computer jargon which separates the men from the boys...

CONCLUSION

The TCMCT is the first of its kind of program which gets the Spectrum owner on to a good footing with machine code and eliminates all the usual anxieties and long recovery procedures (from CRASHES) associated with machine code experimenting. The lessons include all the Z80 commands. These are explained in detail on screen, but for the total beginner it may be necessary to read a more general description of a microprocessor system with explanations of the various function blocks and the general modus operandi. It is highly recommended to purchase the Zilog Technical Manual, which not only gives a short and precise description of the Z80 CPU architecture, but also provides a reference manual for all the commands in the practical Group Table form together with the necessary execution bmings. It must be understood that TCMCT is only intended for exercising machine code, so no provision is made for relocating the assembler/simulator or for positioning the object code at a specific memory start address. TCMCT is not a full blown assembler/editor/monitor with which complete commercial programs may be written. It is however the best machine code tutor and no serious Spectrum programmer should learn machine code without it.


REVIEW BY: Franco Frey

Transcript by Chris Bourne

Sinclair User Issue 31, Oct 1984   page(s) 51,53,54

STIMULATING SIMULATORS

Machine code tutors take the agony out of assembler language by simulating the workings of the Z-80A processor. John Gilbert attends the tutorial.

BEYOND BASIC
Memory: 48K
Price: £9.95

THE COMPLETE MACHINE CODE TUTOR
Memory: 48K
Price: £14.95

SPECTROSIM
Memory: 48K
Price: £7.95

ZX SPECTRUM ASSEMBLER
Memory: 16/48K
Price: £7.95


SPECTRE MAC-MON
Memory: 48K
Price: £14.95

SUPERCODE II
Memory: 16/48K
Price: £9.95

Until recently the term 'utility' has been used by software companies to mean any product which handles machine code, such as assemblers, disassemblers and toolkits. Those products help you to exploit the potential of the Spectrum giving enhanced graphics and sound and also provides aids for writing Basic programs such as line or block delete, memory available and REMkill.

The utility market has, however, expanded to include programs which provide you with information on how to use machine code or assembler language. Those programs could be classified as educational but most of them also include utility routines which simulate the Spectrum Z-80A microprocessor and allow you to experiment with machine code in an environment controlled by the program so that any errors do not cause a crash.

The first of such programs to be released was Beyond Basic produced by Sinclair Research with the help of Incognito Software. The back of the cassette package primes the purchaser for an adventure into the world of assembly language in which they will be guided by the Spectrum through the intricate workings of the Z80 processor.

It is also claimed that the program will "take the agony out of machine code". That may be true but it also puts the agony into loading the program from cassette. Of the samples received at Sinclair User only one would load and that was after it had been coaxed through the tape deck several times.

Unfortunately, the crashes made it evident that most of Beyond Basic has, ironically, been written in slow-moving Basic. It therefore has a greater tendency to crash and is slower and less polished than if the program had been written in machine code.

Once loaded, the package displays four options, three of which correspond to sections of the program which deal with lessons and examples of assembly language and the fourth sends the machine back into Basic. The last option is pointless as you can go back into Basic at any time by pressing the BREAK key.

The first section explains how information is stored within the Spectrum and provides details on the machine registers through which information is passed to and from the other chips and in which the results of calculations are stored.

At first no machine code instructions are explained. The author provides a set of pseudo-instructions which are not Basic or machine code commands but bridge the gap between the two languages. You might think that is a good idea but could get confused when real assembly language instructions are introduced and the pseudo-instructions are discarded.

The second section on the tape give a brief rundown of standard assembler mnemonics. The rundown is a little brief and explanations which would require a whole chapter in a book on the same subject are given only one or two screens.

The final part of the tutor involves writing and running your own machine code program using the Beyond Basic version of a Z-80 simulator. Once the program has been entered you can watch how the registers and internal memory change as each instruction is effected. When it has run you can edit the lines of code and watch sections of your program run if de-bugging is necessary.

The potential of a real simulator and effective lessons in machine code seems to have eluded Incognito with Beyond Basic. Sinclair Research states that the philosophy behind the package is one of simplicity. It is not simple to use, its style is not simple to learn from and it is certainly not simple to load.

The Complete Machine Code Tutor, from New Generation Software, is unlike Beyond Basic in one respect: it is sample to use. It provides a series of 33 lessons covering all aspects of assembly language programming together with a powerful simulator program on which you can run examples and write your own routines without fear of fatal crashes.

The simulator makes the package better than a book and the lessons are comprehensive enough to help even the beginner who has failed to learn from other texts. The package also succeeds because it does not adopt the style of the huge tomes about machine code which so often take pride of place in bookshops. It is also more helpful than a book as it draws attention to any ideas that you have failed to understand in a lesson. The package is very user-friendly in that respect and if an error does occur the computer not only locates and explains it but also gives you the opportunity to try again with some help from the Spectrum.

It is hard to crash the Tutor, even when loading one of the lessons. If a tape-loading error occurs the Spectrum will not crash, which is the case with Beyond Basic, but a message is displayed on the screen showing that an error has occured and asking if you still want to load the next lesson. If not the package returns to the main menu of the previous set of lessons.

The Complete Machine Code Tutor provides an excellent introduction to assembly language. It may not give the necessary spur to beginners who want to give up Basic and become machine code programmers but it will give an extra push to those who are already committed to going through the agony of learning machine code from a book.

The same cannot be said of Spectrosim, from Shiva Software. As with Beyond Basic it is written in Sinclair Basic which, of course, the program is attempting to encourage users to replace with machine code.

The package is a Z-80 simulator but has none of the power or attraction of its rival from New Generation. While The Complete Machine Code Tutor can handle 16-bit registers as well as eight-bit in its simulator, Spectrosim can only handle the eight-bit registers from A-D. No mention is made of the E, F, G, H, and L registers which all have special jobs within the Z-80. That means that the true power of the chip is not simulated.

New Generation have an excuse for cutting back its simulator on the grounds of memory restrictions but Shiva has none. If the author could not get a full simulator to fit into 32K using Basic he should perhaps take lessons from his own book and write it in machine code to make it fit within the Spectrum RAM. That would have been better than releasing a product which many intermediate Basic programmers could write.

The main menu of Spectrosim provides nine options, the titles of which may prove confusing to the beginner. For instance, the term 'load' is used twice in the menu. The first option is 'Load program'. You might think that you have to reach for the tape recorder and the LOAD key but the author means that you should start typing in a program from the keyboard. There is also a Tape-Load option but even someone with some knowledge of computer buzzwords might get confused at the terminology.

The other main display within Spectrosim is one in which the contents of the Z-80 registers and flags are shown together with the current program name and the number of instructions which have been processed so far by the simulator. It is immediately obvious that only three of the six main system flags can be used by the simulator and those are Carry, Zero, and Sign. They are the most important of the flags that you can change but the omission of the others is a gross oversight.

The best aspect of the package is the 44-page booklet included as an aid to working the simulator. It includes the assembly language instructions which can be used with the simulator, some of which do not correspond to Z-80 assembly mnemonics. It is, however, more helpful than the program could ever be in showing the potential of Z-80 code.

Once you have finished learning about machine code you will need an assembler or monitor to help you put your program into the Spectrum. One of the only assemblers available for both the 16K and 48K machines as the ZX Spectrum Machine Code Assembler from McGraw Hill.

The software allows the use of full standard Z-80 mnemonics and also includes the usual time-saving devices to make the computer assemble at a given address and define blocks of data or text strings within a program. If you make an error the program provides adequate error messages and allows you to correct the usual mistakes which often occur when you are learning about machine code.

Unfortunately the way in which you have to write assembly language programs is made difficult by the program and errors are bound to creep into even an expert's program. The assembly code has to be typed into REM statements within a Basic program. That may seem to make the job easier but, without the neat display of a full screen editor with which most assemblers are equipped, your code will soon turn into a jumble of instructions.

The other problem with the assembler is the instructions, or lack of them. The purchaser is supplied with eight pages of text which give a quick introduction to the program and a few example routines. It is written in a style that few beginners would understand and few experts will bother to read. The assembler may be as powerful as most others on the market but it will lose customers when they learn that the instructions are so sparse and the program is so unfriendly.

If the assembler from McGraw-Hill does not sound enchanting then you might be more inclined to buy Spectre-Mac-Mon, a complete machine code development system from Oasis Software. The publisher has given it a grand name and the product certainly deserves it.

The package includes a 48K assembier and a 16K monitor both of which are microdrive-compatible. Spectre-Mac, the Editor/Assembler, is the most impressive part of the package. The full-screen editor allows up to 254 characters on one line and will scroll sideways to the left when the cursor reaches the righthand side of the screen.

The assembler includes commands which cover any eventuality, including searching code files, deleting blocks of lines, merging and copying files and replacing one part of a file with new code. There is also a help option which will give you the key names of all the commands available through the assembler without the need to look through the well-written manual.

Spectre-Mac will also allow you to personalise commands so that you can replace the Z-80 instruction set with one of your own. That would be helpful if you had learnt assembly code programming from a book that did not use standard mnemonics.

The tailoring of commands to your own needs is the icing on the cake as far as Spectre-Mac is concerned. It is an excellent product in its own right, but the addition of a monitor of an equally high standard on a separate tape makes the package even more attractive.

Spectre-Mon provides disassembly functions on both ROM and RAM with the ability to run machine code programs, stepping through them one instruction at a time.

Oasis has produced a powerful package which provides all the utilities which could be reasonably asked for by a machine code programmer. If, however, you do not want to write your own machine code routines you may want to use a toolkit such as SuperCode II from CP software.

That package includes 120 routines which can be used either when writing programs or within them. It covers utilities for sound graphics, error trapping of Basic programs and program protection. Supercode also includes a novel routine for entering and replaying a voice or music with the aid of a microphone or tape recorder.

The authors have thought of everything a Basic programmer might want to do in machine code but cannot.


REVIEW BY: John Gilbert

Gilbert Factor8/10
Transcript by Chris Bourne

Sinclair Programs Issue 23, Sep 1984   page(s) 29

While many educational programs are aimed at those in schools or colleges, a significant amount of them are aimed at enthusiasts who wish to study a subject in their spare time. An example of this is The Complete Machine Code Tutor, which is produced by New Generation Software. The two cassettes contained in this package have different programs on each side, and are subdivided into a series of lessons designed to teach machine code to complete beginners.

Each lesson contains text covering one area of machine code, and then a worked example which can be viewed as many times as the student wishes and also changed by the student in order to check that the concept explained has been fully understood.

Machine code is a difficult subject which cannot be learned in the abstract, as trying out examples at every stage is essential. For this reason the Machine Code Tutor is good, for it takes the student steadily through a course.

Despite the importance of worked examples, there is also a very large amount of text to be studied in any machine code course. None but the most enthusiastic computer buffs can claim to enjoy reading large amounts of text from the Spectrum screen, but reading from the screen is just what you are required to do in this program. It is to be hoped that later editions of the Machine Code Tutor will contain an accompanying booklet, which can be studied in conjunction with the information displayed on screen.


Transcript by Chris Bourne

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