Sharp logo
The monitor program  
( of the S-Basic 1Z013B )  
General

The IOCS ( Input Output Control System ) of the S-BASIC 1Z-013B contains a monitor program to create and / or change machinecode programs as known by the monitor program 1Z-013A which is resident in a 4kb ROM, but the monitor of the S-BASIC contains expanded functions and some changes.

If you write and test machinecode programs with this monitor you should know, the monitor uses its stack from $FF00 to $FFFF.

The monitor uses the same editor functions known by the S-BASIC editor e.g. scrolling, some of them are more powerful than the editor functions of the ROM monitor 1Z-013A.

The commands of the S-BASIC monitor 1Z-013B are described in detail below. If the S-BASIC is loaded you can call the monitor by the S-BASIC command BYE or its short form"B." To release the monitor type in "R" and then the S-BASIC will be reactivated.

This is an overview of all available commands of this monitor:

command
action
:
used to edit the storage in hex
P
transfers output to printer/plotter
D
displays the contents of the storage ( dump formatted )
M
modifies the contents of the storage
F
finds the specified character or character string in storage
G
delivers the control to a program beginning at the specified address
T
transfers a block of bytes to another location in storage
S
stores a machinecode program area from the storage to tape
L
loads a machinecode program file from tape into the storage
V
verifies the contents of the data stored on tape
R
releases the monitor and returns to the S-BASIC
Detailed syntax of the monitor commands

Commands will be executed when you enter the command, its papameter(s), and then the enter key CR is pressed. Numerical values must be entered in hexadecimal notation. Don't omit preceding zeroes. Please select one of the following commands to get the syntax of the command:

Edit command

Syntax:

:ADDR=h1h2h3.....hn
:ADDR=h1 h2 h3 ..... hn
h1 ..... hn are any 2-digit hexvalues.

You can separate each parameter by one or more space character(s).

Use this command to enter or change a machinecode program.

The format of this command is the same as given by the result of a D command ( display command ).

This is an example:

Edit Mode of Basic's Monitor

$C000 to $C007 was modified by the command ":C000= 4D 5A 2D 37 30 30 0D". The following command "DC000 C007" shows the result. The first display command shows the contents of the storage before modifying the contents of the storage.

Print/Plot command

Syntax: P

This command transfers the output of the commands F and D to the plotter / printer if the output was shown on the screen before invoking the command P, otherwise the output will be transferred to the screen again ( flip-flop-method ). If no plotter / printer is connected to the MZ-700 "Err?" will be displayed. There is no response by the MZ after the execution of this command.

Dump / display command

Syntax: Daaaaeeee

You can separate each parameter by one or more space character(s).

This command displays the contents of the storage from aaaa to eeee on the screen.

The format is dump as follows:

Dump command example

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 or DC000 C009 ( parameters can be seperated by space(s) ). 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, but if the output will be transferred to the plotter ( by the command P ) then the plotter changes to the next color pen and plots the hex code. If a printer is active instead of the plotter it prints the hex code too.

Dump commad example ( plotter )

If you enter the command D again but without parameters then the next following 128 bytes will be displayed.

Dump command example without parameter

If the end address eeee is less than the start address or equals to the start address aaaa the end address is ignored by the monitor and the first 8 bytes starting from aaaa are listed.

Dump command example  with invalid end address parameter

The monitor displays a block of 128 bytes starting from aaaa if a non hex character was entered in the end address eeee.

Dump command example with invalid hex value

The monitor displays the next 128 bytes if a non hex character was entered in the start address.

Dump command example with invalid hex value

To pause a complex, long listing press the BREAK key as long as needed. The listing can be stopped by pressing the SHIFT key and the BREAK key coincidentally.

You can modify each displayed hex value in the storage by overtyping its value and then pressing CR. You cannot change the address or an ASCII character by overtyping its value. To the syntax of editing values see the command ":".

Memory modification

Syntax: Maaaa

You can separate the parameter from the command by one or more space character(s).

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

example of the memory modify 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 ( e.g. non-hex-data inputted ).

Find command

Syntax:

Faaaaeeee h1h2h3.....hn
Faaaaeeee h1 h2 h3 ..... hn
h1 ..... hn are any 2-digit hexvalues.

Faaaaeeee ;ASCII1;ASCII2,ASCII3;.....ASCIIn
(ASCII1.....ASCIIn are ASCII characters and must be separated by a colon)

You can separate each parameter by one or more space character(s).

The command F searches the area from aaaa to eeee for the data you've defined in the command and lists the addresses and the data where the data was found in this area. You can premature stop searching by pressing SHIFT and BREAK.

Example:

example of the find command output

The hexadecimal value $41 (ASCII "A") is to find in the area from $2000 to $3000. The monitor found 12 matches and displayed the related addresses where $41 was found. The output format is the same as needed for an edit function, this means: you can change the values immediately.

Go command

Syntax: Gaaaa

You can separate the parameter from the command by one or more space character(s).

The subprogram at the location aaaa will be executed. The monitor transfers the control to this subprogram. Example to start a subprogram with its entry point at $C000:

*GC000

On entry to the subprogram invoked by the G command the stack is set to $FFEE by the monitor. If the subprogram shall return to the monitor at its end then the subprogram must return by an assembler RET command.

Transfer command

Syntax: Taaaa eeee ssss

You can separate each parameter by one or more space character(s).

The area from aaaa to eeee will be copied to the specified storage location ssss. Use 4digit hexadecimal values for the definitions of the area and the target.

Example:

*TC000 C100 A000
*cursor

The area from C000 to C100 is to copy to the storage location from A000 to A100.

Save command

Syntax: Saaaa eeee ssss :name

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.
:name is the name of the program to be saved.

You can separate each parameter by one or more space character(s).

This is an example of the save procedure:

example of the save command

press keys RECORDPLAYRECORD.PLAY will be displayed if the datarecorder isn't ready. In this case press PLAY and RECORD coincidentally.

The user saved the program with the name MYPROG that starts at the location $C000 and the save will stop saving at the location $CFFF. The program is to start automatically after the next load by the monitor from the address $C124 (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 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".

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 $0000 (BASIC warm start).

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.

Load command

Syntax: L ssss :name

L loads the next machine code file found on tape or the one specified by the parameter "name" if not omitted in the command.

The file is stored into the memory as specified by the parameter ssss. If this parameter is omitted the value specified within the tape header is used to load the file from 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.

Verify command

Syntax: V name

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!

The next program on tape will be verified if you omit the parameter for the name in the command V.

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
*cursor

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 no error message.

If the monitor detects any errors, you'll get the error message: Err?. 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.

Return/release command

Syntax: R

The monitor returns to S-BASIC.

If a program was executed by the command G and the stack between $FF00 and $FFFF was used or there is no return address to the S-BASIC on the stack don't use the command R. In this case goback to $0000 (S-BASIC warm start) by the command G0000. Before returning to the S-BASIC the register HL is restored to the same value on entry to the monitor.


Go to the top of this page Home

last updated August 4, 2002
sharpmz@sharpmz.org