Sharp MZ-80B User manual

Personal Computer
.
lllZ·OOrnJ
MONITOR
SB-1510
REFERENCE
MANUAL
SHARP
•

J
SHARP
Personal
Computer
MZ-808
Monitor
SB-1510 Reference
Manual
·
~
.
january
1981
080231-150281
Printed
in
Japan
©SHARP
CORPORATION

NOTICE
This manual
is
applicable
to
the
MONITOR
S8-1510
system software used with
the
SHARP
MZ
-
808
Personal Computer. The
MZ
-
808
general-purpose personal
computer
is
supported by system software which
is
filed
in
software packs (cassettes and diskettes).
All
system software
is
subject
to
revision
without
prior notice; therefore, you are
requested
to
pay special
attention
to
their file version numbers.
This manual has been carefully prepared and checked
for
completeness, accuracy and
clarity. However,
in
the
event
that
you
should notice any errors or ambiguities, please feel
free
to
contact
your
local Sharp representative
for
clarification.
All
system software packs provided
for
the
MZ-808 are original products, and all rights
are reserved. No portion
of
any system software pack may be copied
without
approval
of
the
Sharp Corporation.
ii

Introduction
This manual describes commands and subroutines
of
standard system software MONITOR
SB-151
0
for
the
Sharp MZ-80B and procedures
for
coding machine language programs and generating data.
MONITOR SB-1510
is
part
of
the system software for the MZ-80B and it acts mainly as
the
moni-
tor
program for BASIC
SB-5
510, DISK BASIC SB-651 0 and Double Precision DISK BASIC SB-671 0.
Further, MONITOR SB-1510 can be used
as
a machine language
monitor
by
transferring system con-
trol
to
it. With this feature,
you
can
not
only code and debug machine language programs
but
also
generate system programs
of
your
own.
This manual includes all MONITOR SB-1510 assembly listings for reference.
iii
•.,
.

Contents
Notice
....
......
....
.........
.
..............
..
....
.
..............
ii
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
..
.......
.....
iii
Chapter 1 MONITOR SB-1510 Commands and Subroutines
................
1
1.1
Function
of
the
monitor
program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Using
monitor
commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2.1
1.2.2
1.2.3
1.2.4
..
;.
1.2.5
1.2.6
M command
..
.
.....
.....
..
.
..........................
. 4
D command
........................
.
..
.
.-
......
.
....
.
..
7
J command
...
...
....
...
...
.
...........................
9
S command
V command
L command
.......
...
.
..
.
..
...
..
..
.
............
.
....
. 10
.......
.
..................................
12
13
1.3 Monitor Subroutines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15
Appendix
.......................................................
21
A.l Mnemonic Codes and Corresponding Object Codes . . . . . . . . . . . . . . . . . . 22
(Mnemonic codes are arranged in alphabetic order.)
A.2 Object Codes and Corresponding Mnemonic Codes
...............
...
32
(Object codes are arranged in hexadecimal order.)
A.3 MONITOR SB-1510 Assembly Listing
..
............
.....
..
.
.. ..
. 42
iv

Chapter 1
MONITOR
SB-1510 Commands and Subroutines
This chapter describes six commands executed
at
the
monitor
command level and
monitor
sub-
routines enables the user to generate, execute and/or
file
a simple machine language program;
that
is,
to operate the MZ-80B at the
CPU
level. Machine language programs generated can be linked with
other BASICprograms with the USR function
of
the BASIC language.
I

2
1.1
Function
of
the monitor program
A Monitor program generally monitors system programs such as
the
BASIC interpreter.
The
MZ-
80B uses a Monitor program called MONITOR SB-1510.
It
includes various functional subroutines
which control
the
keyboard, display, sound circuit, cassette tape deck, etc. These subroutines are
called
by
the
BASIC interpreter when
it
executes INPUT statement, SAVE command, MUSIC state-
ment
or
other
commands
or
statements. Monitor subroutines may also be called
by
the
user
at
will.
$0000
$1220
MONITOR
BASIC
interpreter, etc.
User's program
$FFFF
...._
_______
__,
FIGURE 1.1 Monitor subroutine call
1/0
control: keyboard, CMT, TV, etc.
Return
MONITOR SB-1510 occupies 4.5K bytes
of
memory
and
is stored in memory addresses
$0000
through $121F. Its required work area is included within this area. Therefore, MONITOR SB-1510
can be used as an individual system program.
That
is, it can perform the following functions in addi-
tion
to
system monitoring.
•
It
generates, executes and files machine language programs using 6
monitor
commands:
M:
Memory correction
D:
Memory
dump
J
Jump
s -save
V:
Verify
L:
Load

3
• Since MONITOR SB-1510
is
stored in RAM, its contents may be varied with commands.
For
example, the contents
of
$0000-
$0038 and $0066, which are called when processing an inter-
rupt, can be changed at will
or
the
function
of
a monitor subroutine can be modified.
Programs may be freely written
on
cassette tape,
so
a machine language program including MONI-
TOR SB-1510 can
be
filed for future use. See
the
assembly listing for MONITOR SB-1510 in Ap-
pendix A.3.
To use monitor commands, system control must be transferred
to
the Monitor from the BASIC
interpreter
or
other
system program.
• To transfer system control from the BASIC interpreter
to
the
Monitor, execute a
MON
command.
• To transfer system control from
the
Assembler
or
Linkert
to
the Monitor, execute a ! command.
•
To
transfer system control from
the
PASCAL
interpretertt
to
the Monitor, execute
an
editor _
command,
Q/.
FIGURE 1.2 shows a display flame when a BASIC command
MON
is
executed. After the
MON
command has been executed, the cursor moves to the next line, an asterisk at the beginning
of
the new
line and the cursor flickers to inform the operator
that
system control has been transferred
to
the
Monitor.
FIGURE
1.2 Execution
of
a
BASIC
command
MON
t.
tt.
Refer
to
the Assembler, Linker and PASCAL interpreter manuals.

4
1.2
Using
monitor commands
General conventions for use
of
Monitor commands are as follows:
• Commands and data are
input
from
the
keyboard with
the
I CR ] key pressed
to
conclude
the
entry.
• Data display and
input
are in hexadecimal. One
byte
of
data consists
of
two
hexadecimal digits
and an address consists
of
four hexadecimal digits.
• When
the
number
of
characters
input
firm
the
keyboard exceeds
the
number
the
required
by
the
Monitor program,
the
excess are ignored.
•
To
cancel execution
of
a command, press
the
IBREAK] key.
• Every command can access any memory location, allowing a wide range
of
applications,
but
spe-
ci~l
care must
be
taken
not
to
destroy required data
or
a program.
1.2.1 M command·
Function
Operation
Corrects
the
contents
of
the
specified memory address.
When
aM
command is entered,
the
display is as shown in FIGURE 1.3.
FIGURE 1.3

5
In
this case,
the
Monitor requests
the
operator
to
enter
the
address
at
which mem-
ory correction
is
to
start.
For
example, let memory correction start
at
memory address $70AO.
Enter
70AO
from
the
keyboard,
then
press
the
[
CR
] key. The display is as shown in FIGURE
1.4.
FIGURE
1.4
The
monitor
program displays
the
contents, $00,
of
memory address $70AO and
requests
the
operator
to
determine whether or
not
the
contents
of$
70AO
are
to
be
corrected.
To
correct them,
enter
two hexadecimal digits, from
of
00
to
FF,
at
the
cursor position from
the
keyboard.
For
example,
to
change
the
contents
of
$70AO
from $00
to
$C9 (operation code
of
the
RET command),
enter
"C9",
then
press
the
[
CR
] key.
The
monitor
program
then
corrects
the
contents
of
the
memory address and
the
display is as shown in FIGURE 1.5.
FIGURE
1.5

6
In this case, the monitor program requests the operator
to
determine whether
or
not
the next address contents are to be corrected. When correction
is
not re-
quired, press the [
CR
J key. The display then indicates
the
next address.
For
example, when the [
CR
] key
is
pressed when
the
display
is
as
shown in FIG-
URE 1.5,
the
display changes
as
shown in FIGURE 1.6.
FIGURE 1.6
When any characters other than hexadecimal digits are entered from
the
key-
board,
the
monitor program requests
the
operator
to
enter a new memory ad-
dress. FIGURE
1.
7 shows
the
display as it appears when
"S"
is
entered from the
keyboard.
FIGURE 1.7
Now, enter "70AO" to determine whether
the
contents
of
the memory addresses
starting at $
70AO
have been properly corrected. The display will be
as
shown in
FIGURE 1.8.t
FIGURE 1.8
To
cancel
the
M command
to
return
to
the
monitor command level, press the
( BREAK ) key.
t
Make
it a habit to check the memory contents after correction
as
shown above. Even a small error
in
an operation
code
of
a machine language program may result in uncontrolled program execution and destruction
of
the mem-
ory. Proper care will prevent this.
The memory contents are also checked
by
the D command which
is
explained below.

1.2.2 D command
Function
Operation
7
Dumps
the
specified memory block.
When
aD
command is entered,
the
display screen is as shown in FIGURE 1.9.
FIGURE 1.9
At
this time,
the
monitor
program requests
the
operator
to
enter
the
first address
of
the
memory block.
For
example,
to
dump
the
memory block from $0000
through
$007F
(where
part
of
the
monitor program is stored) enter
"0000"
from
the
keyboard
as
the
start address (S-ADR),
then
press
the
[
CR
J key. The dis-
play will
then
be
as shown in FIGURE
1.1
0.
FIGURE 1.10

8
The monitor program now requests
the
operator
to
enter
the
end address (E-
ADR)
of
the
memory block
to
be dumped. When
"007F"
is entered from
the
keyboard and the I
CR
] key is pressed,
the
contents
of
the
memory block are
listed as shown in FIGURE 1.11.
•D
5-ADR
Hl880
E-ADP
$087F
1313130
(.3
3B
08
EB
D 1
05
04
1
:;:
01308
,e;3
00 00
8 1
18
08
1F
~30
131310
C3
B 1
88
08
D0
FF
88
~'711:-1
13018
•:3
B 1
00
C8
83 84
11
FF
RH~H
(;3
B 1
88
38 38
8[.
04
1
:;·
~~~~
·:3 B 1
00
80 80
88
HE
10
(.3
B 1
00
?F
80
01
~~n3
~::,
1:1
1111
=::=:
a '='1
0D
3E
82
[•?. E
:::
~:[
~~~ ~~!
~
~~
(.:::
E7
3E
74
Io?.
E7
:::E
E:4
Io?.
E7
AF
[.3
EE
[•
:::
E~.
~-=-11:1
C'"
1:-1
:;:E
n
[•::::
E5
D3
E4
HF
[•
=:
~~,~~1
~
:~:
E5
E4
3E
CF
[o
:::
~·~
HF
oor::.o
[•
:::
?.E
CF
1C•
~1-=:
-: n
1:11:1~,
:=:
1:11:1
a
EE:
?.E
FF
f·
~:
~
E:
~~,~~171~1
'~'I
~B
(;)
E:
~3Et
3 1 I
1:1
10
007:=:
[!
(16
2F
2 1
~~~1
1 1
.,,
FIGURE 1.11
As shown in FIGURE 1.11,
the
contents
of
8 bytes
of
memory are displayed
on
each line.
If
the
space bar
is
pressed during a memory dump,
the
display is fixed as long as
it
is
held down. This function
is
effective when a large block
of
memory is
to
be
dumped
at
one time.

1.2.3 J command
Function
Operation
9
Transfers system control
to
the specified address,
that
is, loads
the
specified ad-
dress in the program counter
of
the
CPU.
When a J command is entered, the display
is
as shown in FIGURE 1.12.
FIGURE 1.12
At this time,
the
monitor program requests the operator
to
enter the address
to
which system control
is
to be transferred.
Enter
a 4-digit hexadecimal address
from
the
keyboard and press the [
CR
) key. System control
is
then transferred
to
the machine language program starting at the specified address.
This command
is
used to invoke a machine language program. Before executing a
machine language program, carefully check
the
program. Careless execution
of
a
machine language program may result in a serious error.t This command
is
also
used
to
restart
the
BASIC interpreter
or
other system program
if
it has
not
been
destroyed. There are two methods
of
restarting the system program: warm start
and cold start. With a warm start, previous system data (that is, data which was
stored in the system work area at the end
of
the last execution
of
the system pro-
gram) are
not
erased. With a cold start, previous system data are ignored just
as
during an initial start with the IPL. The start addresses
of
the BASIC interpreter
are
as
follows:
Warm
start address= $1280
Cold start address = $1220
t The hardware
will
not be damaged, but a
ftle
protected tape may be overwritten with something
else
or the pro·
gram in
RAM
may
be
destroyed.
The RST 7 instruction (OBJ Code: $FF)
is
used to stop machine language program execution.
When
the
RST
7
instruction
is
encountered, system control
is
transferred to the monitor program to wait for the next command.
At the
same
time, the contents
of
registers AF,
BC,
DE,
HL
and
P~
are displayed on the CRT screen in sequence
in
4 digit hexadecimal notation. The
PC
register contains the address where the RST 7 instruction
is
stored.
It
is
recommended that RST 7 instructions be placed in appropriate program locations for
ease
of
debugging. To
continue program execution, execute the J command. (The contents
of
the
PC
register which were pushed
to
the
stack
by
the RST 7 instruction
have
been popped from the stack by the break routine. Therefore, no RET instruc-
tion can be executed.)

10
1.2.4 S command
Function
Operation
Saves the contents
of
the specified memory block
on
cassette
tape
with
the
speci-
fied file name assigned.
When
aS
command
is
entered,
the
display is
as
shown below.
*S
FILENAME:
c::::l
The
monitor
requests
the
operator
to
specify file name.
Enter
an appropriate file
name
of
16 characters
or
less from
the
keyboard
and
press the [
CR
] key.
For
example, when "ABRACADABRA" is specified,
the
display is as shown below.t
*S
FILENAME: ABRACADABRA
S-ADR.$
c::ll
After the file name has been specified,
the
monitor
requests the operator
to
speci-
fy the memory block
to
be saved.
Enter
the
start
and end addresses in
the
manner
described in
the
D command explanation. Any start and end addresses
of
the
installed memory can be specified; however,
if
the
monitor
area is saved, a file
which cannot be coded
is
generated
on
the
cassette tape. This
is
because
the
moni-
tor
saves itself, so check sum codes necessarily mismatch.
t
If
the
~
key
is
pressed without specifying a
file
name, a nameless file
is
generated. This
is
not
desirable.
It
is
strongly recommended that
flle
names be specified for all significant files.

11
For
example,
to
save
the
memory block from $6000
to
$60A3 with
the
file name
"ABRACADABRA" assigned,
enter
"6000"
and press theI CR ] key,
then
enter
"60A3"
and press
the
I
CR
] key. The display is
as
shown below.
*S
FILENAME: ABRACADABRA
S-ADR.$6000
E-ADR.$60A3
1-ADR.$
~
The monitor now requests the operator
to
enter a
jump
address.
If
a
jump
address
is
specified, system control will be transferred
to
this address after loading when
the file
is
later loaded
by
a L command. This feature
is
useful when
the
file
is
an
individual machine language program file.
When
the
file
is
a data file
or
program file which
is
linked with the BASIC inter-
preter,
the
jump
address
is
not
specified.t
In
this case,
the
monitor
will retain
system control after file loading.
For
example, when file "ABRACADABRA" includes a program with a starting
address
of
$6050,
enter
"6050"
from the keyboard as shown below.
J-ADR.$6050
After
the
I
CR
] key
is
pressed,
the
file will be saved. When no cassette
is
in-
stalled in
the
cassette tape deck,
the
cassette tape cover will open and
the
message
"SET TAPE" will appear
on
the
screen
if
aS
command is attempted. When a file
protected tape
is
loaded,
the
message "WRITE PROTECT" will appear
on
the
screen
if
aS
command
is
attempted.
t Press the
~
key without entering the address.

12
1.2.5 V command
Function
Operation
Checks to confirm that data in a cassette tape file matches the original data in the
memory block from which it was saved.
When a V command
is
entered, the display
is
as
shown below.
*V
FILENAME:§
The monitor requests the operator
to
specify the file name
to
be verified.
For
example, when file "ABRACADABRA"
is
to
be verified, enter "ABRACADA-
BRA" from the ·keyboard
as
shown below. Note
that
the cassette tape must first
be rewound.
*V
FILENAME: ABRACADABRA
When the I
CR
rkey
is
pressed, verification
is
performed automatically. The
memory block with which the specified file
is
compared is indicated by informa-
tion recorded when
the
file was saved with the S command.
If
the
file name
is
not specified,
the
first cassette tape file data encountered will
be verified.
When the file data
is
the same
as
data in the memory block,
"OK"
is
displayed;
when it differs,
"ERROR"
is
displayed.
Although cassette deck read/write operation
is
highly reliable, it
is
recommended
that
a habit be made
of
verifying data every time a file
is
saved.

1.2.6 L command
Function
Operation
13
Loads
the
specified file
into
the memory.
When a L command
is
entered,
the
display is
as
shown below.
*L
FILE
NAME:~
The
monitor
requests the
operator
to
specify
the
name
of
the file
to
be loaded.
For
example, when file "ABRACADABRA"
is
to
be loaded,
enter
the
file name
as
shown below.
*L
FILE
NAME: ABRACADABRA
When
the
[
CR
] key
is
pressed, a search
is
made for the specified file.
After
the
file
is
found it
is
loaded
into
memory. Following shows
the
display as it appears
after files "OPEN SESAME" and "ABRACADABRA" have been loaded.
*L
FILE
NAME: ABRACADABRA
FOUND OPEN SESAME
FOUND ABRACADABRA
LOADING ABRACADABRA
The memory address to which
the
file
is
loaded
is
indicated in the file information
recorded when the file was saved.
In this example, file "ABRACADABRA" was saved in the cassette tape file from
the
memory block from $6000
to
$60A3
with
an
S command. Therefore,
the
file
is loaded
into
$6000
to
$60A3
by
the
L command. See FIGURE 1.13.

14
Monitor
$6000
1-------i
$60A3
1---------i
ftle
ABRACADABRA
FIGURE 1.13
Monitor
Jump\
$6000
t--------l
.J,
J
$60A3
t---------i
$
6050
In
FIGURE 1.13, when file "ABRACADABRA"
is
generated
by
a command,
the
jump
address specified is $6050. Therefore,
after
file "ABRACADABRA" has
been loaded, system control
is
transferred
to
this address.
If
the
jump
address
is
not
specified,
the
monitor
waits for the
next
command
after
loading is completed.

15
1.3 Monitor Subroutines
MONITOR SB-151 0 subroutines are listed in Table 1.1.
The
subroutine names indicated are the
same as the labels shown in
the
monitor
program assembly listing in
the
Appendix. Each name
is
a
mnemonic representing
the
subroutine's function.
To
call a subroutine, use
the
CALL statement
as
follows:
CALL subroutine address
For
example,
to
call LETNL, issue
CDB008
....
CALL 08BOH
Care must be taken with register contents
just
before a subroutine
is
called, since some registers are
modified
by
some subroutines.
The
number
of
stacks required
for
each subroutine
is
also shown in Table 1.1. Required stack area
memory capacity
is
indicated in Table 1.1.
(For
example, subroutine LETNL requires 8 stacks
as
·
shown in Table 1.1. Each stack requires 2 bytes. Then, 8 x 2 =16 bytes are required for tlie LETNL
stack area.)
Table
1.1
Monitor Subroutine List
Subroutine name Number
and address Function of Stacks
(in hexadecimal)
CALL LETNL Moves
the
cursor
on
the
display screen
to
the
beginning
of
8
$08BO
the
next
line.
All register contents
other
than
those
of
the
AF
register
are protected.
CALL PRNTS Displays a blank in
the
current cursor position and ad- 3
$08B9 vances
the
cursor one character.
CALLPRNT
Displays the character corresponding
to
the
ASCII code 3
$0916 stored in the A register
at
the
current cursor position.
(For
ASCII codes, refer
to
FIGURE OWNER'S MANUAL.)
continued
--7
Other manuals for MZ-80B
4
Table of contents
Other Sharp Desktop manuals

Sharp
Sharp MZ-80A User manual

Sharp
Sharp MZ-80B User manual

Sharp
Sharp PC-4741 User manual

Sharp
Sharp PN-L602B User manual

Sharp
Sharp PC-7200 User manual

Sharp
Sharp ZQ-4450M User manual

Sharp
Sharp SCR3042FB User manual

Sharp
Sharp MZ-3500 User manual

Sharp
Sharp MZ-5500 User manual

Sharp
Sharp Mobilon HC-4000 User manual

Sharp
Sharp MZ-800 User manual

Sharp
Sharp PC-1500A User manual

Sharp
Sharp MZ-700 Series Installation guide

Sharp
Sharp MZ-800 Use and care manual

Sharp
Sharp PC-6220 User manual

Sharp
Sharp MZ-700 Series User manual

Sharp
Sharp PC-AX40 User manual

Sharp
Sharp ZQ-4400 User manual

Sharp
Sharp PC-4741 User manual

Sharp
Sharp MZ-3500 Instruction manual