Part 2 of a machine code monitor by Brian Cadge The monitor itself is written as a collection of subroutines, to do things like encode and decode a set of hex characters to and from their binary value. Any of the general routines could easily be incorporated into your own programs. The breakpoint facility is provided by using the RST 30 instruction, which is the only RST which the operating system doesn't use. Many Rom calls are made throughout the program to print characters, change modes, access the cassette, read the keyboard, etc. These are all fully explained in the Amsoft firmware manual. It is very simple to add new commands of your own to the monitor software. The command name table currently ends in Line 2890 of the assembly language listing. To add a new command, insert the command word, followed by a zero byte. The value 255 is used to signal the end of the word list. The start address of the command routine must be added to the addresses in Lines 2900 to 2920. All command subroutines end with a JP LOOP instruction, to return to the command prompt. Do not use the RET as this will return to Basic. The HELP command will automatically include any new commands in its list. The assembly language listing should be quite easily understood by anyone who writes Z80 code. However, it isn't necessary to understand it to use the program. Popular Computing Weekly |