Sharp logo

MZ-700 monitor 1Z-013A 

General description

The monitor program 1Z-013A of the MZ-700

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:

command
action
L
loads a program file from the data recorder into the storage, for example BASIC
P
prints or plots a character string
M
modifies the contents of the storage
D
displays the contents of the storage ( dump formatted )
J
delivers the control to a program beginning at the specified address
S
stores a program area from the storage to the data recorder
V
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
B
beeps if a key is pressed
F
floppy disk access

The monitor's work area

monitor's work area  
The work area of the monitor starts at location $1000 and ends at location $11F5.

The contents of the monitor's work area shows the following table:

Address symbolic
name
length function
$1000
-
$38
( 56 )
free area
$1038
-
$03
Jump command to the time interrupt routine at location $038D. Contents is $C38D03. Set by monitor during startup.
$103C
to
$10F0
SP
$B4
( 180 )
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.
$10F0
IBUFE
$80
( 128 )
The tape buffer contains the tape header during read / write. Click to get a detailed description of the tape header.
$10F0
ATRB
$01
The attribute of the file. For example
01 = machine code program
$10F1
NAME
$11
( 17 )
The name of the file.
$1102
SIZE
$02
The byte size / length of the file.
$1104
DTADR
$02
The storage address the file was saved from. ( equals to the load address of the load process )
$1106
EXADR
$02
This is the execution address the file is to be executed after loading the file. ( autostart function )
$1108
COMNT
$68
( 104 )
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.
$1170
KANAF
$01
00 = alpha cursor alpha cursor
01 = graphic cursor graphic cursor
Changing this value will set the mode and the cursor as specified. See the keyboard operating instructions for further details.
$1171
DSPXY
$02
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.
$1173
MANG
$1B
( 27 )
work area used by scrolling
$118E
FLASH
$01
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.
$118F
FLPST
$02
( flashing position MZ80, unused )
$1191
FLSST
$01
( MZ80, unused )
$1192
FLSDT
$01
This value defines the type of the cursor currently displayed:
$EF = alpha cursor ( alpha )
$FF = graphic cursor ( graphic )
A cursor is displayed when PC6 = 0 of the port $E002.
Changing the value takes no effect. See $118E.
$1193
STRGF
$01
( unused )
$1194
DPRNT
$01
work area used by the print subroutine
( internal counter, e.g. TAB ).
$1195
TMCNT
$02
controls the number of tape mark pulses ( 40 / 20 ) during read.
$1197
SUMDT
$02
current check sum of logical-1-bits of the tape file during read / write.
$1199
CSMDT
$02
check sum value of logical-1-bits used by the verify process.
$119B
AMPM
$01
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.
$119C
TIMFG
$01
$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.
$119D
SWRK
$01
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.
$119E
TEMPW
$01
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.
$119F
ONTYO
$01
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.
$11A0
OCTV
$01

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.

$11A1
RATIO
$02
used by the melody play subroutine and 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.
$11A3
BUFER
$51
( 81 )
input line buffer used by the monitor's get line routine.
$11F5
-
-
end of the monitor's work area.
$11F6
-
-
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:

Load command

Syntax: L

L loads the next machine code file found on tape.

The monitor will response:press key at data recorderPLAY 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:

example of the LOAD command

To premature end the load process you can press SHIFT and BREAK coincidentally.

Print / Plot command

Syntax: PHELLO WORLD

The plotter will plot "HELLO WORLD"

Syntax: P&T

The plotter performs its self test. The response at the
plotter will be:

plotter test output

Syntax: P&S

The plotter is set to plot 80 characters per line.

Syntax: P&L

The plotter is set to plot 40 characters per line.

Syntax: P&G

The plotter is set to the graphic mode.

Syntax: P&C

The plotter changes to the next color pen.

Memory modification

Syntax: Maaaa

This command modifies the contents of the storage starting at the location aaaa.
Example:

example of the memory modification command

To end the input mode press now SHIFT and BREAK coincidentally. The storage from the location $B000 to $B003 is changed.

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

Syntax: Daaaaeeee

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:

example of the dump command

The area to be displayed is from $C000 to $C008.

Note The monitor stops displaying at $C007. If you want to see the area from $C000 to $C008, you should type in: DC000C009. There is one byte left and it works as designed.

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.

You can pause a complex, long listing by pressing the space bar until you depress the space bar. You can get a slower listing speed by pressing the SHIFT key until you depress the SHIFT key.

Jump command

Syntax: Jaaaa

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:

*JC000

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.

Save command

Syntax: Saaaaeeeessss

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:

example of the Save command

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.

To premature end the save process you can press SHIFT and BREAK coincidentally. In this case wait until the monitor stops saving and sometimes you have to try it again and again.

Verify command

Syntax: V

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
press key PLAYPLAY
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.

To premature end the verify process you can press SHIFT and BREAK coincidentally.

The #-command

Syntax: #

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 ).

Bell command

Syntax: B

If you enter the bell command you can hear a short beep tone over the loudspeaker while pressing any key. If you enter the beep command again, the beeping will be stopped.

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.


Go to the top of this page Home

last updated August 5, 2002
sharpmz@sharpmz.org