Z8E UsersManual RickSurwilo
Z8E UsersManual RickSurwilo
.r- ,._,
Copyright 1984
by
RICK SURWILO
23 PLMOUTH ROAD
STAMFORD,CONNECTICUT 06906
(203) 324-3809
TABLE OF CONTENTS
Section Page
.··::·.(
I. INTRODUCTION
II. INSTALLATION 3
IV. INITIALIZATION 19
v. COMMAND INPUT 23
VI. BREAKPOINTS 29
VII. COMMANDS:
A Assemble 32
B Set Breakpoint 26
c Clear Breakpoint 27
D Dump 28
E Examine 29
F Find 31
G Go 33
H Disp~ay Symbol Table 34
.I Input File . · 35
J Animated Full Screen Debugging 37
K Set Memory Window Address for J command 49
M Move Memory 50
N Output to I/O Port without Pre-read 51
0 Output Current Breakpoints to Console 53
p Examine Flag Register 54
Q Query I/O Ports 55
R Register 57
s Single Step 58
u Save Symbol Table to Disk 60
v Verify Memory 61
w Write Memory Segment to Disk 62
X Displa~ Machine State 63
y Fill Memory 64
z Disassemble 65
I. INTRODUCTION
Z8E is a professional quality interactive debugging tool designed
to speed the testing of Z80 assembly language programs. Origin-
ally written as a standalone monitor, Z8E was used in the deve-
lopement of the world/s largest Touch-Tone Input/Voice Response
system. Now redone to run in a CP/M or TurboDOS environment Z8E
contains more features in less memory than any comparable soft-
ware product. Occupying less than 9K of memory, Z8E includes the
following among its many features:
- Full screen animated display of the program under
test while it is being executed by the Z80
- Complete Z80 inline assembler, with labels, sym-
bols, expressions, and directives, using Zilog
mnemonics
- Interac~ive disassembly with labels and" symbols
to console or ~isk allows the user to specify
ou~put fo-rmats and add comments
You may want to spend some time familarizing yourself with the
manual and Z8E/s command structure, especially the EXAMINE memory
command, before turning to the INSTALLATION section.
Z8E - Z80 DEBUG MONITOR Rick Surwilo
2
. .-~li!IIII\!J,._IlJII' _ _ _ _ _ _
- - - - - - - - - - - - - - - - - - - - - - - - - · - - tJ!""~H-----~~----
II. INSTALLATION
First make a working copy of Z8E, then place your original disk-
ette in a safe place. Make all modifications to the working
copy, not the original.
Z8E/s (E)xamine memory command will be used to change memory
contents. This command is described briefly below. For a more
detailed explanation please refer to SECTION V of this manual,
COMMAND INPUT.
Z8E requires an addressable cursor which can be patched symboli-
cally as follows:
First instruct Z8E to load itself as well as the symbol
file:
A>Z8E Z8E.COM Z8E.SYM
The symbol file Z8E.SYM contains the name and address
of each parameter which may need to be modified.
Use the (E)xamine memory command to change the required
bytes. You may enter commands in response to Z8E/s
asterisk prompt. Once you enter "E" followed by the
symbolic name of the address you which to change, Z8E
will respond by displaying the actual address followed
by the hex and ASCII representation of the byte being
examined (non-printable characters are shown as a "~").
For example:
'~E MXYCP <cr>
285E 2 XX <cr> ;XX represents your input
285F 1B XX <cr>
2860 3D XX <cr>
2861 00 ;PERIOD ENDS COMMAND
-Jc
IMPORTANT:
Always patch using the symbolic name of the variable;
the addresses shown in the example above are for demon-
stration only and do not necessarily reflect the actual
locations of the variables in memory.
3
Z8E - Z80 DEBUG MONITOR Rick Surwilo
4
,_---------------------.......... ' -~~ J.Mltd6··~,-·-----,,.,.kffi>_ii\&.48'. ____ j~
5
Z8E - Z80 DEBUG MONITOR Rick Surwilo
Listed below is the code that Z8E uses to do console I/O; use it
as a model. Your routines should replace the instructions with
the double semicolons. Be sure to save the registers as show
below. The size of each routine must not exceed 32 bytes.
6
---------------------------------------------~---·---,---~~~!-·---·-~----·-·*-·~---------
TTYQ: push be
push de
push hl
ld c' 11 ;;Check Console Status
~
call BDOS ; ; BDOS returns: A 00 No Character
t' '· ;; A = NZ Input Waiting
;;
and a ;;Character Here?
ld c,6 .., ,
ld e,Offh
call nz,BDOS ;' ;' If Character Here Read It •••
Else Fall Thru
pop hl ''
pop de
pop be
and 7fh
ret
org TTYQ+32
TTY!: push be
push de
push hl
TTYIOO: ld c,06 ;;Unadorned Console Input
ld e,Offh ; ; Tell CP/M this is Input Request
call BDOS .., '
and 7fh ; ; Strip Parity
jr z, TTYIOO ; ;Loop til Input Arrives
pop hl
pop de
pop be
ret
org TTYI+32
TTYO: push af
push be
push de
push hl
ld c,02
ld e,a ..' '
call BDOS ''
; ;Console Output
pop hl
pop de
pop be
pop af
ret
org TTY0+32
7
Z8E - Z80 DEBUG MONITOR Rick Surwilo
The symbols TTYQ, TTY!, and TTYO are included in Z8E.SYM. There-
fo-re these routines can be patched symbolically using Z8E"s
assemble command, for example:
'~ATTYQ
1F76 C5 TTYQ: PUSH BC
8
Z8E - Z80 DEBUG MONITOR Rick Surwilo
9
Z8E - Z80 DEBUG MONITOR Rick Surwilo
Z8E will pass the row address in the B REGISTER and the
column address in the C REGISTER. Row numbers range
from 0 to 23 while column numbers range from 0 to 79.
Your job is to translate these two number into a cursor
postion on the screen of your CRT.
Save all registers including BC. Use the following
skeleton as a guide:
ASEG
.PHASE XXXX ;From Z8E.SYM
YOURS:
PUSH BC
PUSH DE
PUSH HL
CURSOR ADDRESSING CODE HERE
POP HL
POP DE
POP BC
RET
END
Use ZBE/s output routine TTYO as described above (or
your own routine) to output the characters in your
cursor addressing sequence. Obtain the absolute address
of TTYO from the file Z8E.SYM. Code the call to the
subroutine using the absolute address in hexadecimal.
For instance, if Z8E.SYM contains the entry:
2FE2 TTYO
then code your call statements as:
CALL 2FE2H
ZBE imposes only one restriction on the code you write.
In order to guarantee that your routine can be relo-
cated into high memory by Z8E do not load any 16 bit
constants into register pairs; instead do two 8 bit
loads. For example, do not use the following state-
ment:
LD HL,1234H
Rather, code it like this:
LD H, 12H
LD L,34H
10
Z8E - Z80 DEBUG MONITOR Rick Surwilo
11
______________________ ________
12
Z8E - Z80 DEBUG MONITOR Rick Surwilo
13
------~--------------..-.-- ..-~---~' &MJIML Jut JA!&It&JM t .d ,; l!ll ]"'!"
1. A>Z8E
Z8E resides as a standalone program in memory.
2. A>Z8E USERFILE.COM
USERFILE.COM is loaded at the beginning of the
14
Z8E - Z80 DEBUG MONITOR Rick Surwilo
15
Z8E - Z80 DEBUG MONITOR Rick Surwilo
Note:
If no bias is specified, Z8E will use a bias
of zero.
If more than one .LST or .PRN file is being loaded, then each
file n.ame can be specified with. its own bias. The bias may· be
entered in the form of a symbol name, hexadecimal numper, decimal
number, or any combinatiion of the three in an expression using
the + and - operators. If the individual module has a global
entry point, the name of which was previously loaded, the user
can bias all symbols with the value associated with this name.
In this way all symbols, both absolute and relocatable, are
associated with their actual location in memory.
Z8E as presently configured can build a symbol table from the
list files produced by the following programs:
1. Microsoft MACR0-80 V3.37 .PRN Files May 8, 1980
2. Microsoft MACR0-80 V3.44 .PRN Files Dec 9, 1981
3. Microsoft LINK-80 V3.44 .SYM Files Dec 9, 1981
4. SLR Systems Z80ASM V1.07 .LST Files
5. SLR Systems SLRNK V1.07 .SYM Files
Z80ASM and SLRNK may be configured for 80 or 132 column output.
Z8E uses the file name extension (the three characters appearing
to the right of the period) to determine the format of the file.
Each of the above file types has a distinguishing format. The
characteritics of each type are described in APPENDIX A.
16
...---------------------......._...-,_.~-.1~·-?4-"-' "_ . -4!1~-~i#---~r-~~""t"''·~
-t
dl_""
During the loading process Z8E displays status and error messages
on the console relating to the activity in progress as shown
below: ·
STATUS MESSAGE DESCRIPTION
1. Loading: USERFILE.COM Z8E is attempting to open
the named file (in this
case, USERFILE.COM)
17
"""'_.,_,.,..._
------'-""""'-----------~-.,_,.,~.,...._.~,,..,_?!t'"''""'""iltl""m.,.u-~-~ _.._,~
After all user files, both symbol files and the .COM file to be
debugged, have been loaded Z8E displays current memory usage as
follows:
Total Symbols: xxxx
Symbol Table: xxxx - xxxx
Z8E relocated: xxxx - xxxx
Top of memory: xxxx
18
------------------------........-~ teiMJ:&....t~'""'J<-IA------~~~
19
Z8E - Z80 DEBUG MONITOR Rick Surwilo
IV. INITIALIZATION
Once Z8E has been loaded, and has in turn loaded all files speci-
fied on the command line, it initializes all user registers to 0
with the following exceptions:
The user's program counter contains address 100 hex
which is the start of the TPA.
The user's stack pointer is set to the starting ad-
dress of Z8E (the top of the TPA) minus two. These
two bytes are set to zero in accordance with CP/M
convention. When CP/M loads a program it initializes
a stack for the loaded program by pushing the address
of the 'jump to the system warm boot routine onto it.
Thus user programs (STAT.COM is an example) can choose
to terminate themselves and return to CP/M by execu-
ting an RET through this address on the stack. Z8E
accomplishes the same objective: the 0000 on the
,stack permits the user program to return to CP/M via
address 0000 which always contains a jump to the
system's warm boot routine.
20
Z8E - Z80 DEBUG MONITOR Rick Surwilo
21
Z8E - Z80 DEBUG MONITOR Rick Surwilo
DEBUGGING HINT:
It is not necessary to initialize the default FCB and/or the
default (command line) DMA buffer every time a program to be
tested is loaded (if indeed this program utilizes them). Instead
follow the procedure listed below (If you haven/t read the indi-
vidual command summaries the following may make more sense later):
Once you have loaded the program to test
perform the required initialization of the
FCB/s at 5CH and 6CH and the command line
buffer at 80H using the E command. Use the
ASCII string option with the E command to set
the text portions. Use the numeric input
function to intialize the drive specification
at address 5C and the character count at 80H.
Use the W command to write out memory start-
ing at address ZERO. As in:
~'W NEWFILE. COM 0 xxxx
Where XXXX is the highest address you wish to
save. Now the next time you load this file
it will of course load at address 100H. Use
the M (move memory command) to move it to
location 0000. Your FCB and DMA buffer are
initialized.
~'M 100 XX.XX+ 100 0
22
- - - - - - - - - - - - - - - - - - - - - - - - - -.............-----·-~· .......
=l""&bl... ._PM_U...
!I... M ... , .,.,,_&«t:&J~-
_ _...
JJ""·--·"'··""-'"L'k
23
Z8E - Z80 DEBUG MONITOR Rick Surwilo
V. COMMAND INPUT
Once file and symbol table loading has been completed, Z8E
prompts the operator for command input by displaying the ll)'cll
character. The operator can then type any of Z8E's single letter
commands. Some commands require no arguments while others re-
quire between one and four. Arguments may be in any of the forms
listed below (except as noted in the description of the indivi-
dual commands):
24
Z8E - Z80 DEBUG MONITOR Rick Surwilo
25
-----------------------~-~ i !lill•--~ 1Mli'Mt!l!t~£i , i@!hiit#A!\1 _,.L f_ i!
specified
P-3 invalid expression - "PC"
must be used to include the
current value of the program
counter in an expression
26
Z8E - Z80 DEBUG MONITOR Rick Surwilo
27
Z8E - Z80 DEBUG MONITOR Rick Surwilo
28
Z8E - Z80 MONITOR Rick Surwilo
29
Z8E - Z80 DEBUG MONITOR Rick Surwilo
VI. BREAKPOINTS
Breakpoints are those addresses in the program under test at
which the user wishes to suspend execution and return control to
Z8E. The user may set, clear, and display breakpoints at any
time, via the appropriate command in response to Z8E's asterisk
prompt. Z8E's implementation of breakpoints does not force the
user to tediously enter breakpoint addresses every time execution
is resumed. Rather, the user may enter up to 16 breakpoint ad-
dresses and each breakpoint, once set, is stored in one of Z8E's
internal tables and remains in effect until explicitly cleared by
the user via the Clear breakpoint command (see C command).
Z8E also allows you to specify a pass count to be associated with
any breakpoint that is set. Pass counts indicate the number of
times a particular instruction must be executed before Z8E will
regain control.
Furthermore, Z8E does not modify any code in the user program
until a GO command is issued (see G command). This permits the
user to examine code, and make patches if desired, at any point
in the debug session.
When a breakpoint is reached in the user program and Z8E regains
control, the message: 1<BP''r.XXX.X is displayed where XXX.X
represents the hexadecimal address of the breakpoint. In addi-
tion, Z8E will display the symbolic name of this address if one
exists in the symbol table. Z8E foltows this with a display of
the asterisk prompt indicating it is ready ready for command
processing.
The message: ''<ERROR~'<BP''<xxx.x is displayed on the console
whenever Z8E determines that control has been regained without a
valid breakpoint having been reached. This is generally caused
by a user program which has gone off the deep end. If the user
examines the current contents of the registers (via the X com-
mand) the current program counter will most assuredly contain an
address which had not previously been set as a breakpoint.
Things to look for when this situation arises include: a program
that blew its stack, a program that performed a 2 1/2 gainer with
a full twist indirect through a register; ie. JP (HL) into the
great unknown, and attempting to trace where wise men fear to
tread (BIOS and BDOS I/O routines).
Z8E will allow you to single step (trace) and set breakpoints
anywhere in memory. However, bear in mind that as you enter the
BIOS and BDOS netherworld your stack pointer will at some point
be saved directly in memory as CP/M switches to its own stack
(your stack pointer is not saved on a stack by CP/M). If a
breakpoint has been set at an instruction somewhere in BDOS or in
the BIOS (after this save of your stack pointer has occured) and
this breakpoint is reached, Z8E will itself call a BDOS routine
in an attempt to display the >'<BP 1<XXXX message on the console. At
this point CP/M will save Z8E's stack pointer and overlay yours
30
Z8E - Z80 DEBUG MONITOR Rick Surwilo
31
Z8E - Z80 DEBUG MONITOR Rick Surwilo
32
-----------------------~-M:::IIdiiMMI:llld'Mii!l!t~-·-·-M-U-lt""'""·i!!l_t_. _!t... ,ht""~'----l""'-1~
JM.........
A Assemble
33
Z8E - Z80 DEBUG MONITOR Rick Surwilo
In addition the dollar sign ($) may also appear in both the
operand fielp of any instruction in which a 16 bit operand is
allowed, and also in the operand field of any relative jump
instruction. The dollar sign represents the current value of
the assembler/s location counter, that is, the address appearing
on the line at which the assembly is taking place.
34
Z8E - Z80 DEBUG MONITOR Rick Surwilo
35
Z8E - Z80 DEBUG MONITOR Rick Surwilo
36
Z8E - Z80 DEBUG MONITOR Rick Surwilo
B Set Breakpoint
37
Z8E - Z80 DEBUG MONITOR Rick Surwilo
C Clear Breakpoint
38
Z8E - Z80 DEBUG MONITOR Rick Surwilo
D Dump
39
Z8E - Z80 DEBUG MONITOR Rick Surwilo
E Examine Memory
40
-----------------------~~~~·Jl!I!!!11JtlA4ik#£tffi
_ itlm3t~- lllitoJ;O_+~!I'L!l l..,r
CHARACTER ACTION
space read next sequentia l mem-
ory address
up arrow read previous memory ad-
dress
<cr> read next sequentia l mem-
ory address command
41
Z8E - Z80 DEBUG MONITOR Rick Surwilo
F Find
The find command allows the user to search memory for multi-byte
strings in memory. The format of the command is:
*F ARG1 ARG2 <cr>
where ARG1 the starting address at which to begin
the search, it may be of any type
ARG2 is an ARGUMENT-STRING representing the
pattern to search for; the user may
specify any combination of arguments
separated by commas or spaces up to the
limit of Z8E"s command line buffer
which is 80 bytes long. The actual
number of bytes searched for depends on
how the string is ultimately evaluated.
Z8E will display every address which contains data matching ARG2.
The search continues until the end of memory is reached.
The user may elect to cancel the search at any time by depressing
any key on the keyboard.
If ARG2 is a single argument (as opposed to an argument string)
and if this argument is a symbol name then Z8E will reverse the
order of the two bytes comprising the 16 bit operand. Most 16 bit
values in Z80 programs are stored with the least significant byte
at a given addr~ss and the most significant byte at the. given
address+1 (toward the high end of memory). This is in accordance
with the Z80 convention of storing the most significant byte of a
16 bit argument toward the high end of memory.
The following are examples of the FIND command:
'"F 0 SYMBOL
Assuming that the symbol "SYMBOL" is associated with
the hex value 3BF then Z8E would attempt to find all
address containing the byte pair BF and 03 in that
order, with the search beginning at address 0000. Note
that the order of the two bytes is reversed because the
symbol "SYMBOL" exists in the symbol table. To search
for the byte pair 03 and BF in that order the user
should enter the argument as either a 16 bit hex number
(3BF) or as two 8 bit hex numbers (03,BF).
42
Z8E - Z80 DEBUG MONITOR Rick Surwilo
the hex value 3BF then Z8E would attempt to find all
starting addresses of the following 12 byte string:
87 20 41 42 43 44 C3 03 BF 70 27 1F
Notice that Z8E would search for the two byte pattern
03 BF as the value for "symbol". If the user happened
to be trying to find the instruction JP symbol
the search would fail because as mentioned above 16 bit
values are stored low order byte first. The user
should have entered C3 BF 03.
The two bytes which represent the address of symbol are
not reversed as in the example above because· ARG2 is
specified as an ARGUMENT-STRING as opposed to.a single
argument.
Z8E would begin its search at address 100 (ARG1).
43
Z8E - Z80 DEBUG MONITOR Rick Surwilo
G Go
HINT:
When proceeding from a breakpoint it is simplest to use the form
of the GO command: *G P <cr> which informs Z8E to resume
execution at the address specified by the user~s current program
counter.
44
------·~~-----------Jd"""....._~.._,J . ._. . . . . . .
-~ !I!J'l!l!...._ ... 1-·-··""'·'----·-j"',
41--L&-.1-A'f.-4_....
The H command allows the user to view the symbol table on the
console. The format of the command is:
>'<H [ ARG 1 ] <cr>
where ARG1 must be a symbol name
I '
I
45
Z8E - Z80 DEBUG MONITOR Rick Surwilo
I Input file
The I command allows the user to load files into the TPA after
the debug session has started. The format of the command is:
>'<I ARG1[,ARG2] <cr>
ARG1 is a single unambiguous file name con-
forming to standard CP/M syntax rules:
- optional drive name followed by a colon
- mandatory primary file name
- optional secondary file name preceded by a
period
ARG2 is an optional load address. If ARG2 is not
specified the named file is loaded at the start of
the TPA (address 100 hex). If ARG2 is given the
file will be loaded at this address. Z8E will NOT
relocate individual addresses within the file to
reflect the new load address. ARG2 may be of any
type.
NOTE: If no arguments are entered then Z8E will
redisplay the starting address, ending ad-
dress, and the number of 256 byte pages of
the last file loaded.
46
_ _ _ _ _ _ _ _ _ _ .__~'1i!:1!littiJ~.JW!i::dl!IUJL!eiU!d!M_
f_ifu !l'l'l'!!!tl...........l~l·'"'t.
If the user answers "Y", Z8E will resume loading the file at
address 100 hex if ARG2 was not entered, or at the address speci-
fied as ARG2. If the user types any other response, the loading
process terminate s and Z8E returns to the command level. However,
the user may resume loading the file at a later time by issuing
the I command and specifyin g the file name "." (a single period).
The user may choose to specify a new starting load address
following the period; if ARG2 is omitted then the load address
defaults back to 100 hex, the start of the TPA. If the user has
done any subsequen t disk I/O (such as loading a new file of
disassemb ling to disk) in between the time loading was suspended
and then restarted , Z8E will treat the file name "." as a syntax
error.
The user may occasiona lly need to overlay a section of code in a
program which already resides in memory with input from a file on
disk, for example in modifying a BIOS in preparati on for MOVCPM.
While this is possible with loaders which process .HEX object
files, it is not feasible with Z8E. The user can circumven t this
limitatio n by loading the file from disk into an unused section
of memory and then using Z8E's move command to move only the data
needed to accomplis h the overlay.
47
Z8E - Z80 DEBUG MONITOR Rick Surwilo
The J command provides the user with the ability to "see" inside
the Z80 as it executes a program. The Z8E animated debugger
allows the user to view registers , memory, and instructio ns while
the Z80 is simultane ously executing code. In addtion the J
command provides the user with the ability to interacti vely
single-st ep through a program using the full screen facilitie s of
the command. The format of the J command is:
48
---------------------------,--1--1~
top two lines of the screen along with the contents of the F
register which is shown in mnemonic form. ZBE also disassem bles
18 instruct ions based on the current PC value and displays them
on the screen; finally, using the paramet ers entered in the W
command, ZBE snapsho ts a block of memory and displays it as a
window on the screen.
Executio n of the user program continue s until any non-num eric key
on the keyboard is pressed which ends the command. If a numeric
key is pressed , then Z8E responds by changing the timeout parame-
ter on the fly. The user may use the keys 0 - 9 as a throttle to
govern the executio n speed. Zero being the fastest; nine being
the slowest.
The command also termina tes wheneve r a user defined breakpo int is
reached. That is, if the user had set a breakpo int via the B
command ·and this address is reached the J command ends and ZBE
prompts the user for the next command. ·If the breakpo int had a
pass count associat ed with it, the pass count must reach zero
before the J command will termina te.
USING THE J COMMAND FOR SINGLE STEPPING
ZBE permits the user to single-s tep through a program while
allowing a continuo us full-scr een view of the register s, code
being executed , and the contents of a block of memory as speci-
fied by the K command. In order to invoke the full screen single-
step the user enters the followin g command:
49
Z8E - Z80 DEBUG MONITOR Rick Surwilo
The K command sets the starting address and block size of the
memory window display during the J command. The format of the
command is:
'~(K ARG1 [ ,ARG2]
50
Z8E - Z80 DEBUG MONITOR Rick Surwilo
M Move Memory
The M command allows the user to move blocks of date from any
address in memory to any other address in memory. The format of
the command is:
51
Z8E - Z80 DEBUG MONITOR Rick Surwilo
This command allows the user to output data to an I/O port with-
out first reading the port (as occurs in the Q command). The
format of the command is:
>':N [ARG1]
52
Z8E - Z80 DEBUG MONITOR Rick Surwilo
The user can also monitor an I/O port with the N command by
enclosing the port number on the command line in parentheses .
Monitor mode via the N command is identical to that of the Q
command (see Q command).
53
Z8E - Z80 DEBUG MONITOR Rick Surwilo
The 0 command allows the user to view all breakpo ints current ly
in effect. The format of the command is:
*o
no argumen ts are required
If Z8E finds a symbol name correspo nding to the absolute hex
address of a breakpo int address in the symbol table (if a symbol
table exists) then the symbol name as well as the memory address
is displaye d. If no symbol correspo nding to the address is found
only the hex address is displaye d.
If any pass counts are current ly in effect they are displaye d
next to the breakpo int address with which they are associat ed.
54
Z8E - Z80 DEBUG MONITOR Rick Surwilo
55
Z8E - Z80 DEBUG MONITOR Rick Surwilo
Upon receipt of ARG1 Z8E will read the specifie d I/O port and
display the byte read as both 8 bit hexadec imal value and it's
ASCII equival ent. Command options once a byte has been read from
the I/O port are as follows:
56
Z8E - Z80 DEBUG MONITOR Rick Surwilo
57
-----~~-· _ _,..
_ _ _ , ..., _ _. , . , _
...
..,_____
,_..,J ..__j_
_ _,._ _
58
----------,,,,.,wt____ OOO>t_ _ _ _ _ _L~~·- ·,--,--~----·-·-·-0""'-"~""'·~tM!
... f_N~i"ff•
_______
S Single Step
59
Z8E - Z80 DEBUG MONITOR Rick Surwilo
60
Z8E - Z80 DEBUG MONITOR Rick Surwilo
The U command allows the user to write the current symbol table
·to a disk file. The format of the command is:
~~u ARG1
61
Z8E ~ Z80 DEBUG MONITOR Rick Surwilo
62
Z8E - Z80 DEBUG MONITOR Rick Surwilo
Z8E always deletes any file on disk whose name is the same as
ARG1. If no file by this name exists then Z8E will automatically
create it.
Z8E will echo the starting memory address and continually update
the ending memory address as the writing to disk takes place.
63
Z8E - Z80 DEBUG MONITOR Rick Surwilo
64
..
·------r·----------------.....-~--~ ~.-•-·--''"''""'tn-.1-ow-,.H~~-,.?!'J~~
Y fill memory
65
Z8E - Z80 DEBUG MONITOR Rick Surwilo
Z disassemble command
66
Z8E - Z80 DEBUG MONITOR Rick Surwilo
67
--=-----·...·--•--inI--=-' •!l _ _ _ _ _ _ _ _ _ _
- - < n l- - O i ' ... rt~~~ ....
l$ _ , . .
_ _ ~, ,>VI!i<i:<R L.$bkii!HU+J4!£. _ 1 _ _Ed:! t, ~~~~~,
ASCII DEFB:
The contents of memory at the current disassembly ad-
dress is converted to a quoted ASCII character. Values
less than hexadecimal 20 (ASCII space) or greater than
hexadecimal 7E (ASCII tilde) cannot be disassembled
into this format.
HEX DEFB:
The 8 bit contents of memory at the current disassembly
address are converted to a hex byte.
CODE:
This is the normal default for disassembly. As Z8E
moves on to a new address it will always display the
contents of memory as a Z80 instruction. The "C" is
only needed to redisplay the contents of memory as an
instruction had one of the other characters (A, B,~ or
D) already have been entered.
68
Z8E - Z80 DEBUG MONITOR Rick Surwilo
HEX DEFW:
The contents of the two bytes of memory starting at the
loaction of the current disassembly address are output
as a define word directive. The byte pointed to
directly by the current disassembly address becomes the
low order byte of the operand. The byte at disassembly
address plus one becomes the high order byte.
NOTE:
If Z8E had just disassembled a multi-
byte Z80 instruction and the user en-
tered any of the characters listed above
(A, B, C, or D) only the first byte, or
first two for "D", of the instruction
would be converted to the requested
format. The remaining bytes of the
instruction would be treated as a new
Z80 instruction once the user proceeded
to the next disassembly address.
ADDING COMMENTS
Z8E allows the user to add one comment per line of
disassembled code. If MAXLEN is set to 6 then comments
may be up to 29 characters in length. If MAXLEN is set
to 14 then comments may be up to 16 characters in
length.
69
APPENDIX A
70
APPENDIX A
MACR0-80 V3.44
LINK-80 V3.44
LINK-80 can optionally produce a link map (.SYM file)
which lists all globally defined symbols if the user
specifies the "Y" option the 180 command line. Z8E
treats all symbols names loaded from a LINK-80 .SYM file
as absolute (non-relocatable) addresses. Nevertheless,
if the user specifies a bias, it will be added to every
symbol value read in from the .SYM file.
Z8E expects the first symbol value in a .SYM file to
begin in the first byte position in the file. Each
symbol value consists of four hexadecimal bytes in ASCII
followed by a tab character. Immediately after the tab
character is the symbol name which may be between one and
six alphanumeric characters in length. The symbol name
is followed by a tab and the sequence repeats. Every
fourth symbol value/symbol name pair should be followed
by a carriage return and line feed.
The file should be terminated with the CP/M end-of-file
character (control Z which is equivalent to a helx 1A).
Z80ASM
Z80ASM may be configured to produce either 80 or 132
column output.
Z8E searches for the 8 byte string "Symbol Table:" in the
file. This string need not be at the beginning of the
file; Z8E will scan the entire file looking for it. Once
this string is found, Z8E expects an ASCII carriage
return character and an ASCII line feed character to be
71
APPENDIX A
the next two bytes in the file. The symbol table list-
ing should begin in the next character position in the
file.
In a Z80ASM .LST file the hex value appears before the
symbol name. Hex value/symbol name combinations appear
three per line. Z80ASM symbol names may contain up to 16
characters. Z8E will accept the first 14 characters of a
symbol name if MAXLEN is set to 14 or the first 6 charac-
ters if MAXLEN is set to 6.
If the string "Symbol Table:" is never found, Z8E prints
the message:
Symbol Table Not Found
SLRNK.
NOTE:
While reading in a MACR0-80 .PRN file, or a Z80ASM .LST
file, Z8E is capable of reading an entire assembly list-
ing file looking for the "Symbols:" string or "Symbol
Table:" string. These strings need not be located at the
beginning of the file. However, the loading of the
symbol table will be speeded up considerably if the
symbol table is the only data in the file. This is
accomplished quite easily in both MACR0-80 by turning off
the listing during an assembly through the use of the
.XLIST directive. The listing can then be turned back on
just prior to the END directive via a .LIST directive to
ensure that the symbol table is written to disk.
If you are using Z80ASM use the /S option to instruct
Z80ASM to produce a symbol file.
72
------·----·-------------~--~!)_IIU!4Lf _ J t A"4H!!II!.,,!IM!!:~-~~~""E"''"'J
APPENDIX A
74
..
---------·------------·---1MII~·---at---·- d!-·--"""'"'*1-<~:...,J
0152 A3 AND E
0153 A4 AND H
0154 A5 AND L
0155 E6 49 AND NN
75
.------·""''--WW<U_______________,.__. < --L'--~ _JB1_tW LL._B.A --·--'h ... ~~""""""'-~~~~
76
APPENDIX B - ZILOG MNEMONICS
0232 3F CCF
0233 BE CP (HL)
0234 DD BE 36 CP (IX+INDEX)
0237 FD BE 36 CP (IY+INDEX)
023A BF CP A
023B B8 CP B
023C B9 CP c
023D BA CP D
023E BB CP E
023F BC CP H
0240 BD CP L
0241 FE 49 · CP NN
0243 ED A9 (;PD
0245 ED B9 CPDR
0247 ED A1 CPI
0249 ED B1 CPIR
024B 2F CPL
024C 27 DAA
0263 F3 DI
77
APPENDIX B - ZILOG MNEMONICS
0266 FB EI
0267 E3 EX (SP),HL
0268 DD E3 EX (SP),IX
026A FD E3 EX (SP),IY
026C 08 EX AF,AF"
026D EB EX DE,HL
026E D9 EXX
026F 76 HALT
0270 ED 46 IM 0
0272 ED 56 IM 1
0274 ED 5E IM 2
0276 ED 78 IN A, (C)
0278 DB 49 IN A, (NN)
027A ED 40 IN B,(C)
027C ED 48 IN C,(C)
027E ED 50 IN D, (C)
0280 ED 58 IN E, (C)
0284 ED 60 IN H, (C)
0286 ED 68 IN L, (C)
029E ED AA IND
02AO ED BA INDR
02A2 ED A2 INI
02A4 ED B2 INIR
02A6 E9 JP (HL)
02A7 DD E9 JP (IX)
78
APPENDIX B - ZILOG MNEMONICS
02A9 FD E9 JP (IY)
02AB DA 123F JP C,NNNN
02AE FA 123F JP M,NNNN
02B1 D2 123F JP NC,NNNN
02B4 C3 123F JP NNNN
02B7 C2 123F JP NZ,NNNN
02BA F2 123F JP P,NNNN
02BD EA 123F JP PE,NNNN
02CO E2 123F JP PO,NNNN
02C3 CA 123F JP Z,NNNN
02C6 38 04 JR C,$+6
02C8 18 04 JR $+6
02CA 30 04 JR NC,$+6
02CC 20 04 JR NZ,$+6
02CE 28 04 JR Z,$+6
02DO 02 LD (BC),A
02D1 12 LD (DE),A
02D2 77 LD (HL),A
02D3 70 LD (HL),B
02D4 71 LD (HL),C
02D5 72 LD (HL),D
02D6 73 LD (HL),E
02D7 74 LD (HL),H
02D8 75 LD (HL),L
02D9 36 49 LD (HL),NN
02DB DD 77 36 LD (IX+INDEX),A
02DE DD 70 36 LD (IX+INDEX),B
02E1 DD 71 36 LD (IX+INDEX),C
02E4 DD 72 36 LD (IX+INDEX),D
02E7 DD 73 36 LD (IX+INDEX),E
02EA DD 74 36 LD (IX+INDEX) ,H
02ED DD 75 36 LD (IX+INDEX),L
02FO DD 36 36 49 LD (IX+INDEX),NN
02F4 FD 77 36 LD (IY+INDEX),A
02F7 FD 70 36 LD ( IY+INDEX), B
02FA FD 71 36 LD (IY+INDEX),C
02FD FD 72 36 LD (IY+INDEX) ,D
0300 FD 73 36 LD (IY+INDEX) ,E
0303 FD 74 36 LD (IY+INDEX),H
0306 FD 75 36 LD (IY+INDEX),L
0309 FD 36 36 49 LD (IY+INDEX),NN
79
APPENDIX B - ZILOG MNEMONICS
0327 OA LD A, (BC)
0328 1A LD A, (DE)
0329 7E LD A, (HL)
032A DD 7E 36 LD A,(IX+INDEX)
032D FD 7E 36 LD A,(IY+INDEX)
0330 3A 123F LD A, (NNNN)
0333 7F LD A,A
0334 78 LD A,B
0335 79 LD A,C
0336 7A LD A,D
0337 7B LD A,E
0338 7C LD A,H
0339 ED 57 LD A, I
033B 7D LD A,L
033C 3E 49 LD A,NN
033E ED SF LD A,R
0340 46 LD B, (HL)
0341 DD 46 36 LD B,(IX+INDEX)
0344 FD 46 36 LD B,(IY+INDEX)
0347 47 LD B,A
0348 40 LD B,B
0349 41 LD B,C
034A 42 LD B,D
034B "43 LD B,E
034C 44 LD B,H
034D 45 LD B,L
034E 06 49 LD B,NN
0357 4E LD C, (HL)
0358 DD 4E 36 LD C,(IX+INDEX)
035B FD 4E 36 LD C,(IY+INDEX)
035E 4F LD C,A
035F 48 LD C,B
0360 49 LD c,c
0361 4A LD C,D
0362 4B LD C,E
0363 4C LD C,H
0364 4D LD C,L
0365 OE 49 LD C,NN
0367 56 LD D, (HL)
80
--~---..---~-~....,------------~-
•1 :llil-..~l'!fitMil!¥4\\li¥! ~-MlM .L£51i __ ! !ltJI iJtj -~~~~J,~r
0368 DD 56 36 LD D, (IX+INDEX)
036B FD 56 36 LD D,(IY+INDEX)
036E 57 LD D,A
036F 50 LD D,B
0370 51 LD D,C
0371 52 LD D,D
0372 53 LD D,E
0373 54 LD D,H
0374 55 LD D,L
0375 16 49 LD D,NN
037E 5E LD E, (HL)
037F DD 5E 36 LD E,(IX+INDEX)
0382 FD 5E 36 LD E,(IY+INDEX)
0385 SF LD E,A
0386 58 LD E,B
0387 59 LD E,C
0388 5A LD E,D
0389 5B LD E,E
038A 5C LD E,H
038B 5D LD E,L
038C 1E 49 LD E,NN
038E 66 LD H, (HL)
038F DD 66 36 LD H,(IX+INDEX)
0392 FD 66 36 LD H,(IY+INDEX)
0395 67 LD H,A
0396 60 LD H,B
0397 61 LD H,C
0398 62 LD H,D
0399 63 LD H,E
039A 64 LD H,H
039B 65 LD H,L
039C 26 49 LD H,NN
03A4 ED 47 LD I,A
81
APPENDIX B - ZILOG MNEMONICS
03B6 6E LD L, (HL)
03B7 DD 6E 36 LD L,(IX+INDEX)
03BA FD 6E 36 LD L,(IY+INDEX)
03BD 6F LD L,A
03BE 68 LD L,B
03BF 69 LD L,C
03CO 6A LD L,D
03C1 6B LD L,E
03C2 6C LD L,H
03C3 6D LD L,L
03C4 2E 49 LD L,NN
03C6 ED 4F LD R,A
03D4 ED A8 LDD
03D6 ED B8 LDDR
.03D8 ED AO LDI
03DA ED BO LDIR
03DC ED 44 NEG
03DE 00 NOP
03DF B6 OR (HL)
03EO DD B6 36 OR (IX+INDEX)
03E3 FD B6 36 OR (IY+INDEX)
03E6 B7 OR A
03E7 BO OR B
03E8 B1 OR c
03E9 B2 OR D
03EA B3 OR E
03EB B4 OR H
03EC BS OR L
03ED F6 49 OR NN
03EF ED BB OTDR
03F1 ED B3 OTIR
82
,-.---------------··-u•r~.·------------------------.----.~~ t
0403 ED AB OUTD
0405 ED A3 OUT!
0407 F1 POP AF
0408 C1 POP BC
0409 D1 POP DE
040A E1 POP HL
040B DD E1 POP IX
040D FD E1 POP IY
040F F5 PUSH AF
0410 C5 PUSH BC
0411 D5 PUSH DE
0412 E5 PUSH HL
0413 DD E5 PUSH IX
0415 ·. FD E5 PUSH IY
83
APPENDIX B - ZILOG MNEMONICS
84
APPENDIX B - ZILOG MNEMONICS
04D7 C9 RET
04D8 D8 RET c
04D9 F8 RET M
04DA DO RET NC
04DB co RET NZ
04DC FO RET p
04DD E8 RET PE
04DE EO RET PO
04DF C8 RET z
04EO ED 4D RETI
04Ei ED 45 RETN
04E4 CB 16 RL (HL)
04E6 DD CB 36 16 RL (IX+INDEX)
04EA FD CB 36 16 RL (IY+INDEX)
04EE CB 17 RL A
04FO CB 10 RL B
04F2 CB 11 RL c
04F4 CB 12 RL D
04F6 CB 13 .RL E
04F8 CB 14 RL H
04FA CB 15 RL L
04FC 17 RLA
85
------------ ------------ --JA-.1--.-t!l!i!-.L-,l'!ti-$k. .1-L. . #> t~!MfMI:IMIIllfll!lk._j_,.,..,.,j~,
050B CB 01 RLC c
050D CB 02 RLC D
050F CB 03 RLC E
0511 CB 04 RLC H
0513 CB 05 RLC L
0515 07 RLCA
0516 ED 6F RLD
0518 CB 1E RR (HL)
051A DD CB 36 1E RR (IX+ INDEX)
051E FD CB 36 1E RR (IY+INDEX)
0522 CB 1F RR A
0524 CB 18 RR B
0526 CB 19 RR c
0528 CB 1A RR D
052A CB 1B RR E
052C CB 1C RR H
052E CB 1D RR L
0530 1F RRA
0549 OF RRCA
054A ED 67 RRD
i
I "
I
I
054C C7 RST 0
054D CF RST 08H
054E D7 RST 1OH
054F DF RST 18H
0550 E7 RST 20H
0551 EF RST 28H
0552 F7 RST 30H
0553 FF RST 38H
86
.-,J---------·-----------~'l!!lllllll&tiliJ• ·~~ ;1!1 blllt_1JkllJ !!f
056C 37 SCF
87
APPENDIX B -·ZILOG MNEMONICS
88
--------------------~~lt!Mbii:
!YU! .. .. _ _ ___."""lw.
.....,..~:--~\d- .....,.,- -
89
APPENDIX B - ZILOG MNEMONICS
90
-------------~----------------------:WI!I~~"""·-- ..
,,_!!Il,.._\l!'.,.,_iL.,P..,,..,_I.,.,.t,.,_,.....,~,,
. .._....,.~,.,--'"1-Mii!I'""""~.,.,_I""'F
1111111111111111111111 1111111111
1111111111111111111111 1111111111
1111111111111111111111 1111111111
TPA
I II II II II I II I I II I II I I I II I II I I I II --- o1oo
PAGE ZERO RESERVED
92
APPENDIX B - ZILOG MNEMONICS
93