S100 Computers

 
Home S-100 Boards History New Boards Software Boards For Sale
Forum Other Web Sites News Index    

A Z80 Monitor Program
My first computer was centered around the TDL system monitor board. This very useful S-100 board had a wonderful Z80 monitor in its custom 4K ROM. It was called "Zapple". It was an extension of an 8080 monitor program written by Roger Amidon called "Apple" back in the mid 70's. It had all the basic requirements such as allowing the user to examine/modify RAM or IO ports. Output to a console, printer, punch, tape reader (these were the Teletype days) or cassette recorder.  It was really the first to do the obvious, namely have all jump calls at the start of the program - for easy access by other programs and allow redirection of output by changing an "IOBYTE" stored in an IO port.

SMB Board

Over the years this monitor code has been copied and modified many times over by others. I too have extensively modified it to incorporate things like booting the first sector of a floppy disk to load CPM. Or doing the same thing for my hard disk. I even have code in there to direct output to my speech synthesizer, run a date/clock chip etc.  I no longer use the origional SMB, instead the monitor now resides in the EEPROM of the S100Computers Z80 CPU Board.
 
I am enclosing the complete source code for the monitor (see Below).

 

MASTER.Z80
The above ROM based monitor normally resides at 0F000H. However for testing purposes it can be assembled to run at 100H where it should run in a CPM system with no conflicts. The monitor is really split into two 2K sections. The first section contains a table for  all the "normal" monitor jump options like displaying or modifying memory or ports.  The second section at 0F800H contains a jump table for CPM BIOS routines. Some of my older (pre-CPM3) software counts on these locations being there.  The monitor resided in a 2732 PROM chip on a Intersystems Z80 CPU board. As with any such monitor there are some extremely hardware specific sections. Major sections consist of the following:-

  Master Monitor ON LCD

Setup all equates for ports and memory locations
The main Jump table to routines within the monitor
The A-Z command jump table
Initialization of serial and parallel ports (LED's on a IMSAI PIO board light up one by one as sections are completed)
Send a text string to consol.  String in [HL]
Get highest RAM location available to Z80
Various parameter processing routines
Keyboard input routine
Consol output routine
Consol status routine
Printer status and output
Boot CPM from hard disk (8255 driven IDE Drives or CF Cards)
Display a memory map of 64K
Display memory map for any segment up to 1 MG.
Query ports
Dsiaply all active ports from (0 to FFH)
Test RAM
Move and verify memory
Switch in another CPU (8086, 80286 or 68000 etc.)

At F800H, A jump table for CPM BIOS
Boot CPM from a floppy
CPM required BIOS routines
Get Time from a 58167 or DS12887 clock chip
Hex math routines
Display ASCII in RAM
Send an ASCII  string to a speech chip
I/O from a serial port/modem
Download code from another Computer/PC over a serial/USB port and place it in RAM at any location (0H to 0FFFFFH) using the XMODEM protocol.
Jump to code in RAM.

 
 
As you can see the program is written in Z80 code. It should assemble with almost any Z80 assembler. In the past I used the SD Systems assembler simply because that's what I started with. It has a slight quirk in that the data fields "DB", "DW" require "DEFB" and "DEFW". The good news is that strings can be written with "DEFM".  I also used the Cromemco Assembler, but that one has a quirk in that it will not accept names with "$" or "_" character.  

I have now switched over all my stuff to the SLR Z80 assembler. Kicking myself i did not do this earlier!  It is extremly fast and produces .COM or .HEX files directly.   To review and download a CPM based assembler go here.


Z80 Monitor Software For The V2 Z80 CPU Board.
This ability to flip 4K "pages" within the ROM in the V2 Z80 CPU Board effectively allows one to almost double the effective size of the code in your Z80 monitor.  The only thing to watch out for is that the actual code used for the switch reside in EXACTLY the same place in both 4K pages.   I have modified the above well tested Master.Z80 monitor to have Floppy disk/CPM booting code in the lower 4K and the ability to download a ZModem formatted file directly to RAM from a PC (via a serial port) in the upper 4K.  You can actually do a lot with 8K of ROM with a Z80 -- just be careful about the common code used during the switch.

Here is a Video of the V2-Z80 Board Monitor with the file transfer command running:-
   

 
     
  
BUGS
Rich Camarda noticed that when using the Serial Board as the Console, (with the I/O Byte set as 11011111), and no Propeller Board in the system, you get a constant scrolling cursor. The Serial Board functions well in all other aspects. If you have the Propeller Video board in the system along with the Serial Board, the output to the console goes to both, and the Serial terminal works fine. Rich modified the console I/O routines to fix theis bug. The patched version of the Master Z80 can be obtained below. Basically he added 3 lines to the beginning of each console routine, and put some of the serial calls at the bottom.

PDF FILE OF THE MASTER Z80 MONITOR (Using MM58167 Clock Chip)   (V4.57   1/5/2013)
MASTER Z80 MONITOR SOFTWARE (Using MM58167 Clock Chip)  (V4.57   1/5/2013)

PDF FILE OF THE MASTER Z80 MONITOR  V4.7  (Using DS12887 Clock Chip)    (V4.7   3/28/2012)
"MASTER.Z80" MONITOR SOFTWARE   V4.7  (V4.7, FINAL, 11/07/2011)

MOST CURRENT VERSION PDF FILE OF THE MASTER Z80 MONITOR  V5.2 (Using two 4K Pages)    (V5.2  12/17/2016)
MOST CURRENT "MASTER.Z80" MONITOR V5.2 SOFTWARE  (Using two 4K pages)  (V5.2 12/17/2016)

MASTER.Z80 MONITOR with Serial only Console I/O routines  (V1.0     6/2/2016)

This page was last modified on 12/17/2016