Home
Z8E User`s Manual (C) 1984 - Chicago Classic Computing
Contents
1. po rb RPS SATO RI 7 d 28 USER S MANUAL Copyright 1984 by RICK SURWILO 23 PLMOUTH ROAD STAMFORD CONNECTICUT 06906 203 324 3809 TABLE OF CONTENTS PM Section Page are I INTRODUCTION 1 II INSTALLATION 3 III INVOKING Z8E AT THE CP M COMMAND LEVEL 13 IV INITIALIZATION 19 V COMMAND INPUT 23 H m VI BREAKPOINTS 29 VII COMMANDS Assemble 32 Set Breakpoint 26 C Clear Breakpoint 27 D Dump 28 Examine 29 F Find 31 G Go 33 s H Display Symbol Table 34 Cc C Input File 35 Aid 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 Output Current Breakpoints to Console 53 P Examine Flag Register 54 Q Query I O Ports 55 R Register 1 57 5 Single Step 58 U Save Symbol Table to Disk 60 Verify Memory 61 W Write Memory Segment to Disk 62 LS X Display Mach ne State 63 Y Fill Memory 64 Mar Z Disassemble 65 APPENDIX Symbol File Formats 69 APPENDIX B ZILOG Mnemonics 73 APPENDIX C System Memory Map 91 hm a gt _ 28 280 DEBUG MONITOR Rick Surwilo Z8E 280 DEBUGGING MONITOR I INTRODUCTION Z8E is a professional qualit
2. Intentionally Left Blank 32 Rick Surwilo LI cr E 2 mE NCL GN DAMNUM S A PREPARAR Z8E 280 DEBUG MONITOR Rick Surwilo Assemble _ REND cd The command permits the user to effect inline assembly 280 assembler source code including labels and symbols using the full 280 instruction set In addition the assembler accepts standard Zilog mnemonics APPENDIX B expressions using the and operators as well as the following five assembler direc tives DEFB DDB EQU and DEFW The format of the command is ARGI cr where ARGI represents the starting address at which assembly will take place ARG may be of any type Z8E initially prompts the user by first disassembling and displaying the instruction currently located at the address spe cified by ARGI This is done as a convenience to permit the user to ensure that any patches will be assembled into memory at the intended location Z8E then outputs a carriage return line feed displays the address specified as ARG1 and awaits input 28 will not disassemble before every line of source code entered by the user only before the first one os xem 78 expects assembler input in the following format LABEL opcode operandi operand2 The label field is always optional t
3. E 1002 1002 45 E 12 8F 00 cr 1005 28 40 co Z8E 280 DEBUG MONITOR Rick Surwilo The user entered an ARGUMENT STRING 12 8F 00 which was evaluated to 3 bytes Since the ARGUMENT STRING was terminated by a car riage return the next address displayed was 100243 1005 By terminating the ARGUMENT STRING with a space the user verify the contents of memory just modified ARGUMENT STRINGS terminated by space cause Z8E to redisplay the starting ad dress this makes the data just entered availalbe for inspection E 1002 1002 45 12 8F 00 space 1002 12 If the user does not want to write any data to the current memory address then the character entered should be space character up arrow carret character or a carriage return CHARACTER ACTION space read next sequential mem ory address up arrow read previous memory ad dress cr read next sequential mem ory address command period terminate command The user may also change the current memory address by entering an equal sign followed by a valid argument The address obtained by evaluating this argument becomes the new current memory address as shown below E 1344 1344 89 cr 1345 6F 1346 52 9 34 cr 9F34 63 c 41 cmt nmn iii tegere sitem HIMEN io 4 Z8E 280 DEBUG MONITOR Rick Surwilo F
4. CCF CP HL IX INDEX cP IY INDEX Soc Ege CPL DAA DEC HL DEC IX INDEX DEC IY INDEX DEC DEC DEC DEC DEC DEC DE DEC DEC H DEC HL DEC IX DEC IY DEC L DEC SP DI DJNZ 46 77 dpi AIRTEL ence nane 0266 0267 0268 026A 026C 026D 026 026F 0270 0272 0274 0276 0278 027A 027C 027E 0280 0284 0286 0288 0289 028C 028F 0290 0291 0292 0293 0294 0295 0296 0297 0298 029A 029C 029D 029E 0240 0242 02A4 0246 02 7 FB E3 DD FD 08 EB 9 76 34 DD 3c 04 03 0C 13 1C 24 23 DD FD 2C 33 APPENDIX B ZILOG MNEMONICS E3 E3 46 56 5 78 49 40 48 58 60 68 34 34 23 23 A2 B2 E9 36 36 EI INC INC INC INC INC INC INC INC INC INC INC INC INC INC INC INC IND INDR INI INIR JP JP 78 SP HL SP IX SP IY AF AF DE HL HL IY INDEX A B BC C D DE HL IX 02A9 02AB 02 02B1 02B4 0287 02 0280 02 0 02C3 02C6 02C8 02CA 02CC 02 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0208 02 02 1 02 4 02 7 02 02 02 0 02 4 02F7 02FA 02FD 0300 0303 0306 0309 030D 0310 0314 0318 FD DA FA
5. 7E 36 7E 36 123F 57 49 5F 46 36 46 36 49 4B 123F 123F 4E 36 4E 36 49 LD LD LD LD 80 NNNN IX LY NNNN SP A IX INDEX A IY INDEX A NNNN 2 gt gt gt gt gt gt HL IX INDEX IY INDEX A ea oe ee EU UE B C D E H L NN BC NNNN BC NNNN HL IX INDEX IY INDEX gt oN zi t mUmnuau mmt tton min mc e ES 3 1 M 0368 036B 036E 036F 0370 0371 0372 0373 0374 0375 0377 0378 037 037F 0382 0385 0386 0387 0388 0389 038A 038B 038C 038 038 0392 0395 0396 0397 0398 0399 039A 039 039 039 03 1 03A4 03A6 0382 DD FD 57 50 51 52 53 54 55 16 66 DD FD 67 60 61 62 63 65 26 2A 21 ED DD DD FD FD APPENDIX B ZILOG MNEMONICS 56 36 56 36 49 5B 123F 123F 5E 36 5E 36 49 66 36 66 36 49 123F 123F 47 2A 123F 21 123F 2A 123F 21 123F LD LD LD LD LD 81 IX INDEX IY INDEX DE NNNN DE NNNN E HL IX INDEX IY INDEX VY IY INDEX v 9 9 it OU oOtUm a z HL NNNN HL NNNN I A IX NNNN IX NNNN TY NNNN
6. A carriage return input by the user terminates the com mand while any other character causes the next block to be disassembled unless interactive mode is in effect Perhaps the most convenient way to disassemble is to specify a count of one either explicity or by omitting ARG2 and to use the space bar as an on off switch Holding down the space bar produces output releasing the space bar ends output Z8E s disassembler is especially powerful when used in tion with the symbol facility By building a symbol table with both PRN and SYM files and or creating user defined symbol names via the command the user can virtually recreate assembler output listing minus the comments with Z8E inserting labels and symbolic operands wherever possible If Z8E cannot match operand in the disassembled instruction to a corresponding symbol in the symbol table or if no symbol table exists Z8E uses the hexadecimal value If multiple symbols in the symbol table are equal to the same 16 bit value or address Z8E disassembles using the first symbol name encountered the search of the symbol table which is equated to the 16 bit operand specified in the instruction being disassembled This will unavoidably produce an occasional mis named operand when more than one symbol name is equated to the same 16 bit value Z8E does not substitute symbol names in those 780 instructions which reference 8 bit immediate data
7. If a mismatch occurs Z8E will display the address in each block at which the mismatch was found as well as the byte contained at each address The comparison continues until the ending address is reached The user may halt the command at any time by depressing key on the keyboard 62 Z8E Z80 DEBUG MONITOR Rick Surwilo W write memory to disk The W command allows the user to write the contents of memory to disk file The format of the command is W arg arg2 arg3 ARGI is the name of a file to which writing will take place ARG2 and ARG3 are the optional starting and ending addresses of the portion of memory to be written to the disk If the addresses omitted then the memory block to be written is defined by the starting and ending addresses of the last file loaded These addresses can be redisplayed by entering the I command with no arguments Z8E always deletes any file on disk whose name is the same as ARGI no file by this name exists then Z8E will automatically create it Z8bE will echo the starting memory address and continually update the ending memory address as the writing to disk takes place 63 C Z8E 280 DEBUG MONITOR Rick Surwilo X display machine state X command displays the current contents of all user registers The format of the command is no arguments are required Z8E displays displays all registers except the I register an
8. cially useful when used prior to disassembling see Z command code for which no symbol table exists The EQU directive quires the user to supply a symbolic name in the label field the instruction If Z8E indicates errors in an EQU statement by printing question marks If an EQU statement is correctly assem bled by 78 the address of the assembler s current location counter is erased since an EQU statement generates no object code Operands appearing in EQU statements are evaluated to 16 bit value 28 will display the value of this 16 bit number as four hex digits in the object code field on the console 36 PAESI TRA Rn x C ITEM leas Meo Z8E 280 DEBUG MONITOR Rick Surwilo B Set Breakpoint Breakpoints are those addresses at which the user wishes to suspend execution of the program under test Breakpoints may be set at any time in response to Z8E s asterisk prompt Z8E allows the user to set up to 16 individual breakpoints in his program Z8E also allows the user to specify a pass count to be associated with any breakpoint The command is invoked as follows ARGi pass count ARG2 ARGn cr where each argument represents the address in the user program at which a breakpoint is to be set Normally that is when no pass count is specifed execution the user program stops and control returns to the Z8E
9. defaults to 1 If the current PC 1000 in this example is pointing to a call instruction then the command 1000 CD 56 30 RASRTN CALL ANYSUB 1003 FE 04 CP 4 1005 CA 17 10 JP Z AHEAD will cause the entire subroutine ANYSUB to be executed and control will return to the user at address 1003 If ARGI is omitted Z8E will transfer control to the user program and one instruction the one pointed to by the current contents of the user s program counter will be executed Following the execution of the instruction or group of instructions if ARG2 was greater than 1 Z8E regains control and automatically dis plays the current contents of all the user registers The user may optionally indicate that more than one instruction is to be executed by entering a value greater than 1 for ARGI Z8E will transfer control to the user program and regain control only when the specified number of instructions have been cuted This feature is useful in debugging small loops in that the user can set ARG equal to the number of instructions in the range of the loop Z8E will display the register contents after each instruction of the loop is executed and return control to the user after every iteration of the loop The single step command always causes the execution of the in struction pointed to by the current contents of the user s pro gram counter This is the instruction that appears in disassem 59 i Y 28
10. 132 column output Z8E uses the file name extension the three characters appearing eA to the right of the period to determine the format of the file Each of the above file types has distinguishing format The ed characteritics of each type are described in APPENDIX A errs Z8E 280 DEBUG MONITOR Rick S rwilo During the loading process Z8bE displays status and error messages on the below STATUS MESSAGE Loading USERFILE COM 2 Number of symbols loaded Loaded 100 YYYY Pages 222 ERROR uem File not found Symbol table not found Invalid offset using 0000 console relating to the activity in progress as shown DESCRIPTION Z8E is attempting to open the named file in this case USERFILE COM Following the loading all symbols from a listing file or SYM file the number of symbols loaded from the specified file is displayed as a decimal number 28 displays the starting and ending memory addres ses of the target file the first file specified on the CP M command line and the one which is going to be debugged Pages refers to the decimal number of pages and is the count of 256 byte pages in the file This number may be subse quently used with the CP M SAVE command once the de bug session ends DESCRIPTION The file specified in the command could not be found on the specified drive The specified file was found but did not contain
11. 780 DEBUG MONITOR Rick Surwilo bled form as part of the output of the X command display machine state Bear in mind that ARG is not the address at which single stepping is to begin it is a count to the number of instructions to execute If the user desires to single step at address other than the one contained in the program counter then the PC register must be modified via the command before the single step command is issued to Z8E Allowing the convenience of entering 5 cr to execute one instruction has the side effect of not allowing the user to abort the command in between the time the S is typed and the lt cr gt is entered by simply omitting an argument and typing lt cr gt If you change your mind and want to cancel the command type in an inva lid argument as ARG This will cause a question mark to be displayed however no instruction will be executed During block tracing ARGI greater than 1 the command may be terminated by hitting any key on the keyboard The 5 command does not relocate instructions before execution as does the G command see G command Hence it is not possible to single step through each iteration of a DJNZ instruction 60 EET BUNT aS mee 28 280 DEBUG MONITOR Rick Surwilo U Write Symbol Table to Disk MM a 2 The U command allows the user to write th
12. D2 c2 F2 EA E2 CA 38 18 30 20 28 02 12 77 70 71 72 73 74 75 36 32 ED ED 22 nt menores een emen APPENDIX B ZILOG MNEMONICS E9 123F 123F 123F 123F 123F 123F 123F 123F 123F 04 04 04 04 04 49 77 70 71 72 73 74 75 36 77 70 71 72 73 74 75 36 36 36 36 36 36 36 36 49 36 36 36 36 36 36 36 36 49 123F 43 53 123F 123F 123F 1Y C NNNN M NNNN NC NNNN NNNN NZ P NNNN PE NNNN PO NNNN Z NNNN 5 6 46 NC 46 2 6 2 5 6 BC A DE A HL A HL B HL C HL D HL E HL H HL L HL NN IX INDEX A IX INDEX D IX INDEX E IX INDEX H IX INDEX L IX INDEX NN IY INDEX A IY INDEX B IY INDEX C IY INDEX D IY INDEX E IY INDEX H IY INDEX L IY INDEX NN NNNN A CNNNN BC NNNN DE NNNN HL nee es 031 031F 0323 0327 0328 0329 032A 032D 0330 0333 0334 0335 0336 0337 0338 0339 0338 033C 033E 0340 0341 0344 0347 0348 0349 034A 0348 034C 034D 034 0350 0354 0357 0358 0358 035 035F 0360 0361 0362 0363 0364 0365 0367 46 DD FD 47 40 41 42 743 44 45 06 01 4E 4F 48 49 4A 4B 4C 4D OE 56 APPENDIX B ZILOG MNEMONICS 22 123F 22 123F 73 123F
13. ENDS COMMAND 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 PN hie EN Z8E 280 DEBUG MONITOR Rick Surwilo Listed below are the symbolic names of the addresses which may have to be patched for your CRT MXYCP ROWB4 ROW COLUMN CASE MAXLEN Cursor addressing lead in string The first byte the number 2 in the above example re presents the number of bytes in the string The string may be up to 10 bytes long This actual lead in string should immediately fol low the count byte Default is the two character string 1B Hex 3D Hex ASCII ESCAPE followed by EQUAL SIGN Set this byte as follows NOT ZERO Row is sent before Column ZERO Column is sent before Row Default is NOT ZERO row sent before column Set this byte to contain the value which is to be added row number before it is sent to the screen Default is 20 Hex ASCII space Set this byte to contain the value which is to be added column number before it is sent to the screen Default is 20 Hex ASCII space This byte controls whether you prefer entering symbol names in upper or lower case It also controls whether disassembly will be done in upper lower case Patch as follows FF lower case DEFAU
14. O5BF 05 1 05C3 05C5 05 7 05 9 05 05CD 0553 0577 0509 O5DB 05DD 05DF 05 1 05 05 5 05 7 05 1_ 05 05 5 05 7 0529 05 05FD 05FF 0603 0607 0609 060B 060D 060 0611 0613 0615 0617 0618 061 0621 FD CB CB ROR EY APPENDIX B 211 06 MNEMONICS CB CB E7 EO E2 E3 4 E5 F6 CB CB F7 FO F2 F3 F5 FE CB CB FF F8 36 DE 36 DE 36 E6 36 E6 36 EE 36 EE 36 F6 36 F6 36 FE 36 FE SET SET SET SET SET SET SET SET SET SET SET SET SET SET SET SET SET SET SET SET SET SET SET SET SET SET SET SET SET SET SET SET SET SET 88 3 CHL IX INDEX LY INDEX WWWWWWWWW wv gt 4 HL C D E H L IX INDEX C D E H L IX INDEX IY INDEX gt 7 IX INDEX 7 7 7 d sth A 0623 0625 0627 0629 0628 0620 062 0633 0637 0639 063 063D 063F 0641 0643 0645 0647 064 064F 0651 0653 0655 0657 0659 0658 0650 065 0663 0667 0669 0668 0660 066 0671 0673 0675 0676 0679 067C 067D 067E 067F 0680 0681 0682 0683 96 DD FD 97 90 91 92 93 94 95 D6 APPENDIX B 21
15. Surwilo C Clear Breakpoint MM M M M Hn M M The C command clears individual breakpoints previously set by a B command The format of the command is C ARG1 ARG2 ARGn cr where each arg may be any valid argument type which evaluates to an address previously set as a breakpoint Multiple breakpoints may be cleared by the same C command by separating each argument with a single space Z8E displays a question mark when an attempt is made to clear a non existent breakpoint To clear ALL breakpoints enter where the asterisk indicates ALL 38 a Z8E 280 DEBUG MONITOR Rick Surwilo b Dump d CQ The D command allows the user to dump memory in both hexadecimal and ASCII to the console in user specified block sizes The format of the command is ARG1 ARG2 tt where ARG the starting address to dump ARG2 dictates the dump format depending on its value ARG2 is in the range 0 255 then it is treated as a block size and represents the number of bytes to be displayed 0 is treated as 256 If ARG2 is greater than 255 then ARG2 is treated as an ending address and memory will be dumped non interactively to the console ARG1 and ARG2 may be of any argument type If ARGI is omitted then the dump resumes from the last memory address 1 as displayed via the previous invocation of the D command If no previous D
16. below 28 pauses after each block is disassembled and allows the user to continue or to terminate the command If ARG2 is omitted altogether a default block size of 1 is used Whenever ARG2 equals 1 either explicitly or by default Z8E allows interactive disassem bly which allows the user to choose the out put format of the data Interactive disas sembly is discussed below 2 If ARG2 evaluates to a number greater than 255 it 15 assumed to be an ending address In this case disassembly will proceed from starting address ARG1 to ending address ARG2 and no user intervention is required ARG3 if present is assumed to be the name of a disk file into which the disassembled output will be written Z8E searches the specified disk for 66 eo f O Z8E Z80 DEBUG MONITOR Rick Surwilo the named file If the file is found then all disassembled output will be written to it over writing any data that existed there If the file does not exist the file will be created using the name specified in ARG3 NOTE If ARG3 is present ARG2 must be explicitly specified otherwise Z8E will mistakenly treat the file name as ARG2 Z8E outputs to the console using the following format ADDRESS OBJECT CODE LABEL OPCODE OPERAND Z8E writes to disk using the following formart LABEL OPCODE OPERAND Z8E disassembles memory block by block in the user specified block size After each block is output Z8E pauses for user input
17. command level as soon as a breakpoint s reached Pass counts are used to inform Z8E that execution of the user program should halt only when the specified breakpoint is reached the number of times times indicated by the pass count Pass counts are specified by following the breakpoint address with a comma and then entering a pass count immediately following the comma axistin pass count may be changed to a different value by re entering the same breakpoint address following it with a comma and then specifying the new pass count To break on a multi byte Z80 instruction the address specified as the breakpoint address must be that of the first byte of the instruction Users who fail to observe this rule will generally find their programs hopping the next bus to never never land If a patch is made at an address of a breakpoint currently in effect be sure the breakpoint address is still pointing at the first byte of the new instruction Multiple breakpoints may be set with the same B command by sepa rating each one with a single space If multiple breakpoints are specified and Z8E detects an erroneous argument a non existent symbol for example a question mark will be printed the command terminates All valid breakpoints specified up to the invalid one will be set Z8E displays a question mark when a attempt is made to set a seventeenth breakpoint 37 iC Z8E 280 DEBUG MONITOR Rick
18. command had been given then memory is dumped starting at address 100H If ARG2 is omitted then the most recent value of ARG2 from the last D command is used The dump command displays the contents of memory in hexadecimal on the left side of the console while the ASCII equivalent each byte is shown on the right side During block by block dump ARG2 lt 256 signifies a block by block dump 28 waits for user input after each block is 415 played carriage return entered by the user causes the next sequential block to be dumped while any other character causes the command to terminate For non interactive dumps starting address to ending address pressing any key terminates the dump The dump command provides an especially easy way of examining tabular data for example in scanning the disk parameter headers in your BIOS That is by specifying the base address as ARG and the table size as ARG2 the user can walk through memory table by table 39 ae 2 28 280 DEBUG MONITOR R ck Surwilo E Examine Memory The E command allows the user to examine and optionally modify the contents of memory The format of the command is where ARG1 is the address of the first byte to examine ARG may be any symbol type Upon receipt of ARG Z8E will read the contents of the specified memory address and display the byte in both hex and ASCII At this point the user has two
19. expression the mnemonic PC must be used If an expression used as an argument contains a register pair as one of its terms the register pair must be the first term Also only one register pair may be included in expression HL 4 valid expression 5 DE invalid expression register pair is not the first term HL BC invalid expression more than one register pair was 25 3 tege Z8E 280 DEBUG MONITOR Rick Surwilo REGISTER INDIRECT DECIMAL specified P 3 invalid expression PC must be used to include the current value of the program counter in an expression To differentiate between the hexadecimal numbers AF BC and DE and the Z80 register pairs of the same name be sure to prefix the numerical version with a leading O Note also that the 780 prime register names are not allowed as arguments except in the R command Z8E allows the user to specify the data con tained in the memory location pointed to by a register pair as an argument For instance if the user s HL register pair contained 18EE and the addresses 18EE and 18EF contained the bytes 42 and 61 respectively then the com mand HL would examine the contents of memory location 6142 Note that register indirect memory references are indicated by enclosing the register pair name in PAREN THESES which follows the ZILOG mnemonic meth od of signifying the contents The most useful application of register
20. hex value is I meaning that the symbol is globally defined then the character following the I is examined If this character is an apostrophe it is considered to be program relative and the bias if specified is added the value If the character following the hex symbol value the I is any character besides an apostrophe the symbol is considered absoiute and the bias will not be added The file should be terminated with the CP M end of file character control Z which is equivalent to a hex 1A If the string Symbols is never found 28 prints the message Symbol Table not Found 70 T Pads i d APPENDIX A MACRO 80 24 Z8E searches for the 8 byte string Symbols in the file Once this string is found Z8E expects an ASCII carriage return character and an ASCII line feed charac ter to be the next two bytes in the file The symbol table listing should begin in the next character position in the file In this release of MACRO 80 the format of the symbol table is completely opposite of V3 37 That is the hex value appears before the symbol name In addition these hex value symbol name combination appear three per line The character appearing after the hex value is inter preted as described for version 3 37 If the string Symbols is never found Z8E prints the message Symbol Table not Found LINK 80 V3 44 LINK 80 can optionally produce link map SYM file which lists all g
21. in order to prevent 28E s and the user s stack from becoming hopelessly entangled ARG2 represents an optional timeout paramter which affects the speed at which instructions are cuted This number may be in the range 0 255 with 10 decimal as the default if no value is entered A timeout value of 10 yields approximate ly half second delay between the execution of sequential instructions A value 0 sents NO time delay and is actuality the fast est rate a which the J command can run Once the J command commences Z8E takes over the 280 and fur nishes the user with a peephole into the CPU 28 executes one instruction a time in the user program pausing after each one to dynamically update the screen display The J command divides the screen into three areas register map disassembled code and memory window The register map displays all registers on the 48 28 780 DEBUG MONITOR Rick Surwilo top two lines of the screen along with the contents of the F register which is shown in mnemonic form Z8E also disassembles 18 instructions based on the current PC value and displays them on the screen finally using the parameters entered in the W command 28 snapshots a block of memory and displays it as a window on the screen Execution of the user program continues until any non numeric key on the keyboard is pressed which ends the command If a numeric key is
22. 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 execution speed Zero being the fastest nine being the slowest The command also terminates whenever a user defined breakpoint 15 reached That is if the user had set a breakpoint via the B command and this address is reached the J command ends and 78 prompts the user for the next command 1f the breakpoint had a pass count associated with it the pass count must reach zero before the J command will terminate USING THE J COMMAND FOR SINGLE STEPPING Z8E permits the user to single step through a program while allowing a continuous full screen view of the registers 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 following command J dd pe instructs Z8E not to trace any subroutines at all instructs Z8E not to trace any subroutines location below address 100H and is specifically designed to allow the user the option of not becoming tangled in BDOS BIOS Note that this version of the J command is differentiated from the non interactive version by the absence of any argument indicating a execution address This version allows the user to execute one instruction in his program and then regain control at the Z8E command level Z8E will execute the instruction pointed to by t
23. starting at address 1000 This pattern would repeat at address 1006 100C 1012 etc The command ends after a byte is written to the ARG2 address even if this byte does not represent the last byte the ARG3 block In the above example the command would end when a byte is written to address 127C even if that byte is not 77 65 FO 28 280 DEBUG MONITOR Rick Surwilo Z disassemble command E a The Z command allows the user to disassemble a block of data Z8E performs disassembly which is the translation of binary memory data into source code format using the full Z80 instruc tion set and Zilog mnemonics The resultant source code may be directed to the console or to the console and a disk file simul taneously Z8E also allows the user to disassemble interactively when ARG2 is equal to 1 The format of the command is 2 ARGI ARG2 ARG3 where 1 the start address at which disa ssembly is to begin ARG2 is optional and represents the upper limit of the disassembly process see details below ARG3 is an optional file name speci fication for disassembly to disk ARG1 may be of any argument type ARG2 is treated in one of two ways depending on its value 1 If ARG2 evaluates to a number between 1 and 255 decimal Z8E will disassemble in block mode and ARG2 becomes a count of the number of instructions per block to disassemble As Will be explained
24. this exam ple location 80 would contain a hexadec imal decimal 15 representing the num om ber of characters and locations 81 Mess through 8F would contain the 15 characters space through S Similiarly the first byte of the default FCB at address 5 would contain the number 1 numeric equi valent of drive B and the next 11 bytes would contain the file name FYL2EDIT in ASCII If the name FYL2EDIT was shorter than 8 characters then the remainder of the file name field in the FCB would be filled with ASCII spaces The next 3 bytes would contain the file type in ASCII in this example the file type is BAS M file type was specified this field would BUS contain 3 ASCII spaces Now if the user was to debug the EDIT program using Z8E this initialization of the default DMA buffer and default FCB must be accomplished by hand prior to attempting to debug EDIT COM owing to the fact that CP M has already set up these to areas with the data from the command line which was typed in to load Z8E In short EDIT must be tricked into believing it was loaded by CP M and not by Z8E and the user must perform the initialization of these T two areas The user may use the E command s to store both ASCII and numeric data in memory to simulate initialized command line buffer and FCB Further information regarding the format of the FCB DMA buffer may me found in Digital Research s CP M 2 0 INTERFACE GUIDE
25. 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 symbol file is able to process symbol tables which occupy multiple pages 72 Headings which precede C Y 1 x T UNUS CIUS PET punt APPENDIX A each page are automatically ignored by 28 con ul 7 0049 123F 0036 010B 010C 010F 0112 0113 0114 0115 0116 0117 0118 0119 011 0110 011F 0121 0123 0124 0127 012A 0128 012 012D 012E 012F 0130 0131 0133 0134 0135 0136 0137 0139 013B 013D 013F 0141 0143 0145 0147 0148 014B 014 014 0150 0151 A6 DD FD A7 Al A2 APPENDIX B ZILOG MNEMONICS 8E 36 36 49 5A 6A 7A 86 36 86 36 49 09 19 29 39 09 19 29 39 A6 36 A6 36 NN NNNN INDEX gt gt gt gt gt gt gt gt 49H 8 BIT OPERAND 123FH 16 OPERAND 36H INDEX REGISTER INDEX A HL A IX INDEX IY INDEX A CHL IX INDEX IY INDEX A B C D E H L IY IY IY SP HL IX INDEX IY INDEX gt CC LS Md J 0
26. 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 Tabie Not Found SLRNK SLRNK can optionally produce link map SYM File similar to the one produced by Link 80 Z8E treats all symbols loaded from a SLRNK SYM file as absolute sym bols However as in the case of Link 80 SYM files Z8E will add a relocation bias to each symbol if one is specified Each symbol value in a SLRNK SYM file consists of four hexadecimal bytes followed by a space followed by the feet seer n symbol name symbol name is followed by two ASCII tab characters Use SLRNK s M option to produce a link map NOTE 28 in any of the file types mentioned above While reading a MACRO 80 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 MACRO 80 by turning off the listing during an assembly
27. 041D FD CB 36 86 RES 0 IY INDEX 0421 CB 87 RES 0 0423 CB 80 RES 0 0425 CB 81 RES 0 0427 CB 82 RES 0 D 0429 CB 83 RES 0 0428 CB 84 RES 0 pm 042D CB 85 RES 0 1 042 8 RES 1 HL 0431 CB 36 8E RES 1 IX INDEX 0435 FD CB 36 8E RES 1 IY INDEX 0439 CB 8F RES 1 A 0438 88 RES 1 043D CB 89 RES 1 C 043F CB 8A RES 1 D po 0441 CB 8B RES 1 E pum 0443 CB 8C RES 1 0445 CB 8D RES 1 1 C 83 Ap cpu cit Yep 0447 0449 044D 0451 0453 0455 0457 0459 0458 0455 045 0461 0465 0469 046 0465 046 0471 0473 0475 0477 0479 0470 0481 0483 0485 0487 0489 048 0480 048F 0491 0495 0499 0498 049D 049F 0441 0443 0445 04A7 04A9 O4AD 0481 0453 CB FD CB CB APPENDIX B ZILOG MNEMONICS 96 CB CB 97 90 91 92 93 94 95 9E CB CB 9F 98 99 9A 9B 9c 9D B6 CB CB B7 BO 36 96 36 96 36 9E 36 9 36 A6 36 A6 36 AE 36 AE 36 B6 36 B6 RES RES RES RES RES RES RES RES RES RES RES RES RES RES RES RES RES RES RES RES RES RES RES RES 84 2 CHL IX INDEX IY INDEX B H L 3 HL IX INDEX IY INDEX A B C D E H L An w IX INDEX IY INDEX v vw w 5 HL IX INDEX IY I
28. 106 MNEMONICS 26 CB CB 27 20 21 22 23 24 25 2 CB CB 2F 28 29 2A 2B 2C 2D 96 96 49 36 26 36 26 36 2E 36 2E 36 3E 36 3E 36 36 SET SET SET SET SET SLA SLA SLA SLA SLA SLA SLA SLA SLA SLA SRA SRA SRA SRA SRA SRA SRA SRA SRA SRL SRL SRL SRL SRL SRL SRL SRL SRL SRL 89 Pmmoous HL IX INDEX IY INDEX gt HL IX INDEX IY INDEX HL IY INDEX HL IX INDEX IY INDEX A je C 0685 0686 0689 068 0680 068 068F 0690 0691 0692 0693 APPENDIX B ZILOG MNEMONICS DD AE 36 FD AE 36 XOR XOR XOR XOR XOR XOR XOR XOR XOR 90 HL IX INDEX IY INDEX APPENDIX B ZILOG MNEMONICS N e semper er i 3 we APPENDIX B ZILOG MNEMONICS APPENDIX C SYSTEM MEMORY MAP EEEEEEEEEEEEBEEE FFFF CP M BDOS and BIOS Z8E Approx 8 75 BYTES OPTIONAL SYMBOL TABLE LEE HEEL EE HEEL TPA CEPA PATEL 0100 PAGE ZERO RESERVED 2200900 92 INDEED Cp p H n E pen ted nibii eacus Prom APPENDIX ZIL
29. 152 0153 0154 0155 0157 0159 015D 0161 0163 0165 0167 0169 016B 016D 016F 0171 0175 0179 017B 017D 017F 0181 0183 0185 0187 0189 0180 0191 0193 0195 0197 0199 0198 0190 019 0141 01A5 90149 0181 0183 0185 0187 APPENDIX B 21106 MNEMONICS 49 46 CB CB 47 40 41 42 43 44 45 4E CB CB 4F 48 49 4A 4B 4c 4D 56 CB CB 57 50 51 52 53 54 55 5E CB CB 5F 58 59 5A 5B 5D 66 36 46 36 46 36 4E 36 36 56 36 56 36 5E 36 5E AND AND AND BIT BIT BIT BIT BIT BIT BIT BIT BIT BIT BIT BIT BIT BIT BIT BIT BIT BIT BIT 75 0 CHL 0 0 0 0 C 0 D 0 0 H 0 L 9 9 4 HL IX INDEX IY INDEX OD OU PARR v v 9 v a gt IX INDEX IY INDEX ho t2 FO FO B2 BO FO FO B2 3 HL CIX INDEX IY INDEX WWW CO CO CO CO CO Ww o v A B C D E H L e 0189 01BD 01c1 01 3 0185 01C7 01 9 01CB 01 01 0121 0105 0109 0178 0100 O1DF 01E3 01 5 01 7 01E9 O1ED 01 1 O1F3 01 5 7 01 7 01 9 01 O1FF 0201 0205 0209 0208 0200 020 0211 0213 0215 0217 021A 021D 0220 0223 0226 0229 022C CB FD
30. 77 21 N Z8E 280 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 100 XXXX 100 0 22 78 Z80 DEBUG MONITOR d This Page f i Intentionally Left Blank 23 Rick Surwilo EN S f C 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 c
31. CB CB CB CB CB CB CB APPENDIX B ZILOG MNEMONICS CB 36 66 CB 36 66 67 60 61 62 63 64 65 6E CB 36 6E CB 36 6E 6F 68 69 6A 6B 6C 6D 76 CB 36 76 CB 36 76 77 70 71 72 73 74 75 7 36 7 36 7 7 78 79 7 7 7C 7D 123F 123F 123F 123F 123F 123F 123F 123F BIT BIT BIT BIT BIT BIT BIT BIT BIT BIT BIT BIT BIT BIT BIT BIT BIT BIT BIT BIT BIT BIT BIT BIT BIT BIT BIT CALL CALL CALL CALL CALL CALL CALL CALL 76 lt lt lt lt IX INDEX TY INDEX t Hi bp O OO 0 gt 6 CHL IX INDEX IY INDEX B C D E H L 7 CHL IX INDEX IY INDEX SI SSI MEM A B C D E H L 3 gt a M fom din RHONE niani 022 0232 0233 0234 0237 023A 0238 023C 023D 023E 023F 0240 0241 0243 0245 0247 0249 0248 024 0240 7024 0251 0254 0255 0256 0257 0258 0259 025 0258 025C 025D 025F 0261 0262 0263 0264 cc APPENDIX B ZILOG MNEMONICS 123F BE 36 BE 36 49 A9 B9 Al B1 27 35 DD FD 3D 05 OB OD 15 1B 1D 25 2B DD FD 2D 3B F3 35 36 35 36 2B 2B 04 CALL 2Z NNNN
32. Find The find command allows the user to search memory for multi byte strings in memory The format of the command is ARG2 where the starting address at which to begin the search it may be of any type ARG2 is 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 address 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 cont
33. IY NNNN APPENDIX B ZILOG MNEMONICS ern 0356 6E LD iL CHL 03B7 DD 6E 36 LD L IX INDEX oe FD 6E 36 LD L IY INDEX eo 03BD 6F Madey 68 LD 69 LD L C 03 0 L D 0301 6B L E 0362 6 LD L H 03c3 6D LD L L 03C4 2k 49 L NN j 0366 LD 03c8 ED 7B 123F LD SP NNNN 03cc F9 LD SP HL 03CD DD F9 SP IX O3CF FD F9 LD SP IY 03D1 31 123F LD SP NNNN 03D4 ED A8 LDD 0306 ED B8 LDDR 0308 ED LDI m 03DA EDBO LDIR Ns 03DC ED 44 NEG 03DE 00 NOP O3DF B6 OR HL 03E0 DD B6 36 OR IX INDEX 03E3 FD B6 36 OR 03E6 B7 OR 03 7 B0 OR B dao 8 OR 03 9 B2 OR 03EA B3 OR E O3EB OR H B5 OR L F6 49 OR NN ED BB OTDR Co 03F1 ED B3 OTIR Umm 82 APPENDIX B ZILOG MNEMONICS 03F3 ED 79 OUT C 03F5 ED 41 OUT C B a 03 7 ED 49 OUT S 03F9 ED 51 OUT LUN 03FB ED 59 OUT ED 61 OUT C H ED 69 OUT 0401 D3 49 OUT NN A 0403 ED AB OUTD 0405 ED OUTI 77 Naai 0407 F1 POP AF 0408 C1 POP BC 0409 D1 POP DE 040A POP HL 0408 DD POP IX 040D FD POP IY 40 5 PUSH AF 0410 65 PUSH BC 0411 05 PUSH DE TN 0412 5 PUSH HL 27 0413 DD E5 PUSH IX CP 0415 FD E5 PUSH IY 0417 CB 86 RES 0 HL 0419 DD CB 36 86 RES 0 IX INDEX
34. LT 00 UPPER CASE This is the maximum length of permitted for symbol names The permissable values are 6 and 14 If patched to any other value then Z8E will use 6 The maximum length of the symbol is required by Z8E in order to allocate space for loading the symbol table MAXLEN equals 6 then Z8E reserves 8 byte per symbol 6 for the name and two for the address If the number 14 is used then Z8E reserves 16 bytes symbol Hence MAXLEN impacts the amount of TPA available to the program s nce a symbol table of 16 bytes per entry obviously NANCE ott ATENEO ATE LLNS TO ET SUN Ato Ng Neil un v 5 pm Z8E Z80 DEBUG MONITOR Rick Surwilo takes up twice as much space as one with 8 byte entries If while reading in the symbols from disk Z8E encounters a symbol longer than the value specified in MAXLEN the symbol name is truncated to MAXLEN 6 Maximum Symbol Length DEFAULT 14 Optional Symbol Length TO SAVE THE PATCHED PROGRAM ANYNAME COM Writes the File to Disk This completes the installation of Z8E Typing in C Control C in response to Z8E s asterisk prompt will return you to the operating system Z8E 280 DEBUG MONITOR Rick Surwilo USER CODED CONSOLE I O The following section provides details on a method of optionally replacing the BDOS calls for Console I O which Z8E uses with physical console I O routines or direct BIOS calls To modify
35. NDEX Ur ana Ur Gn IY INDEX A B niin emper oce ten i EN ps SSA DOPO URN MUSS DORUM QAUM PUN qui Un rt 0485 0487 0489 O4BD O4BF 04C1 04C5 04 9 O4CB 04 0 4 0401 0403 0405 0407 0408 0409 O4DA O4DB 04DC 0405 04DE O4DF 04 0 04 2 04 4 04 6 O4EA O4EE 04 0 04 2 04 6 4 OAFA O4FC O4FD O4FF 0503 0507 0509 mme APPENDIX B ZILOG MNEMONICS B1 B2 B3 B4 B5 4D 45 16 CB CB 17 10 11 12 13 14 15 06 CB CB 07 00 36 BE 36 BE 36 16 36 16 36 06 36 06 RES RES RES RES RES RES RES RES RES RES RES RES RES RES RES RET RET RLA RLC RLC RLC RLC 85 7 HL rFmmpmooumrm HL IX INDEX IY INDEX 92 gt HL IX INDEX IY INDEX IX INDEX IY INDEX 050B 050D 050F 0511 0513 0515 0516 0518 051A 051E 0522 0524 0526 0528 052A 052C 052 0530 0531 0533 0537 053 0535 053 0541 0543 0545 0547 0549 054 054C 054D 054E 054F 0550 0551 0552 0553 ED C7 CF D7 DF E7 EF F7 FF APPENDIX B ZILOG MNEMONICS 01 02 03 04 05 6F 1E CB CB 18 19 1A 1B 1 1 67 36 1E 36 36 OE 36 OE RLC RLC
36. OG MNEMONICS COMMAND SUMMARY REFERENCE iin CMD Description Arguments Inline Assembly StartAddr B Set Breakpoint Addri Pass Count Addr2 AddrN Uu C Clear Breakpoint Addr1 Addr2 AddrN D Dump Memory StartAddr End Count Examine Memory StartAddr F Find StartAddr MatchData G Go ExecutionAddr H Display Symbol Table FirstSymbol I Input File FileName Load Address J Full Screen Animated Debug Addr Timeout K Set Memory Window StartAddr Size fs M Move Memory SourceStart SourceEnd DestStart Res N Output to Port NO Pre Read PortAddr Output Current Breakpoints P Exam Modify PSW Flag Reg Q Query I O Port PortAddr R Examine Modify Registers RegSpecifier S Single Step Count U Write Symbol Table To Disk FileName V Verify Memory SourceStart SourceEnd DestStart W Write to Disk FileName StartAddr EndAddr X Examine Machine State Y Fili Memory FromAddr ToAddr Data 2 Disassemble StartAddr End Count FileName PES Denotes Optional Argument Do Not Trace Subroutine Do Not Trace BDOS Call D 1 0 Port Monitor Mode He PS ec 28 93 Copyright 1984 AERO SOFT
37. PRN bias As in the previous example USERFILE COM is loaded at the beginning of the TPA but in this instance a PRN file is used to construct the symbol table The optional bias becomes very useful if the LST or PRN file sents the listing of a relocatable program Relocatable programs linked using Microsoft s LINK 80 default to a load address of 103H with the three bytes of memory located at 100H containing a jump to the entry point of the program Therefore if the user supplies bias of 103 in the command line all relocat able symbols in the file will be associated with their actual addresses in memory Any bias specified will only be added to those symbols which are flagged as code relative in the PRN file A bias will not be added to any symbol flagged as ABSOLUTE EXTERANL OR COMMON USERFILE COM is loaded at the start of the TPA only after the LST or PRN file has been read the symbol table built 28 280 DEBUG MONITOR Rick Surwilo 5 A gt Z8E USERFILE COM USERFILE SYM bias NFILE LST bias EN pem The true power Z8E s symbol loading is best evidenced when loading multiple symbol tables from several f les The first file is gen mp erally SYM file specifying all the global f symbol names in the program to be tested The ae subsequent files specified on the command line are usually PRN or LST files of the indivi dual source modules that were originally as semb
38. Q command If ARG is enclosed in parentheses Z8E will enter MONITOR MODE Upon receipt of ARGI Z8E will read the specified I O port and display the byte read as both 8 bit hexadecimal value and it s ASCII equivalent Command options once a byte has been read from the I O port are as follows SINGLE BYTE INPUT By entering a SPACE immediately following the displayed contents of the I O port the user can instruct Z8E to continue reading from the same I O port Q EE 24 space EE 24 5 By entering a CARRIAGE RETURN following the dis played contents of the I O port the user can instruct Z8E to read the next port number ascending order Q EE EE 24 8 cr A By entering a caret 7 following the displayed contents the I O port the user can instruct 56 neg al ee ERE ERREUR M UOCE CEN UNAM NIMM Oc 28 780 DEBUG MONITOR Rick Surwilo 28 to read the previous port number descending go order Q 24 5 up arrow entered by user PN ED 06 X By entering an equal sign followed by a valid argument the user can switch to reading a new port address EE 24 75 90 90 BF 7 yor CONTINUOUS INPUT MONITOR MODE Z8E provides the user with the ability to monitor an input port Z8E will continously read the selecte
39. RLC RLC RLC RLCA RLD RRA RRC RRC RRC RRC RRC RRC RRC RRC RRC RRCA 86 HL IX INDEX IY INDEX HL IX INDEX IY INDEX HaGo 08H 10H 18H 20H 28H 30H 38H E 0554 0555 0558 0558 055C 055D 055 055 0560 0561 0562 0564 0566 0568 056A 056C 056D 056F 0573 0577 0579 0578 057D 057F 0581 0583 0585 0587 0588 058F 0591 0593 0595 0597 0599 0598 0595 059 0543 05 7 0549 05AD 05 05 1 0583 37 CB DD FD CB CB CB CB CB CB CB APPENDIX B ZILOG MNEMONICS 9E 9E 49 42 52 62 72 C6 CB CB c7 co c1 C2 c3 4 c5 36 36 36 C6 36 C6 36 CE 36 CE 36 D6 36 D6 SBC SBC SBC SBC SBC SBC SBC SBC SBC SBC SBC SBC SBC SBC SBC SCF SET SET SET SET SET SET SET SET SET 2 SET SET SET SET SET SET SET SET SET SET SET SET SET SET SET SET SET SET SET 87 CHL IY INDEX gt gt Pr gt gt gt gt gt A B C D E H L A NN HL BC HL DE HL HL HL SP 0 CHL IX INDEX TY INDEX A B C D E H L IX INDEX IY INDEX A B c D E H L 2 HL IX INDEX TY INDEX NM RN POP PO TO ND 3 3 5 B C D E H L C 0585 0587 05
40. Z8E determines the size of the TPA by examining the address field of the jump instruction at location 5 This ad dress represents both the entry point into CP M and the end of the TPA Z8E lowers this address by approximately 9K bytes and relocates into this area by adjusting all addresses within itself to reflect its new location The jump instruction at location 5 is similiarly modified to reflect the new size of the TPA Thus all programs which use this address to determine the amount of available memory can run unchanged Z8E completes its initiali zation storing a jump instruction to its breakpoint handling software at absolute address 38 hexadecimal Symbols which are loaded from files are stored by Z8E in a symbol table at the top of the TPA just below Z8E 28 will dynamically allocate the storage necessary to hold all symbols loaded from files however Z8E also allows the user to enter his own symbols from the keyboard via the A ssemble command Z8E does NOT reserve ANY space in memory for user generated symbols The user must explicitly request memory space on the CP M command line This is accomplished by entering the number of symbols for which space should be reserved as a decimal number This number must be enclosed in parentheses and must appear as the first argument on the command line as shown below A gt Z8E 32 In this example the user has requested space for 32 user defined symbols If MAXLEN has be set to 6 Se
41. a properly formatted sym bol table 3 The user has specified an invalid offset to be added to each loaded symbol Z8E will continue to load this symbol file but will not add any bias to the sym S s i rms Z8E 280 MONITOR Rick Surwilo bols This error may have occured because the user specified an offset in the form of symbol which had not been previously loaded or the user may have specified a numeric value which contained an illegal character 4 Syntax Error The file name was rectly specified 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 Z8bE relocated XXXX XXXX Top of memory XXXX It is important to note that Z8E expects the files appearing in the command line to be appear a specific order The first file name appearing in the command iine is assumed to be the target file which is to be debugged It is always the last file to be loaded All file names following the target file name are assumed to be symbol input files and they are loaded in the order in which they appear The first file named in the command line is always loaded starting at address 100 hex The I command contains an option to allow the file to be loaded at a different address This feature is not available at the CP M command line level F
42. aining the byte pair BF and 03 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 100 87 324 ABCD 0C3 symbol p 271F Assuming that the symbol symbol is associated with 42 i Z8E 280 DEBUG MONITOR ia AMEN e NOM Hh Ment tris id gin mieten 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 IF 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 SPEI Rick Surwilo 5 Z8E Z80 DEBUG MONITOR Rick Surwilo G Go De RE TET a RI EE The comma
43. an circumvent this limitation 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 accomplish the overlay 47 28 280 DEBUG MONITOR Rick Surwilo J Animated Full Screen Debugger The J command provides the user with the ability to see inside the 280 as it executes a program The Z8E animated debugger allows the user to view registers memory and instructions while the 280 is simultaneously executing code In addtion the J command provides the user with the ability to interactively single step through a program using the full screen facilities of the command The format of the J command is J 1 ARG1 ARG2 USE OF THE J COMMAND FOR SINGLE STEPPING IS DESCRIBED AT THE END OF THIS SECTION THIS SECTION DESCRIBES THE NON INTERACTIVE VERSION OF THE 1 COMMAND DURING WHICH THE USER TURNS OVER COMPLETE CONTROL OF THE EXECUTION OF THE PROGRAM UNDER TEST TO Z8E ARG is the starting address of the display and may be of any valid argument type For example the user may specify J P to resume execution at the point where it had previouly been stopped The slash and star control subroutine tracing as follows Slash informs Z8E not to trace any subrou tines at all Asterisk informs Z8E not to trace any subrou tine calls to addresses located in the range 0 to FF This feature is intended to screen out calls to location 5 BDOS
44. current contents of the register on the same line At this point the user has the option of entering an argument of any type if the contents of the register or register pair are to be changed The replacement value may be terminated by either a carriage return or a space If no value is entered Z8E issues a carriage return line feed and waits for the next register mnemo nic to be entered If the user specifies a 16 bit value as the new contents of an 8 bit register only the low order byte of the value is used The command terminates when a carriage return or Space is entered when Z8E is waiting for a register mnemonic 58 Z8E 780 DEBUG MONITOR Rick Surwilo S Single Step H P The S command allows the user to execute a program instruction by instruction The S command provides for full tracing the user program The format of the command is S ARGI where ARGI is the number of instructions to exe cute in the user program if no argument is given Z8E defaults to 1 ARG may be of any type The slash allows the user control over the tracing of subrou tines If slash is included before the count if a count is entered if the slash is the only character on the command line then subroutines will not be traced slash affects only CALL instructions which lie within the range of ARGI In the most typical case no ARGI is present and the single step count
45. d the R register two lines of the console In addition the instruction pointed to by the user s program counter is disassem bled and displayed on the second line Think of this as the on deck instruction the instruction that will be executed upon the receipt of the next G GO or S SINGLE STEP command To inspect the I or R registers use the R command 64 gres br Z8E 280 DEBUG MONITOR Rick Surwilo Y fill memory The command fills a user specified block of memory with a user specified pattern of bytes the length of which is limited only by the length of Z8E s input buffer which is 80 bytes long ARGI ARG2 ARG3 where ARGI the starting address of the block to fill ARG2 the ending address of the block to fill ARG3 is the data pattern to be written to memory ARG3 is evaluated by Z8E as type ARGUMENT STRING which may be of any length in the range of 1 through the number of bytes remaining in the input buffer once and ARG2 have been input The Y command gives the user the capability to initialize memory to any data pattern The capability entering multi byte strings as the data pattern with which to fill memory allows the user to store repeating patterns of data in memory with a single command For example if the user entered the command d 1000 127C abcd 16 77 78 would begin writing the 6 byte pattern 61 62 63 16 77 entered as ARG3
46. d input port and display the contents on the screen Z8E displays the byte in both hex and binary This feature is useful in the testing of I O ports Depressing any key on the keyboard exits monitor mode MULTI BYTE OUTPUT P na Following the read of an I O port the user may elect to output data The user may enter an 4 ARGUMENT STRING which will be sent to the port on a byte by byte basis with no intervening reads between outputs as shown below Q 50 50 44 707 23 9 782 7 00 723 81 string as entered by user appears between arrows The data as entered by the user this example would first be converted to the 9 bytes shown below 23 09 42 32 45 00 F7 23 81 These 9 bytes would then be sent to port 50 byte after another without any intervening reads or status checks en C 57 Meme Z8E Z80 DEBUG MONITOR Rick Surwilo R Examine Modify Register Contents 3 R command allows the user to examine and optionally modify registers and register pairs in the user register set The format of the command is R ARGI cr or space where ARGI is of the 22 register mnemonics listed below A B C D E H L AF BC DE HL IX IY SP BC DE HL R P PC the program counter may be specified as either P or PC To examine a register the user enters a mnemonic from the above list followed by a carriage return or a space Z8E will display the
47. decimal 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 28 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 or D already have been entered 68 Esa LLANE cin AEN ELL EL LLANE Snina SIM Ble 28 280 DEBUG MONITOR Rick Surwilo 1 DEFW f s 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 p NOTE If 78 had just disassembled multi byte 280 instruction and the user 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 ie format The remaining bytes of the ER instruction would be treated as new 280 instruction once the user proceeded to the next disassembly address ADDING COMMENTS Z8E allows the user to add on
48. ds For example do not use the following state ment LD HL 1234H Rather code it like this LD H 12H See LD L 34H 10 Z8E 280 DEBUG MONITOR Rick Surwilo This is the only restriction other than the maximum code length which is placed on your code which is 128 bytes 3 Assemble your routine with either 80 280 5 LES Link it with either Link 80 or SLRNK gu P tide Z8E 280 DEBUG MONITOR Rick Surwilo 4 Load Z8E COM using Z8E a LN A gt Z8E Z8E COM Z8E SYM 225 5 Now overlay Z8E s cursor address code with your own I YOURCODE COM Z8E will load your cursor addressing routine on top its own beginning at the address associated with the symbol XYCP 6 Save the new file using name of your choosing mm W NEWDEBUG COM 7 Exit back to the operating system be entering a Control C at the asterisk prompt o POE ee 12 Z8E 280 DEBUG MONITOR This Page f E Intentionally Left Blank Rick Surwilo qmi tss mee egere SINUM i 2 vfi Z8E 280 DEBUG MONITOR Rick Surwilo III INVOKING Z8E AT THE CP M COMMAND LEVEL Upon invokation at the CP M command level Z8E loads at the low end of the Transient Program Area TPA which begins at absolute address 100H The TPA is the area in memory where user programs are executed Once loaded
49. e INSTALLATION Section then each symbol requires 8 bytes of storage hence in this example Z8E will set aside 256 bytes of memory for user defined symbols Subsequent action is based on the format of the remainder of the command line as entered by the user In the examples that follow bear in mind that any of these command lines may contain the argument requesting memory space for user symbol table entries The argument would appear immmediate after Z8E in every case 1 A gt Z8E Z8E resides as a standalone program in memory 2 gt 28 USERFILE COM USERFILE COM is loaded at the beginning of the 14 ny SRNR Rn Z8E 280 DEBUG MONITOR Rick Surwiio TPA and is ready to be acted on by Z8E mands USERFILE COM USERFILE SYM bias USERFILE SYM is read in by Z8E and all symbol names contained in the file are entered into a table which begins at the starting address of Z8E the ending address of the and extends downward in memory The optional bias if specified is a 16 bit value which Will be added to the 16 bit address associated with each symbol in the file In this exam ple SYM file is shown however since all addresses appearing in a SYM file are abso lute the optional b as would probably not be used USERFILE COM is loaded at the start of the TPA only after the SYM file has been read and the symbol table built USERFILE COM USERFILE
50. e 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 NN If during disassembly Z8E encounters data which cannot be of disassembled into a valid Z80 instruction it will display the data as DEFB s is oe 69 M T N APPENDIX FILE FORMAT FOR SYMBOL TABLES Z8E is currently set up to be able to read any of the listing files which appear below 1 Microsoft MACRO 80 V3 37 PRN Files May 8 1980 2 Microsoft MACRO 80 V3 44 PRN Files Dec 9 1981 3 Microsoft LINK 80 V3 44 5 Files Dec 9 1981 4 SLR Systems Z80ASM V1 07 LST Files 5 SLR Systems SLRNK V1 07 5 Files The unique characteristics of each are MACRO 80 V3 37 Z8E searches for the 8 byte string Symbols the file Once this string is found 28 expects an ASCII carriage return character and an ASCII line feed charac ter to be the next two bytes in the file The symbol table listing should begin in the next character position in the file Each line of the symbol table listing contains four symbol names and an associated address If the character following the symbol s hex value is apostophe the symbol is considered to be program rela tive If the user specified a bias in the command line the bias will be added to the symbol s value the character following the symbol s
51. e current symbol table to a disk file The format of the command is U ARGI ARGI is the name of the file to which the symbol table is to be written This command is useful to save any symbol names entered the user via the A command The entire symbol table is written to disk using the format of a SYM file see appendix A The table can be subsequently loaded at the next invokation of 78 Note that since the file is stored as a SYM formatted file the user should use a file name extension that begin with the letter S This 15 due to the fact that the next time Z8E loads this symbol file it will examine the the first character of the file name extension If the first character is an S the format 15 assumed to be SYM and the symbol table is built accordingly the appearance any other letter is taken to indicate a PRN file If a file with the name already exists on disk it will be deleted 61 Z8E 280 DEBUG MONITOR Rick Surwilo Verify two memory blocks cC E MC n LORD NNNM The V command allows the user to compare two blocks of memory Z8E will display all differences between the two The format of the command is ARG2 ARG3 where ARGI the starting address of memory block 1 ARG2 the ending address of memory block 1 ARG3 the starting address of memory block 2 Z8E compares memory block 1 to memory block 2 byte by byte
52. e mnemonics corres ponding to the current state of the four user modifiable bits sign carry zero parity in Flag register MNEMONIC MEANING BIT STATUS P positive reset M minus set NC no carry reset C carry set PO parity odd reset parity even set NZ not zero reset Z zero set 28 prints the mnemonic corresponding to the current state of each of the four flag bits Z8E then issues a carriage return line feed and pauses for user input The user may modify any of the four flag bits by typing the appropriate mnemonic followed by carriage return The user may enter multiple mnemonics by separating each one with a space If no mnemonics are entered flags bits are altered and the command terminates If an invalid flag bit mnemonic is entered 78 prints a question mark 55 Z8E 280 DEBUG MONITOR Rick Surwilo Q Query I O Ports The Q command allows the user flexible access to I O ports providing the ability to perform single byte input continuous input monitor mode and single or multi byte output following a pre read of the port The format of the command is Q ARG1 DD _ where ARG is an 8 bit port address the range 0 255 ARGI may any symbol type however if 16 bit value is specified only the low order byte is significant If no argument is given Z8E will use the most recent port number as entered by the user via an N or
53. ed This entire process is total ly transparent and it allows the user to debug loops by setting only a single breakpoint within the range of a loop obviates the need to clear any breakpoints which are located at the address where execution is to resume and even allows breakpoints at a DJNZ instructions HINT When proceeding from a breakpoint it is simplest to use the form of the GO command G P cr which informs 78 to resume execution at the address specified by the user s current program counter 44 C pes Z8E 280 DEBUG MONITOR Rick Surwilo H Display Symbol Table 2 The H command allows the user to view the symbol table the console The format of the command is H ARG1 where ARG must be a symbol name If ARG is omitted Z8E will display the entire symbol table starting with the first symbol in the table If ARG is present Z8E will begin the display with that symbol Z8E displays block of 32 symbols then waits for user input If the user enters a carriage return the the next block of 32 symbols is displayed If the user enteres any other character the command terminates If a symbol name entered as ARG cannot be found in the symbol table 78 prints a question mark 45 atu MS TET QUU RNIN SPURS r
54. ent Labels may be of any length but only the first 6 characters are significant Z8E always assigns the 16 bit value of the assembler s current location counter to the label being entered unless the statement is an EQU directive Labels need not be followed by an opcode and this as well as the EQU directive provides a convenient way to assign a value symbol name Merely set the assemblers location counter via the ORG directive or as ARG in the command line to the value you wish to assign then type the symbol name followed by a carriage return No object code is produced and no user memory areas are modified but the symbol and its associated value are entered into the user symbol table Z8E does not treat duplicate symbol names as errors Rather if the user enters symbol name which already appears in the symbol table the value associated with the new symbol replaces the one asso ciated with the old For example if the symbol ENTRYP exists in the symbol table and is associated with the value 23DA and the user assembles the following nstruction 41FF OE 04 ENTRYP LD C 4 Z8E would replace 23DA with 41FF Assembler statements which do not contain labels may begin in any column including column one There is NO need to insert leading space or tab before an opcode if the opcode is not ceded by a label Operands appearing in the operand field of the instruction to be assembled may be any of the following type
55. g the current port number on the left hand side of the console and postioning the cursor two spaces the the right At this point the user can enter the data to be sent to the port in the form of an ARGUMENT STRING The ARGUMENT STRING allows the user to mix various argument types such as hex data and ASCII literal strings Of course the user can elect to merely output single bytes if desired The N com mand is particularly useful when programming various 280 pheral chips such as the DMA and SIO chips which expect initia lization bytes to arrive in a stream without intervening reads N 80 80 T 00 12 998 This ARGUMENT STRING would be evaluated into the 5 bytes 54 00 OC 09 98 These five bytes would be sent to port 80 via an OTIR instruction No delay occurs between successive bytes After the data has been entered and after it has been sent to the I O port Z8E reprompts the user by displaying the same port number This gives the user to oppportunity to send addtional data to the same port However not entering data the user can change the current port address by entering any of the following 52 28 280 DEBUG MONITOR Rick Surwilo CARRIAGE The next sequential port number in ascending RETURN order becomes the current port address UP ARROW The next sequential port number in descending order becomes the current port address ARG Any argument appearing immediately after the equal sign no intervening space
56. h the CP M LOAD command and save the file with the CP M SAVE command which produces an absolute memory image load able 28 All COM files are of course already in loadable form and no LOADing and SAVEing is required If the file will not fit into the Z8E will print the message Out of memory Continue 46 md Z8E 280 DEBUG MONITOR Rick Surwilo If the user answers Y 78 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 terminates 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 specifying the file name 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 the user has done any subsequent disk I O such as loading a new file of disassembling to disk in between the time loading was suspended and then restarted Z8E will treat the file name as syntax error The user may occasionally 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 preparation for MOVCPM While this 15 possible with loaders which process HEX object files it is not feasible with Z8E The user c
57. haracter The operator can then type 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 SYMBOL Any symbol previously loaded previously entered via the keyboard see A command may appear as a command argument All symbols are treated as 16 bit values HEX A 16 bit hex number may be entered as argument Only the last four characters en tered are treated as significant input if Z8E is expecting 16 bit argument those instances where Z8E expects 8 bit argument only the last two characters are significant As such the user may elect to correct mis takes by either backspacing and retyping by continuing to enter the number and ring that the erroneous digit does not pear the rightmost four or two charac ters as shown in the following example 1 21 4 If 16 bit argument is expected 28 would ignore the first two digits 1 and E and would examine the contents of memory location 21F4 If no symbol table is present in memory then hexadecimal numbers 8 or 16 bits in length may begin with any digit O F However if a symbol table is in memory then all hexade cimal numbers which begin with digit in the range F are evaluated first as symbol names If no corresponding name i
58. he opcode field is mandatory only if no label was entered and the operand field must naturally be included for those Z80 instructions which require one The three fields may be separated from one another by spaces or tab characters Z8E does not automatically reserve space within itself for user supplied symbol names User supplied symbols as opposed to those loaded from files are entered from the keyboard in the label field using the A ssemble command Symbol table space to hold user supplied symbol names must be explicitly requested on the CP M command line as explained in the section INVOKING Z8E at on the CP M COMMAND LEVEL These user supplied symbols once tered may referenced in the operand field of any subsequent assembly statement or in the argument field of any Z8E command These symbols come in handy when disassembling COM files for which no source listing exists and also when patching code The assembler is a one pass assembler and forward references 33 Site N a Z8E Z80 DEBUG MONITOR Rick Surwilo symbols which do not already appear in the symbol table are flagged as errors However 28 allows the use of the ORG directive see discussion below which allows the user to mani pulate the assembler s location counter which helps to minimize the no forward reference limitation Labels may begin in any column but all labels must be followed by colon even those appearing in an EQU statem
59. he user s current PC After the instruction is executed an ARROW points to the next instruction to be executed The and options are only valid if the next instruction to be executed is a CALL If the program counter is pointing at any other instruction then the and have no effect 49 epp dm O AB tait Z8E 280 DEBUG MONITOR Rick Surwilo K Set Memory Window Parameters for Use With the J Command The 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 ARG represents the starting address of the memory block ARG2 is an optional size paramter if omitted the block size defaults to the maximum The maximum block size is 144 decimal which is 90 hex The starting address of the memory block can be anywhere in memory it does not have to be within the confines of the user program 50 pU _28 280 DEBUG MONITOR Rick Surwilo M Move Memory ee M 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 M ARGI ARG2 ARG3 where ARG1 the Starting address of the source data block ARG2 the ending address of the source data block ARG3 the starting address of the destination data block arguments may be of any type Z8bE a
60. ie LD A 24H Eight bit immediate data is disassembled as a quoted ASCII character if it s absolute value is in the range 20 hex to 7E hex otherwise it is disassembled as a hex byte Output by Z8E to a disk file is instantly assemblable by most any 67 ET 28 280 DEBUG MONITOR Rick Surwilo assembler which accepts 21105 mnemonics without any modifications other than adding an END statement at the end of the file When disassembling a block of memory starting address to ending address the disassembly process may be halted at any time by depressing any key on the keyboard Interactive disassembly allows the user to specify the format of the source code produced by disassembly l ne by line basis Interactive mode which is always in effect whenever ARG2 is equal to 1 causes Z8E to pause after each instruction is disas sembled This pause for input permits the user to enter one of the following commands to choose the desired output format CHARACTER OUTPUT FORMAT EXAMPLE A ASCII DEFB DEFB Q B HEX DEFB DEFB 23H C CODE EX HL D HEX DEFW DEFW 2 DEFW LABEL add COMMENT sThis is a Comment carriage terminate command return any other PROCEED TO THE character NEXT INSTRUCTION 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 hexa
61. in direct arguments is to set breakpoints at subroutine return addresses Consider the situation of a program which is currently suspended via a breakpoint somewhere in the middle of subroutine The user is longer interested debugging the body of the subroutine he only cares about getting back to the instruction that follows the CALL that got him into the subroutine Register in direct format allows him to enter B SP This informs Z8E to set a breakpoint at the address pointed to the stack pointer register Decimal numbers in the range 0 65535 may be entered as arguments All digits of the num ber must be in the range 0 9 decimal number must be followed by a f character 26 Z8E Z80 DEBUG MONITOR Rick Surwilo age LITERAL eo Noy PN ae ARGUMENT STRINGS O rj otherwise Z8E will treat it as a hex number The following example shows a decimal number being input as part of the E command 512 instructs Z8E to examine memory location 512 decimal 200 hex ASCII literals up to 78 bytes in length are permitted as arguments Z8E s input buffer is 80 characters long less the opening and trailing quote characters ASCII literals must be enclosed in quotes The quote char acter itself is the only character not mitted as literal Commands which do not permit the use of ARGUMENT STRINGs see be low will still accept input in the form of quoted strings In s
62. led and then linked which produced the SYM file Although only two files USERFILE and NFILE are shown in this example in actu ality the number of SYM and PRN files speci fied the command line is limited only the size Z8E s input buffer which is 80 m characters long USERFILE COM is loaded at the start of the only after all SYM and PRN LST files have been read and the symbol table built Note If no bias is specified Z8E will use a bias of zero 22 If more than LST PRN file is being loaded then each file name can be specified with its own bias The bias may be entered in the form of a symbol name hexadecimal number decimal number or any combinatiion of the three in an expression using the and operators If the individual module has 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 presently configured can build a symbol table from the list files produced by the following programs 1 Microsoft 80 V3 37 PRN Files 8 1980 a 2 Microsoft MACRO 80 V3 44 PRN Files Dec 9 1981 3 Microsoft LINK 80 V3 44 5 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
63. lobally defined symbols if the user specifies the option the 180 command line 28 treats all symbols names loaded from 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 hex 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 ASCII carriage return character and an ASCII line feed character to be 71 uem me s Er 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
64. mand structure especially the EXAMINE memory command before turning to the INSTALLATION section yet 1 C C 28 280 DEBUG MONITOR This Page Intentionally Left Blank Rick Surwilo P P 28 280 DEBUG MONITOR Rick Surwilo II INSTALLATION First make a working copy of Z8E then place your original disk ette 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 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 gt 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 28 75 asterisk prompt Once you enter E followed by the symbolic name of the address you which to change 28 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 MXYCP cr 285E 2 cr represents your input 285F 1B cr 2860 3D cr 2861 00 PERIOD
65. nd operators argu ment type may be combined with any other type The length of an expression is limited only by the size of the input buffer Expressions are evaluated from left to right and the use of parentheses is not permitted Z8E indicates argument errors by printing a question mark Arguments may 1 using the standard CP M control characters backspace erase the last character typed control X erase the entire line control C return to CP M via warm boot All input is truncated to the size of Z8E s input buffer which is 80 characters long All alphabetic input to Z8E may be in uppercase or lowercase All output by Z8E follows the dictates of the CASE byte as patched by the user see INSTALLATION In this manual the appearance of square brackets around an argument always indicates that the argument is optional 28 qu p Z8E 280 DEBUG MONITOR This Page Intentionally Left Blank 29 Rick Surwilo prs Z8E 280 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 re
66. nd instructs Z8E to begin or resume execution of the user program The format of the command is G where ARG1 the address of the first instruction the user wishes to execute ARG may be any argument type Upon receipt of this command Z8E initializes all breakpoints in the user program restores all user registers and transfers control to the user program under test at the address specified ARGI Execution within the user program will continue until the user program reaches a breakpoint which point control will return to Z8E This is the only way the user is able to return control to 28 once the GO command is issued 28 breakpoint technique has been designed such that Z8E will not directly initialize breakpoint at the address specified in ARGI In actualiity it would be impossible to do so since attempt would be made to resume execution at this address a breakpoint would have been set at this address and control would immediately return to the monitor without this instruction ever having been executed This limitation has been overcome in Z8E by actually copying the single instruction located at ARGI to 28 5 memory THEN setting the breakpoint at the ARGI address and finally executing the moved version of the instruction 28 5 memory rather than in the user program Z8E compensates for the that CALL and RELATIVE JUMP instructions are affected by the address at which they are execut
67. not use the default DMA buffer at absolute location 80 nor does it use the default File Control Block FCB at absolute location 5C Note When CP M finishes loading any program including Z8E it moves the command line tail to the default DMA buffer at absolute address 80 hex and initializes the de fault FCB at absolute address 5C the name of the first file or first two files if two or more specified appearing the command line Z8E makes use of this Senee information in order to load the user program and any symbol files If the program to be tested also expects an ini tialized FCB and or DMA buffer as is very often the case then the user must effect this before attempting to execute the program dido For example many text editing programs are invoked by typing the name of the editor program followed by the name of the ANN CULPA ELINA TL IH UR MIU HCM FUE Nd EUN NBN RN 28 280 DEBUG MONITOR Rick Surwilo program to edit the CP M command line hypothetical case A gt EDIT B FYL2EDIT BAS Once the program EDIT COM is loaded it may expect to find the default FCB to be al set up to read the file FYL2EDIT BAS EDIT COM may also expect the DMA buffer to contain the number characters in the command line at address 80 as well the the text of the command line starting at address 81 In
68. oop til Input Arrives hl de bc Unadorned Console Input Tell CP M this is Input Request we we we TTYI 32 af be de hl c 02 oe e a 33 BDOS 33 hl de be af Console Output TTYO 32 LLL tice eget ALIEN LNA LANNE A NELLIE S CHRON Z8E 780 DEBUG MONITOR Rick Surwilo The symbols TTYQ TTYI and TTYO are included in Z8E SYM There fore these routines be patched symbolically using Z8E s assemble command for example A TTYQ 1F76 c5 TTYQ PUSH BC Z8E also contains a provision for user installed initialization code As soon as Z8E is loaded but before it relocates itself into high memory it makes a call to INIT As presently confi gured INIT merely contains a RET instruction However the user may add up to 127 bytes of initialization code This code may be used for any purpose for example to change your SIO or Uart from interrupt driven to non interrupt driven in the event that the Z8E console routines were replaced Any code installed at INIT 15 executed once and is not moved to high memory with the rest of Z8E You need not save any registers 28 280 DEBUG MONITOR Rick Surwilo SUPPLYING YOUR OWN CURSOR ADDRESSING ROUTINE If your computer requires a custom cursor addressing routine can be easily added by following the steps listed below 1 Examine the Z8E SYM file that to determine the address of Z8E s
69. options The user may specify placement data to be written to memory starting at the current address or he may choose to continue to passively examine memory The choice is determined by the character s which are input after the contents of an address are displayed If the user wishes to modify memory starting at the current memory address then an ARGUMENT STRING may be entered following the displayed byte Z8E will evaluate the entire string and write the evaluated equivalent of the string into consecutive memory locations starting with the current memory address For example the user could enter the following ARGUMENT STRING E 45F9 45F9 42 This is a 13 4 9 05 The user input apprears between the arrows and would be evaluated to the following 31 bytes 54 68 69 73 20 49 73 20 61 20 73 74 72 69 6E 67 OD 13 09 6F 62 65 20 74 65 78 74 05 These 31 bytes would be stored into memory locations 45F9 to 4617 and the next address displayed on the screen would be 4618 4618 23 Remember that ARGUMENT STRINGS may be terminated by either a carriage return by the first space character which does not appear a quoted literal string The choice of terminator determines the which address will be displayed next If riage return is used to terminate the ARGUMENT STRING then Z8E will display the next sequential memory address For example
70. or a discussion of the format of symbol files see APPENDIX A co 78 780 DEBUG MONITOR This Page Intentionally Left Blank Rick Surwilo S d d Z8E 280 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 ENS 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 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 e Thus user programs STAT COM is an example can choose to terminate themselves and return to CP M by execu ting RET through th s address on the stack 28 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 The user interrupt register is set to the value contained the I register when Z8E was loaded Modify at your own risk C All input and output by 28 is accomplished using buffers con tained within itself Z8E does
71. r es 5 78 780 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 WI ARG1 ARG2 ARG1 is a single unambiguous file name forming to standard CP M syntax rules optional drive name followed colon mandatory primary file name optional secondary file name preceded by 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 If Z8E detects a error in the file name specification the message Syntax error is printed on the console and the command terminates If Z8E is unable to locate the file on the specified drive the message File not found is printed on the console and the command terminates 28 contains facilties for converting HEX Intel Hex format object files to loadable memory image All files regardless of type are loaded into memory in exactly the same form as they appear on disk To debug a HEX file the user should first load the file wit
72. s is luated as an 8 bit number and if found to be valid then it becomes the new current port address PERIOD Terminate command The user can also monitor an I O port with the command by enclosing the port number on the command line parentheses Monitor mode via the N command is identical to that of the Q command see Q command 53 ee EEEN E ANM ANM ANIM Z8E 280 DEBUG MONITOR Rick Surwilo Output Current Breakpoints to Console The O command allows the user to view all breakpoints currently in effect The format of the command 15 arguments are required If Z8E finds a symbol name corresponding to the absolute hex address of a breakpoint address in the symbol table if a symbol table exists then the symbol name as well as the memory address is displayed If no symbol corresponding to the address is found only the hex address is displayed If any pass counts are currently in effect they are displayed next to the breakpoint address with which they are associated 54 Z8E 280 DEBUG MONITOR Rick Surwilo P Examine Modify PSW Flag Register E MEM RED SERERE E 22 RE The P command provides convenient method examining and optionally modifying the F lag register in the user register set The format of the command is no arguments are required on the command line Upon receipt of the P command Z8E displays th
73. s found in the symbol table then Z8E attempts to reeval uate the name as a hexadecimal number For example the token DEAD is a valid symbol names as well as a valid hexadecimal number If a symbol table is present then Z8E first searches the symbol table looking for the string DEAD If no match occurs then Z8E 24 ps Mene qnm 7 Sas Z8E 780 DEBUG MONITOR Rick Surwilo REGISTER treats DEAD as the hexadecimal number ODEAD To force Z8E to evaluate an argument as a hexadecimal number prefix the argument with a leading zero as in ODEAD Valid 280 16 bit register names are permit ted as arguments If 16 bit register name is entered Z8E uses the 16 bit value currently contained in the specified register pair the user s register set as an argu ment HL 8 instructs Z8E to dump the first eight of memory bytes which are located at the address contained in the user s HL register pair Valid 16 bit register names AF Accumulator and Flag BC BC register pa r DE DE register pair HL HL register pair SP Stack Pointer P Program Counter PC Program Counter IX IX index register IY IY index register Note that the program counter may be speci fied in either of two ways The single cha racter can be used to specify the program counter provided does not appear an expression To include the current value of the user s program counter an
74. s subject only to the proviso that 16 bit values cannot appear as operand for those Z80 instructions which require 8 bit values Expressions combining any of the following four types with the and operators are also permissable SYMBOL from symbol table HEX LITERAL two bytes maximum DECIMAL In addition the dollar sign may also appear in both the operand field of any instruction in which 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 The operand field of a relative jump instruction can be entered mS in either of two ways The user may code the operand using the d dollar sign mentioned above as in the following examples JR 2 5411 jump to address PC 11 hex DJNZ 24j jump to address PC 24 decimal The user may alternatively specify 16 bit value in the operand field of relative jump instruction and let Z8E calculate the relative displacement from the assembler s program counter as shown below rtm JR C LABEL Assuming LABEL exists in the symbol 1 table Z8E will calculate the offset X LABEL must within 129 126 i bytes from the assembler s location counter or assembly error will result JR NZ 1080 Z8E calculates
75. standard cursor addressing routine which is called XYCP Associated with name XYCP in the file is its absolute address 2 Using your own text editor code your routine and preface with the following puedo ops ASEG PHASE XXXXH Where XXXX represents the absolute hexadecimal address obtained in step 1 it it Z8E 280 DEBUG MONITOR Rick Surwilo sei 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 Use the following skeleton as a guide ASEG PHASE From Z8E SYM YOURS PUSH BC 5 PUSH DE PUSH HL CURSOR ADDRESSING CODE HERE POP HL POP DE POP BC RET END D Z8E s output routine TTYO as described above ah your own routine to output the characters in your Mn 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 Z8E imposes only one restriction on the code you write qnm In order to guarantee that your routine can be relo cated into high memory Z8E do not load any 16 bit constants into register pairs instead do two 8 bit loa
76. sumed 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 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 breakpoint is reached in the user program and Z8E regains control the message BP XXXX is displayed where XXXX represents the hexadecimal address of the breakpoint In addi tion Z8E will display the symbolic name of this address if one exists the symbol table Z8E follows this with a display of the asterisk prompt indicating it is ready ready for command processing The message ERROR BP XXXX 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 previousl
77. the displacement be tween the assembler s current loca tion counter and the address 1080 hex Z8E indicates error free input by first displaying the resultant object code and then displaying the next line the next address at which assembly will take place Assembly errors are always indicated by a double pair of question marks which appear following the location counter An error flag is also printed and will be one of the following ERROR FLAG MEANING L Label starts with numeric character Invalid opcode Syntax error x C Symbol tabie full U Instruction references an und fined symbol name Value error a 16 bit value was specified as an operand for mA an instruction which permits 5 only 8 bit numbers If an error occurs Z8E will reprompt the user with the same 2 NR d 9 are d a Z8E 280 DEBUG MONITOR Rick Surwilo location counter address As was mentioned previously the Z8E assmebler uses standard Zilog mnemonics The one exception to this is the EX AF AF instruc tion To assemble this instruction the trailing quote character must be omitted Z8E supports the ORG directive which allows the user to change the value of the assembly location counter The operand field of the ORG directive may be a 16 bit argument of any type After setting the new assembly location counter Z8E displays the disas sembled instruction at the ne
78. them use the symbol names listed below and assemble your routine at the appropriate address via Z8E s A ssemble command See Manual TTYQ This routine checks the status of the console If a character is waiting it is read otherwise TTYQ returns a zero in to indicate that character is waiting TTYI Read a character waiting until one arrives i Return Character in A TTYO Output a character waiting until it is sent Character passed in A 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 reqisters as show below The size of each routine must not exceed 32 bytes arte 7 NR ems mr 5 Z8E 280 DEBUG MONITOR TTYQ push push push ld call and 14 14 call pop pop pop and ret org TTYI push push push TTYIOO 14 ld call and jr pop pop pop ret Org TTYO push push push push 14 14 call pop pop pop pop ret org USUS QBUS SU NUR UNUM Rick Surwilo bc de c 11 Console Status BDOS B DOS returns 00 No Character NZ Input Waiting nod a Character Here c 6 nz BDOS Character Here Read It Else Fall Thru hl de be 7fh TTYQ432 bc de hl c 06 e 0ffh BDOS 7fh i Strip Parity z TTYIOO L
79. uch a case Z8E will ignore all but the last two characters of the quoted literali treating the input a 16 bit number For example if the user entered 2 ABCD Z8E would begin treat BC as a 16 bit number and begin disassembling at address at 4243 The find examine memory query I O ports without pre read Q query I O ports and Y fill memory commands permit the use of ARGUMENT STRINGS which are simply combinations of all valid argument types separated by commas ARGUMENT STRINGs be any length up to the limit of Z8E s input buffer which is 80 bytes long ARGUMENT STRINGS may be terminated by either a car riage return or the first space character not appearing in between quote characters The following is an e xample of a 15 byte ARGUMENT STRINGS string which combines SYM BOLS LITERALS HEX and DECIMAL numbers SYMBOL xyZ 4F 12E4 9 21 511 ABc Assuming that SYMBOL is equal to 177H then the above ARGUMENT STRING would evaluate to 01 77 78 79 5A 12 EA 09 15 01 FF 41 42 63 Again ARGUMENT STRINGS are terminated by either carriage return or by the first space character that does not appear in a 27 ROR He N ST el NNO NL eT Rd MM puli ipie pie il pet i j Pli Z8E 280 DEBUG MONITOR Rick Surwilo quoted literal string Z8E permits expressions using the a
80. utomatically decides whether a head to head or tail to tail move is required based on the three arguments entered If a head to head move is needed then the first byte of the source data block will be written to the first byte position of the destination data block the second byte of the source data block Will be written to the second byte position of the destination data block and so on until the ending address of the destination data block is reached On the other hand if tail to tail move is necessary Z8E will move the last byte of the source data block to the last byte position of the destination data block followed by the second to last byte of the source data block to the second to last byte position of the destination data block and so on until the starting address of the destination block is reached A tail to tail move would be necessary in the following example to prevent the overwriting of the destination data block 1000 100F 1008 51 Z8E 280 DEBUG MONITOR Rick Surwilo N Output to I O Ports Without Pre Read 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 ARGI where ARGI is the port number to which the data will be written If ARGI is omitted then Z8E uses the last port address which had been input by a previous N or Q command Z8E will prompt the user by displayin
81. w address Z8E supports the DEFB DEFW and DDB directives which give the user the ability to assemble data constants into memory DEFB accepts an 8 bit operand the value of which in placed into memory at the address of the assembler s current location coun ter DEFW allows the user to specify a 16 bit operand value the low order byte of which is placed into memory at the address of the assembler s current location counter while the high order byte the operand is placed into memory at the address of the assembler s current location counter plus one This is in accor dance with the 8080 280 convention of storing the high order byte of 16 bit data toward the high end of memory The DDB define double byte directive allows the user to specify a 16 bit value which contrast to the DEFW directive is stored in memory with the high order byte toward the low end of memory That is a DDB directive instructs Z8E to store the most significant byte of the 16 bit operand value in memory at the address of the assembler s current location counter and the least significant low order byte is placed into memory at the address of the assembler s current location counter plus one The EQU directive allows the user to assign a value to a symbol EQU directive does not generate object code It merely allows the user to reference numeric value symbolic name subsequent assembly statements or monitor commands It is espe
82. y been set as 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 If 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 XXXX message on the console At this point CP M will save Z8E s stack pointer and overlay yours 30 mo di fon nir ne tle hand Sapient ned enn EAE Z8E Z80 DEBUG MONITOR Rick Surwilo in memory When BDOS eventually restores the stack pointer and executes instruction you will not return to your program and your stack pointer will be gone These routines can be traced albeit with difficulty but you must keep an eye on what CP M is doing with the stack pointer 31 _ 28 280 DEBUG MONITOR This Page m Ed
83. y 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 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 Fuli screen animated display of the program under test while it is being executed by the Z80 Complete Z80 inline assembler with labels sym bois expressions directives using Zilog mnemonics Interactive disassembly with labels symbols to console or disk allows the user to specify output formats and add comments Fully traced program execution including a full screen single step command that instructs Z8E to disassemble code and to move the cursor to the next instruction to execute Up to 16 user settable breakpoints with optional pass counts True symbolic debugging using the input from multiple Microsoft 80 LINK 80 SYM files and Z80ASM LST and SLRNK and Z80ASM SYM files from SLR Systems Dynamic relocation of Z8E at load time to the top of user memory regardless of size No user configuration of any kind is required You may want to spend some time familarizing yourself with the manual and 28 5 com
Download Pdf Manuals
Related Search
Related Contents
With FLEXI-GUARD Installation/Care/Use Manual Manual de User's Guide MultiMaster™ Digital MultiMeter BRAZO EXTENSIBLE PARA SELFIES Bedienungsanleitung Multimeter HP760C DU MÊME AUTEUR Ma vie secrète, par Joseph Staline, récit ROBO-8911VG2A User`s Manual Mod. XLC 410 Copyright © All rights reserved.
Failed to retrieve file