Sharp MZ-80B Reference Manual

Personal Computer
.
lllZ·OOrnJ
MONITOR
SB-1510
REFERENCE
MANUAL
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-151 0
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-151 0 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 BASIC programs 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 $121 F. Its required work area is included within this area. Therefore, MONITOR SB-151 0 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
I BREAK] 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
~:
~
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 the I 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
r key
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
16
Subroutine name
Number
and address Function
(in hexadecimal)
of
Stacks
Note
that
ASCII codes $01 through
$OF
are control codes;
when any
of
these characters are stored in the A register,
the
corresponding display control
is
performed.
For
example, $01 performs
the
same function as
the
CfJ
key.
CALL MSG
Display characters stored in the area whose start address
is
4
$08DB
stored in
the
DE register, starting at the cursor position
and continuing until
$0D
(the
carriage
return
code) is en-
countered. Carriage
return
is
not
performed in this case.
Display control
is
performed
with
ASC codes
$01-$0A,
$0C, $0E
and
$OF.
All register contents are protected.
CALL BELL Sounds middle range
tone
(about
440
Hz) for a short time.
4
$0EBE
CALLMELDY
Plays music according
to
music data.
The
music data area
4
$0EE9
start address must
be
set in
the
DE register in advance.
Music data
is
coded in
the
same manner as described
for
the
MUSIC statement in the BASIC Language Manual.
The
end mark
is
$0D (carriage return)
or$2A(*).
When con-
trol
is
returned
to
the
calling program, the C flag has
the
following meanings:
0 - play has been completed. 1
-play
has been stopped
by
the
[BREAK]
key.
CALL XTEMP
Specifies
the
tempo
at which music
is
played.
Tempo
data
3
$0DF8
($0 1-$07) must be set in
the
A register in advance.
$01: Lowest
tempo
$04
: Medium
tempo
$07: Highest
tempo
CALL SOUT
Sounds a
tone
of
the desired pitch and duration. The
pitch
3
$0ECC
and duration must be set, respectively,
in
the
HL and
BC registers in advance. (For
example, when $00A4
is
set in
the
HL register,
the pitch is middle la).
Subroutine
name
and
address
(in
hexadecimal)
CALL TIMST $0E06
CALLTIMRD $0E51
CALL BRKEY $0562
CALL
GETL
$06A4
Function
Sets the built-in clock. Time data must be set in advance
as
follows:
A register
+--
0:
AM
1:
PM
DE register
+--
Time (in seconds) (2
byte
data)
Reads
the
built-in clock. Time data are set as follows:
A register
+--
0:
AM
1: PM
DE register
+--
Time (in seconds) (2
byte
data)
All register contents
other
than
those
of
the
AF and DE re-
gisters are
protected
.
Checks whether
or
not
the
(
BREAK
J key
is
pressed .
Z flag
+--
0:
not
pressed
1:
pressed
Obtain one line
of
data from
the
keyboard.
The
start ad-
dress
of
the
area in which
the
input
data are to be stored
and
the
number
of
characters
to
be accepted must be set
as
follows:
DE register
+--
Input
data storage area start address
KNUMBS (addre
ss
$06A2)
+--
Number
of
characters ac-
cepted
The
key
input
sequence
is
terminated by pressing
the
(
CR
]
(or
[
ENT])
key. When
the
[
CR
]
(or
(
ENT
j)
key
is
pressed,
the
end mark ($0D)
is
stored following
the
input
data. Therefore,
the
setting indicating
the
number
of
characters to be accepted must include
one
for the end mark. The
input
data are displayed
on
the
screen and cursor con-
trol, insertion and deletion
of
characters are possible .
When
the
(BREAK] key
is
pressed in
the
middle
of
a key
input
sequence,
the
break code ($0B)
is
set in
the
start ad-
dress indicated by
the
DE register and control
is
returned
to
the
calling program.
The
monitor
program uses this subroutine
by
setting label
BUFER (address
$103F)
in
the
DE register and
$14
in
address
KNUMBS.
17
Number
of
Stacks
3
3
2
8
18
Subroutine name
and address
(in hexadecimal)
CALL GETKY
$0871
CALL ASC
$05F3
CALL HEX
$05FD
CALL 2HEX
$0623
Function
Obtains one character from
the
keyboard and stores it in
the
A register.
For
example, when CALL GETKY
is
exe-
cuted while
the B key
is
being pressed, ASCII code $42 (B)
is
set in
the
A register. When CALL GETKY
is
executed
while no key is pressed,
$00
is set
in
the
A register.
The
input
character
is
not
displayed
on
the
screen.
Converts
the
lower 4
bit
contained in
the
A register
into
the
ASCII code corresponding
to
their hexadecimal equiv-
alent and sets it in
the
A register.
For
example, when
the
lower 4 bits
of
the
A register are
1000 ($8 in hexadecimal), $38
(the
ASCII code corre-
sponding
to
"8")
is set in
the
A register.
When the A register contains an
ASCII code corresponding
to
a hexadecimal number, this subroutine sets
the
binary
equivalent
of
the
hexadecimal
number
in
the
lower 4 bits
of
the
A register.
For
example, when
the
A register contains $42,
the
ASCII
code corresponding
to
"B",
lOll
($Bin
hexadecimal)
is
set
to
the
lower 4 bits
of
the
A register.
If
the A register contains codes
other
than
those corre-
sponding
to
characters representing hexadecimals,
the
C
flag (carry flag)
is
set
to
1 and
the
A register contents are
undefined.
C flag
at
return
0: Lower 4 bits
of
A register are
properly set.
1:
Data error.
When
the
2 successive
bytes
of
data contained in the area
starting
at
the
address indicated in
the
DE register are an ASCII code string representing a 2 digit hexadecimal num­ber, this subroutine sets the 2 digit hexadecimal number in the A register and returns control
to
the
calling program.
If
the
ASCII code string does
not
represent any 2 digit hexa-
decimal number, this subroutine sets
the
C flag
to
1 and
returns control
to
the
calling program.
In
this case,
the
contents
of
the
A register are undefined.
Number
of
Stacks
8
2
Subroutine name
and address
(in hexadecimal)
CALL HLHEX $0614
CALL
CURSR
$0B2C
Function
When
the
4 successive bytes
of
data contained in
the
area
starting
at
the
address indicated in
the
DE register are an ASCII code string representing a 4 digit hexadecimal num­ber, this subroutine sets
the
4 digit hexadecimal number in
the
HL register and returns control
to
the
calling program.
If
the
ASCII code string does
not
represents a 4 digit hexa-
decimal number, this subroutine sets
the
C flag
to
1 and
returns control
to
the
calling program. In this case,
the
A register contents are undefined. For
example, when $33, $30 , $43 and $39 are stored in
successive areas starting at
$8000, $30C9
is
set in
the
HL
register
by
executing.
LD DE,
8000H
CALL 0614H
Sets
the
Video-RAM address corresponding
to
the
current cursor position in the HL register. For
example, when
the
cursor
is
in
the
home position
(upper left comer),
$DOOO
is
set in
the
HL register.
Number
of
Stacks
4
2
19
APPENDIX
Correspondence between each object
(08
j)
code and mnemonic code
is
shown in sections A. 7 and
A.2.
In
A.
7,
mnemonic codes
are
arranged in the alphabetic order; this arrangement
is
convenient
when cross-referencing from
ZBOA
CPU
instructions to corresponding object codes.
In
A.2, object
codes
are
arranged in hexadecimal order; this arrangement
is
convenient when it
is
necessary to look
up the mnemonic code corresponding to a particular object code.
Details on operation,
flag
operation, execution time, etc., for each instruction
are
contained in the
ZBOA
CPU
reference data
in
the appendix
of
the MZ-808 OWNER's MANUAL.
The
MONITOR 58-7 570 assembly listing
is
shown in
A.3
.
21
22
A.l
Mnemonic Codes and Corresponding Object
Codes
(Mnemonic codes are arranged in alphabetic order.)
Note
nn, n, d and e in the operands
of
each mnemonic code represent constant data. The example values set forth below are used for these constants in this table.
nn = 5848
n =
208
d s
e = 30H
Data codes represented
by
example values are shown
in
italic and underlined.
OP-Code
BE DDSE05
-
FD8E05
SF
ss
S9 SA SB SC SD
CE20
ED4A ED5A ED6A ED7A
86
DD8605 FD8605
-
87 80 81 82 83 84 85
C620
-
09
19 29 39
DD09
DD19
DD29
DD39 FD09 FD19 FD29
FD39
Mnemonic
ADC
A,
(HL)
ADC
A,
(IX
+d)
ADC
A,
(IY +d)
ADC
A,
A
ADC
A,B
ADC
A,C
ADC
A,D
ADC
A,E
ADC
A,H
ADC
A,L
ADC
A,n
ADC
HL,BC
ADC
HL,DE
ADC
HL,HL
ADC
HL,SP
ADD
A,
(HL)
ADD
A,
(IX +d)
ADD
A,
(IY
+d)
ADD
A,
A
ADD
A,B
ADD
A,C
ADD
A,D
ADD
A,E
ADD
A,H
ADD
A,L
ADD
A,n
ADD
HL,BC
ADD HL,
DE
ADD
HL,HL
ADD
HL,SP
ADD
IX,BC
ADD
IX,
DE
ADD
IX,
IX
ADD
IX,SP
ADD
IY,BC
ADD
IY,DE
ADD
IY,IY
ADD
IY,SP
23
OP-Code
Mnemonic
OP-Code
Mnemon ic
A6
AND
(HL)
CB54
BIT
2,H
DDA605
AND
(IX + d)
CB55
BIT
2,L
-
FDA605
AND
(IY
+d)
CB5E
BIT
3,(HL)
A7
AND A
DDCB055E
BIT
3,
(IX
+d)
-
AO
AND
B
FDCB055E
-
BIT
3,
(IY + d)
AI
AND
c
CB5F
BIT
3,A
A2
AND
D
CB58
BIT
3,B
A3
AND
E
CB59
BIT
3,C
A4
AND
H
CB5A
BIT
3,D
A5
AND
L
CB5B BIT
3,E
E620
AND n
CB5C BIT
3,H
CB5D
BIT
3,L
CB46
BIT
0,
(HL)
CB66
BIT
4,(HL)
DDCB0546
BIT
0,
(IX
+d)
DDCB0566
BIT
4,(1X + d)
-
FDCB0546
BIT
0,
(IY + d)
FDCB0566 BIT
4,(1Y
+d)
CB47
BIT O,A
CB67
BIT
4,A
CB40
BIT
O,B
CB60
BIT
4,B
CB41
BIT
0,
c
CB61
BIT 4,C
CB42
BIT
O,D
CB62
BIT
4,D
~
CB43
BIT
0,
E
CB63
BIT
4,E
CB44
BIT
O,H
CB64
BIT
4,H
CB45
BIT
O,L
CB65
BIT 4,L
CB4E
BIT
1,
(HL)
CB6E BIT
5,(HL)
DDCB054E
BIT
1,
(IX
+d)
DDCB056E
BIT
5,(1X+d)
-
-
FDCB054E
BIT
1,
(IY
+d)
FDCB056E
BIT
5,
(IY
+d)
-
CB4F BIT
l,A
CB6F BIT
5,A
CB48 BIT
l,B
CB68
BIT
5,B
CB49 BIT
1,
c
CB69
BIT
5,C
CB4A BIT
1,
D
CB6A BIT
5,D
CB4B
BIT
1,
E
CB6B BIT
5,E
CB4C BIT
1,
H
CB6C BIT
5,H
CB4D BIT
1,
L
CB6D BIT
5,L
CB56
BIT
2,
(HL)
CB76
BIT
6,(HL)
DDCB0556
BIT
2,
(IX
+d)
DDCB0576
BIT
6,(1X+ d)
-
FDCB0556
BIT
2,
(IY
+d)
FDCB0576
BIT
6,(IY+d)
-
-
CB57
BIT
2,A
CB77
BIT
6,A
CB50
BIT
2,B
CB70
BIT
6,B
CB51
BIT
2,C
CB71
BIT 6,C
CB52 BIT
2,
D
CB72
BIT
6,D
CB53
BIT
2,
E
CB
73 BIT
6,E
24
OP-Code
Mnemonic
OP-Code
Mnemonic
CB74
BIT
6,H
EDBl
CPIR
CB75
BIT
6,L
CB7E
BIT
7,(HL) 2F
CPL
DDCB057E
BIT
7,(IX+d)
FDCB057E
BIT
7,(1Y + d)
27
DAA
-
CB7F BIT
7,A
CB78
BIT
7,B
35
DEC
(HL)
CB79
BIT 7,C
DD3505 DEC
(IX + d)
-
CB7A BIT
7,D
FD3505 DEC
(IY
+d)
-
CB7B BIT
7,E
3D
DEC A
CB7C
BIT
7,H
05
DEC B
CB7D
BIT
7,L
OB
DEC
BC
OD
DEC c
DC8405
CALL
C,n
n
15
DEC D
FC8405
CALL
M,nn
1B DEC
DE
D48405
CALL
NC,nn
1D
DEC E
CD8405
CALL
nn
25
DEC H
--
C48405
CALL
NZ,nn
2B
DEC
HL
.
..---------
F48405
!
CALL
P,nn
DD2B DEC IX
- -
EC8405
CALL
PE,nn
FD2B DEC IY
E48405
CALL
PO,nn
2D
DEC
L
- -
.!
CC8405
CALL
Z,nn
3B DEC
SP
3F
CCF F3
DI
BE
CP
(HL)
102E
DJNZ
e
DDBE05
CP
(IX
+d)
-
FDBE05
CP
(IY
+d)
FB
EI
-
BF
CP
A
BS
CP
B
E3 EX
(SP),HL
B9
CP
c DDE3
EX
(SP),IX
BA
CP
D
FDE3 EX
(SP),
IY
BB
CP
E
08
EX
AF,AF'
BC CP H
EB
EX
DE,HL
BD CP L
D9
EXX
FE20
CP
n
-
76
HALT EDA9 CPD EDB9
CPDR
ED46
IM
0
EDA1
CPI
ED
56
IM 1
Loading...
+ 65 hidden pages