MZ-80K Monitor SP-1002 Description

MZ-80K monitor SP-1002

General description

The 48 kbytes RAM of the MZ-80K 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 SP-1002 is activated after power on first and the blinking cursor waits for your input command ( see screenshot above).

The following monitor commands are available and described in detail later in this section:

command
action
FD load machine code program stored on cassette to RAM, for example BASIC
GOTO transfer the control to the machine code beginning at the specified address
LOAD loads a program file from the data recorder into the storage, for example BASIC
SG keyboard beep-tone on
SS keyboard beep-tone off

Detailed syntax of the monitor commands

Commands will be executed when you enter 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: LOADfilename

LOAD loads the next machine code file found on tape, whereas
LOADMYPROG loads the file “MYPROG” from tape ( if any was saved with this filename ).

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

example of the LOAD command

To premature end the load process press the BREAK-key.

After loading is complete control is passed to the loaded program code.


GOTO command


Syntax: GOTO$aaaa

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:

*GOTO$C000

The normal starting address for machine code programs is $1200, hence control can be passed to a machine code routine using GOTO$1200.

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	$0082	    ; goback to the monitor

SG command ( Sound Generate )


Syntax: SG

If you enter the SG command you can hear a short beep-tone over the loudspeaker while pressing any key.


SS ( Sound Stop ) command

Syntax: SS

If you enter the SS command the beeping while pressing a key will be stopped.


Floppy Disk access

Syntax: FD

If you type in the command FD 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. $F000 is the address of the floppy disk bootstrap routine ( held in ROM on the optional disk interface board ).

The response will be:

 

 

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 FD command to start your own application from this location. $00 is a NOP only.


The 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; unused by the monitor
$1038
$03
Jump command to the time interrupt routine at location $0392. Contents is $C39203. Set by monitor during startup. Can be modified for own interrupt routines.
$103C
to
$10F0
SP
$B5
( 181 )
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.
$10F0
ATRB
$01
The attribute of the file.
01 = machine code program
02 = BASIC program file
03 = BASIC data file
04 = Editor-ASCII file
05 = assembler RB file
$10F1
NAME
$11
( 17 )
The name of the file ( max. 16 + $0D )
$1102
SIZE
$02
The length of the file.
$1104
DTADR
$02
The storage address the file was saved from. ( equals to the load address for 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. Can be in use by other programs for specific functions. Can be used for own purposes if unused ( e.g. own loader or copyright information etc. )
$1170
KANAF
$01
00 = capital letters
01 = SML ( small )
$1171
DSPXY
$02
Column / row pointer of the current cursor position.
$1171 = column ( X ). Possible values: $00 – $27 ( 40 columns )
$1172 = row ( Y ). Possible values: $00 – $18 ( 25 lines )
$1173
MANG
$1B
( 27 )
work area mainly used for scrolling. Contains line pointers ( 40 / 80 char. / line )
$118E
FLASH
$01
Contains the character at the cursor-position to restore the display character when the cursor changes from on to off.
$118F
FLPST
$02
flashing position; absolute address of the cursor
$1191
FLSST
$01
0 = cursor off
1 = cursor on
$1192
FLSDT
$01
character code of the cursor
$1193
STRGF
$01
quotation mark counter; indicates insert / normal mode. 0 = normal, <> 0 insert
$1194
DPRNT
$01
length of input line ( number of characters in the input line )
$1195
TMCNT
$02
controls the number of tape mark pulses 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
$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. $F0 means clock is running
$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.
$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 ( note length ) 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.
$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 $0271 and $0289 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 ( note frequency )
$11A3
BUFER
$51
( 81 )
input line buffer used by the monitor’s get line routine at $0003 / $07E6.
$11F5
end of the monitor’s work area.
$11F6
start of free area.