MZ-700 Monitor 1Z-013A
The 64 kbytes RAM of the MZ-700 are free and not allocated after power on / RESET. A program to be executed must be loaded first into the storage by the data recorder, a disk drive, or manually by the keyboard. The monitor program is needed to load the program to be executed. It is resident in a 4 Kb ROM and it does the work like a boot loader or an IPL ( Initial Program Loader ). The monitor program 1Z-013A is activated after power on first and the blinking cursor waits for your input command ( see screenshot above).
The monitor can be used too to change programs, to enter new programs, to modify the storage, to print or plot a character string, and to test programs.
The following monitor commands are available and described in detail later in this section:
|Loads a program file from the data recorder into the storage, for example BASIC|
|Prints or plots a character string|
|Modifies the contents of the storage|
|Displays the contents of the storage ( dump formatted )|
|Delivers the control to a program beginning at the specified address|
|Stores a program area from the storage to the data recorder|
|Verifies the contents of the data stored on the data recorder|
|Delivers the control from the monitor to a program in the RAM at location $0000|
|Beeps if a key is pressed|
|Floppy disk access|
The monitor’s work area
The contents of the monitor’s work area shows the following table:
|Jump command to the time interrupt routine at location $038D. Contents is $C38D03. Set by monitor during startup.|
|SP||The stack of the monitor from $103C to $10EF ( top down processed, $103B unused ) for max. 90 stack entries ( all needed? ). Set to $10F0 by the monitor during startup.|
|IBUFE||The tape buffer contains the tape header during read / write. Click to get a detailed description of the tape header.|
|ATRB||The attribute of the file. For example
01 = machine code program
|NAME||The name of the file.|
|SIZE||The byte size / length of the file.|
|DTADR||The storage address the file was saved from (equals to the load address of the load process)|
|EXADR||This is the execution address the file is to be executed after loading the file (autostart function)|
|COMNT||Unused by the monitor. This is the comment area of the tape header. The BASIC load tape contains a tiny program in this area to copy the BASIC tape. Can be in use by other programs for specific functions. Can be used for own purposes if unused.|
|KANAF||00 = alpha cursor
01 = graphic cursor
Changing this value will set the mode and the cursor as specified. See the keyboard operating instructions for further details.
|DSPXY||Column / row pointer of the current cursor position.
$1171 = column ( X ). Possible values: $00 – $27 ( 1 – 40 dec. )
$1172 = row ( Y ). Possible values: $00 – $18 ( 1 – 25 decimal )
Changing these values will move the cursor to the specified position.
|MANG||work area used by scrolling|
|FLASH||Contains the character lying under the cursor to restore the display character when the cursor changes from on to off. Changing the value takes no effect, see $0BA8 of the monitor’s source code. This character is displayed when
PC6 = 1 of the port $E002. See $1192.
|FLPST||( flashing position MZ80, unused )|
|FLSST||( MZ80, unused )|
|FLSDT||This value defines the type of the cursor currently displayed:
$EF = ( alpha )
$FF = ( graphic )
A cursor is displayed when PC6 = 0 of the port $E002.
Changing the value takes no effect. See $118E.
|STRGF||( unused )|
|DPRNT||work area used by the print subroutine
( internal counter, e.g. TAB ).
|TMCNT||controls the number of tape mark pulses ( 40 / 20 ) during read.|
|SUMDT||current check sum of logical-1-bits of the tape file during read / write.|
|CSMDT||check sum value of logical-1-bits used by the verify process.|
|AMPM||AM / PM value used by the internal clock ( 8253 ):
$00 = AM
$01 = PM
Click to get further information about the time set routine or about the interrupt invoked by the internal clock.
|TIMFG||$F0 set by the time set routine normally. The subroutines RDI ( $0027 ) and RDD
( $02A ) disable interrupts by DI but don’t enable further interrupts by EI at the end of execution if this time flag is not $F0. See $055B of the monitor program.
|SWRK||Controls the bell. The bell is on if bit 0 is off and beeps every time a key is pressed. Used by the beep command. Can be changed for own purposes.|
|TEMPW||Controls the tempo of a melody to be played. The valid range is from $01 to $07. $01 is quick, $04 is normal, and $07 is slow. Note, the order of the values from quick to slow ( $01 to $07 ) is contrary to the order of the values used by the subroutine $0041.|
|ONTYO||work area used by ONPU subroutine at $021C to compute the interval of a note. If you code a note without its interval, the last specified interval to a note / pause is used or the default value 0 if never an interval was specified before. To this, ONTYO contains the last specified interval or the default value 0. See $0242, $0247, $0252, and $0259 of the monitor program.|
|OCTV||work area used by the melody play subroutine to operate the octave internally.
01 = upper octave
02 = middle octave
03 = lower octave
The values in the tables at $026C and $0284 are multiplied by OCTV to compute the value RATIO.
|RATIO||used by the melody play subroutineand the monitor’s subroutine $0044 to set the output frequency of counter 0 of the 8253. For further information to set this value see $0044. The value must be
>= $0100 ( 256 decimal ) otherwise MLDST does not work. This means, the max. frequency is 4.331 KHz if you use the monitor’s subroutine $0030
( 1.1088MHz / 256 = 4.331KHz ). Write your own routine if you want to use higher frequencies up to the input frequency of 1.1088MHz. The min. frequency is
1.1088MHz / 65.535 = 16.9Hz
if RATIO is set to $FFFF.
|BUFER||input line buffer used by the monitor’s get line routine.|
|end of the monitor’s work area.|
|start of free area.|
Detailed syntax of the monitor commands
Commands will be executed when you entered the command and afterwards the enter key CR was pressed. Numerical values must be entered in hexadecimal notation. Don’t use spaces and don’t omit preceding zeroes. Please select one of the following commands to see the syntax of the command:
L loads the next machine code file found on tape.
The monitor will response:PLAY if the PLAY button isn’t pressed at this time.
Press now the PLAY button at your data recorder. If the monitor has found a machine code program, the monitor responses:
Print / Plot command
Syntax: PHELLO WORLD
The plotter will plot “HELLO WORLD”
The plotter performs its self test. The response at the
plotter will be:
The plotter is set to plot 80 characters per line.
The plotter is set to plot 40 characters per line.
The plotter is set to the graphic mode.
The plotter changes to the next color pen.
This command modifies the contents of the storage starting at the location aaaa.
The monitor displays the current storage address and the contents of the current storage address. You can enter any 2 digits hex value at the cursor position. If you press CR immediately without entering any value, the memory will not be changed. The monitor displays the last address once more if there was any error during the last input.
Dump / display command
This command displays the contents of the storage from aaaa to eeee on the screen. A block of 160 bytes is displayed if you omit the end address ( eeee ). The format is dump as follows:
The area to be displayed is from $C000 to $C008.
C000 is followed by 8 hex characters which represent the contents of the storage in hexadecimal notation. The monitor tries to translate these values to the MZ-700 ASCII code. If the monitor finds a non displayable character ( see the $00’s ) then a decimal point is displayed by the monitor.
If the end address ( eeee ) is less than the start address or equals to the start address ( aaaa ) the listing from aaaa does not end until you press SHIFT and BREAK coincidentally. The listing has no real end address. The same will take effect if the end address is incorrect, for example, a non hex character was entered at the end address.
The program at the location aaaa will be executed. The monitor transfers the control to this program. Example to start a program with its entry point at $C000:
Don’t use the assembler RET command to return to the monitor, unpredictable results can occur if you use the same stack in your program and if you don’t set up the stack before returning to the monitor. Use the following commands instead of the assembler RET command to return to the monitor program:
LD SP,$10F0 ; re-initiate monitor's stack JP $00AD ; goback to monitor
For further information download the reassembled monitor program.
aaaa is the starting address of the area to be saved
eeee is the ending address of the area to be saved
ssss is the execution address for the autostart function of the next load by the monitor. The monitor automatically starts the program at eeee when the next load process is executed. This is an example of the save procedure:
The user saved the program with the name MYPROG that starts at the location $C000 and the save will stop saving at the location $C2FF. The program is to start automatically after the next load by the monitor from the address $C000 ( entry point address ). The file attribute will be $01 ( machine code program ). For further information about all information of the file stored on tape click here.
When the save command is entered, the monitor requests for the file name. Then the user was prompted to press the RECORD button and the PLAY button coincidentally at the data recorder and then the save process was started by the monitor. The monitor response was: “WRITING MYPROG” and at the end of the save process the monitor’s response was: “OK!”.
Don’t forget to insert the right tape at the right position before you press the keys at the data recorder
You cannot save BASIC programs by this command. You can save only the machine code of your program and its data areas. The load routine always sets the attribute byte of the file to $01 and this is the attribute of a machine code program. The load process of BASIC ignores machine code programs, it is searching only for BASIC programs whose attribute byte is set to $05.
If you want to suppress the autostart function, then set the execution address ssss to $00AD or $0000. Note, if you use $0000 the MZ-700 will be reset.
The program in the storage and the program on tape will be verified by the monitor. This command will only work well immediately afterwards of a save process that was fully completed!
If you have saved a program by the save command you have to rewind the tape to the start position of the file just saved and then to execute the verify command. The process is as follows:
*V PLAY OK
You’ve entered the verify command and the monitor has prompted you to press the PLAY button at the data recorder. The monitor verified the program and has stopped with the message: “OK”.
If the monitor detects any errors, you’ll get the error message: “CHECK SUM ER.”. In this case try again to save the program and try to use a better tape.
The command # has the same effect like pressing the RESET key at the reverse side of the MZ-700 and the CTRL key coincidentally. The program at location $0000 in the RAM will be executed. For further detailed information click here. This command is used normally to return to BASIC after you’ve used the BASIC command BOOT or after you’ve pressed the reset key while BASIC was active (or another program having the entrypoint address $0000).
Floppy disk access
If you type in the command F the monitor checks the byte at location $F000. If the value of this byte is $00 the control is transferred to $F000, otherwise the monitor ignores the command. Source: see the monitor’s program at location $00C9 and then $00FF.
This function can be used for some own purposes too. Connect your own ROM or RAM and put $00 to this location and use the F command to start your own application from this location. $00 is a NOP only.