home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / znode3 / asm / z8e-30.ark / Z8E.DOC < prev    next >
Encoding:
Text File  |  1988-11-17  |  201.8 KB  |  6,338 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.                                 Z8E USER'S MANUAL
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.                                  Copyright 1984
  22.                                        by
  23.                                   RICK SURWILO
  24.                                  23 PLMOUTH ROAD
  25.                            STAMFORD,CONNECTICUT 06906
  26.                                  (203) 324-3809
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.                                 TABLE OF CONTENTS
  74.  
  75.                 Section                                        Page
  76.            
  77.           I.  INTRODUCTION                                       1
  78.  
  79.          II.  INSTALLATION                                       3
  80.                              
  81.         III.  INVOKING Z8E AT THE CP/M COMMAND LEVEL            13
  82.              
  83.          IV.  INITIALIZATION                                    19
  84.               
  85.           V.  COMMAND INPUT                                     23
  86.  
  87.          VI.  BREAKPOINTS                                       29
  88.  
  89.         VII.  COMMANDS:
  90.  
  91.                A     Assemble                                   33
  92.                B     Set Breakpoint                             37
  93.                C     Clear Breakpoint                           38
  94.                D     Dump                                       39     
  95.                E     Examine                                    40
  96.                F     Find                                       42
  97.                G     Go                                         44
  98.                H     Display Symbol Table                       45
  99.                I     Initialize Command Line (and FCB fields)   46
  100.                J     Animated Full Screen Debugging             47
  101.                K     Set Memory Window Address for J command    49
  102.                L     Load File                                  50
  103.                M     Move Memory                                51
  104.                N     Output to I/O Port without Pre-read        52
  105.                O     Output Current Breakpoints to Console      54
  106.                P     Examine Flag Register                      55
  107.                Q     Query I/O Ports                            56
  108.                R     Register                                   58
  109.                S     Single Step                                59
  110.                U     Save Symbol Table to Disk                  61
  111.                V     Verify Memory                              62
  112.                W     Write Memory Segment to Disk               63
  113.                X     Display Machine State                      64
  114.                Y     Fill Memory                                65 
  115.                Z     Disassemble                                66
  116.  
  117.               APPENDIX A - Symbol File Formats                  70
  118.               APPENDIX B - ZILOG Mnemonics                      71 
  119.               APPENDIX C - System Memory Map                    92
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.                            Z8E - Z80 DEBUGGING MONITOR
  144.          
  145.  
  146.         I. INTRODUCTION
  147.                     
  148.         Z8E is a professional quality interactive debugging tool designed 
  149.         to speed the testing of Z80 assembly language programs.   Origin-
  150.         ally written as a standalone monitor,  Z8E was used in the  deve-
  151.         lopement  of the world's largest Touch-Tone Input/Voice  Response 
  152.         system.   Now redone to run in a CP/M or TurboDOS environment Z8E 
  153.         contains  more features in less memory than any comparable  soft-
  154.         ware product.  Occupying less than 9K of memory, Z8E includes the 
  155.         following among its many features:
  156.  
  157.               - Full screen animated display of the program under 
  158.                 test while it is being executed by the Z80 
  159.  
  160.               - Complete Z80 inline assembler,  with labels, sym-
  161.                 bols,  expressions,  and directives,  using Zilog 
  162.                 mnemonics
  163.                                 
  164.               - Interactive  disassembly with labels and  symbols 
  165.                 to  console  or disk allows the user  to  specify 
  166.                 output formats and add comments 
  167.  
  168.               - Fully  traced program execution including a  full 
  169.                 screen single step command that instructs Z8E  to 
  170.                 disassemble  code  and to move the cursor to  the 
  171.                 next instruction to execute
  172.  
  173.               - Up to 16 user settable breakpoints with  optional 
  174.                 pass counts
  175.  
  176.               - True  symbolic  debugging  using the  input  from 
  177.                 multiple   Microsoft  MACRO-80 .PRN  and  LINK-80 
  178.                 .SYM  files and Z80ASM .LST and SLRNK and  Z80ASM 
  179.                 .SYM files from SLR Systems. 
  180.  
  181.               - Dynamic relocation of Z8E at load time to the top 
  182.                 of   user  memory regardless of  size.   No  user 
  183.                 configuration of any kind is required.       
  184.  
  185.  
  186.         You  may  want to spend some time familarizing yourself with  the 
  187.         manual and Z8E's command structure, especially the EXAMINE memory 
  188.         command, before turning to the INSTALLATION section.
  189.  
  190.  
  191.  
  192.  
  193.  
  194.                                         1
  195.  
  196.  
  197.  
  198.  
  199.  
  200.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  201.  
  202.  
  203.  
  204.  
  205.  
  206.                        This Page Intentionally Left Blank.
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.                                         2
  261.  
  262.  
  263.  
  264.  
  265.  
  266.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  267.  
  268.  
  269.         II.  INSTALLATION
  270.  
  271.         First make a working copy of Z8E,  then place your original disk-
  272.         ette  in  a safe place.   Make all modifications to  the  working 
  273.         copy, not the original. 
  274.  
  275.         Z8E's  (E)xamine  memory  command will be used to  change  memory 
  276.         contents.  This  command is described briefly below.  For a  more 
  277.         detailed  explanation please refer to SECTION V of  this  manual, 
  278.         COMMAND INPUT.
  279.  
  280.         Z8E requires an addressable cursor which can be patched  symboli-
  281.         cally as follows:
  282.  
  283.              First instruct Z8E to load itself as well as the symbol 
  284.              file:
  285.  
  286.                         A>Z8E Z8E.COM Z8E.SYM
  287.  
  288.              The  symbol file Z8E.SYM contains the name and  address 
  289.              of each parameter which may need to be modified.
  290.  
  291.              Use the (E)xamine memory command to change the required 
  292.              bytes.   You  may  enter commands in response to  Z8E's 
  293.              asterisk  prompt.  Once you enter "E" followed  by  the 
  294.              symbolic  name of the address you which to change,  Z8E 
  295.              will respond by displaying  the actual address followed 
  296.              by  the hex and ASCII representation of the byte  being 
  297.              examined (non-printable characters are shown as a "~").  
  298.              For example: 
  299.  
  300.              *E  MXYCP <cr>
  301.  
  302.              285E   2   ~   XX   <cr>   ;XX represents your input
  303.              285F   1B  ~   XX   <cr>   
  304.              2860   3D  =   XX   <cr>   
  305.              2861   00  ~   .           ;PERIOD ENDS COMMAND
  306.              *   
  307.  
  308.  
  309.              IMPORTANT:
  310.              Always  patch using the symbolic name of the  variable; 
  311.              the addresses shown in the example above are for demon-
  312.              stration only and do not necessarily reflect the actual 
  313.              locations of the variables in memory.
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.                                         3
  327.  
  328.  
  329.  
  330.  
  331.  
  332.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  333.  
  334.  
  335.              Listed  below are the symbolic names of  the  addresses 
  336.              which may have to be patched for your CRT.  
  337.  
  338.              MXYCP  - Cursor addressing lead-in string.   The  first 
  339.                       byte  (the number 2 in the above example)  re-
  340.                       presents  the  number of bytes in the  string.  
  341.                       The string may be up to 10 bytes  long.   This 
  342.                       actual  lead-in string should immediately fol-
  343.                       low the count byte.
  344.  
  345.                       Default is the two character string:
  346.                             
  347.                             1B (Hex), 3D (Hex)
  348.  
  349.                       ASCII ESCAPE, followed by EQUAL SIGN.  
  350.                          
  351.              ROWB4? - Set this byte as follows:
  352.  
  353.                       NOT ZERO - Row is sent before Column
  354.                       ZERO     - Column is sent before Row
  355.  
  356.                       Default is NOT ZERO, row sent before column.               
  357.  
  358.  
  359.              ROW    - Set  this byte to contain the value which is to  be 
  360.                       added row number before it is sent to the screen.
  361.  
  362.                       Default is 20 Hex, ASCII space. 
  363.  
  364.  
  365.              COLUMN - Set  this byte to contain the value which is to  be 
  366.                       added  column  number  before  it is  sent  to  the 
  367.                       screen. Default is 20 Hex, ASCII space.
  368.  
  369.  
  370.              CASE   - This  byte  controls whether  you  prefer  entering 
  371.                       symbol  names  in  upper or lower  case.   It  also 
  372.                       controls whether disassembly will be done in  upper 
  373.                       or   lower  case.   Patch  as follows:
  374.  
  375.                       FF - lower case  (DEFAULT)
  376.                       00 - UPPER CASE  
  377.  
  378.              MAXLEN - This  is  the maximum length of permitted  for 
  379.                       symbol  names.   The permissable values are  6 
  380.                       and  14.   If patched to any other value  then 
  381.                       Z8E  will use 6.   The maximum length  of  the 
  382.                       symbol is required by Z8E in order to allocate 
  383.                       space for loading the symbol table.  If MAXLEN 
  384.                       equals  6 then Z8E reserves 8 byte per symbol, 
  385.                       6  for the name and two for the  address.   If 
  386.                       the  number  14 is used then Z8E  reserves  16 
  387.                       bytes  per symbol.   Hence MAXLEN impacts  the 
  388.                       amount of TPA available to the program since a 
  389.                       symbol  table of 16 bytes per entry  obviously 
  390.  
  391.  
  392.                                         4
  393.  
  394.  
  395.  
  396.  
  397.  
  398.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  399.  
  400.  
  401.                       takes  up  twice as much space as one  with  8 
  402.                       byte entries.  
  403.  
  404.                       If,  while  reading in the symbols from  disk, 
  405.                       Z8E  encounters a symbol longer than the value 
  406.                       specified   in  MAXLEN  the  symbol  name   is 
  407.                       truncated to MAXLEN.
  408.  
  409.                             6 - Maximum Symbol Length (DEFAULT)               
  410.                            14 - Optional Symbol Length 
  411.  
  412.              RSTVEC - Determines the address of the vector to the  break-
  413.                       point  routine.   The default address is 38h and is 
  414.                       reached by an RST 38h (sometimes written as RST 7).  
  415.                       The  breakpoint  vector  occupies  three  bytes  of 
  416.                       memory  so  if your software uses locations 38h  to 
  417.                       3Ah  for  something else  (typically  an  interrupt 
  418.                       handler) then alter RSTVEC to another value.  Legal 
  419.                       values are 10h, 18h, 20h, 28h and 30h.
  420.  
  421.  
  422.         TO SAVE THE PATCHED PROGRAM:
  423.  
  424.                            *W ANYNAME.COM  (Writes the File to Disk)
  425.  
  426.         This completes the installation of Z8E.  Typing in ^C (Control C) 
  427.         in  response  to  Z8E's asterisk prompt will return  you  to  the 
  428.         operating system.
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.                                         5
  459.  
  460.  
  461.  
  462.  
  463.  
  464.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  465.  
  466.  
  467.                              USER CODED CONSOLE I/O
  468.  
  469.         The following section provides details on a method of  optionally 
  470.         replacing  the  BDOS  calls for Console I/O which Z8E  uses  with 
  471.         physical console I/O routines or direct BIOS calls. 
  472.  
  473.         To  modify  them use the symbol names listed below  and  assemble 
  474.         your  routine  at the appropriate address (via  Z8E's  (A)ssemble 
  475.         command - See Manual).
  476.  
  477.  
  478.              TTYQ:      This  routine checks the status of  the  console.  
  479.                         If a character is waiting it is read;  otherwise, 
  480.                         TTYQ  returns  a  zero in A to indicate  that  no 
  481.                         character is waiting.
  482.           
  483.              TTYI:      Read a character, waiting until one arrives.
  484.                         Return Character in A.
  485.           
  486.              TTYO:      Output a character, waiting until it is sent.
  487.                         Character passed in A.
  488.  
  489.  
  490.         Listed below is the code that Z8E uses to do console I/O;  use it 
  491.         as  a model.  Your routines should replace the instructions  with 
  492.         the  double  semicolons.   Be sure to save the reqisters as  show 
  493.         below.  The size of each routine must not exceed 32 bytes.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.                                         6
  525.  
  526.  
  527.  
  528.  
  529.  
  530.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  531.  
  532.  
  533.                                                                                 
  534.                 TTYQ:   push    bc
  535.                         push    de
  536.                         push    hl
  537.                         ld      c,11     ;;Check Console Status
  538.                         call    BDOS     ;;BDOS returns:  A = 00  No Character 
  539.                                          ;;               A = NZ  Input Waiting
  540.                                          ;;
  541.                         and     a        ;;Character Here?
  542.                         ld      c,6      ;;
  543.                         ld      e,0ffh   ;;     
  544.                         call    nz,BDOS  ;;If Character Here Read It...
  545.                                          ;;   Else Fall Thru
  546.                         pop     hl
  547.                         pop     de
  548.                         pop     bc
  549.                         and     7fh             
  550.                         ret
  551.  
  552.                         org     TTYQ+32
  553.  
  554.                 TTYI:   push    bc
  555.                         push    de
  556.                         push    hl
  557.                 TTYI00: ld      c,06     ;;Unadorned Console Input
  558.                         ld      e,0ffh   ;;Tell CP/M this is Input Request
  559.                         call    BDOS     ;;
  560.                         and     7fh      ;;Strip Parity
  561.                         jr      z,TTYI00 ;;Loop til Input Arrives
  562.                         pop     hl
  563.                         pop     de
  564.                         pop     bc
  565.                         ret
  566.  
  567.                         org     TTYI+32
  568.  
  569.  
  570.                 TTYO:   push    af
  571.                         push    bc
  572.                         push    de
  573.                         push    hl
  574.                         ld      c,02     ;;
  575.                         ld      e,a      ;;
  576.                         call    BDOS     ;;Console Output
  577.                         pop     hl      
  578.                         pop     de
  579.                         pop     bc
  580.                         pop     af
  581.                         ret
  582.  
  583.                         org     TTYO+32
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.                                         7
  591.  
  592.  
  593.  
  594.  
  595.  
  596.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  597.  
  598.  
  599.         The symbols TTYQ, TTYI, and TTYO are included in Z8E.SYM.  There-
  600.         fore  these  routines  can be patched  symbolically  using  Z8E's 
  601.         assemble command, for example: 
  602.  
  603.  
  604.                 *A TTYQ
  605.                 1F76    C5      TTYQ:   PUSH    BC
  606.  
  607.  
  608.  
  609.  
  610.         Z8E  also contains a provision for user installed  initialization 
  611.         code.  As  soon as Z8E is loaded,  but before it relocates itself 
  612.         into high memory,  it makes a call to INIT.   As presently confi-
  613.         gured INIT merely contains a RET instruction.   However the  user 
  614.         may add up to 127 bytes of initialization code.  This code may be 
  615.         used  for any purpose,  for example,  to change your SIO or  Uart 
  616.         from  interrupt driven to non-interrupt driven in the event  that 
  617.         the  Z8E  console routines were replaced.  Any code installed  at 
  618.         INIT  is executed once and is not moved to high memory  with  the 
  619.         rest of Z8E. You need not save any registers.
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.                                         8
  657.  
  658.  
  659.  
  660.  
  661.  
  662.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  663.  
  664.  
  665.                   SUPPLYING YOUR OWN CURSOR ADDRESSING ROUTINE
  666.  
  667.  
  668.         If  your computer requires a custom cursor addressing routine  it 
  669.         can be easily added by following the steps listed below:
  670.  
  671.         1.   Examine  the Z8E.SYM file that to determine the address 
  672.              of  Z8E's standard cursor addressing routine  which  is 
  673.              called XYCP.   Associated with name XYCP in the file is 
  674.              its absolute address.
  675.  
  676.         2.   Using your own text editor code your routine and preface  it 
  677.              with the following puedo-ops:
  678.  
  679.                             ASEG
  680.                             .PHASE    XXXXH
  681.  
  682.                   Where  XXXX  represents the  absolute  hexadecimal 
  683.                   address obtained in step 1.
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.                                         9
  723.  
  724.  
  725.  
  726.  
  727.  
  728.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  729.  
  730.  
  731.  
  732.  
  733.              Z8E will pass the row address in the B REGISTER and the 
  734.              column  address  in the C REGISTER.  Row numbers  range 
  735.              from 0 to 23 while column numbers range from 0 to 79. 
  736.              Your job is to translate these two number into a cursor 
  737.              postion on the screen of your CRT.
  738.  
  739.              Save  all  registers including BC.  Use  the  following 
  740.              skeleton as a guide:
  741.  
  742.                                  ASEG
  743.                                  .PHASE  XXXX        ;From  Z8E.SYM 
  744.  
  745.                        YOURS:    
  746.                                  PUSH    BC
  747.                                  PUSH    DE
  748.                                  PUSH    HL
  749.  
  750.                                  CURSOR ADDRESSING CODE HERE
  751.  
  752.                                  POP     HL
  753.                                  POP     DE
  754.                                  POP     BC
  755.                                  RET
  756.  
  757.                                  END    
  758.                                           
  759.              Use  Z8E's output routine TTYO as described  above  (or 
  760.              your  own  routine)  to output the characters  in  your 
  761.              cursor addressing sequence. Obtain the absolute address 
  762.              of  TTYO from the file Z8E.SYM.  Code the call  to  the 
  763.              subroutine  using the absolute address in  hexadecimal.  
  764.              For instance, if Z8E.SYM contains the entry:
  765.  
  766.                                  2FE2   TTYO
  767.  
  768.              then code your call statements as:
  769.  
  770.                                  CALL   2FE2H
  771.  
  772.              Z8E imposes only one restriction on the code you write. 
  773.              In  order  to guarantee that your routine can be  relo-
  774.              cated  into high memory by Z8E do not load any  16  bit 
  775.              constants  into  register pairs;  instead do two 8  bit 
  776.              loads.   For example,  do not use the following  state-
  777.              ment:
  778.  
  779.                                  LD     HL,1234H
  780.  
  781.              Rather, code it like this:
  782.  
  783.                                  LD     H,12H
  784.                                  LD     L,34H
  785.  
  786.  
  787.  
  788.                                        10
  789.  
  790.  
  791.  
  792.  
  793.  
  794.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  795.  
  796.  
  797.              This  is  the only restriction other than  the  maximum 
  798.              code  length which is placed on your code which is  128 
  799.              bytes.
  800.  
  801.         3.   Assemble  your routine with either Macro-80 or  Z80ASM. 
  802.              Link it with either Link-80 or SLRNK.
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.  
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.                                        11
  855.  
  856.  
  857.  
  858.  
  859.  
  860.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  861.  
  862.  
  863.         4.   Load Z8E.COM using Z8E:
  864.  
  865.                   A>Z8E Z8E.COM Z8E.SYM
  866.  
  867.                   *
  868.  
  869.         5.   Now overlay Z8E's cursor address code with your own:
  870.  
  871.                   *L YOURCODE.COM,XYCP
  872.  
  873.              Z8E will load your cursor addressing routine on top its 
  874.              own  beginning  at  the  address  associated  with  the 
  875.              symbol XYCP.         
  876.  
  877.         6.   Save the new file using a name of your choosing:
  878.  
  879.                   *W  NEWDEBUG.COM
  880.  
  881.         7.   Exit  back  to  the  operating  system  be  entering  a 
  882.              Control-C at the asterisk prompt. 
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.                                        12
  921.  
  922.  
  923.  
  924.  
  925.  
  926.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  927.  
  928.  
  929.  
  930.  
  931.  
  932.                        This Page Intentionally Left Blank.
  933.  
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.                                        13
  987.  
  988.  
  989.  
  990.  
  991.  
  992.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  993.  
  994.  
  995.         III.  INVOKING Z8E AT THE CP/M COMMAND LEVEL
  996.  
  997.         Upon  invokation at the CP/M command level Z8E loads at  the  low 
  998.         end  of the Transient Program Area (TPA) which begins at absolute 
  999.         address 100H.  The TPA is the area in memory where user  programs 
  1000.         are executed. 
  1001.  
  1002.         Once  loaded Z8E determines the size of the TPA by examining  the 
  1003.         address  field of the jump instruction at location 5.   This  ad-
  1004.         dress  represents  both the entry point into CP/M and the end  of 
  1005.         the TPA.   Z8E lowers this address by approximately 9K bytes  and 
  1006.         relocates into this area by adjusting all addresses within itself 
  1007.         to reflect its new location.   The jump instruction at location 5 
  1008.         is similiarly modified to reflect the new size of the TPA.   Thus 
  1009.         all  programs  which use this address to determine the amount  of 
  1010.         available memory can run unchanged.   Z8E completes its initiali-
  1011.         zation  by storing a jump instruction to its breakpoint  handling 
  1012.         software at absolute address 38 (hexadecimal).  
  1013.  
  1014.         Symbols which are loaded from files are stored by Z8E in a symbol 
  1015.         table at the top of the TPA just below Z8E.  Z8E will dynamically 
  1016.         allocate  the  storage necessary to hold all symbols loaded  from 
  1017.         files; however, Z8E also allows the user to enter his own symbols 
  1018.         from  the  keyboard via the (A)ssemble  command.   Z8E  does  NOT 
  1019.         reserve ANY space in memory for user generated symbols.  The user 
  1020.         must  explicitly  request memory space on the CP/M command  line.  
  1021.         This is accomplished by entering the number of symbols for  which 
  1022.         space  should be reserved as a decimal number.   This number must 
  1023.         be enclosed in parentheses and must appear as the first  argument 
  1024.         on the command line as shown below:
  1025.  
  1026.                    A>Z8E (32)
  1027.  
  1028.         In  this example the user has requested space for 32 user defined 
  1029.         symbols.   If  MAXLEN has be set to 6 (See INSTALLATION  Section) 
  1030.         then  each symbol requires 8 bytes of  storage,  hence,  in  this 
  1031.         example  Z8E will set aside 256 bytes of memory for user  defined 
  1032.         symbols.  
  1033.  
  1034.         Subsequent action is based on the format of the remainder of  the 
  1035.         command line as entered by the user.  In the examples that follow 
  1036.         bear  in  mind  that any of these command lines may  contain  the 
  1037.         argument  requesting memory space for user symbol table  entries.  
  1038.         The argument would appear immmediate after "Z8E" in every case.
  1039.  
  1040.  
  1041.              1.    A>Z8E
  1042.                         
  1043.                            Z8E resides as a standalone program in memory.
  1044.  
  1045.  
  1046.  
  1047.              2.    A>Z8E  USERFILE.COM
  1048.  
  1049.                            USERFILE.COM is loaded at the beginning of the 
  1050.  
  1051.  
  1052.                                        14
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  1059.  
  1060.  
  1061.                            TPA  and is ready to be acted on by  Z8E  com-
  1062.                            mands.   
  1063.  
  1064.  
  1065.  
  1066.              3.    A>Z8E  USERFILE.COM USERFILE.SYM [,bias]
  1067.  
  1068.                            USERFILE.SYM is read in by Z8E and all  symbol 
  1069.                            names contained in the file are entered into a 
  1070.                            table  which begins at the starting address of 
  1071.                            Z8E (the ending address of the "new" TPA)  and  
  1072.                            extends  downward  in  memory.   The  optional 
  1073.                            bias,  if  specified,  is a 16 bit value which 
  1074.                            will be added to the 16 bit address associated 
  1075.                            with each symbol in the file.   (In this exam-
  1076.                            ple a .SYM file is shown;  however,  since all 
  1077.                            addresses  appearing in a .SYM file are  abso-
  1078.                            lute  the optional bias would probably not  be 
  1079.                            used.)
  1080.  
  1081.                            USERFILE.COM is loaded at the start of the TPA 
  1082.                            only after the .SYM file has been read and the 
  1083.                            symbol  table built.  
  1084.                                  
  1085.  
  1086.  
  1087.              4.    A>Z8E  USERFILE.COM  USERFILE.PRN [,bias]
  1088.                              
  1089.                            As  in  the previous example  USERFILE.COM  is 
  1090.                            loaded  at the beginning of the  TPA,  but  in 
  1091.                            this instance a .PRN file is used to construct 
  1092.                            the  symbol table.   The optional bias becomes 
  1093.                            very  useful if the .LST or .PRN  file  repre-
  1094.                            sents  the  listing of a relocatable  program.  
  1095.                            Relocatable programs linked using  Microsoft's 
  1096.                            LINK-80 default to a load address of 103H with 
  1097.                            the  three  bytes  of memory located  at  100H 
  1098.                            containing  a jump to the entry point  of  the 
  1099.                            program.   Therefore,  if  the user supplies a 
  1100.                            bias  of 103 in the command line all  relocat-
  1101.                            able  symbols in the file will  be  associated 
  1102.                            with  their actual addresses in  memory.   Any 
  1103.                            bias  specified  will only be added  to  those 
  1104.                            symbols  which are flagged as code relative in 
  1105.                            the .PRN file. A bias will not be added to any 
  1106.                            symbol  flagged  as  ABSOLUTE,   EXTERANL,  OR 
  1107.                            COMMON.
  1108.  
  1109.                            USERFILE.COM is loaded at the start of the TPA 
  1110.                            only after the .LST or .PRN file has been read 
  1111.                            and the symbol table built.
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.                                        15
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  1125.  
  1126.  
  1127.              5.    A>Z8E USERFILE.COM USERFILE.SYM [,bias] NFILE.LST [,bias]
  1128.                                       
  1129.                            The true power of Z8E's symbol loading is best 
  1130.                            evidenced when loading multiple symbol  tables 
  1131.                            from  several files.   The first file is  gen-
  1132.                            erally  a .SYM file specifying all the  global 
  1133.                            symbol names in the program to be tested.  The 
  1134.                            subsequent files specified on the command line 
  1135.                            are  usually .PRN or .LST files of the indivi-
  1136.                            dual  source modules that were originally  as-
  1137.                            sembled  and then linked (which  produced  the 
  1138.                            .SYM file).  Although only two files (USERFILE 
  1139.                            and NFILE) are shown in this example, in actu-
  1140.                            ality the number of .SYM and .PRN files speci-
  1141.                            fied  in  the command line is limited only  by 
  1142.                            the  size  of Z8E's input buffer which  is  80 
  1143.                            characters long.
  1144.  
  1145.  
  1146.                            USERFILE.COM  is loaded  at the start  of  the 
  1147.                            TPA  only  after all .SYM and .PRN/.LST  files 
  1148.                            have been read and the symbol table built.
  1149.  
  1150.  
  1151.                            Note:
  1152.                            If no bias is specified,  Z8E will use a  bias 
  1153.                            of zero. 
  1154.  
  1155.  
  1156.         If  more than one .LST or .PRN file is being  loaded,  then  each 
  1157.         file  name can be specified with its own bias.   The bias may  be 
  1158.         entered in the form of a symbol name, hexadecimal number, decimal 
  1159.         number,  or  any combinatiion of the three in an expression using 
  1160.         the  + and - operators.   If the individual module has  a  global 
  1161.         entry  point,  the name of which was previously loaded,  the user 
  1162.         can  bias all symbols with the value associated with  this  name.  
  1163.         In  this  way all symbols,  both absolute  and  relocatable,  are 
  1164.         associated with their actual location in memory.
  1165.  
  1166.         Z8E  as  presently configured can build a symbol table  from  the 
  1167.         list files produced by the following programs:
  1168.  
  1169.             1. Microsoft   MACRO-80    V3.37  .PRN Files  May 8, 1980
  1170.             2. Microsoft   MACRO-80    V3.44  .PRN Files  Dec 9, 1981
  1171.             3. Microsoft   LINK-80     V3.44  .SYM Files  Dec 9, 1981 
  1172.             4. SLR Systems Z80ASM      V1.07  .LST Files
  1173.             5. SLR Systems SLRNK       V1.07  .SYM Files  
  1174.  
  1175.         Z80ASM and SLRNK may be configured for 80 or 132 column output.
  1176.  
  1177.         Z8E  uses the file name extension (the three characters appearing 
  1178.         to the right of the period) to determine the format of the  file. 
  1179.         Each  of  the above file types has a distinguishing  format.  The 
  1180.         characteritics of each type are described in APPENDIX A. 
  1181.                  
  1182.  
  1183.  
  1184.                                        16
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  1191.  
  1192.  
  1193.         During the loading process Z8E displays status and error messages 
  1194.         on  the  console relating to the activity in  progress  as  shown 
  1195.         below:
  1196.                    
  1197.                     STATUS  MESSAGE                  DESCRIPTION
  1198.  
  1199.              1. Loading: USERFILE.COM          Z8E  is attempting to open 
  1200.                                                the  named  file (in  this 
  1201.                                                case, USERFILE.COM)
  1202.  
  1203.  
  1204.              2.  Number of symbols loaded:     Following  the loading  of 
  1205.                                                all symbols from a listing 
  1206.                                                file  or  a .SYM file, the 
  1207.                                                number  of symbols  loaded 
  1208.                                                from the specified file is 
  1209.                                                displayed  as  a   decimal 
  1210.                                                number.
  1211.  
  1212.  
  1213.              3.   Loaded: 100  YYYY            Z8E displays the  starting           
  1214.                   Pages:  ZZZ                  and  ending memory addres-
  1215.                                                ses  of  the  target  file 
  1216.                                                (the first file  specified 
  1217.                                                on  the CP/M command  line 
  1218.                                                and the one which is going 
  1219.                                                to be debugged).
  1220.  
  1221.                                                "Pages:"   refers  to  the  
  1222.                                                decimal  number  of  pages 
  1223.                                                and  is the count  of  256 
  1224.                                                byte  pages  in the  file. 
  1225.                                                This number may  be subse-
  1226.                                                quently used with the CP/M 
  1227.                                                SAVE command once the  de-
  1228.                                                bug session ends. 
  1229.  
  1230.  
  1231.                   ERROR  MESSAGE                        DESCRIPTION
  1232.  
  1233.              1.   File not found               The  file specified in the 
  1234.                                                command could not be found 
  1235.                                                on the specified drive.
  1236.  
  1237.              2.   Symbol table not found       The   specified  file  was 
  1238.                                                found but did not  contain 
  1239.                                                a  properly formatted sym-
  1240.                                                bol table.
  1241.  
  1242.              3.   Invalid offset - using 0000  The  user has specified an 
  1243.                                                invalid offset to be added 
  1244.                                                to each loaded symbol. Z8E 
  1245.                                                will continue to load this 
  1246.                                                symbol  file but will  not 
  1247.                                                add  any bias to the  sym-
  1248.  
  1249.  
  1250.                                        17
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  1257.  
  1258.  
  1259.                                                bols.  This error may have 
  1260.                                                occured  because the  user 
  1261.                                                specified an offset in the 
  1262.                                                form of a symbol which had 
  1263.                                                not    been     previously 
  1264.                                                loaded,  or  the user  may 
  1265.                                                have  specified a  numeric 
  1266.                                                value  which contained  an 
  1267.                                                illegal character.
  1268.  
  1269.               4.   Syntax Error                The  file name was  incor-
  1270.                                                rectly specified. 
  1271.  
  1272.  
  1273.         After  all user files,  both symbol files and the .COM file to be 
  1274.         debugged,  have been loaded Z8E displays current memory usage  as 
  1275.         follows:
  1276.  
  1277.              Total Symbols:    XXXX
  1278.              Symbol Table:     XXXX - XXXX
  1279.              Z8E relocated:    XXXX - XXXX
  1280.              Top of memory:    XXXX            
  1281.  
  1282.  
  1283.  
  1284.         It  is important to note that Z8E expects the files appearing  in 
  1285.         the  command  line to be appear in a specific order.   The  first 
  1286.         file  name  appearing in the command line is assumed  to  be  the 
  1287.         target file which is to be debugged.   It is always the last file 
  1288.         to  be loaded.  All file names following the target file name are 
  1289.         assumed to be symbol input files and they are loaded in the order 
  1290.         in which they appear.
  1291.  
  1292.         The  first  file  named  in the command  line  is  always  loaded 
  1293.         starting at address 100 hex.   The "I" command contains an option 
  1294.         to  allow  the file to be loaded at a  different  address.   This 
  1295.         feature is not available at the CP/M command line level.
  1296.  
  1297.         For a discussion of the format of symbol files see APPENDIX A.
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.                                        18
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  1323.  
  1324.  
  1325.  
  1326.  
  1327.  
  1328.                        This Page Intentionally Left Blank.
  1329.  
  1330.  
  1331.  
  1332.  
  1333.  
  1334.  
  1335.  
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.                                        19
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  1389.  
  1390.  
  1391.         IV. INITIALIZATION
  1392.  
  1393.         Once Z8E has been loaded, and has in turn loaded all files speci-
  1394.         fied on the command line,  it initializes all user registers to 0 
  1395.         with the following exceptions:
  1396.  
  1397.              The  user's program counter contains address  100  hex 
  1398.              which is the start of the TPA.   
  1399.  
  1400.              The  user's  stack pointer is set to the starting  ad-
  1401.              dress  of Z8E (the top of the TPA) minus  two.   These 
  1402.              two  bytes  are set to zero in  accordance  with  CP/M 
  1403.              convention.   When CP/M loads a program it initializes 
  1404.              a  stack for the loaded program by pushing the address 
  1405.              of  the jump to the system warm boot routine onto  it. 
  1406.              Thus user programs (STAT.COM is an example) can choose 
  1407.              to terminate themselves  and return to CP/M by  execu-
  1408.              ting  an RET through this address on the  stack.   Z8E 
  1409.              accomplishes  the  same objective:   the 0000  on  the 
  1410.              stack  permits the user program to return to CP/M  via 
  1411.              address  0000  which  always contains a  jump  to  the 
  1412.              system's warm boot routine.  
  1413.               
  1414.  
  1415.              The  user  I (interrupt) register is set to the  value 
  1416.              contained  in  the  I register when  Z8E  was  loaded.  
  1417.              Modify at your own risk.
  1418.  
  1419.  
  1420.  
  1421.         All  input and output by Z8E is accomplished using  buffers  con-
  1422.         tained within itself.  Z8E does not use the default DMA buffer at 
  1423.         absolute  location  80 nor does it use the default  File  Control 
  1424.         Block  (FCB)  at absolute location 5C. 
  1425.  
  1426.              Note:                                           
  1427.                    When  CP/M finishes loading  any  program, 
  1428.                    including  Z8E,  it moves the command line 
  1429.                    tail to the default DMA buffer at absolute 
  1430.                    address  80 (hex) and initializes the  de-
  1431.                    fault  FCB at absolute address 5C  to  the 
  1432.                    name of the first file (or first two files 
  1433.                    if two or more are specified) appearing in 
  1434.                    the command line.   Z8E makes use of  this 
  1435.                    information  in  order to  load  the  user 
  1436.                    program  and  any symbol  files.   If  the 
  1437.                    program  to be tested also expects an ini-
  1438.                    tialized FCB and/or DMA buffer (as is very 
  1439.                    often the case), then the user must effect 
  1440.                    this  before  attempting  to  execute  the 
  1441.                    program. 
  1442.  
  1443.                    For  example,  many text editing  programs 
  1444.                    are  invoked  by  typing the name  of  the 
  1445.                    editor program followed by the name of the 
  1446.  
  1447.  
  1448.                                        20
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  1455.  
  1456.  
  1457.                    program to edit on the CP/M command  line, 
  1458.                    as in hypothetical case:
  1459.  
  1460.                          A>EDIT B:FYL2EDIT.BAS
  1461.  
  1462.                    Once the program EDIT.COM is loaded it may 
  1463.                    expect  to find the default FCB to be  al-
  1464.                    ready    set   up   to   read   the   file 
  1465.                    FYL2EDIT.BAS.   EDIT.COM  may also  expect 
  1466.                    the  DMA buffer to contain the  number  of 
  1467.                    characters  in the command line at address 
  1468.                    80,  as  well the the text of the  command 
  1469.                    line starting at address 81. In this exam-
  1470.                    ple  location 80 would contain a  hexadec-
  1471.                    imal F (decimal 15) representing the  num-
  1472.                    ber   of  characters,   and  locations  81 
  1473.                    through 8F would contain the 15 characters 
  1474.                    (space through S).  Similiarly,  the first 
  1475.                    byte  of  the default FCB  at  address  5C 
  1476.                    would  contain the number 1 (numeric equi-
  1477.                    valent  of drive B) and the next 11  bytes 
  1478.                    would  contain the file name  FYL2EDIT  in 
  1479.                    ASCII.   If  the name FYL2EDIT was shorter 
  1480.                    than 8 characters,  then the remainder  of 
  1481.                    the  file  name field in the FCB would  be 
  1482.                    filled with ASCII spaces. The next 3 bytes 
  1483.                    would contain the file type in  ASCII;  in 
  1484.                    this  example the file type is BAS.  If no 
  1485.                    file type was specified,  this field would 
  1486.                    contain  3 ASCII spaces.
  1487.  
  1488.                    Now,  if  the  user was to debug the  EDIT 
  1489.                    program using Z8E,  this initialization of 
  1490.                    the  default  DMA buffer and  default  FCB 
  1491.                    must  be accomplished "by hand"  prior  to 
  1492.                    attempting to debug EDIT.COM, owing to the 
  1493.                    fact that CP/M has already set up these to 
  1494.                    areas  with the data from the command line 
  1495.                    which was typed in to load Z8E.  In short, 
  1496.                    EDIT must be tricked into believing it was 
  1497.                    loaded by CP/M and not by Z8E and the user 
  1498.                    must  perform the initialization of  these 
  1499.                    two areas.  The user may use the E command 
  1500.                    (to  store both ASCII and numeric data  in 
  1501.                    memory) to simulate an initialized command 
  1502.                    line buffer and FCB.   Further information 
  1503.                    regarding  the format of the FCB  and  DMA 
  1504.                    buffer  may me found in Digital Research's 
  1505.                    CP/M 2.0 INTERFACE GUIDE.
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.                                        21
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  1521.  
  1522.  
  1523.         DEBUGGING HINT:
  1524.  
  1525.         It  is  not necessary to initialize the default  FCB  and/or  the 
  1526.         default  (command  line)  DMA buffer every time a program  to  be 
  1527.         tested is loaded (if indeed this program utilizes them).  Instead 
  1528.         follow the procedure listed below (If you haven't read the  indi-
  1529.         vidual command summaries the following may make more sense later):
  1530.  
  1531.                   Once  you  have  loaded the program  to  test 
  1532.                   perform  the required initialization  of  the 
  1533.                   FCB's  at  5CH and 6CH and the  command  line 
  1534.                   buffer  at 80H using the E command.  Use  the 
  1535.                   ASCII string option with the E command to set 
  1536.                   the  text  portions.  Use the  numeric  input 
  1537.                   function to intialize the drive specification 
  1538.                   at address 5C and the character count at 80H. 
  1539.  
  1540.                   Use  the W command to write out memory start-
  1541.                   ing at address ZERO. As in:
  1542.  
  1543.                              *W  NEWFILE.COM  0   XXXX
  1544.  
  1545.                   Where XXXX is the highest address you wish to 
  1546.                   save.   Now the next time you load this  file 
  1547.                   it  will of course load at address 100H.  Use 
  1548.                   the  M  (move memory command) to move  it  to 
  1549.                   location 0000.   Your FCB and DMA buffer  are 
  1550.                   initialized.  
  1551.  
  1552.                               *M  100  XXXX+100  0
  1553.  
  1554.         SPECIAL NOTE:   If you have Z8E version 1.4 or later then you may 
  1555.         use the I (initialize) command to do most of the work.  In nearly 
  1556.         all  cases the I command provides the simplest method for setting 
  1557.         up  the  command tail and FCB file name fields  after  loading  a 
  1558.         program.
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.                                        22
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  1587.  
  1588.  
  1589.  
  1590.  
  1591.  
  1592.                        This Page Intentionally Left Blank.
  1593.  
  1594.  
  1595.  
  1596.  
  1597.  
  1598.  
  1599.  
  1600.  
  1601.  
  1602.  
  1603.  
  1604.  
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.  
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626.  
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.                                        23
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  1653.  
  1654.  
  1655.         V.  COMMAND INPUT    
  1656.  
  1657.         Once  file  and  symbol table loading  has  been  completed,  Z8E 
  1658.         prompts  the  operator for command input by  displaying  the  "*" 
  1659.         character.  The operator can then type any of Z8E's single letter 
  1660.         commands.   Some  commands require no arguments while others  re-
  1661.         quire  between one and four. Arguments may be in any of the forms 
  1662.         listed  below (except as noted in the description of the  indivi-
  1663.         dual commands):      
  1664.  
  1665.  
  1666.  
  1667.  
  1668.              SYMBOL:        Any  symbol previously loaded  or  previously 
  1669.                             entered  via the keyboard (see A command) may 
  1670.                             appear as a command argument. All symbols are 
  1671.                             treated as 16 bit values.
  1672.              
  1673.                                                                         
  1674.              HEX:           A  16  bit  hex number may be entered  as  an 
  1675.                             argument.  Only the last four characters  en-
  1676.                             tered are treated as significant input if Z8E 
  1677.                             is  expecting  a 16 bit  argument.  In  those 
  1678.                             instances where Z8E expects a 8 bit argument, 
  1679.                             only the last two characters are significant.  
  1680.                             As  such,  the user may elect to correct mis-
  1681.                             takes by either backspacing and retyping,  or 
  1682.                             by  continuing to enter the number and  ensu-
  1683.                             ring  that the erroneous digit does not  ap-
  1684.                             pear  in the rightmost four (or two)  charac-
  1685.                             ters as shown in the following example:
  1686.  
  1687.                                 *E 1E21F4
  1688.  
  1689.                                       If  a 16 bit argument  is  expected 
  1690.                                       Z8E  would  ignore  the  first  two 
  1691.                                       digits  (1 and E) and would examine 
  1692.                                       the  contents  of  memory  location 
  1693.                                       21F4.
  1694.  
  1695.  
  1696.                             If  no symbol table is present in memory then 
  1697.                             hexadecimal numbers (8 or 16 bits in  length) 
  1698.                             may begin with any digit 0 - F.   However, if 
  1699.                             a  symbol table is in memory then all hexade-
  1700.                             cimal numbers which begin with a digit in the 
  1701.                             range  A  - F are evaluated first  as  symbol 
  1702.                             names.   If no corresponding name is found in 
  1703.                             the symbol table then Z8E attempts to reeval-
  1704.                             uate the name as a hexadecimal  number.   For 
  1705.                             example,  the  token  DEAD is a valid  symbol 
  1706.                             names as well as a valid hexadecimal  number.  
  1707.                             If  a symbol table is present then Z8E  first 
  1708.                             searches  the  symbol table looking  for  the 
  1709.                             string  DEAD.   If  no match occurs then  Z8E 
  1710.  
  1711.  
  1712.                                        24
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  1719.  
  1720.  
  1721.                             treats DEAD as the hexadecimal number  0DEAD. 
  1722.                             To  force  Z8E to evaluate an argument  as  a 
  1723.                             hexadecimal number prefix the argument with a 
  1724.                             leading zero as in 0DEAD. 
  1725.  
  1726.  
  1727.              REGISTER:      Valid Z80 16 bit register  names are  permit-
  1728.                             ted  as arguments.  If a 16 bit register name 
  1729.                             is  entered,   Z8E  uses  the  16  bit  value 
  1730.                             currently contained in the specified register 
  1731.                             pair  in the user's register set as an  argu-
  1732.                             ment. 
  1733.          
  1734.                                  *D HL 8
  1735.  
  1736.                                       instructs  Z8E  to dump  the  first 
  1737.                                       eight  of  memory bytes  which  are 
  1738.                                       located at the address contained in 
  1739.                                       the user's HL register pair
  1740.  
  1741.  
  1742.                             Valid 16 bit register names:
  1743.                                       
  1744.                                       AF - Accumulator and Flag
  1745.                                       BC - BC register pair
  1746.                                       DE - DE register pair
  1747.                                       HL - HL register pair
  1748.                                       SP - Stack Pointer
  1749.                                       P  - Program Counter
  1750.                                       PC - Program Counter
  1751.                                       IX - IX index register 
  1752.                                       IY - IY index register
  1753.  
  1754.                             Note  that the program counter may be  speci-
  1755.                             fied in either of two ways.   The single cha-
  1756.                             racter "P" can be used to specify the program 
  1757.                             counter  provided  it does not appear  in  an 
  1758.                             expression.   To include the current value of 
  1759.                             the  user's program counter in an  expression 
  1760.                             the mnemonic "PC" must be used.
  1761.  
  1762.                             If an expression used as an argument contains 
  1763.                             a  register  pair as one of  its  terms,  the 
  1764.                             register pair must be the first term.   Also, 
  1765.                             only  one register pair may be included in an 
  1766.                             expression:
  1767.  
  1768.  
  1769.                                  HL+4      valid expression
  1770.  
  1771.                                  5+DE      invalid expression - register 
  1772.                                            pair is not the first term
  1773.                                 
  1774.                                 HL+BC      invalid   expression  - more 
  1775.                                            than  one  register pair  was 
  1776.  
  1777.  
  1778.                                        25
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  1785.  
  1786.  
  1787.                                            specified
  1788.  
  1789.                                  P-3       invalid   expression   - "PC" 
  1790.                                            must  be used to include  the 
  1791.                                            current  value of the program 
  1792.                                            counter in an expression      
  1793.                                            
  1794.  
  1795.                             To   differentiate  between  the  hexadecimal 
  1796.                             numbers AF,  BC,  and DE and the Z80 register 
  1797.                             pairs of the same name be sure to prefix  the 
  1798.                             numerical version with a leading 0.
  1799.          
  1800.                             Note  also that the Z80 prime register  names 
  1801.                             are  not allowed as arguments except in the R 
  1802.                             command.
  1803.  
  1804.  
  1805.              REGISTER       Z8E allows the user to specify the data  con-
  1806.              INDIRECT:      tained in the memory location pointed to by a 
  1807.                             register pair as an argument.   For instance, 
  1808.                             if the user's HL register pair contained 18EE 
  1809.                             and the addresses 18EE and 18EF contained the 
  1810.                             bytes  42 and 61 respectively,  then the com-
  1811.                             mand   *E (HL)    would examine the  contents 
  1812.                             of  memory location 6142.  Note that register 
  1813.                             indirect  memory references are indicated  by 
  1814.                             enclosing  the register pair name  in  PAREN-
  1815.                             THESES which follows the ZILOG mnemonic meth-
  1816.                             od of signifying "the contents of".
  1817.  
  1818.                             The  most useful application of register  in-
  1819.                             direct  arguments  is to set  breakpoints  at 
  1820.                             subroutine  return addresses.   Consider  the 
  1821.                             situation  of  a program which  is  currently 
  1822.                             suspended  via a breakpoint somewhere in  the 
  1823.                             middle  of  a  subroutine.   The user  is  no 
  1824.                             longer  interested debugging the body of  the 
  1825.                             subroutine;  he only cares about getting back 
  1826.                             to the instruction that follows the CALL that 
  1827.                             got  him into the subroutine.   Register  in-
  1828.                             direct format allows him to enter:
  1829.  
  1830.                                              *B (SP)
  1831.  
  1832.                             This  informs Z8E to set a breakpoint at  the 
  1833.                             address  pointed  to  by  the  stack  pointer 
  1834.                             register.
  1835.  
  1836.  
  1837.  
  1838.              DECIMAL:       Decimal numbers in the range 0 - 65535 may be 
  1839.                             entered as arguments.  All digits of the num-
  1840.                             ber  must  be in the range  0-9.   A  decimal 
  1841.                             number  must be followed by a "#"  character, 
  1842.  
  1843.  
  1844.                                        26
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  1851.  
  1852.  
  1853.                             otherwise Z8E will treat it as a hex  number.  
  1854.                             The  following example shows a decimal number 
  1855.                             being input as part of the E command:
  1856.  
  1857.                                  *E 512#  
  1858.                               
  1859.                                       instructs  Z8E  to  examine  memory 
  1860.                                       location  512 decimal (200 hex)
  1861.  
  1862.  
  1863.               LITERAL:      ASCII  literals up to 78 bytes in length  are 
  1864.                             permitted as arguments (Z8E's input buffer is 
  1865.                             80  characters  long  less  the  opening  and 
  1866.                             trailing  quote characters).   ASCII literals 
  1867.                             must be enclosed in quotes.   The quote char-
  1868.                             acter  itself is the only character not  per-
  1869.                             mitted as a literal.   Commands which do  not 
  1870.                             permit  the use of ARGUMENT-STRINGs (see  be-
  1871.                             low)  will still accept input in the form  of 
  1872.                             quoted  strings.   In  such a case  Z8E  will 
  1873.                             ignore all but the last two characters of the 
  1874.                             quoted  literal,  treating the input as a  16 
  1875.                             bit number.  For example if the user entered:
  1876.  
  1877.                                             *Z 'ABCD'
  1878.  
  1879.                             Z8E would begin treat 'BC' as a 16 bit number 
  1880.                             and begin disassembling at address at 4243.
  1881.  
  1882.  
  1883.           ARGUMENT-         The F (find),  E (examine memory),  N  (query   
  1884.           STRINGS:          I/O  ports without pre-read),  Q (query   I/O 
  1885.                             ports),  and  Y (fill memory) commands permit 
  1886.                             the use of ARGUMENT-STRINGS, which are simply 
  1887.                             combinations  of  all  valid  argument  types 
  1888.                             separated by commas.  ARGUMENT-STRINGs may be 
  1889.                             any  length  up to the limit of  Z8E's  input 
  1890.                             buffer  which is 80  bytes  long.   ARGUMENT-
  1891.                             STRINGs  may  be terminated by either a  car-
  1892.                             riage return or the first space character not 
  1893.                             appearing  in between quote characters.   The 
  1894.                             following   is  an  example  of  a  15   byte 
  1895.                             ARGUMENT-STRINGS  string which combines  SYM-
  1896.                             BOLS, LITERALS, HEX, and DECIMAL numbers:
  1897.  
  1898.                                SYMBOL,'xyZ',4F,12E4,9,21#,511#,'ABc'
  1899.  
  1900.                             Assuming  that SYMBOL is equal to  177H  then 
  1901.                             the above ARGUMENT-STRING would evaluate to:
  1902.                             
  1903.                             01 77 78 79 5A 4F 12 E4 09 15 01 FF 41 42 63     
  1904.  
  1905.                             Again,  ARGUMENT-STRINGS  are  terminated  by 
  1906.                             either  a  carriage return or  by  the  first 
  1907.                             space  character  that does not appear  in  a 
  1908.  
  1909.  
  1910.                                        27
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  1917.  
  1918.  
  1919.                             quoted literal string.
  1920.  
  1921.         Z8E permits expressions using the + and - operators.   Any  argu-
  1922.         ment type may be combined with any other type.   The length of an 
  1923.         expression  is  limited  only by the size of  the  input  buffer.  
  1924.         Expressions  are  evaluated  from left to right and  the  use  of 
  1925.         parentheses is not permitted. 
  1926.  
  1927.         Z8E  indicates argument errors by printing a question mark.
  1928.  
  1929.         Arguments may  be  line-edited using the  standard  CP/M  control 
  1930.         characters:
  1931.  
  1932.                        backspace:  erase the last character typed
  1933.                        control X:  erase the entire line 
  1934.                        control C:  return to CP/M via warm boot
  1935.  
  1936.         All input is truncated to the size of Z8E's input buffer which is 
  1937.         80 characters long.  
  1938.  
  1939.         All alphabetic input to Z8E may be in uppercase or lowercase. All 
  1940.         output by Z8E follows the dictates of the CASE byte as patched by 
  1941.         the user (see INSTALLATION).
  1942.  
  1943.         In  this  manual the appearance of square brackets [ ] around  an 
  1944.         argument always indicates that the argument is optional.
  1945.  
  1946.  
  1947.  
  1948.  
  1949.  
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.                                        28
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  1983.  
  1984.  
  1985.  
  1986.  
  1987.  
  1988.  
  1989.                        This Page Intentionally Left Blank.
  1990.  
  1991.  
  1992.  
  1993.  
  1994.  
  1995.  
  1996.  
  1997.  
  1998.  
  1999.  
  2000.  
  2001.  
  2002.  
  2003.  
  2004.  
  2005.  
  2006.  
  2007.  
  2008.  
  2009.  
  2010.  
  2011.  
  2012.  
  2013.  
  2014.  
  2015.  
  2016.  
  2017.  
  2018.  
  2019.  
  2020.  
  2021.  
  2022.  
  2023.  
  2024.  
  2025.  
  2026.  
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.                                        29
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  2049.  
  2050.  
  2051.  
  2052.         VI. BREAKPOINTS
  2053.  
  2054.         Breakpoints  are  those addresses in the program  under  test  at 
  2055.         which  the user wishes to suspend execution and return control to 
  2056.         Z8E.  The  user may set,  clear,  and display breakpoints at  any 
  2057.         time,  via the appropriate command in response to Z8E's  asterisk 
  2058.         prompt.   Z8E's  implementation of breakpoints does not force the 
  2059.         user to tediously enter breakpoint addresses every time execution 
  2060.         is resumed.  Rather,  the user may enter up to 16 breakpoint  ad-
  2061.         dresses and each breakpoint,  once set, is stored in one of Z8E's 
  2062.         internal tables and remains in effect until explicitly cleared by 
  2063.         the user via the Clear breakpoint command (see C command).
  2064.  
  2065.         Z8E also allows you to specify a pass count to be associated with 
  2066.         any breakpoint that is set.   Pass counts indicate the number  of 
  2067.         times  a particular instruction must be executed before Z8E  will 
  2068.         regain control.
  2069.  
  2070.         Furthermore,  Z8E  does not modify any code in the  user  program 
  2071.         until  a GO command is issued (see G command).  This permits  the 
  2072.         user to examine code,  and make patches if desired,  at any point 
  2073.         in the debug session.
  2074.  
  2075.         When  a breakpoint is reached in the user program and Z8E regains 
  2076.         control,  the message:      *BP*XXXX      is displayed where XXXX 
  2077.         represents the hexadecimal address of the breakpoint.   In  addi-
  2078.         tion,  Z8E  will display the symbolic name of this address if one 
  2079.         exists  in the symbol table.  Z8E follows this with a display  of 
  2080.         the  asterisk  prompt indicating it is ready  ready  for  command 
  2081.         processing.
  2082.  
  2083.         The  message:     *ERROR*BP*XXXX      is displayed on the console 
  2084.         whenever Z8E determines that control has been regained without  a 
  2085.         valid  breakpoint having been reached.   This is generally caused 
  2086.         by a user program which has gone off the deep end.   If the  user 
  2087.         examines  the  current contents of the registers (via the X  com-
  2088.         mand) the current program counter will most assuredly contain  an 
  2089.         address  which  had  not  previously been set  as  a  breakpoint.  
  2090.         Things to look for when this situation arises include:  a program 
  2091.         that blew its stack, a program that performed a 2 1/2 gainer with 
  2092.         a full twist indirect through a register;  ie.  JP (HL) into  the 
  2093.         great  unknown,  and  attempting to trace where wise men fear  to 
  2094.         tread (BIOS and BDOS I/O routines).
  2095.  
  2096.         Z8E  will  allow you to single step (trace) and  set  breakpoints 
  2097.         anywhere in memory.  However,  bear in mind that as you enter the 
  2098.         BIOS  and BDOS netherworld your stack pointer will at some  point 
  2099.         be  saved  directly in memory as CP/M switches to its  own  stack 
  2100.         (your  stack  pointer is not saved on a stack  by  CP/M).   If  a 
  2101.         breakpoint has been set at an instruction somewhere in BDOS or in 
  2102.         the  BIOS (after this save of your stack pointer has occured) and 
  2103.         this breakpoint is reached,  Z8E will itself call a BDOS  routine 
  2104.         in an attempt to display the *BP*XXXX message on the console.  At 
  2105.         this  point CP/M will save Z8E's stack pointer  and overlay yours 
  2106.  
  2107.  
  2108.                                        30
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  2115.  
  2116.  
  2117.         in memory.   When BDOS eventually restores the stack pointer  and 
  2118.         executes  a  RET instruction you will not return to your  program 
  2119.         and  your  stack pointer will be gone.   These  routines  can  be 
  2120.         traced, albeit with difficulty,  but you must keep an eye on what 
  2121.         CP/M is doing with the stack pointer.
  2122.  
  2123.  
  2124.  
  2125.  
  2126.  
  2127.  
  2128.  
  2129.  
  2130.  
  2131.  
  2132.  
  2133.  
  2134.  
  2135.  
  2136.  
  2137.  
  2138.  
  2139.  
  2140.  
  2141.  
  2142.  
  2143.  
  2144.  
  2145.  
  2146.  
  2147.  
  2148.  
  2149.  
  2150.  
  2151.  
  2152.  
  2153.  
  2154.  
  2155.  
  2156.  
  2157.  
  2158.  
  2159.  
  2160.  
  2161.  
  2162.  
  2163.  
  2164.  
  2165.  
  2166.  
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.  
  2174.                                        31
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  2181.  
  2182.  
  2183.  
  2184.  
  2185.  
  2186.  
  2187.                        This Page Intentionally Left Blank.
  2188.  
  2189.  
  2190.  
  2191.  
  2192.  
  2193.  
  2194.  
  2195.  
  2196.  
  2197.  
  2198.  
  2199.  
  2200.  
  2201.  
  2202.  
  2203.  
  2204.  
  2205.  
  2206.  
  2207.  
  2208.  
  2209.  
  2210.  
  2211.  
  2212.  
  2213.  
  2214.  
  2215.  
  2216.  
  2217.  
  2218.  
  2219.  
  2220.  
  2221.  
  2222.  
  2223.  
  2224.  
  2225.  
  2226.  
  2227.  
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  
  2233.  
  2234.  
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240.                                        32
  2241.  
  2242.  
  2243.  
  2244.  
  2245.  
  2246.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  2247.  
  2248.  
  2249.         A    Assemble
  2250.         _________________________________________________________________
  2251.  
  2252.  
  2253.         The  A command permits the user to effect inline assembly of  Z80 
  2254.         assembler source code,  including labels and symbols,  using  the 
  2255.         full  Z80  instruction set.  In addition,  the assembler  accepts 
  2256.         standard  Zilog mnemonics (APPENDIX B),  expressions using the  + 
  2257.         and - operators,  as well as the following five assembler  direc-
  2258.         tives:  ORG, DEFB, DDB, EQU, and DEFW.  The format of the command 
  2259.         is:
  2260.  
  2261.                 *A  ARG1  <cr>
  2262.  
  2263.                   where  ARG1  represents the starting address  at  which 
  2264.                   assembly will take place
  2265.  
  2266.                   ARG1 may be of any type
  2267.  
  2268.  
  2269.         Z8E  initially  prompts  the  user  by  first  disassembling  and 
  2270.         displaying the instruction currently located at the address  spe-
  2271.         cified by ARG1.  This is done as a convenience to permit the user 
  2272.         to  ensure that any patches will be assembled into memory at  the 
  2273.         intended location.  Z8E then outputs a carriage return/line feed, 
  2274.         displays  the address specified as ARG1,  and awaits  input.  Z8E 
  2275.         will  not disassemble before every line of source code entered by 
  2276.         the user, only before the first one. 
  2277.  
  2278.  
  2279.         Z8E expects assembler input in the following format:
  2280.  
  2281.  
  2282.                      LABEL:  opcode  [operand1] [,operand2]
  2283.  
  2284.  
  2285.         The label field is always optional, the opcode field is mandatory 
  2286.         only  if  no  label  was entered,  and  the  operand  field  must 
  2287.         naturally  be  included for those Z80 instructions which  require 
  2288.         one. The three fields may be separated from one another by spaces 
  2289.         or tab characters.
  2290.  
  2291.         Z8E  does not automatically reserve space within itself for  user 
  2292.         supplied symbol names. User supplied symbols, as opposed to those 
  2293.         loaded  from files,  are entered from the keyboard in  the  label 
  2294.         field  using the (A)ssemble command.  Symbol table space to  hold 
  2295.         user  supplied  symbol names must be explicitly requested on  the 
  2296.         CP/M command line as explained in the section "INVOKING Z8E at on 
  2297.         the CP/M COMMAND LEVEL".  These user supplied symbols,  once  en-
  2298.         tered,  may  be referenced in the operand field of any subsequent 
  2299.         assembly  statement or in the argument field of any Z8E  command. 
  2300.         These  symbols  come in handy when disassembling .COM  files  for 
  2301.         which no source listing exists and also when patching code.
  2302.  
  2303.         The  assembler is a one pass assembler and forward references  to 
  2304.  
  2305.  
  2306.                                        33
  2307.  
  2308.  
  2309.  
  2310.  
  2311.  
  2312.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  2313.  
  2314.  
  2315.         symbols  which  do  not already appear in the  symbol  table  are 
  2316.         flagged  as  errors.    However,  Z8E allows the use of  the  ORG 
  2317.         directive  (see discussion below) which allows the user to  mani-
  2318.         pulate the assembler's location counter,  which helps to minimize 
  2319.         the no forward reference limitation.
  2320.  
  2321.         Labels  may begin in any column,  but all labels must be followed 
  2322.         by a colon even those appearing in an EQU statement.   Labels may 
  2323.         be of any length but only the first 6 characters are significant.  
  2324.         Z8E  always assigns the 16 bit value of the  assembler's  current 
  2325.         location counter to the label being entered, unless the statement 
  2326.         is  an EQU directive.   Labels need not be followed by an  opcode 
  2327.         and this (as well as the EQU directive) provides a convenient way 
  2328.         to  assign a value to a symbol name.   Merely set the  assemblers 
  2329.         location counter (via the ORG directive or as ARG1 in the command 
  2330.         line) to the value you wish to assign,  then type the symbol name 
  2331.         followed by a carriage return.  No object code is produced and no 
  2332.         user  memory areas are modified but the symbol and its associated 
  2333.         value  are  entered into the user symbol table.    Z8E  does  not 
  2334.         treat  duplicate symbol names as errors.   Rather,  if  the  user 
  2335.         enters  a symbol name which already appears in the symbol  table, 
  2336.         the  value associated with the new symbol replaces the one  asso-
  2337.         ciated with the old.  For example, if the symbol ENTRYP exists in 
  2338.         the  symbol  table and is associated with the value 23DA and  the 
  2339.         user assembles the following instruction:
  2340.  
  2341.              41FF 0E 04       ENTRYP: LD C,4
  2342.  
  2343.         Z8E would replace 23DA with 41FF.
  2344.  
  2345.         Assembler statements which do not contain labels may begin in any 
  2346.         column,  including  column one.   There is NO  need to  insert  a 
  2347.         leading  space or tab before an opcode if the opcode is not  pre-
  2348.         ceded by a label.
  2349.  
  2350.         Operands  appearing in the operand field of the instruction to be 
  2351.         assembled  may be any of the following types subject only to  the 
  2352.         proviso that 16 bit values cannot appear as operand for those Z80 
  2353.         instructions  which require 8 bit values.   Expressions combining 
  2354.         any of the following four types (with the + and - operators)  are 
  2355.         also permissable.  
  2356.  
  2357.                        SYMBOL  (from symbol table)
  2358.                        HEX
  2359.                        LITERAL (two bytes maximum)
  2360.                        DECIMAL
  2361.  
  2362.  
  2363.         In  addition  the  dollar sign ($) may also appear in  both  the 
  2364.         operand  field of any instruction in which a 16 bit  operand  is 
  2365.         allowed,  and  also  in the operand field of any  relative  jump 
  2366.         instruction.   The  dollar sign represents the current value  of 
  2367.         the assembler's location counter, that is, the address appearing 
  2368.         on the line at which the assembly is taking place.
  2369.  
  2370.  
  2371.  
  2372.                                        34
  2373.  
  2374.  
  2375.  
  2376.  
  2377.  
  2378.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  2379.  
  2380.  
  2381.         The  operand field of a relative jump instruction can be  entered 
  2382.         in  either of two ways.   The user may code the operand using the 
  2383.         dollar sign  mentioned above as in the following examples:
  2384.  
  2385.  
  2386.                   JR  NZ,$+11       ;jump to address PC+11 (hex)     
  2387.                   
  2388.                   DJNZ  $-24#       ;jump to address PC-24 (decimal)
  2389.  
  2390.         The user may alternatively specify a 16 bit value in the  operand 
  2391.         field  of  a relative jump instruction and let Z8E calculate  the 
  2392.         relative  displacement  from the assembler's program  counter  as 
  2393.         shown below:
  2394.  
  2395.                   JR    C,LABEL      Assuming LABEL exists, in the symbol  
  2396.                                      table Z8E will calculate the offset. 
  2397.                                      LABEL  must  be within +129 or  -126  
  2398.                                      bytes from the assembler's  location  
  2399.                                      counter  or  an assembly error  will  
  2400.                                      result.
  2401.  
  2402.                   JR      NZ,1080    Z8E  calculates the displacement be- 
  2403.                                      tween the assembler's current  loca-
  2404.                                      tion  counter  and the address  1080  
  2405.                                      (hex).
  2406.  
  2407.  
  2408.            
  2409.         Z8E indicates  error-free input by first displaying the resultant 
  2410.         object  code  and  then displaying (on the next  line)  the  next 
  2411.         address at which assembly will take place.  
  2412.  
  2413.         Assembly errors are always indicated by a double pair of question 
  2414.         marks which appear following the location counter.  An error flag 
  2415.         is also printed and will be one of the following:
  2416.  
  2417.                         ERROR FLAG               MEANING
  2418.  
  2419.                             L         Label starts with numeric character
  2420.                                          
  2421.                             O         Invalid opcode
  2422.  
  2423.                             S         Syntax error
  2424.  
  2425.                             T         Symbol table full                  
  2426.  
  2427.                             U         Instruction references an undefined
  2428.                                       symbol name
  2429.  
  2430.                             V         Value error - a 16 bit  value 
  2431.                                       was specified as an operand for 
  2432.                                       an  instruction  which  permits 
  2433.                                       only 8 bit numbers.                  
  2434.  
  2435.         If  an  error occurs,  Z8E will reprompt the user with  the  same 
  2436.  
  2437.  
  2438.                                        35
  2439.  
  2440.  
  2441.  
  2442.  
  2443.  
  2444.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  2445.  
  2446.  
  2447.         location counter address.
  2448.          
  2449.         As was mentioned previously the Z8E assmebler uses standard Zilog 
  2450.         mnemonics.   The  one exception to this is the EX AF,AF' instruc-
  2451.         tion.   To assemble this instruction the trailing quote character 
  2452.         must be omitted.
  2453.  
  2454.         Z8E  supports the ORG directive which allows the user  to  change 
  2455.         the value of the assembly location counter.  The operand field of 
  2456.         the  ORG directive may be a 16 bit argument of any  type.   After 
  2457.         setting the new assembly location counter Z8E displays the disas-
  2458.         sembled instruction at the new address.
  2459.  
  2460.         Z8E supports the DEFB,  DEFW,  and DDB directives which give  the 
  2461.         user  the ability to assemble data constants into  memory.   DEFB 
  2462.         accepts  an  8  bit operand;  the value of which in  placed  into 
  2463.         memory  at the address of the assembler's current location  coun-
  2464.         ter.  DEFW allows the user to specify a 16 bit operand value, the 
  2465.         low  order byte of which is placed into memory at the address  of 
  2466.         the  assembler's current location counter,  while the high  order 
  2467.         byte  of the operand is placed into memory at the address of  the 
  2468.         assembler's current location counter plus one.  This is in accor-
  2469.         dance with the 8080/Z80 convention of storing the high order byte 
  2470.         of  16 bit data toward the high end of memory.  The  DDB  (define 
  2471.         double  byte) directive allows the user to specify a 16 bit value 
  2472.         which,  in  contrast to the DEFW directive,  is stored in  memory 
  2473.         with the high order byte toward the low end of memory.   That is, 
  2474.         a DDB directive instructs Z8E to store the most significant  byte 
  2475.         of  the  16  bit operand value in memory at the  address  of  the 
  2476.         assembler's  current location counter,  and the least significant 
  2477.         (low  order)  byte is placed into memory at the  address  of  the 
  2478.         assembler's current location counter plus one. 
  2479.  
  2480.         The EQU directive allows the user to assign a value to a  symbol.  
  2481.         An EQU directive does not generate object code.  It merely allows 
  2482.         the  user  to  reference a numeric value by a  symbolic  name  in 
  2483.         subsequent assembly statements or monitor commands.   It is espe-
  2484.         cially  useful  when used prior to disassembling (see Z  command) 
  2485.         code  for which no symbol table exists.   The EQU  directive  re-
  2486.         quires  the user to supply a symbolic name in the label field  of 
  2487.         the instruction.   If Z8E indicates errors in an EQU statement by 
  2488.         printing question marks.  If an EQU statement is correctly assem-
  2489.         bled  by  Z8E,  the address of the assembler's  current  location 
  2490.         counter  is  erased  since an EQU statement generates  no  object 
  2491.         code.  Operands appearing in EQU statements are evaluated to a 16 
  2492.         bit  value.  Z8E will display the value of this 16 bit number  as 
  2493.         four hex digits in the object code field on the console.
  2494.  
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501.  
  2502.  
  2503.  
  2504.                                        36
  2505.  
  2506.  
  2507.  
  2508.  
  2509.  
  2510.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  2511.  
  2512.  
  2513.         B    Set Breakpoint 
  2514.         _________________________________________________________________
  2515.  
  2516.  
  2517.         Breakpoints  are  those  addresses at which the  user  wishes  to 
  2518.         suspend execution of the program under test.   Breakpoints may be 
  2519.         set at any time in response to Z8E's asterisk prompt.  Z8E allows 
  2520.         the  user to set up to 16 individual breakpoints in his  program. 
  2521.         Z8E also allows the user to specify a pass count to be associated 
  2522.         with any breakpoint.
  2523.           
  2524.         The command is invoked as follows:
  2525.  
  2526.  
  2527.              *B ARG1[,pass count] [ARG2... ARGn] <cr>
  2528.  
  2529.                   where each argument represents the address in the  user 
  2530.                   program at which a breakpoint is to be set 
  2531.  
  2532.         Normally,  that is when no pass count is specifed,  execution  of 
  2533.         the  user  program stops and control returns to the  Z8E  command 
  2534.         level as soon as a breakpoint is reached. Pass counts are used to 
  2535.         inform  Z8E  that execution of the user program should halt  only 
  2536.         when  the  specified breakpoint is reached the  number  of  times 
  2537.         times indicated by the pass count. 
  2538.  
  2539.         Pass  counts  are specified by following the  breakpoint  address 
  2540.         with a comma and then entering a pass count immediately following 
  2541.         the comma.
  2542.  
  2543.         An existing pass count may be changed to a different value by re-
  2544.         entering the same breakpoint address,  following it with a comma, 
  2545.         and then specifying the new pass count.
  2546.          
  2547.         To break on a multi-byte Z80 instruction the address specified as 
  2548.         the  breakpoint  address must be that of the first  byte  of  the 
  2549.         instruction.   Users who fail to observe this rule will generally 
  2550.         find their programs hopping the next bus to never-never land.  If 
  2551.         a patch is made at an address of a breakpoint currently in effect 
  2552.         be  sure  the breakpoint address is still pointing at  the  first 
  2553.         byte  of  the new instruction.   
  2554.  
  2555.         Multiple breakpoints may be set with the same B command by  sepa-
  2556.         rating each one with a single space.  If multiple breakpoints are 
  2557.         specified  and Z8E detects an erroneous argument (a  non-existent 
  2558.         symbol  for  example) a question mark will be  printed,  and  the 
  2559.         command  terminates.   All valid breakpoints specified up to  the 
  2560.         invalid one will be set. 
  2561.  
  2562.         Z8E  displays  a  question mark when a attempt is made to  set  a 
  2563.         seventeenth breakpoint.
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.                                        37
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  2577.  
  2578.  
  2579.         C    Clear Breakpoint 
  2580.         _________________________________________________________________
  2581.  
  2582.  
  2583.         The C command clears individual breakpoints previously set by a B 
  2584.         command.  The format of the command is:
  2585.  
  2586.  
  2587.                   *C  ARG1 [ARG2...ARGn] <cr>
  2588.  
  2589.                        where each arg may be any valid argument type 
  2590.                        which  evaluates to an address previously set 
  2591.                        as a breakpoint
  2592.  
  2593.  
  2594.         Multiple  breakpoints  may  be cleared by the same C  command  by 
  2595.         separating each argument with a single space.
  2596.  
  2597.         Z8E  displays a question mark when an attempt is made to clear  a 
  2598.         non-existent breakpoint.
  2599.  
  2600.         To  clear  ALL  breakpoints enter:   *C *    where  the  asterisk 
  2601.         indicates ALL.
  2602.  
  2603.  
  2604.  
  2605.  
  2606.  
  2607.  
  2608.  
  2609.  
  2610.  
  2611.  
  2612.  
  2613.  
  2614.  
  2615.  
  2616.  
  2617.  
  2618.  
  2619.  
  2620.  
  2621.  
  2622.  
  2623.  
  2624.  
  2625.  
  2626.  
  2627.  
  2628.  
  2629.  
  2630.  
  2631.  
  2632.  
  2633.  
  2634.  
  2635.  
  2636.                                        38
  2637.  
  2638.  
  2639.  
  2640.  
  2641.  
  2642.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  2643.  
  2644.  
  2645.         D    Dump 
  2646.         _________________________________________________________________
  2647.  
  2648.  
  2649.         The D command allows the user to dump memory in both hexadecimal 
  2650.         and ASCII to the console in user specified block sizes.
  2651.          
  2652.         The format of the command is:
  2653.  
  2654.                   *D  [ARG1]  [ARG2]  <cr>
  2655.  
  2656.                        where    ARG1 =  the starting address to dump
  2657.                                 
  2658.                                 ARG2 =  dictates    the    dump    format 
  2659.                                         depending on its value.   If ARG2 
  2660.                                         is  in the range 0 - 255 then  it 
  2661.                                         is  treated  as a block size  and 
  2662.                                         represents the number of bytes to 
  2663.                                         be  displayed  (0 is  treated  as 
  2664.                                         256). If ARG2 is greater than 255 
  2665.                                         then ARG2 is treated as an ending 
  2666.                                         address and memory will be dumped 
  2667.                                         non-interactively to the console.
  2668.  
  2669.                        ARG1 and ARG2 may be of any argument type.
  2670.  
  2671.         If  ARG1  is omitted then the dump resumes from the  last  memory 
  2672.         address  +1  as displayed via the previous invocation  of  the  D 
  2673.         command.  If  no previous D command had been given then memory is 
  2674.         dumped starting at address 100H.
  2675.  
  2676.         If  ARG2 is omitted then the most recent value of ARG2 (from  the 
  2677.         last D command) is used.
  2678.          
  2679.         The  dump command displays the contents of memory in  hexadecimal 
  2680.         on  the  left side of the console while the ASCII  equivalent  of 
  2681.         each byte is shown on the right side.  
  2682.  
  2683.         During  a  block by block dump (ARG2 < 256 signifies a  block  by 
  2684.         block  dump)  Z8E waits for user input after each block  is  dis-
  2685.         played.   A  carriage return entered by the user causes the  next 
  2686.         sequential  block to be dumped while any other  character  causes 
  2687.         the command to terminate.
  2688.  
  2689.         For  non-interactive dumps,  starting address to ending  address, 
  2690.         pressing any key terminates the dump.
  2691.  
  2692.         The  dump  command provides an especially easy way  of  examining 
  2693.         tabular data,  for example in scanning the disk parameter headers 
  2694.         in your BIOS.   That is,  by specifying the base address as  ARG1 
  2695.         and  the  table  size as ARG2 the user can walk  through  memory, 
  2696.         table by table.
  2697.  
  2698.  
  2699.  
  2700.  
  2701.  
  2702.                                        39
  2703.  
  2704.  
  2705.  
  2706.  
  2707.  
  2708.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  2709.  
  2710.  
  2711.         E    Examine Memory   
  2712.         _________________________________________________________________
  2713.  
  2714.  
  2715.         The  E  command allows the user to examine and optionally  modify 
  2716.         the contents of memory.  The format of the command is:
  2717.  
  2718.              *E   ARG1  <cr>
  2719.  
  2720.                        where  ARG1 is the address of the first byte  to 
  2721.                        examine
  2722.  
  2723.                        ARG1 may be any symbol type 
  2724.  
  2725.         Upon  receipt of ARG1 Z8E will read the contents of the specified 
  2726.         memory  address and display the byte in both hex and  ASCII.   At 
  2727.         this  point the user has two options.  The user may specify   re-
  2728.         placement  data  to be written to memory starting at the  current 
  2729.         address,  or  he  may  choose to continue  to  passively  examine 
  2730.         memory.   The choice is determined by the character(s) which  are 
  2731.         input after the contents of an address are displayed.  
  2732.  
  2733.         If  the  user  wishes to modify memory starting  at  the  current 
  2734.         memory address,  then an ARGUMENT-STRING may be entered following 
  2735.         the  displayed  byte.   Z8E will evaluate the entire  string  and 
  2736.         write  the  evaluated equivalent of the string  into  consecutive 
  2737.         memory  locations starting with the current memory  address.  For 
  2738.         example the user could enter the following ARGUMENT-STRING: 
  2739.  
  2740.              *E 45F9
  2741.              45F9  42  B  'This is a string',0D,0A,13,4F,9,'More Text',05
  2742.                           ^                                             ^  
  2743.  
  2744.                           The user input apprears between the arrows  and 
  2745.                           would be evaluated to the following 31 bytes: 
  2746.                             
  2747.                           54 68 69 73 20 49 73 20 61 20 73 74 72 69 6E 67 
  2748.                           0D 0A 13 4F 09 4D 6F 62 65 20 74 65 78 74 05  
  2749.  
  2750.                           These  31  bytes  would be stored  into  memory 
  2751.                           locations  45F9  to 4617 and the  next  address 
  2752.                           displayed on the screen would be 4618.
  2753.  
  2754.              4618  23  #
  2755.  
  2756.         Remember  that  ARGUMENT-STRINGS may be terminated  by  either  a 
  2757.         carriage  return  or by the first space character which does  not 
  2758.         appear  in  a quoted literal string.  The  choice  of  terminator 
  2759.         determines  the which address will be displayed next.   If a car-
  2760.         riage  return is used to terminate the ARGUMENT-STRING,  then Z8E 
  2761.         will display the next sequential memory address. For example:
  2762.  
  2763.                   *E 1002
  2764.                   1002  45  E  12,8F,00 <cr>
  2765.                   1005  28  (
  2766.  
  2767.  
  2768.                                        40
  2769.  
  2770.  
  2771.  
  2772.  
  2773.  
  2774.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  2775.  
  2776.  
  2777.  
  2778.         The user entered an ARGUMENT-STRING 12,8F,00 which was  evaluated 
  2779.         to  3 bytes.   Since the ARGUMENT-STRING was terminated by a car-
  2780.         riage return the next address displayed was 1002+3 or 1005. 
  2781.  
  2782.         By  terminating  the  ARGUMENT-STRING with a space the  user  can 
  2783.         verify  the contents of memory just  modified.   ARGUMENT-STRINGS 
  2784.         terminated  by  a space cause Z8E to redisplay the  starting  ad-
  2785.         dress;  this  makes  the  data just  entered  availalbe  for  re-
  2786.         inspection:
  2787.  
  2788.                   *E 1002
  2789.                   1002  45  E  12,8F,00  <space>
  2790.                   1002  12  ~
  2791.  
  2792.         If the user does not want to write any data to the current memory 
  2793.         address,  then the character entered should be a space character, 
  2794.         up arrow (carret) character, or a carriage return.
  2795.  
  2796.                           CHARACTER                     ACTION
  2797.                        
  2798.                             space               read next sequential mem-
  2799.                                                 ory address 
  2800.                             
  2801.                           up arrow              read previous memory  ad-
  2802.                                                 dress 
  2803.                                                      
  2804.                             <cr>                read next sequential mem-
  2805.                                                 ory address command  
  2806.  
  2807.  
  2808.                            period               terminate command                                             
  2809.  
  2810.         The  user may also change the current memory address by  entering 
  2811.         an  equal  sign "=" followed by a valid  argument.   The  address 
  2812.         obtained  by  evaluating this argument becomes  the  new  current 
  2813.         memory address as shown below: 
  2814.  
  2815.              *E 1344
  2816.              1344  89  ~  <cr>
  2817.              1345  6F  o  <cr>
  2818.              1346  52  R  =9F34 <cr>
  2819.              9F34  63  c
  2820.  
  2821.  
  2822.  
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832.  
  2833.  
  2834.                                        41
  2835.  
  2836.  
  2837.  
  2838.  
  2839.  
  2840.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  2841.  
  2842.  
  2843.          F    Find 
  2844.         _________________________________________________________________
  2845.  
  2846.  
  2847.         The  find command allows the user to search memory for multi-byte 
  2848.         strings in memory.  The format of the command is:
  2849.  
  2850.              *F   ARG1  ARG2 <cr>
  2851.  
  2852.                   where  ARG1  =  the  starting address at which to begin 
  2853.                                   the search, it may be of any type
  2854.                          
  2855.                          ARG2  =  is  an ARGUMENT-STRING representing the 
  2856.                                   pattern  to search for;  the  user  may 
  2857.                                   specify  any  combination of  arguments 
  2858.                                   separated by commas or spaces up to the 
  2859.                                   limit  of  Z8E's  command  line  buffer 
  2860.                                   which  is 80 bytes  long.   The  actual 
  2861.                                   number of bytes searched for depends on 
  2862.                                   how the string is ultimately evaluated.
  2863.  
  2864.                                       
  2865.         Z8E will display every address which contains data matching ARG2.  
  2866.         The search continues until the end of memory is reached.
  2867.  
  2868.         The user may elect to cancel the search at any time by depressing 
  2869.         any key on the keyboard.
  2870.  
  2871.         If  ARG2 is a single argument (as opposed to an argument  string) 
  2872.         and  if this argument is a symbol name then Z8E will reverse  the 
  2873.         order of the two bytes comprising the 16 bit operand. Most 16 bit 
  2874.         values in Z80 programs are stored with the least significant byte 
  2875.         at  a  given address and the most significant byte at  the  given 
  2876.         address+1 (toward the high end of memory).  This is in accordance 
  2877.         with the Z80 convention of storing the most significant byte of a 
  2878.         16 bit argument toward the high end of memory.
  2879.  
  2880.         The following are examples of the FIND command:
  2881.  
  2882.              *F 0 SYMBOL
  2883.  
  2884.              Assuming  that the symbol "SYMBOL" is  associated  with 
  2885.              the  hex  value 3BF then Z8E would attempt to find  all 
  2886.              address  containing  the byte pair BF and  03  in  that 
  2887.              order, with the search beginning at address 0000.  Note 
  2888.              that the order of the two bytes is reversed because the 
  2889.              symbol "SYMBOL" exists in the symbol table.   To search 
  2890.              for  the  byte  pair 03 and BF in that order  the  user 
  2891.              should enter the argument as either a 16 bit hex number 
  2892.              (3BF) or as two 8 bit hex numbers (03,BF).  
  2893.  
  2894.  
  2895.              *F 100 87,32#,'ABCD',0C3,symbol,'p',271F
  2896.  
  2897.              Assuming  that the symbol "symbol" is  associated  with          
  2898.  
  2899.  
  2900.                                        42
  2901.  
  2902.  
  2903.  
  2904.  
  2905.  
  2906.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  2907.  
  2908.  
  2909.              the  hex  value 3BF then Z8E would attempt to find  all 
  2910.              starting addresses of the following 12 byte string:
  2911.  
  2912.                      87 20 41 42 43 44 C3 03 BF 70 27 1F
  2913.  
  2914.  
  2915.              Notice  that Z8E would search for the two byte  pattern 
  2916.              03 BF as the value for "symbol".   If the user happened 
  2917.              to  be  trying to find the  instruction     JP   symbol   
  2918.              the search would fail because as mentioned above 16 bit 
  2919.              values  are  stored  low order byte  first.   The  user 
  2920.              should have entered C3 BF 03.
  2921.  
  2922.              The two bytes which represent the address of symbol are 
  2923.              not  reversed as in the example above because  ARG2  is 
  2924.              specified  as an ARGUMENT-STRING as opposed to a single 
  2925.              argument.
  2926.  
  2927.              Z8E would begin its search at address 100 (ARG1). 
  2928.  
  2929.  
  2930.  
  2931.  
  2932.  
  2933.  
  2934.  
  2935.  
  2936.  
  2937.  
  2938.  
  2939.  
  2940.  
  2941.  
  2942.  
  2943.  
  2944.  
  2945.  
  2946.  
  2947.  
  2948.  
  2949.  
  2950.  
  2951.  
  2952.  
  2953.  
  2954.  
  2955.  
  2956.  
  2957.  
  2958.  
  2959.  
  2960.  
  2961.  
  2962.  
  2963.  
  2964.  
  2965.  
  2966.                                        43
  2967.  
  2968.  
  2969.  
  2970.  
  2971.  
  2972.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  2973.  
  2974.  
  2975.         G    Go 
  2976.         _________________________________________________________________
  2977.  
  2978.  
  2979.         The  G command instructs Z8E to begin or resume execution of  the 
  2980.         user program.  The format of the command is:
  2981.  
  2982.                   *G   ARG1  <cr>
  2983.  
  2984.                        where      ARG1   =   the  address  of  the  first 
  2985.                                              instruction the user wishes
  2986.                                              to execute.
  2987.  
  2988.                        ARG1 may be any argument type
  2989.  
  2990.         Upon  receipt of this command Z8E initializes all breakpoints  in 
  2991.         the  user  program,  restores all user registers,  and  transfers 
  2992.         control  to the user program under test at the address  specified 
  2993.         in ARG1.   Execution within the user program will continue  until 
  2994.         the  user  program reaches a breakpoint,  at which point  control 
  2995.         will  return to Z8E.   This is the only way the user is  able  to 
  2996.         return control to Z8E once the GO command is issued.
  2997.  
  2998.         Z8E breakpoint technique has been designed such that Z8E will not 
  2999.         directly  initialize  a  breakpoint at the address  specified  in 
  3000.         ARG1.  In  actualiity it  would be impossible to do so  since  an 
  3001.         attempt  would  be made to resume execution at  this  address,  a 
  3002.         breakpoint would have been set at this address, and control would 
  3003.         immediately  return to the monitor without this instruction  ever 
  3004.         having been executed.    This limitation has been overcome in Z8E 
  3005.         by  actually  copying the single instruction located at  ARG1  to 
  3006.         Z8E's  memory,  THEN setting the breakpoint at the ARG1  address, 
  3007.         and  finally executing the "moved" version of the instruction  in 
  3008.         Z8E's memory rather than in the user program. Z8E compensates for 
  3009.         the  that CALL and RELATIVE JUMP instructions are affected by the 
  3010.         address at which they are executed. This entire process is total-
  3011.         ly  transparent and it allows the user to debug loops by  setting 
  3012.         only a single breakpoint within the range of a loop, obviates the 
  3013.         need  to clear any breakpoints which are located at  the  address 
  3014.         where  execution is to resume,  and even allows breakpoints at  a  
  3015.         DJNZ  $   instructions!
  3016.  
  3017.  
  3018.         HINT:
  3019.         When  proceeding from a breakpoint it is simplest to use the form 
  3020.         of the GO command:    *G   P <cr>    which informs Z8E to  resume 
  3021.         execution  at the address specified by the user's current program 
  3022.         counter.   
  3023.  
  3024.  
  3025.  
  3026.  
  3027.  
  3028.  
  3029.  
  3030.  
  3031.  
  3032.                                        44
  3033.  
  3034.  
  3035.  
  3036.  
  3037.  
  3038.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  3039.  
  3040.  
  3041.         H    Display Symbol Table
  3042.         _________________________________________________________________
  3043.  
  3044.  
  3045.         The  H  command allows the user to view the symbol table  on  the 
  3046.         console.  The format of the command is:
  3047.  
  3048.                   *H   [ARG1]  <cr>
  3049.  
  3050.                        where ARG1 must be a symbol name
  3051.  
  3052.  
  3053.         If  ARG1  is  omitted Z8E will display the  entire  symbol  table 
  3054.         starting with the first symbol in the table.   If ARG1 is present 
  3055.         Z8E  will  begin the display with that symbol.   Z8E  displays  a 
  3056.         block  of  32  symbols then waits for user input.   If  the  user 
  3057.         enters  a  carriage return the the next block of  32  symbols  is 
  3058.         displayed.  If  the user enteres any other character the  command 
  3059.         terminates.
  3060.  
  3061.         If  a  symbol name entered as ARG1 cannot be found in the  symbol 
  3062.         table Z8E prints a question mark.
  3063.  
  3064.  
  3065.  
  3066.  
  3067.  
  3068.  
  3069.  
  3070.  
  3071.  
  3072.  
  3073.  
  3074.  
  3075.  
  3076.  
  3077.  
  3078.  
  3079.  
  3080.  
  3081.  
  3082.  
  3083.  
  3084.  
  3085.  
  3086.  
  3087.  
  3088.  
  3089.  
  3090.  
  3091.  
  3092.  
  3093.  
  3094.  
  3095.  
  3096.  
  3097.  
  3098.                                        45
  3099.  
  3100.  
  3101.  
  3102.  
  3103.  
  3104.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  3105.  
  3106.  
  3107.         I    Initialize FCB and command tail
  3108.         _________________________________________________________________
  3109.  
  3110.  
  3111.         The I  command initializes  the  command tail at 80h and the file 
  3112.         name fields in the default FCB (5Ch and 6Ch).
  3113.  
  3114.                   *I  [ARG1] [ARG2] ... [ARGn] <cr>
  3115.  
  3116.                        where each arg may be any string.
  3117.  
  3118.         The  command tail in the default DMA buffer at 80h will be filled 
  3119.         in with a standard format command buffer comprising a length byte 
  3120.         followed  by  the string formed by translating all  the  ARGs  to 
  3121.         upper case.  A zero is appended after the last ARG.
  3122.  
  3123.         The first two ARGs are treated as (possibly ambiguous) file names 
  3124.         and are copied with appropriate padding into the file name fields 
  3125.         in the default FCB area.
  3126.  
  3127.         If  no  ARG2 is present then the file name field at 6Ch  will  be 
  3128.         blank-filled  from  6Dh to 77h.   If no ARG1 is present then  the 
  3129.         file name field at 5Ch will be blank-filled from 5Dh to 67h.
  3130.  
  3131.         Since  the "I" command with no arguments is a valid  command,  it 
  3132.         cannot be aborted.
  3133.  
  3134.         Note  that Z8E does not automatically insert a space at the  head 
  3135.         of the command tail.   If you are debugging routines to parse the 
  3136.         command  line  you should insert a tab or space yourself to  make 
  3137.         the command tail realistic.  For example, the Z8E command:
  3138.  
  3139.                          i   square.peg
  3140.  
  3141.         generates the command tail:
  3142.  
  3143.                0A 53 51 55 41 52 45 21 50 45 47 00
  3144.                10  S  Q  U  A  R  E  .  P  E  G 00
  3145.  
  3146.         whereas  the command tail to program 'fit' generated at the  CP/M 
  3147.         level by:
  3148.  
  3149.                          fit square.peg
  3150.  
  3151.         would be:
  3152.  
  3153.                0B 20 53 51 55 41 52 45 21 50 45 47 00
  3154.                11     S  Q  U  A  R  E  .  P  E  G 00
  3155.  
  3156.         and  you  can emulate this form by putting the space in  yourself 
  3157.         before the word 'square'.
  3158.  
  3159.  
  3160.  
  3161.  
  3162.  
  3163.  
  3164.                                        46
  3165.  
  3166.  
  3167.  
  3168.  
  3169.  
  3170.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  3171.  
  3172.  
  3173.         J    Animated Full Screen Debugger
  3174.         ________________________________________________________________
  3175.  
  3176.         The  J command provides the user with the ability to "see" inside 
  3177.         the  Z80  as it executes a program.   The Z8E  animated  debugger 
  3178.         allows the user to view registers, memory, and instructions while 
  3179.         the  Z80  is simultaneously executing code.   In  addtion  the  J 
  3180.         command  provides  the  user with the  ability  to  interactively 
  3181.         single-step through a program using the full screen facilities of 
  3182.         the command. The format of the J command is:
  3183.  
  3184.                   *J   [/] [*] [ARG1] [ARG2]
  3185.  
  3186.  
  3187.                        USE  OF  THE  J  COMMAND FOR  SINGLE  STEPPING  IS 
  3188.                        DESCRIBED  AT  THE  END  OF  THIS  SECTION.   THIS 
  3189.                        SECTION  DESCRIBES THE NON-INTERACTIVE VERSION  OF 
  3190.                        THE  J  COMMAND DURING WHICH THE USER  TURNS  OVER 
  3191.                        COMPLETE  CONTROL OF THE EXECUTION OF THE  PROGRAM 
  3192.                        UNDER TEST TO Z8E. 
  3193.  
  3194.                        ARG1  is  the starting address of the display  and 
  3195.                        may  be of any valid argument type.  For  example, 
  3196.                        the user may specify   *J P    to resume execution 
  3197.                        at the point where it had previouly been stopped. 
  3198.  
  3199.                        The  slash and star control subroutine tracing  as 
  3200.                        follows:
  3201.  
  3202.                        "/"  Slash  informs  Z8E not to trace any  subrou-
  3203.                             tines at all.
  3204.                  
  3205.                        "*"  Asterisk informs Z8E not to trace any subrou-
  3206.                             tine  calls to addresses located in the range 
  3207.                             0 to FF.  This feature is intended to  screen 
  3208.                             out  calls  to location 5 (BDOS) in order  to 
  3209.                             prevent  Z8E's  and  the  user's  stack  from 
  3210.                             becoming hopelessly entangled.
  3211.                        
  3212.                        ARG2 represents an optional timeout paramter which 
  3213.                        affects  the speed at which instructions are  exe-
  3214.                        cuted.   This  number may be in the range 0 - 255, 
  3215.                        with  10 (decimal) as the default if no  value  is 
  3216.                        entered. A timeout value of 10 yields approximate-
  3217.                        ly  a one half second delay between the  execution 
  3218.                        of sequential instructions.   A value of 0  repre-
  3219.                        sents  NO time delay and is in actuality the fast-
  3220.                        est rate a which the J command can run.
  3221.  
  3222.         Once  the J command commences,  Z8E takes over the Z80  and  fur-
  3223.         nishes the user with a "peephole" into the CPU.  Z8E executes one 
  3224.         instruction  at a time in the user program pausing after each one 
  3225.         to dynamically update the screen display.  The J command  divides 
  3226.         the screen into three areas: register map, disassembled code, and 
  3227.         memory  window.   The register map displays all registers on  the 
  3228.  
  3229.  
  3230.                                        47
  3231.  
  3232.  
  3233.  
  3234.  
  3235.  
  3236.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  3237.  
  3238.  
  3239.         top  two  lines  of the screen along with the contents of  the  F 
  3240.         register which is shown in mnemonic form.   Z8E also disassembles 
  3241.         18  instructions based on the current PC value and displays  them 
  3242.         on  the screen;  finally,  using the parameters entered in the  W 
  3243.         command,  Z8E  snapshots a block of memory and displays it  as  a 
  3244.         window on the screen. 
  3245.  
  3246.         Execution of the user program continues until any non-numeric key 
  3247.         on the keyboard is pressed which ends the command.   If a numeric 
  3248.         key is pressed, then Z8E responds by changing the timeout parame-
  3249.         ter on the fly.  The user may use the keys 0 - 9 as a throttle to 
  3250.         govern the execution speed.   Zero being the fastest;  nine being 
  3251.         the slowest.
  3252.  
  3253.         The command also terminates whenever a user defined breakpoint is 
  3254.         reached.   That  is,  if the user had set a breakpoint via the  B 
  3255.         command  and this address is reached the J command ends  and  Z8E 
  3256.         prompts  the user for the next command.   If the breakpoint had a 
  3257.         pass  count associated with it,  the pass count must  reach  zero 
  3258.         before the J command will terminate.
  3259.  
  3260.         USING THE J COMMAND FOR SINGLE STEPPING
  3261.  
  3262.         Z8E  permits  the  user to single-step through  a  program  while 
  3263.         allowing  a  continuous full-screen view of the  registers,  code 
  3264.         being executed,  and the contents of a block of memory as  speci-
  3265.         fied by the K command. In order to invoke the full screen single-
  3266.         step the user enters the following command:
  3267.  
  3268.                   *J   [/]  [*] 
  3269.  
  3270.                             / instructs Z8E not to trace any  subroutines 
  3271.                             at all
  3272.  
  3273.                             *  instructs Z8E not to trace any subroutines 
  3274.                             location   below   address   100H   and    is 
  3275.                             specifically  designed to allow the user  the 
  3276.                             option  of  not becoming tangled in BDOS  and 
  3277.                             BIOS.
  3278.  
  3279.                             Note  that  this version of the J command  is 
  3280.                             differentiated   from   the   non-interactive 
  3281.                             version  by  the  absence  of  any   argument 
  3282.                             indicating a execution address.  
  3283.  
  3284.         This  version allows the user to execute one instruction  in  his 
  3285.         program  and then regain control at the Z8E command  level.   Z8E 
  3286.         will execute the instruction pointed to by the user's current PC. 
  3287.         After  the instruction is executed an ARROW ( => ) points to  the 
  3288.         next instruction to be executed.
  3289.  
  3290.         The / and * options are only valid if the next instruction to  be 
  3291.         executed  is a CALL.   If the program counter is pointing at  any 
  3292.         other instruction then the / and * have no effect.
  3293.  
  3294.  
  3295.  
  3296.                                        48
  3297.  
  3298.  
  3299.  
  3300.  
  3301.  
  3302.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  3303.  
  3304.  
  3305.         K    Set Memory Window Parameters for Use With the J Command
  3306.         ________________________________________________________________
  3307.  
  3308.         The  K  command sets the starting address and block size  of  the 
  3309.         memory  window display during the J command.   The format of  the 
  3310.         command is:
  3311.  
  3312.                   *K  ARG1 [,ARG2]
  3313.  
  3314.                   ARG1  represents  the starting address  of  the  memory 
  3315.                   block.
  3316.  
  3317.                   ARG2 is an optional size paramter, if omitted the block 
  3318.                   size defaults to the maximum.
  3319.  
  3320.         The  maximum  block size is 144 decimal which  is  90  hex.   The 
  3321.         starting  address of the memory block can be anywhere in  memory; 
  3322.         it does not have to be within the confines of the user program.
  3323.  
  3324.  
  3325.  
  3326.  
  3327.  
  3328.  
  3329.  
  3330.  
  3331.  
  3332.  
  3333.  
  3334.  
  3335.  
  3336.  
  3337.  
  3338.  
  3339.  
  3340.  
  3341.  
  3342.  
  3343.  
  3344.  
  3345.  
  3346.  
  3347.  
  3348.  
  3349.  
  3350.  
  3351.  
  3352.  
  3353.  
  3354.  
  3355.  
  3356.  
  3357.  
  3358.  
  3359.  
  3360.  
  3361.  
  3362.                                        49
  3363.  
  3364.  
  3365.  
  3366.  
  3367.  
  3368.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  3369.  
  3370.  
  3371.         L    Load file
  3372.         _________________________________________________________________
  3373.  
  3374.  
  3375.         The  L command allows the user to load files into the  TPA  after 
  3376.         the debug session has started.  The format of the command is:
  3377.  
  3378.              *L   ARG1[,ARG2]  <cr>
  3379.  
  3380.                        ARG1 is a single unambiguous file name  con-
  3381.                        forming to standard CP/M syntax rules:
  3382.                        
  3383.                             - optional  drive  name followed by  a  colon  
  3384.                        
  3385.                             - mandatory primary file name
  3386.  
  3387.                             - optional  secondary file name preceded by a 
  3388.                               period      
  3389.  
  3390.                        ARG2 is an optional load address.  If ARG2 is  not 
  3391.                        specified the named file is loaded at the start of 
  3392.                        the  TPA (address 100 hex).   If ARG2 is given the 
  3393.                        file will be loaded at this address.  Z8E will NOT 
  3394.                        relocate  individual addresses within the file  to 
  3395.                        reflect the new load address.   ARG2 may be of any 
  3396.                        type.
  3397.  
  3398.                        NOTE:  If  no arguments are entered then Z8E  will 
  3399.                               redisplay the starting address,  ending ad-
  3400.                               dress,  and the number of 256 byte pages of 
  3401.                               the last file loaded.  
  3402.  
  3403.  
  3404.         If Z8E detects a error in the file name specification the message 
  3405.         "Syntax  error"  is  printed  on  the  console  and  the  command 
  3406.         terminates.
  3407.  
  3408.         If  Z8E  is unable to locate the file on the specified drive  the 
  3409.         message  "File  not  found" is printed on  the  console  and  the 
  3410.         command terminates.
  3411.  
  3412.         Z8E contains no facilties for converting .HEX (Intel Hex  format) 
  3413.         object files to loadable memory image.   All files, regardless of 
  3414.         type,  are  loaded  into memory in exactly the same form as  they 
  3415.         appear on disk.   To debug a .HEX file the user should first load 
  3416.         the  file with the CP/M LOAD command and save the file  with  the 
  3417.         CP/M  SAVE command which produces an absolute memory image  load-
  3418.         able  by Z8E.   All .COM files are of course already in  loadable 
  3419.         form and no LOADing and SAVEing is required.
  3420.  
  3421.         If  the  file  will  not fit into the TPA,  Z8E  will  print  the 
  3422.         message:
  3423.  
  3424.              Out of memory - Continue?
  3425.  
  3426.  
  3427.  
  3428.                                        50
  3429.  
  3430.  
  3431.  
  3432.  
  3433.  
  3434.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  3435.  
  3436.  
  3437.         If  the  user answers "Y",  Z8E will resume loading the  file  at 
  3438.         address 100 hex if ARG2 was not entered, or at the address speci-
  3439.         fied as ARG2.   If the user types any other response, the loading 
  3440.         process terminates and Z8E returns to the command level. However, 
  3441.         the  user may resume loading the file at a later time by  issuing 
  3442.         the L command and specifying the file name "." (a single period).  
  3443.         The  user  may  choose  to specify a new  starting  load  address 
  3444.         following  the period;  if ARG2 is omitted then the load  address 
  3445.         defaults back to 100 hex,  the start of the TPA.  If the user has 
  3446.         done  any  subsequent  disk I/O (such as loading a  new  file  of 
  3447.         disassembling  to disk) in between the time loading was suspended 
  3448.         and then restarted,  Z8E will treat the file name "." as a syntax 
  3449.         error. 
  3450.  
  3451.         The  user may occasionally need to overlay a section of code in a 
  3452.         program which already resides in memory with input from a file on 
  3453.         disk,  for example in modifying a BIOS in preparation for MOVCPM. 
  3454.         While  this  is possible with loaders which process  .HEX  object 
  3455.         files,  it is not feasible with Z8E. The user can circumvent this 
  3456.         limitation  by loading the file from disk into an unused  section 
  3457.         of memory and then using Z8E's move command to move only the data 
  3458.         needed to accomplish the overlay.
  3459.  
  3460.  
  3461.  
  3462.  
  3463.  
  3464.  
  3465.  
  3466.  
  3467.  
  3468.  
  3469.  
  3470.  
  3471.  
  3472.  
  3473.  
  3474.  
  3475.  
  3476.  
  3477.  
  3478.  
  3479.  
  3480.  
  3481.  
  3482.  
  3483.  
  3484.  
  3485.  
  3486.  
  3487.  
  3488.  
  3489.  
  3490.  
  3491.  
  3492.  
  3493.  
  3494.                                        51
  3495.  
  3496.  
  3497.  
  3498.  
  3499.  
  3500.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  3501.  
  3502.  
  3503.         M    Move Memory 
  3504.         _________________________________________________________________
  3505.  
  3506.  
  3507.         The  M  command allows the user to move blocks of date  from  any 
  3508.         address in memory to any other address in memory.   The format of 
  3509.         the command is:
  3510.  
  3511.                   *M   ARG1  ARG2  ARG3  
  3512.  
  3513.                        where   ARG1  =  the   starting  address  of   the 
  3514.                                         source data block        
  3515.                                
  3516.                                ARG2  =  the  ending address of the source 
  3517.                                         data block
  3518.  
  3519.                                ARG3  =  the   starting  address  of   the 
  3520.                                         destination data block   
  3521.  
  3522.  
  3523.                                         arguments may be of any type
  3524.  
  3525.         Z8E automatically decides whether a head-to-head or  tail-to-tail 
  3526.         move  is  required based on the three arguments  entered.   If  a 
  3527.         head-to-head  move  is needed then the first byte of  the  source 
  3528.         data  block  will  be written to the first byte position  of  the 
  3529.         destination data block;  the second byte of the source data block 
  3530.         will  be written to the second byte position of  the  destination 
  3531.         data block, and so on until the ending address of the destination 
  3532.         data block is reached. 
  3533.  
  3534.         On  the other hand,  if a tail-to-tail move is necessary Z8E will 
  3535.         move  the  last byte of the source data block to  the  last  byte 
  3536.         position of the destination data block, followed by the second to 
  3537.         last  byte  of the source data block to the second to  last  byte 
  3538.         position  of  the  destination data block,  and so on  until  the 
  3539.         starting address of the destination block is reached.  
  3540.  
  3541.         A  tail to tail move would be necessary in the following  example 
  3542.         to prevent the overwriting of the destination data block:
  3543.  
  3544.                   *M  1000 100F 1008
  3545.  
  3546.  
  3547.  
  3548.  
  3549.  
  3550.  
  3551.  
  3552.  
  3553.  
  3554.  
  3555.  
  3556.  
  3557.  
  3558.  
  3559.  
  3560.                                        52
  3561.  
  3562.  
  3563.  
  3564.  
  3565.  
  3566.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  3567.  
  3568.  
  3569.         N    Output to I/O Ports Without Pre-Read
  3570.         _________________________________________________________________
  3571.  
  3572.  
  3573.         This  command allows the user to output data to an I/O port with-
  3574.         out  first reading the port (as occurs in the  Q  command).   The 
  3575.         format of the command is:
  3576.  
  3577.                         *N   [ARG1]
  3578.  
  3579.                                where ARG1 is the port number to which the 
  3580.                                      data will be written.
  3581.  
  3582.                                      If ARG1 is omitted then Z8E uses the 
  3583.                                      last  port  address which  had  been 
  3584.                                      input by a previous N or Q command. 
  3585.  
  3586.         Z8E will prompt the user by displaying the current port number on 
  3587.         the  left hand side of the console and postioning the cursor  two 
  3588.         spaces the the right.   At this point the user can enter the data 
  3589.         to  be sent to the port in the form of an  ARGUMENT-STRING.   The 
  3590.         ARGUMENT-STRING  allows  the user to mix various  argument  types 
  3591.         such as hex data and ASCII literal strings.   Of course the  user 
  3592.         can  elect to merely output single bytes if desired.   The N com-
  3593.         mand  is particularly useful when programming various  Z80  peri-
  3594.         pheral  chips such as the DMA and SIO chips which expect  initia-
  3595.         lization bytes to arrive in a stream without intervening reads.
  3596.  
  3597.                         *N 80
  3598.                         80  'T',00,12#,998
  3599.  
  3600.                         This  ARGUMENT-STRING would be evaluated into the 
  3601.                         5 bytes:  54 00 0C 09 98.  These five bytes would 
  3602.                         be sent to port 80 via an OTIR  instruction.   No 
  3603.                         delay occurs between successive bytes.  
  3604.  
  3605.         After the data has been entered and after it has been sent to the 
  3606.         I/O  port  Z8E  reprompts the user by displaying  the  same  port 
  3607.         number.   This  gives the user to oppportunity to send  addtional 
  3608.         data  to the same port.   However,  by not entering data the user 
  3609.         can  change  the  current port address by  entering  any  of  the 
  3610.         following:
  3611.  
  3612.  
  3613.  
  3614.  
  3615.  
  3616.  
  3617.  
  3618.  
  3619.  
  3620.  
  3621.  
  3622.  
  3623.  
  3624.  
  3625.  
  3626.                                        53
  3627.  
  3628.  
  3629.  
  3630.  
  3631.  
  3632.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  3633.  
  3634.  
  3635.  
  3636.                 CARRIAGE    The next sequential port number in  ascending 
  3637.                  RETURN     order becomes the current port address.
  3638.  
  3639.                 UP ARROW    The next sequential port number in descending 
  3640.                             order becomes the current port address.
  3641.  
  3642.                  =ARG       Any argument appearing immediately after  the 
  3643.                             equal  sign  (no intervening spaces) is  eva-
  3644.                             luated as an 8 bit number, and if found to be 
  3645.                             valid  then it becomes the new  current  port 
  3646.                             address.
  3647.  
  3648.                 PERIOD      Terminate command
  3649.  
  3650.  
  3651.         The  user  can  also monitor an I/O port with the  N  command  by 
  3652.         enclosing  the  port number on the command line  in  parentheses. 
  3653.         Monitor  mode  via  the N command is identical to that of  the  Q 
  3654.         command (see Q command).
  3655.  
  3656.  
  3657.  
  3658.  
  3659.  
  3660.  
  3661.  
  3662.  
  3663.  
  3664.  
  3665.  
  3666.  
  3667.  
  3668.  
  3669.  
  3670.  
  3671.  
  3672.  
  3673.  
  3674.  
  3675.  
  3676.  
  3677.  
  3678.  
  3679.  
  3680.  
  3681.  
  3682.  
  3683.  
  3684.  
  3685.  
  3686.  
  3687.  
  3688.  
  3689.  
  3690.  
  3691.  
  3692.                                        54
  3693.  
  3694.  
  3695.  
  3696.  
  3697.  
  3698.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  3699.  
  3700.  
  3701.         O    Output Current Breakpoints to Console
  3702.         _________________________________________________________________
  3703.  
  3704.  
  3705.         The  O command allows the user to view all breakpoints  currently 
  3706.         in effect.  The format of the command is:
  3707.  
  3708.                   *O  
  3709.  
  3710.                        no arguments are required
  3711.  
  3712.         If  Z8E  finds  a symbol name corresponding to the  absolute  hex 
  3713.         address of a breakpoint address in the symbol table (if a  symbol 
  3714.         table  exists) then the symbol name as well as the memory address 
  3715.         is displayed.  If no symbol corresponding to the address is found 
  3716.         only the hex address is displayed.  
  3717.  
  3718.         If  any  pass counts are currently in effect they  are  displayed 
  3719.         next to the breakpoint address with which they are associated.
  3720.  
  3721.  
  3722.  
  3723.  
  3724.  
  3725.  
  3726.  
  3727.  
  3728.  
  3729.  
  3730.  
  3731.  
  3732.  
  3733.  
  3734.  
  3735.  
  3736.  
  3737.  
  3738.  
  3739.  
  3740.  
  3741.  
  3742.  
  3743.  
  3744.  
  3745.  
  3746.  
  3747.  
  3748.  
  3749.  
  3750.  
  3751.  
  3752.  
  3753.  
  3754.  
  3755.  
  3756.  
  3757.  
  3758.                                        55
  3759.  
  3760.  
  3761.  
  3762.  
  3763.  
  3764.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  3765.  
  3766.  
  3767.         P    Examine/Modify PSW (Flag Register)
  3768.         _________________________________________________________________
  3769.  
  3770.  
  3771.         The  P  command  provides a convenient method  of  examining  and 
  3772.         optionally  modifying  the F(lag) register in the  user  register 
  3773.         set.  The format of the command is:
  3774.  
  3775.              *P
  3776.  
  3777.                   no arguments are required on the command line
  3778.  
  3779.         Upon  receipt of the P command Z8E displays the mnemonics corres-
  3780.         ponding  to  the current state of the four  user-modifiable  bits 
  3781.         (sign, carry, zero, parity) in Flag register:
  3782.  
  3783.  
  3784.              MNEMONIC            MEANING             BIT STATUS
  3785.  
  3786.                 P                positive               reset
  3787.                 M                 minus                  set
  3788.  
  3789.                 NC               no carry               reset
  3790.                 C                 carry                  set
  3791.  
  3792.                 PO              parity odd              reset
  3793.                 PE              parity even              set
  3794.  
  3795.                 NZ               not zero               reset
  3796.                 Z                  zero                  set 
  3797.  
  3798.  
  3799.         Z8E  prints  the mnemonic corresponding to the current  state  of 
  3800.         each  of  the  four  flag  bits.   Z8E  then  issues  a  carriage 
  3801.         return/line feed and pauses for user input.   The user may modify 
  3802.         any  of  the four flag bits by typing  the  appropriate  mnemonic 
  3803.         followed  by  a  carriage return.   The user may  enter  multiple 
  3804.         mnemonics by separating each one with a space.  
  3805.  
  3806.         If  no mnemonics are entered,  no flags bits are altered and  the 
  3807.         command terminates.
  3808.  
  3809.         If an invalid flag bit mnemonic is entered Z8E prints a  question 
  3810.         mark.
  3811.  
  3812.  
  3813.  
  3814.  
  3815.  
  3816.  
  3817.  
  3818.  
  3819.  
  3820.  
  3821.  
  3822.  
  3823.  
  3824.                                        56
  3825.  
  3826.  
  3827.  
  3828.  
  3829.  
  3830.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  3831.  
  3832.  
  3833.         Q    Query I/O Ports
  3834.         _________________________________________________________________
  3835.  
  3836.         The  Q  command allows the user flexible access to I/O  ports  by 
  3837.         providing  the ability to perform single byte  input,  continuous 
  3838.         input (monitor mode), and single or multi-byte output following a 
  3839.         pre-read of the port. The format of the command is:
  3840.          
  3841.              *Q   [(] [ARG1] [)]
  3842.  
  3843.                        where ARG1 is an 8 bit port address in the range
  3844.                        0 - 255
  3845.  
  3846.                        ARG1 may be any symbol type,  however if a 16  bit 
  3847.                        value  is  specified  only the low order  byte  is 
  3848.                        significant 
  3849.  
  3850.                        If  no  argument is given Z8E will  use  the  most 
  3851.                        recent port number as entered by the user via an N 
  3852.                        or Q command.
  3853.  
  3854.                        If  ARG1 is enclosed in parentheses Z8E will enter 
  3855.                        MONITOR MODE.
  3856.  
  3857.  
  3858.         Upon  receipt  of ARG1 Z8E will read the specified I/O  port  and 
  3859.         display  the byte read as both 8 bit hexadecimal value  and  it's 
  3860.         ASCII equivalent.  Command options once a byte has been read from 
  3861.         the I/O port are as follows:
  3862.  
  3863.                                                                                          
  3864.              SINGLE BYTE INPUT
  3865.  
  3866.                 By  entering  a SPACE immediately  following  the 
  3867.                 displayed  contents of the I/O port the user  can 
  3868.                 instruct  Z8E to continue reading from  the  same 
  3869.                 I/O port:
  3870.  
  3871.                                *Q EE
  3872.                                EE   24  $  <space>
  3873.                                EE   24  $
  3874.                           
  3875.                 
  3876.                 By  entering a CARRIAGE RETURN following the dis-
  3877.                 played  contents  of the I/O port  the  user  can 
  3878.                 instruct   Z8E  to  read  the  next  port  number 
  3879.                 (ascending order):
  3880.  
  3881.                                *Q EE
  3882.                                EE   24  $  <cr>
  3883.                                EF   C1  A
  3884.  
  3885.  
  3886.                 By  entering a caret "^" following the  displayed 
  3887.                 contents  of the I/O port the user  can  instruct 
  3888.  
  3889.  
  3890.                                        57
  3891.  
  3892.  
  3893.  
  3894.  
  3895.  
  3896.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  3897.  
  3898.  
  3899.                 Z8E  to read the previous port number (descending 
  3900.                 order):
  3901.  
  3902.                                *Q EE
  3903.                                EE   24  $  ^  (up arrow entered by user)
  3904.                                ED   06  ~                       
  3905.  
  3906.  
  3907.                 By entering an equal sign "=" followed by a valid 
  3908.                 argument,  the  user can switch to reading a  new 
  3909.                 port address:
  3910.  
  3911.                                *Q EE
  3912.                                EE   24  '$'  =90 
  3913.                                90   BF  '?'             
  3914.  
  3915.  
  3916.              CONTINUOUS INPUT (MONITOR MODE)
  3917.  
  3918.                 Z8E provides the user with the ability to monitor 
  3919.                 an  input  port.   Z8E will continously read  the 
  3920.                 selected  input port and display the contents  on 
  3921.                 the  screen.   Z8E displays the byte in both  hex 
  3922.                 and  binary.   This  feature is  useful  in  the 
  3923.                 testing  of I/O ports.  Depressing any key on the 
  3924.                 keyboard exits monitor mode.    
  3925.  
  3926.              MULTI-BYTE OUTPUT 
  3927.  
  3928.                 Following  the  read of an I/O port the user  may 
  3929.                 elect  to  output data.  The user  may  enter  an 
  3930.                 ARGUMENT-STRING which will be sent to the port on 
  3931.                 a  byte  by byte basis with no intervening  reads 
  3932.                 between outputs as shown below:
  3933.  
  3934.                         *Q 50
  3935.                         50  44  'D' 23,9,'B2E',00,F723,81
  3936.                                     ^                   ^
  3937.                                     string  as entered by 
  3938.                                     user appears  between 
  3939.                                     arrows
  3940.  
  3941.                 The  data as entered by the user in this  example 
  3942.                 would  first  be converted to the 9  bytes  shown 
  3943.                 below:
  3944.                            23 09 42 32 45 00 F7 23 81
  3945.  
  3946.                 These  9 bytes would then be sent to port 50  one 
  3947.                 byte  after another without any intervening reads 
  3948.                 or status checks.
  3949.  
  3950.  
  3951.  
  3952.  
  3953.  
  3954.  
  3955.  
  3956.                                        58
  3957.  
  3958.  
  3959.  
  3960.  
  3961.  
  3962.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  3963.  
  3964.  
  3965.         R    Examine/Modify Register Contents
  3966.         _________________________________________________________________
  3967.  
  3968.  
  3969.         The  R  command allows the user to examine and optionally  modify 
  3970.         registers  and  register pairs in the  user  register  set.   The 
  3971.         format of the command is:
  3972.  
  3973.                   *R   ARG1  <cr> or space
  3974.  
  3975.                        where  ARG1  is any of the 22  register  mnemonics 
  3976.                        listed below:
  3977.  
  3978.                              A    B    C    D    E    H    L
  3979.                              AF   BC   DE   HL   IX   IY   SP
  3980.                              AF'  BC'  DE'  HL'  I    R    P    PC
  3981.  
  3982.                             (the  program  counter may  be  specified  as 
  3983.                             either P or PC)
  3984.  
  3985.         To  examine a register the user enters a mnemonic from the  above 
  3986.         list followed by a carriage return or a space.   Z8E will display 
  3987.         the  current contents of the register on the same line.   At this 
  3988.         point the user has the option of entering an argument of any type 
  3989.         if  the  contents  of the register or register  pair  are  to  be 
  3990.         changed.    The  replacement value may be terminated by either  a 
  3991.         carriage  return or a space.  If no value is entered Z8E issues a 
  3992.         carriage return/line feed and waits for the next register  mnemo-
  3993.         nic to be entered.
  3994.  
  3995.         If  the user specifies a 16 bit value as the new contents of an 8 
  3996.         bit register only the low order byte of the value is used.
  3997.  
  3998.         The command terminates when a carriage return or space is entered 
  3999.         when Z8E is waiting for a register mnemonic.
  4000.  
  4001.  
  4002.  
  4003.  
  4004.  
  4005.  
  4006.  
  4007.  
  4008.  
  4009.  
  4010.  
  4011.  
  4012.  
  4013.  
  4014.  
  4015.  
  4016.  
  4017.  
  4018.  
  4019.  
  4020.  
  4021.  
  4022.                                        59
  4023.  
  4024.  
  4025.  
  4026.  
  4027.  
  4028.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  4029.  
  4030.  
  4031.         S    Single Step
  4032.         _________________________________________________________________
  4033.  
  4034.                                       
  4035.         The S command allows the user to execute a program instruction by 
  4036.         instruction.   The  S  command provides for full tracing  of  the 
  4037.         user program.  The format of the command is:
  4038.  
  4039.              *S   [/] [ARG1]  <cr>
  4040.                        
  4041.                        where  ARG1 is the number of instructions to  exe-
  4042.                        cute in the user program,  if no argument is given 
  4043.                        Z8E defaults to 1
  4044.                        
  4045.                        ARG1 may be of any type
  4046.  
  4047.         The slash "/" allows the user control over the tracing of subrou-
  4048.         tines.  If  a slash is included before the count (if a  count  is 
  4049.         entered),  or  if the slash is the only character on the  command 
  4050.         line  then subroutines will not be traced.   A slash affects only 
  4051.         CALL  instructions which lie within the range of  ARG1.   In  the 
  4052.         most  typical  case no ARG1 is present and the single step  count 
  4053.         defaults  to 1.   If the current PC,  1000 in  this  example,  is 
  4054.         pointing to a call instruction then the command:
  4055.  
  4056.                             *S /
  4057.  
  4058.                   1000  CD 56 30  RASRTN: CALL  ANYSUB
  4059.                   1003  FE 04             CP    4
  4060.                   1005  CA 17 10          JP    Z,AHEAD
  4061.  
  4062.  
  4063.         will  cause  the  entire  subroutine ANYSUB to  be  executed  and 
  4064.         control  will  return to the user at address 1003.   
  4065.  
  4066.         If ARG1 is omitted Z8E will transfer control to the user  program 
  4067.         and  one instruction,  the one pointed to by the current contents 
  4068.         of the user's program counter,  will be executed.   Following the 
  4069.         execution  of the instruction (or group of instructions  if  ARG2 
  4070.         was  greater  than 1) Z8E regains control and automatically  dis-
  4071.         plays the current contents of all the user registers.
  4072.  
  4073.         The  user may optionally indicate that more than one  instruction 
  4074.         is  to  be executed by entering a value greater than 1 for  ARG1.  
  4075.         Z8E will transfer control to the user program and regain  control 
  4076.         only  when  the specified number of instructions have  been  exe-
  4077.         cuted.   This feature is useful in debugging small loops; in that 
  4078.         the  user can set ARG1 equal to the number of instructions in the 
  4079.         range of the loop.   Z8E will display the register contents after 
  4080.         each  instruction of the loop is executed and return  control  to 
  4081.         the user after every iteration of the loop.
  4082.  
  4083.         The  single  step command always causes the execution of the  in-
  4084.         struction  pointed to by the current contents of the user's  pro-
  4085.         gram counter.   This is the instruction that appears in disassem-
  4086.  
  4087.  
  4088.                                        60
  4089.  
  4090.  
  4091.  
  4092.  
  4093.  
  4094.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  4095.  
  4096.  
  4097.         bled  form  as  part of the output of the  "X"  command  (display 
  4098.         machine  state).   Bear in mind that ARG1 is not the  address  at 
  4099.         which single stepping is to begin; it is a count to the number of 
  4100.         instructions  to execute.   If the user desires to single step at 
  4101.         an  address other than the one contained in the program  counter, 
  4102.         then  the PC register must be modified via the R  command  before 
  4103.         the single step command is issued to Z8E.
  4104.  
  4105.         Allowing  the  convenience of entering "S" <cr>  to  execute  one 
  4106.         instruction has the side effect of not allowing the user to abort 
  4107.         the  command in between the time the "S" is typed and the <cr> is 
  4108.         entered by simply omitting an argument and typing <cr>.   If  you 
  4109.         change your mind and want to cancel the command, type in an inva-
  4110.         lid  argument  as ARG1.   This will cause a question mark  to  be 
  4111.         displayed; however, no instruction will be executed. 
  4112.  
  4113.         During  block  tracing (ARG1 greater than 1) the command  may  be 
  4114.         terminated by hitting any key on the keyboard.
  4115.  
  4116.         The  S command does not relocate instructions before execution as 
  4117.         does the G command (see G command).  Hence, it is not possible to 
  4118.         single step through each iteration of a DJNZ $ instruction.
  4119.  
  4120.  
  4121.  
  4122.  
  4123.  
  4124.  
  4125.  
  4126.  
  4127.  
  4128.  
  4129.  
  4130.  
  4131.  
  4132.  
  4133.  
  4134.  
  4135.  
  4136.  
  4137.  
  4138.  
  4139.  
  4140.  
  4141.  
  4142.  
  4143.  
  4144.  
  4145.  
  4146.  
  4147.  
  4148.  
  4149.  
  4150.  
  4151.  
  4152.  
  4153.  
  4154.                                        61
  4155.  
  4156.  
  4157.  
  4158.  
  4159.  
  4160.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  4161.  
  4162.  
  4163.         U    Write Symbol Table to Disk
  4164.         _________________________________________________________________
  4165.  
  4166.  
  4167.         The  U command allows the user to write the current symbol  table 
  4168.         to a disk file.  The format of the command is:
  4169.  
  4170.                   
  4171.              *U   ARG1
  4172.  
  4173.                        ARG1  is the name of the file to which the  symbol 
  4174.                        table is to be written.
  4175.  
  4176.         This  command is useful to save any symbol names entered  by  the 
  4177.         user  via the A command.   The entire symbol table is written  to 
  4178.         disk using the format of a .SYM file (see appendix A).  The table 
  4179.         can be subsequently loaded at the next invokation of Z8E.
  4180.  
  4181.         Note  that since the file is stored as a .SYM formatted file  the 
  4182.         user should use a  file name extension that begin with the letter 
  4183.         "S".   This  is due to the fact that the next time Z8E loads this 
  4184.         symbol  file it will examine the the first character of the  file 
  4185.         name extension.   If the first character is an "S" the format  is 
  4186.         assumed to be .SYM and the symbol table is built accordingly; the 
  4187.         appearance  of any other letter is taken to indicate a .PRN file.  
  4188.  
  4189.         If  a file with the name ARG1 already exists on disk it  will  be 
  4190.         deleted. 
  4191.  
  4192.  
  4193.  
  4194.  
  4195.  
  4196.  
  4197.  
  4198.  
  4199.  
  4200.  
  4201.  
  4202.  
  4203.  
  4204.  
  4205.  
  4206.  
  4207.  
  4208.  
  4209.  
  4210.  
  4211.  
  4212.  
  4213.  
  4214.  
  4215.  
  4216.  
  4217.  
  4218.  
  4219.  
  4220.                                        62
  4221.  
  4222.  
  4223.  
  4224.  
  4225.  
  4226.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  4227.  
  4228.  
  4229.         V    Verify two memory blocks
  4230.         _________________________________________________________________
  4231.  
  4232.  
  4233.         The  V  command allows the user to compare two blocks of  memory. 
  4234.         Z8E will display all differences between the two.   The format of 
  4235.         the command is:
  4236.  
  4237.              *V   ARG1  ARG2  ARG3
  4238.  
  4239.                   where  ARG1  =  the starting address of memory block 1
  4240.  
  4241.                          ARG2  =  the ending address of memory block 1
  4242.  
  4243.                          ARG3  =  the starting address of memory block 2
  4244.  
  4245.         Z8E compares memory block 1 to memory block 2 byte by byte.  If a 
  4246.         mismatch  occurs  Z8E will display the address in each  block  at 
  4247.         which  the mismatch was found,  as well as the byte contained  at 
  4248.         each address.   The comparison continues until the ending address 
  4249.         is reached.
  4250.  
  4251.         The  user may halt the command at any time by depressing any  key 
  4252.         on the keyboard.
  4253.  
  4254.  
  4255.  
  4256.  
  4257.  
  4258.  
  4259.  
  4260.  
  4261.  
  4262.  
  4263.  
  4264.  
  4265.  
  4266.  
  4267.  
  4268.  
  4269.  
  4270.  
  4271.  
  4272.  
  4273.  
  4274.  
  4275.  
  4276.  
  4277.  
  4278.  
  4279.  
  4280.  
  4281.  
  4282.  
  4283.  
  4284.  
  4285.  
  4286.                                        63
  4287.  
  4288.  
  4289.  
  4290.  
  4291.  
  4292.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  4293.  
  4294.  
  4295.         W    write memory to disk
  4296.         _________________________________________________________________
  4297.  
  4298.  
  4299.         The  W command allows the user to write the contents of memory to 
  4300.         a disk file. The format of the command is:
  4301.  
  4302.                   *W  arg1 [arg2  arg3]
  4303.  
  4304.                        ARG1  is the name of a file to which writing  will 
  4305.                        take place. 
  4306.  
  4307.                        ARG2 and ARG3 are the optional starting and ending 
  4308.                        addresses  of the portion of memory to be  written 
  4309.                        to  the disk.   If the addresses omitted then  the 
  4310.                        memory  block  to  be written is  defined  by  the 
  4311.                        starting  and  ending addresses of the  last  file 
  4312.                        loaded.   These  addresses can be  redisplayed  by 
  4313.                        entering the I command with no arguments.
  4314.  
  4315.  
  4316.         Z8E  always  deletes any file on disk whose name is the  same  as 
  4317.         ARG1.  If no file by this name exists then Z8E will automatically 
  4318.         create it.
  4319.  
  4320.         Z8E will echo the starting memory address and continually  update 
  4321.         the ending memory address as the writing to disk takes place.
  4322.  
  4323.  
  4324.  
  4325.  
  4326.  
  4327.  
  4328.  
  4329.  
  4330.  
  4331.  
  4332.  
  4333.  
  4334.  
  4335.  
  4336.  
  4337.  
  4338.  
  4339.  
  4340.  
  4341.  
  4342.  
  4343.  
  4344.  
  4345.  
  4346.  
  4347.  
  4348.  
  4349.  
  4350.  
  4351.  
  4352.                                        64
  4353.  
  4354.  
  4355.  
  4356.  
  4357.  
  4358.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  4359.  
  4360.  
  4361.         X    display machine state
  4362.         _________________________________________________________________
  4363.  
  4364.  
  4365.         The   X  command  displays  the  current  contents  of  all  user 
  4366.         registers.  The format of the command is:
  4367.  
  4368.                   *X   
  4369.  
  4370.                        no arguments are required
  4371.  
  4372.         Z8E  displays displays all registers,  except the I register  and 
  4373.         the R register,  on two lines of the console.   In addition,  the 
  4374.         instruction pointed to by the user's program counter is disassem-
  4375.         bled and displayed on the second line.   Think of this as the "on 
  4376.         deck"  instruction:   the instruction that will be executed  upon 
  4377.         the receipt of the next G (GO) or S (SINGLE STEP) command.
  4378.  
  4379.         To inspect the I or R registers use the R command.
  4380.  
  4381.  
  4382.  
  4383.  
  4384.  
  4385.  
  4386.  
  4387.  
  4388.  
  4389.  
  4390.  
  4391.  
  4392.  
  4393.  
  4394.  
  4395.  
  4396.  
  4397.  
  4398.  
  4399.  
  4400.  
  4401.  
  4402.  
  4403.  
  4404.  
  4405.  
  4406.  
  4407.  
  4408.  
  4409.  
  4410.  
  4411.  
  4412.  
  4413.  
  4414.  
  4415.  
  4416.  
  4417.  
  4418.                                        65
  4419.  
  4420.  
  4421.  
  4422.  
  4423.  
  4424.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  4425.  
  4426.  
  4427.         Y    fill memory
  4428.         _________________________________________________________________
  4429.  
  4430.  
  4431.         The  Y command fills a user specified block of memory with a user 
  4432.         specified  pattern of bytes,  the length of which is limited only 
  4433.         by the length of Z8E's input buffer which is 80 bytes long:
  4434.  
  4435.                   *Y  ARG1  ARG2  ARG3  <cr>
  4436.  
  4437.                        where  ARG1  =  the  starting address of the block 
  4438.                                        to fill
  4439.  
  4440.                               ARG2  =  the ending address of the block to 
  4441.                                        fill
  4442.  
  4443.                               ARG3  =  is the data pattern to be  written 
  4444.                                        to  memory.   ARG3 is evaluated by 
  4445.                                        Z8E as type ARGUMENT-STRING  which 
  4446.                                        may  be of any length in the range 
  4447.                                        of  1 through the number of  bytes 
  4448.                                        remaining in the input buffer once 
  4449.                                        ARG1 and ARG2 have been input.
  4450.  
  4451.  
  4452.         The Y command gives the user the capability to initialize memory 
  4453.         to  any  data pattern.   The capability  of  entering  multi-byte 
  4454.         strings  as the data pattern with which to fill memory allows the 
  4455.         user to store repeating patterns of data in memory with a  single 
  4456.         command. For example if the user entered the command:
  4457.  
  4458.                   *Y 1000 127C 'abcd',16,77
  4459.  
  4460.         Z8E  would  begin writing the 6 byte pattern  (61 62 63 64 16 77) 
  4461.         entered  as ARG3 starting at address 1000.   This  pattern  would 
  4462.         repeat at address 1006, 100C, 1012, etc. 
  4463.  
  4464.         The command ends after a byte is written to the ARG2 address even 
  4465.         if  this byte does not represent the last byte in the ARG3 block.  
  4466.         In the above example the command would end when a byte is written 
  4467.         to address 127C even if that byte is not 77. 
  4468.  
  4469.  
  4470.  
  4471.  
  4472.  
  4473.  
  4474.  
  4475.  
  4476.  
  4477.  
  4478.  
  4479.  
  4480.  
  4481.  
  4482.  
  4483.  
  4484.                                        66
  4485.  
  4486.  
  4487.  
  4488.  
  4489.  
  4490.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  4491.  
  4492.  
  4493.         Z    disassemble command
  4494.         _________________________________________________________________
  4495.  
  4496.  
  4497.         The  Z  command allows the user to disassemble a block  of  data.  
  4498.         Z8E  performs  disassembly,  which is the translation  of  binary 
  4499.         memory data into source code format,  using the full Z80 instruc-
  4500.         tion set and Zilog mnemonics.   The resultant source code may  be 
  4501.         directed  to the console or to the console and a disk file simul-
  4502.         taneously.  Z8E also allows the user to disassemble interactively 
  4503.         when ARG2 is equal to 1. The format of the command is:
  4504.  
  4505.                   *Z  ARG1 [ARG2 ARG3]  <cr>
  4506.  
  4507.                        where   ARG1  =   the start address at which disa-
  4508.                                          ssembly is to begin
  4509.  
  4510.                                ARG2  =   is  optional and represents  the 
  4511.                                          upper  limit of the  disassembly 
  4512.                                          process (see details below)
  4513.  
  4514.                                ARG3  =   is  an optional file name speci-
  4515.                                          fication for disassembly to disk       
  4516.  
  4517.                        ARG1 may be of any argument type.  
  4518.  
  4519.                        ARG2  is  treated in one of two ways depending  on 
  4520.                        its  value:  
  4521.  
  4522.                          1) If  ARG2 evaluates to a number between 1  and 
  4523.                             255  (decimal) Z8E will disassemble in "block 
  4524.                             mode" and ARG2 becomes a count of the  number 
  4525.                             of instructions per block to disassemble.  As 
  4526.                             will  be  explained below,  Z8E pauses  after 
  4527.                             each  block  is disassembled and  allows  the 
  4528.                             user to continue or to terminate the command.
  4529.  
  4530.                             If ARG2 is omitted altogether a default block 
  4531.                             size of 1 is used.  
  4532.                             
  4533.                             Whenever ARG2 equals 1,  either explicitly or 
  4534.                             by default,  Z8E allows interactive disassem-
  4535.                             bly which allows the user to choose the  out-
  4536.                             put  format of the data.   Interactive disas-
  4537.                             sembly is discussed below.
  4538.  
  4539.                          2) If  ARG2 evaluates to a number  greater  than 
  4540.                             255  it  is assumed to be an ending  address.  
  4541.                             In  this case disassembly will  proceed  from 
  4542.                             starting  address  (ARG1) to  ending  address 
  4543.                             (ARG2) and no user intervention is required.
  4544.  
  4545.                        ARG3,  if present,  is assumed to be the name of a 
  4546.                        disk  file into which the disassembled output will 
  4547.                        be written.   Z8E searches the specified disk  for 
  4548.  
  4549.  
  4550.                                        67
  4551.  
  4552.  
  4553.  
  4554.  
  4555.  
  4556.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  4557.  
  4558.  
  4559.                        the  named file.   If the file is found,  then all 
  4560.                        disassembled output will be written to  it,  over-
  4561.                        writing any data that existed there.   If the file 
  4562.                        does  not exist the file will be created using the 
  4563.                        name specified in ARG3.  
  4564.  
  4565.                        NOTE:  If  ARG3 is present ARG2 must be explicitly 
  4566.                        specified, otherwise Z8E will mistakenly treat the 
  4567.                        file name as ARG2.
  4568.  
  4569.         Z8E outputs to the console using the following format:
  4570.  
  4571.              ADDRESS      OBJECT CODE      LABEL:   OPCODE    OPERAND
  4572.  
  4573.  
  4574.         Z8E writes to disk using the following formart:
  4575.                                            
  4576.                                            LABEL:   OPCODE    OPERAND
  4577.  
  4578.         Z8E  disassembles  memory block by block in  the  user  specified 
  4579.         block  size.   After  each  block is output Z8E pauses  for  user 
  4580.         input.   A carriage return input by the user terminates the  com-
  4581.         mand,  while  any  other  character causes the next block  to  be 
  4582.         disassembled (unless interactive mode is in effect).  Perhaps the 
  4583.         most convenient way to disassemble is to specify a count of  one, 
  4584.         either explicity or by omitting ARG2, and to use the space bar as 
  4585.         an  on/off switch.   Holding down the space bar produces  output, 
  4586.         releasing  the  space  bar ends output.
  4587.  
  4588.         Z8E's  disassembler is especially powerful when used in  conjunc-
  4589.         tion  with the symbol facility.   By building a symbol table with 
  4590.         both  .PRN and .SYM files,  and/or creating user  defined  symbol 
  4591.         names  via  the  A command,  the user can virtually  recreate  an 
  4592.         assembler output listing (minus the comments) with Z8E  inserting 
  4593.         labels and symbolic operands wherever possible.
  4594.  
  4595.         If  Z8E cannot match  an operand in the disassembled  instruction 
  4596.         to  a corresponding symbol in the symbol table,  or if no  symbol 
  4597.         table exists, Z8E uses the hexadecimal value.
  4598.  
  4599.         If multiple symbols in the symbol table are equal to the same  16 
  4600.         bit  value  or address,  Z8E disassembles using the first  symbol 
  4601.         name  encountered  in  the search of the symbol  table  which  is 
  4602.         equated to the 16 bit operand specified in the instruction  being 
  4603.         disassembled.  This   will unavoidably produce an occasional mis-
  4604.         named  operand when more than one symbol name is equated  to  the 
  4605.         same  16  bit value.  
  4606.  
  4607.         Z8E  does not substitute symbol names in those  Z80  instructions 
  4608.         which reference 8 bit immediate data (ie.  LD  A,24H).  Eight bit 
  4609.         immediate  data  is disassembled as a quoted ASCII  character  if 
  4610.         it's absolute value is in the range 20 hex to 7E hex;  otherwise, 
  4611.         it is disassembled as a hex byte.
  4612.  
  4613.         Output by Z8E to a disk file is instantly assemblable by most any 
  4614.  
  4615.  
  4616.                                        68
  4617.  
  4618.  
  4619.  
  4620.  
  4621.  
  4622.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  4623.  
  4624.  
  4625.         assembler which accepts Zilog mnemonics without any modifications 
  4626.         other than adding an END statement at the end of the file.
  4627.  
  4628.         When  disassembling a block of memory (starting address to ending 
  4629.         address)  the  disassembly process may be halted at any  time  by 
  4630.         depressing any key on the keyboard.
  4631.  
  4632.         Interactive  disassembly allows the user to specify the format of 
  4633.         the source code produced by disassembly on a line by line  basis.  
  4634.         Interactive  mode,  which  is always in effect whenever  ARG2  is 
  4635.         equal to 1,  causes Z8E to pause after each instruction is disas-
  4636.         sembled.   This  pause for input permits the user to enter one of 
  4637.         the following commands to choose the desired output format:
  4638.  
  4639.  
  4640.             CHARACTER            OUTPUT FORMAT         EXAMPLE
  4641.  
  4642.              
  4643.                 A                 ASCII DEFB          DEFB   'Q'
  4644.  
  4645.                 B                  HEX DEFB           DEFB   23H    
  4646.  
  4647.                 C                    CODE             EX     DE,HL
  4648.  
  4649.                 D                  HEX DEFW           DEFW   02FCH  or    
  4650.                                                       DEFW   LABEL
  4651.  
  4652.                 ;                 add COMMENT         ;This is a Comment     
  4653.  
  4654.              carriage           (terminate command)
  4655.               return
  4656.            
  4657.              any other           PROCEED TO THE
  4658.              character          NEXT INSTRUCTION     
  4659.  
  4660.  
  4661.              ASCII DEFB:
  4662.              The  contents of memory at the current disassembly  ad-
  4663.              dress is converted to a quoted ASCII character.  Values 
  4664.              less  than hexadecimal 20 (ASCII space) or greater than 
  4665.              hexadecimal  7E  (ASCII tilde) cannot  be  disassembled 
  4666.              into this format.  
  4667.  
  4668.              HEX DEFB:
  4669.              The 8 bit contents of memory at the current disassembly 
  4670.              address are converted to a hex byte.
  4671.  
  4672.              CODE:
  4673.              This  is the normal default for  disassembly.   As  Z8E 
  4674.              moves  on  to a new address it will always display  the 
  4675.              contents  of memory as a Z80 instruction.   The "C"  is 
  4676.              only  needed to redisplay the contents of memory as  an 
  4677.              instruction had one of the other characters (A,  B,  or 
  4678.              D) already have been entered. 
  4679.  
  4680.  
  4681.  
  4682.                                        69
  4683.  
  4684.  
  4685.  
  4686.  
  4687.  
  4688.         Z8E - Z80 DEBUG MONITOR                              Rick Surwilo
  4689.  
  4690.  
  4691.              HEX DEFW:
  4692.              The contents of the two bytes of memory starting at the 
  4693.              loaction of the current disassembly address are  output 
  4694.              as  a  define  word directive.   The  byte  pointed  to 
  4695.              directly by the current disassembly address becomes the 
  4696.              low order byte of the operand.  The byte at disassembly 
  4697.              address plus one becomes the high order byte.
  4698.  
  4699.              NOTE:
  4700.                     If  Z8E had just disassembled  a  multi-
  4701.                     byte  Z80  instruction and the user  en-
  4702.                     tered any of the characters listed above 
  4703.                     (A,  B, C, or D) only the first byte, or 
  4704.                     first  two for "D",  of the  instruction 
  4705.                     would  be  converted  to  the  requested 
  4706.                     format.   The  remaining  bytes  of  the 
  4707.                     instruction  would be treated as  a  new 
  4708.                     Z80  instruction once the user proceeded 
  4709.                     to the next disassembly address. 
  4710.  
  4711.              ADDING COMMENTS
  4712.              Z8E  allows  the  user to add one comment per  line  of 
  4713.              disassembled code.  If MAXLEN is set to 6 then comments 
  4714.              may be up to 29 characters in length.  If MAXLEN is set 
  4715.              to  14  then  comments may be up to  16  characters  in 
  4716.              length.
  4717.  
  4718.  
  4719.         If  during  disassembly,  Z8E  encounters data  which  cannot  be 
  4720.         disassembled  into  a valid Z80 instruction it will  display  the 
  4721.         data as DEFB's.
  4722.  
  4723.  
  4724.  
  4725.  
  4726.  
  4727.  
  4728.  
  4729.  
  4730.  
  4731.  
  4732.  
  4733.  
  4734.  
  4735.  
  4736.  
  4737.  
  4738.  
  4739.  
  4740.  
  4741.  
  4742.  
  4743.  
  4744.  
  4745.  
  4746.  
  4747.  
  4748.                                        70
  4749.  
  4750.  
  4751.  
  4752.  
  4753.  
  4754.                                    APPENDIX A
  4755.  
  4756.  
  4757.  
  4758.  
  4759.  
  4760.  
  4761.  
  4762.  
  4763.  
  4764.         FILE FORMAT FOR SYMBOL TABLES
  4765.  
  4766.         Z8E  is  currently set up to be able to read any of  the  listing 
  4767.         files  which appear below:
  4768.  
  4769.             1. Microsoft   MACRO-80    V3.37  .PRN Files  May 8, 1980
  4770.             2. Microsoft   MACRO-80    V3.44  .PRN Files  Dec 9, 1981
  4771.             3. Microsoft   LINK-80     V3.44  .SYM Files  Dec 9, 1981 
  4772.             4. SLR Systems Z80ASM      V1.07  .LST Files
  4773.             5. SLR Systems SLRNK       V1.07  .SYM Files       
  4774.  
  4775.         The unique characteristics of each are:
  4776.  
  4777.             MACRO-80 V3.37
  4778.  
  4779.             Z8E  searches  for  the 8 byte string "Symbols:"  in  the 
  4780.             file.   Once this string is found,  Z8E expects an  ASCII 
  4781.             carriage  return character and an ASCII line feed charac-
  4782.             ter  to be the  next two bytes in the file.   The  symbol 
  4783.             table listing should begin in the next character position 
  4784.             in the file.
  4785.  
  4786.             Each  line  of  the symbol table  listing  contains  four 
  4787.             symbol names and an associated address.  
  4788.  
  4789.             If  the character following the symbol's hex value is  an 
  4790.             apostophe,  the  symbol is considered to be program rela-
  4791.             tive.  If  the user specified a bias in the command  line 
  4792.             the bias will be added to the symbol's value.
  4793.  
  4794.             If  the character following the symbol's hex value is  an 
  4795.             "I"  (meaning  that the symbol is globally defined)  then 
  4796.             the  character following the "I" is  examined.   If  this 
  4797.             character is an apostrophe it is considered to be program 
  4798.             relative  and  the  bias,  if specified is added  to  the 
  4799.             value.
  4800.  
  4801.             If  the character following the hex symbol value  or  the 
  4802.             "I" is any character besides an apostrophe, the symbol is 
  4803.             considered absolute and the bias will not be added.
  4804.  
  4805.             The  file should be terminated with the CP/M  end-of-file 
  4806.             character (control Z which is equivalent to a hex 1A).
  4807.  
  4808.             If  the string "Symbols" is never found,  Z8E prints  the 
  4809.             message:  Symbol Table not Found
  4810.  
  4811.  
  4812.  
  4813.  
  4814.                                        71
  4815.  
  4816.  
  4817.  
  4818.  
  4819.  
  4820.                                    APPENDIX A
  4821.  
  4822.  
  4823.             MACRO-80  V3.44
  4824.  
  4825.             Z8E  searches  for  the 8 byte string "Symbols:"  in  the 
  4826.             file.   Once this string is found,  Z8E expects an  ASCII 
  4827.             carriage  return character and an ASCII line feed charac-
  4828.             ter  to be the  next two bytes in the file.   The  symbol 
  4829.             table listing should begin in the next character position 
  4830.             in the file.
  4831.  
  4832.             In  this  release of MACRO-80 the format  of  the  symbol 
  4833.             table is completely opposite of V3.37.   That is, the hex 
  4834.             value appears before the symbol name.  In addition, these 
  4835.             hex value/symbol name combination appear three per line.
  4836.  
  4837.             The  character  appearing after the hex value  is  inter-
  4838.             preted as described for version 3.37.   
  4839.  
  4840.             If  the string "Symbols" is never found,  Z8E prints  the 
  4841.             message:  Symbol Table not Found
  4842.  
  4843.             
  4844.             LINK-80  V3.44
  4845.  
  4846.             LINK-80  can  optionally produce a link map  (.SYM  file) 
  4847.             which  lists  all  globally defined symbols if  the  user 
  4848.             specifies  the  "Y" option the  L80  command  line.   Z8E 
  4849.             treats  all symbols names loaded from a LINK-80 .SYM file 
  4850.             as absolute (non-relocatable)  addresses.   Nevertheless, 
  4851.             if  the user specifies a bias,  it will be added to every 
  4852.             symbol value read in from the .SYM file.
  4853.  
  4854.             Z8E  expects  the first symbol value in a  .SYM  file  to 
  4855.             begin  in  the  first byte position in  the  file.   Each 
  4856.             symbol value consists of four hexadecimal bytes in  ASCII 
  4857.             followed  by a tab character.   Immediately after the tab 
  4858.             character is the symbol name which may be between one and 
  4859.             six alphanumeric characters in length.   The symbol  name 
  4860.             is  followed  by a tab and the sequence  repeats.   Every 
  4861.             fourth  symbol value/symbol name pair should be  followed 
  4862.             by a carriage return and line feed.
  4863.  
  4864.             The  file should be terminated with the CP/M  end-of-file 
  4865.             character (control Z which is equivalent to a hex 1A).
  4866.  
  4867.  
  4868.             Z80ASM
  4869.  
  4870.             Z80ASM  may  be configured to produce either  80  or  132 
  4871.             column output.
  4872.  
  4873.             Z8E searches for the 8 byte string "Symbol Table:" in the 
  4874.             file.   This  string need not be at the beginning of  the 
  4875.             file;  Z8E will scan the entire file looking for it. Once 
  4876.             this  string  is found,  Z8E expects  an  ASCII  carriage 
  4877.             return  character and an ASCII line feed character to  be 
  4878.  
  4879.  
  4880.                                        72
  4881.  
  4882.  
  4883.  
  4884.  
  4885.  
  4886.                                    APPENDIX A
  4887.  
  4888.  
  4889.             the  next two bytes in the file.   The symbol table list-
  4890.             ing  should  begin in the next character position in  the 
  4891.             file.
  4892.  
  4893.             In  a Z80ASM .LST file the hex value appears  before  the 
  4894.             symbol  name.  Hex value/symbol name combinations  appear 
  4895.             three per line.  Z80ASM symbol names may contain up to 16 
  4896.             characters.  Z8E will accept the first 14 characters of a 
  4897.             symbol name if MAXLEN is set to 14 or the first 6 charac-
  4898.             ters if MAXLEN is set to 6.   
  4899.  
  4900.             If the string "Symbol Table:" is never found,  Z8E prints 
  4901.             the message:  
  4902.  
  4903.                              Symbol Table Not Found
  4904.  
  4905.             SLRNK
  4906.  
  4907.             SLRNK  can  optionally  produce a link  map  (.SYM  File) 
  4908.             similar  to the one produced by Link-80.  Z8E treats  all 
  4909.             symbols  loaded from a SLRNK .SYM file as  absolute  sym-
  4910.             bols.  However, as in the case of Link-80 .SYM files, Z8E 
  4911.             will  add  a  relocation bias to each symbol  if  one  is 
  4912.             specified.
  4913.  
  4914.             Each  symbol value in a SLRNK .SYM file consists of  four 
  4915.             hexadecimal  bytes  followed by a space followed  by  the 
  4916.             symbol  name.   The symbol name is followed by two  ASCII 
  4917.             tab characters.   
  4918.  
  4919.             Use SLRNK's /M option to produce a link map.
  4920.  
  4921.  
  4922.         NOTE:
  4923.  
  4924.             While reading in a MACRO-80 .PRN file,  or a Z80ASM  .LST 
  4925.             file,  Z8E is capable of reading an entire assembly list-
  4926.             ing  file  looking for the "Symbols:" string  or  "Symbol 
  4927.             Table:" string.  These strings need not be located at the 
  4928.             beginning  of  the file.   However,  the loading  of  the 
  4929.             symbol  table  will  be speeded up  considerably  if  the 
  4930.             symbol  table  is  the only data in the  file.   This  is 
  4931.             accomplished quite easily in both MACRO-80 by turning off 
  4932.             the  listing  during an assembly through the use  of  the 
  4933.             .XLIST directive.  The listing can then be turned back on 
  4934.             just prior to the END directive via a .LIST directive  to 
  4935.             ensure that the symbol table is written to disk.
  4936.  
  4937.             If  you  are using Z80ASM use the /S option  to  instruct 
  4938.             Z80ASM to produce a symbol file.
  4939.  
  4940.  
  4941.  
  4942.         Z8E  is able to process symbol tables which occupy multiple pages 
  4943.         in any of the file types mentioned above.  Headings which precede 
  4944.  
  4945.  
  4946.                                        73
  4947.  
  4948.  
  4949.  
  4950.  
  4951.  
  4952.                                    APPENDIX A
  4953.  
  4954.  
  4955.         each page are automatically ignored by Z8E. 
  4956.  
  4957.  
  4958.  
  4959.  
  4960.  
  4961.  
  4962.  
  4963.  
  4964.  
  4965.  
  4966.  
  4967.  
  4968.  
  4969.  
  4970.  
  4971.  
  4972.  
  4973.  
  4974.  
  4975.  
  4976.  
  4977.  
  4978.  
  4979.  
  4980.  
  4981.  
  4982.  
  4983.  
  4984.  
  4985.  
  4986.  
  4987.  
  4988.  
  4989.  
  4990.  
  4991.  
  4992.  
  4993.  
  4994.  
  4995.  
  4996.  
  4997.  
  4998.  
  4999.  
  5000.  
  5001.  
  5002.  
  5003.  
  5004.  
  5005.  
  5006.  
  5007.  
  5008.  
  5009.  
  5010.  
  5011.  
  5012.  
  5013.  
  5014.  
  5015.  
  5016.  
  5017.  
  5018.                       APPENDIX B - ZILOG MNEMONICS       
  5019.  
  5020.  
  5021.                                 
  5022.                                 
  5023.           0049                  NN     EQU   49H       ;8 BIT OPERAND
  5024.           123F                  NNNN   EQU   123FH     ;16 BIT   OPERAND
  5025.           0036                  INDEX  EQU   36H       ;INDEX REGISTER INDEX
  5026.  
  5027.           010B    8E                   ADC   A,(HL)
  5028.           010C    DD 8E 36             ADC   A,(IX+INDEX)
  5029.           010F    FD 8E 36             ADC   A,(IY+INDEX)
  5030.           0112    8F                   ADC   A,A
  5031.           0113    88                   ADC   A,B
  5032.           0114    89                   ADC   A,C
  5033.           0115    8A                   ADC   A,D
  5034.           0116    8B                   ADC   A,E
  5035.           0117    8C                   ADC   A,H
  5036.           0118    8D                   ADC   A,L
  5037.           0119    CE 49                ADC   A,NN
  5038.           011B    ED 4A                ADC   HL,BC
  5039.           011D    ED 5A                ADC   HL,DE
  5040.           011F    ED 6A                ADC   HL,HL
  5041.           0121    ED 7A                ADC   HL,SP
  5042.                                 
  5043.                                 
  5044.           0123    86                   ADD   A,(HL)
  5045.           0124    DD 86 36             ADD   A,(IX+INDEX)
  5046.           0127    FD 86 36             ADD   A,(IY+INDEX)
  5047.           012A    87                   ADD   A,A
  5048.           012B    80                   ADD   A,B
  5049.           012C    81                   ADD   A,C
  5050.           012D    82                   ADD   A,D
  5051.           012E    83                   ADD   A,E
  5052.           012F    84                   ADD   A,H
  5053.           0130    85                   ADD   A,L
  5054.           0131    C6 49                ADD   A,NN
  5055.           0133    09                   ADD   HL,BC
  5056.           0134    19                   ADD   HL,DE
  5057.           0135    29                   ADD   HL,HL
  5058.           0136    39                   ADD   HL,SP
  5059.           0137    DD 09                ADD   IX,BC
  5060.           0139    DD 19                ADD   IX,DE
  5061.           013B    DD 29                ADD   IX,IX
  5062.           013D    DD 39                ADD   IX,SP
  5063.           013F    FD 09                ADD   IY,BC
  5064.           0141    FD 19                ADD   IY,DE
  5065.           0143    FD 29                ADD   IY,IY
  5066.           0145    FD 39                ADD   IY,SP
  5067.                                 
  5068.  
  5069.           0147    A6                   AND   (HL)
  5070.           0148    DD A6 36             AND   (IX+INDEX)
  5071.           014B    FD A6 36             AND   (IY+INDEX)
  5072.           014E    A7                   AND   A
  5073.           014F    A0                   AND   B
  5074.           0150    A1                   AND   C
  5075.           0151    A2                   AND   D
  5076.  
  5077.  
  5078.                                        75
  5079.  
  5080.  
  5081.  
  5082.  
  5083.  
  5084.                       APPENDIX B - ZILOG MNEMONICS       
  5085.  
  5086.  
  5087.           0152    A3                   AND   E
  5088.           0153    A4                   AND   H
  5089.           0154    A5                   AND   L
  5090.           0155    E6 49                AND   NN
  5091.                                 
  5092.                                 
  5093.           0157    CB 46                BIT   0,(HL)
  5094.           0159    DD CB 36 46          BIT   0,(IX+INDEX)
  5095.           015D    FD CB 36 46          BIT   0,(IY+INDEX)
  5096.           0161    CB 47                BIT   0,A
  5097.           0163    CB 40                BIT   0,B
  5098.           0165    CB 41                BIT   0,C
  5099.           0167    CB 42                BIT   0,D
  5100.           0169    CB 43                BIT   0,E
  5101.           016B    CB 44                BIT   0,H
  5102.           016D    CB 45                BIT   0,L
  5103.                                 
  5104.                                 
  5105.           016F    CB 4E                BIT   1,(HL)
  5106.           0171    DD CB 36 4E          BIT   1,(IX+INDEX)
  5107.           0175    FD CB 36 4E          BIT   1,(IY+INDEX)
  5108.           0179    CB 4F                BIT   1,A
  5109.           017B    CB 48                BIT   1,B
  5110.           017D    CB 49                BIT   1,C
  5111.           017F    CB 4A                BIT   1,D
  5112.           0181    CB 4B                BIT   1,E
  5113.           0183    CB 4C                BIT   1,H
  5114.           0185    CB 4D                BIT   1,L
  5115.                                 
  5116.                                 
  5117.           0187    CB 56                BIT   2,(HL)
  5118.           0189    DD CB 36 56          BIT   2,(IX+INDEX)
  5119.           018D    FD CB 36 56          BIT   2,(IY+INDEX)
  5120.           0191    CB 57                BIT   2,A
  5121.           0193    CB 50                BIT   2,B
  5122.           0195    CB 51                BIT   2,C
  5123.           0197    CB 52                BIT   2,D
  5124.           0199    CB 53                BIT   2,E
  5125.           019B    CB 54                BIT   2,H
  5126.           019D    CB 55                BIT   2,L
  5127.                                 
  5128.                                 
  5129.           019F    CB 5E                BIT   3,(HL)
  5130.           01A1    DD CB 36 5E          BIT   3,(IX+INDEX)
  5131.           01A5    FD CB 36 5E          BIT   3,(IY+INDEX)
  5132.           01A9    CB 5F                BIT   3,A
  5133.           01AB    CB 58                BIT   3,B
  5134.           01AD    CB 59                BIT   3,C
  5135.           01AF    CB 5A                BIT   3,D
  5136.           01B1    CB 5B                BIT   3,E
  5137.           01B3    CB 5C                BIT   3,H
  5138.           01B5    CB 5D                BIT   3,L
  5139.                                 
  5140.                                 
  5141.           01B7    CB 66                BIT   4,(HL)
  5142.  
  5143.  
  5144.                                        76
  5145.  
  5146.  
  5147.  
  5148.  
  5149.  
  5150.                       APPENDIX B - ZILOG MNEMONICS       
  5151.  
  5152.  
  5153.           01B9    DD CB 36 66          BIT   4,(IX+INDEX)
  5154.           01BD    FD CB 36 66          BIT   4,(IY+INDEX)
  5155.           01C1    CB 67                BIT   4,A
  5156.           01C3    CB 60                BIT   4,B
  5157.           01C5    CB 61                BIT   4,C
  5158.           01C7    CB 62                BIT   4,D
  5159.           01C9    CB 63                BIT   4,E
  5160.           01CB    CB 64                BIT   4,H
  5161.           01CD    CB 65                BIT   4,L
  5162.                                 
  5163.                                 
  5164.           01CF    CB 6E                BIT   5,(HL)
  5165.           01D1    DD CB 36 6E          BIT   5,(IX+INDEX)
  5166.           01D5    FD CB 36 6E          BIT   5,(IY+INDEX)
  5167.           01D9    CB 6F                BIT   5,A
  5168.           01DB    CB 68                BIT   5,B
  5169.           01DD    CB 69                BIT   5,C
  5170.           01DF    CB 6A                BIT   5,D
  5171.           01E1    CB 6B                BIT   5,E
  5172.           01E3    CB 6C                BIT   5,H
  5173.           01E5    CB 6D                BIT   5,L
  5174.                                 
  5175.                                 
  5176.           01E7    CB 76                BIT   6,(HL)
  5177.           01E9    DD CB 36 76          BIT   6,(IX+INDEX)
  5178.           01ED    FD CB 36 76          BIT   6,(IY+INDEX)
  5179.           01F1    CB 77                BIT   6,A
  5180.           01F3    CB 70                BIT   6,B
  5181.           01F5    CB 71                BIT   6,C
  5182.           01F7    CB 72                BIT   6,D
  5183.           01F9    CB 73                BIT   6,E
  5184.           01FB    CB 74                BIT   6,H
  5185.           01FD    CB 75                BIT   6,L
  5186.                                 
  5187.                                 
  5188.           01FF    CB 7E                BIT   7,(HL)
  5189.           0201    DD CB 36 7E          BIT   7,(IX+INDEX)
  5190.           0205    FD CB 36 7E          BIT   7,(IY+INDEX)
  5191.           0209    CB 7F                BIT   7,A
  5192.           020B    CB 78                BIT   7,B
  5193.           020D    CB 79                BIT   7,C
  5194.           020F    CB 7A                BIT   7,D
  5195.           0211    CB 7B                BIT   7,E
  5196.           0213    CB 7C                BIT   7,H
  5197.           0215    CB 7D                BIT   7,L
  5198.                                 
  5199.                                 
  5200.           0217    DC 123F              CALL   C,NNNN
  5201.           021A    FC 123F              CALL   M,NNNN
  5202.           021D    D4 123F              CALL   NC,NNNN
  5203.           0220    CD 123F              CALL   NNNN
  5204.           0223    C4 123F              CALL   NZ,NNNN
  5205.           0226    F4 123F              CALL   P,NNNN
  5206.           0229    EC 123F              CALL   PE,NNNN
  5207.           022C    E4 123F              CALL   PO,NNNN
  5208.  
  5209.  
  5210.                                        77
  5211.  
  5212.  
  5213.  
  5214.  
  5215.  
  5216.                       APPENDIX B - ZILOG MNEMONICS       
  5217.  
  5218.  
  5219.           022F    CC 123F              CALL   Z,NNNN
  5220.                                 
  5221.                                 
  5222.           0232    3F                   CCF
  5223.                                 
  5224.                                 
  5225.           0233    BE                   CP   (HL)
  5226.           0234    DD BE 36             CP   (IX+INDEX)
  5227.           0237    FD BE 36             CP   (IY+INDEX)
  5228.           023A    BF                   CP   A
  5229.           023B    B8                   CP   B
  5230.           023C    B9                   CP   C
  5231.           023D    BA                   CP   D
  5232.           023E    BB                   CP   E
  5233.           023F    BC                   CP   H
  5234.           0240    BD                   CP   L
  5235.           0241    FE 49                CP   NN
  5236.                                 
  5237.                                 
  5238.           0243    ED A9                CPD
  5239.           0245    ED B9                CPDR
  5240.           0247    ED A1                CPI
  5241.           0249    ED B1                CPIR
  5242.                                 
  5243.                                 
  5244.           024B    2F                   CPL
  5245.                                 
  5246.                                 
  5247.           024C    27                   DAA
  5248.                                 
  5249.                                 
  5250.           024D    35                   DEC   (HL)
  5251.           024E    DD 35 36             DEC   (IX+INDEX)
  5252.           0251    FD 35 36             DEC   (IY+INDEX)
  5253.           0254    3D                   DEC   A
  5254.           0255    05                   DEC   B
  5255.           0256    0B                   DEC   BC
  5256.           0257    0D                   DEC   C
  5257.           0258    15                   DEC   D
  5258.           0259    1B                   DEC   DE
  5259.           025A    1D                   DEC   E
  5260.           025B    25                   DEC   H
  5261.           025C    2B                   DEC   HL
  5262.           025D    DD 2B                DEC   IX
  5263.           025F    FD 2B                DEC   IY
  5264.           0261    2D                   DEC   L
  5265.           0262    3B                   DEC   SP
  5266.                                 
  5267.                                 
  5268.           0263    F3                   DI
  5269.                                 
  5270.                                 
  5271.           0264    10 04                DJNZ   $+6
  5272.                                 
  5273.                                 
  5274.  
  5275.  
  5276.                                        78
  5277.  
  5278.  
  5279.  
  5280.  
  5281.  
  5282.                       APPENDIX B - ZILOG MNEMONICS       
  5283.  
  5284.  
  5285.           0266    FB                   EI
  5286.                                 
  5287.                                 
  5288.           0267    E3                   EX   (SP),HL
  5289.           0268    DD E3                EX   (SP),IX
  5290.           026A    FD E3                EX   (SP),IY
  5291.           026C    08                   EX   AF,AF'          
  5292.           026D    EB                   EX   DE,HL
  5293.           026E    D9                   EXX
  5294.                                 
  5295.                                 
  5296.           026F    76                   HALT
  5297.                                 
  5298.                                 
  5299.           0270    ED 46                IM   0
  5300.           0272    ED 56                IM   1
  5301.           0274    ED 5E                IM   2
  5302.                                 
  5303.                                 
  5304.           0276    ED 78                IN   A,(C)
  5305.           0278    DB 49                IN   A,(NN)
  5306.           027A    ED 40                IN   B,(C)
  5307.           027C    ED 48                IN   C,(C)
  5308.           027E    ED 50                IN   D,(C)
  5309.           0280    ED 58                IN   E,(C)
  5310.           0284    ED 60                IN   H,(C)
  5311.           0286    ED 68                IN   L,(C)
  5312.                                 
  5313.                                 
  5314.           0288    34                   INC   (HL)
  5315.           0289    DD 34 36             INC   (IX+INDEX)
  5316.           028C    FD 34 36             INC   (IY+INDEX)
  5317.           028F    3C                   INC   A
  5318.           0290    04                   INC   B
  5319.           0291    03                   INC   BC
  5320.           0292    0C                   INC   C
  5321.           0293    14                   INC   D
  5322.           0294    13                   INC   DE
  5323.           0295    1C                   INC   E
  5324.           0296    24                   INC   H
  5325.           0297    23                   INC   HL
  5326.           0298    DD 23                INC   IX
  5327.           029A    FD 23                INC   IY
  5328.           029C    2C                   INC   L
  5329.           029D    33                   INC   SP
  5330.                                 
  5331.                                 
  5332.           029E    ED AA                IND
  5333.           02A0    ED BA                INDR
  5334.           02A2    ED A2                INI
  5335.           02A4    ED B2                INIR
  5336.  
  5337.  
  5338.           02A6    E9                   JP   (HL)
  5339.           02A7    DD E9                JP   (IX)
  5340.  
  5341.  
  5342.                                        79
  5343.  
  5344.  
  5345.  
  5346.  
  5347.  
  5348.                       APPENDIX B - ZILOG MNEMONICS       
  5349.  
  5350.  
  5351.           02A9    FD E9                JP   (IY)
  5352.           02AB    DA 123F              JP   C,NNNN
  5353.           02AE    FA 123F              JP   M,NNNN
  5354.           02B1    D2 123F              JP   NC,NNNN
  5355.           02B4    C3 123F              JP   NNNN
  5356.           02B7    C2 123F              JP   NZ,NNNN
  5357.           02BA    F2 123F              JP   P,NNNN
  5358.           02BD    EA 123F              JP   PE,NNNN
  5359.           02C0    E2 123F              JP   PO,NNNN
  5360.           02C3    CA 123F              JP   Z,NNNN
  5361.                                 
  5362.                                 
  5363.           02C6    38 04                JR   C,$+6
  5364.           02C8    18 04                JR   $+6
  5365.           02CA    30 04                JR   NC,$+6
  5366.           02CC    20 04                JR   NZ,$+6
  5367.           02CE    28 04                JR   Z,$+6
  5368.                                 
  5369.                                 
  5370.           02D0    02                   LD   (BC),A
  5371.           02D1    12                   LD   (DE),A
  5372.           02D2    77                   LD   (HL),A
  5373.           02D3    70                   LD   (HL),B
  5374.           02D4    71                   LD   (HL),C
  5375.           02D5    72                   LD   (HL),D
  5376.           02D6    73                   LD   (HL),E
  5377.           02D7    74                   LD   (HL),H
  5378.           02D8    75                   LD   (HL),L
  5379.           02D9    36 49                LD   (HL),NN
  5380.                                 
  5381.                                 
  5382.           02DB    DD 77 36             LD   (IX+INDEX),A
  5383.           02DE    DD 70 36             LD   (IX+INDEX),B
  5384.           02E1    DD 71 36             LD   (IX+INDEX),C
  5385.           02E4    DD 72 36             LD   (IX+INDEX),D
  5386.           02E7    DD 73 36             LD   (IX+INDEX),E
  5387.           02EA    DD 74 36             LD   (IX+INDEX),H
  5388.           02ED    DD 75 36             LD   (IX+INDEX),L
  5389.           02F0    DD 36 36 49          LD   (IX+INDEX),NN
  5390.                                 
  5391.                                 
  5392.           02F4    FD 77 36             LD   (IY+INDEX),A
  5393.           02F7    FD 70 36             LD   (IY+INDEX),B
  5394.           02FA    FD 71 36             LD   (IY+INDEX),C
  5395.           02FD    FD 72 36             LD   (IY+INDEX),D
  5396.           0300    FD 73 36             LD   (IY+INDEX),E
  5397.           0303    FD 74 36             LD   (IY+INDEX),H
  5398.           0306    FD 75 36             LD   (IY+INDEX),L
  5399.           0309    FD 36 36 49          LD   (IY+INDEX),NN
  5400.                                 
  5401.                                 
  5402.           030D    32 123F              LD   (NNNN),A
  5403.           0310    ED 43 123F           LD   (NNNN),BC
  5404.           0314    ED 53 123F           LD   (NNNN),DE
  5405.           0318    22 123F              LD   (NNNN),HL
  5406.  
  5407.  
  5408.                                        80
  5409.  
  5410.  
  5411.  
  5412.  
  5413.  
  5414.                       APPENDIX B - ZILOG MNEMONICS       
  5415.  
  5416.  
  5417.           031B    DD 22 123F           LD   (NNNN),IX
  5418.           031F    FD 22 123F           LD   (NNNN),IY
  5419.           0323    ED 73 123F           LD   (NNNN),SP
  5420.                                 
  5421.                                 
  5422.           0327    0A                   LD   A,(BC)
  5423.           0328    1A                   LD   A,(DE)
  5424.           0329    7E                   LD   A,(HL)
  5425.           032A    DD 7E 36             LD   A,(IX+INDEX)
  5426.           032D    FD 7E 36             LD   A,(IY+INDEX)
  5427.           0330    3A 123F              LD   A,(NNNN)
  5428.           0333    7F                   LD   A,A
  5429.           0334    78                   LD   A,B
  5430.           0335    79                   LD   A,C
  5431.           0336    7A                   LD   A,D
  5432.           0337    7B                   LD   A,E
  5433.           0338    7C                   LD   A,H
  5434.           0339    ED 57                LD   A,I
  5435.           033B    7D                   LD   A,L
  5436.           033C    3E 49                LD   A,NN
  5437.           033E    ED 5F                LD   A,R
  5438.                                 
  5439.                                 
  5440.           0340    46                   LD   B,(HL)
  5441.           0341    DD 46 36             LD   B,(IX+INDEX)
  5442.           0344    FD 46 36             LD   B,(IY+INDEX)
  5443.           0347    47                   LD   B,A
  5444.           0348    40                   LD   B,B
  5445.           0349    41                   LD   B,C
  5446.           034A    42                   LD   B,D
  5447.           034B    43                   LD   B,E
  5448.           034C    44                   LD   B,H
  5449.           034D    45                   LD   B,L
  5450.           034E    06 49                LD   B,NN
  5451.                                 
  5452.                                 
  5453.           0350    ED 4B 123F           LD   BC,(NNNN)
  5454.           0354    01 123F              LD   BC,NNNN
  5455.                                 
  5456.                                 
  5457.           0357    4E                   LD   C,(HL)
  5458.           0358    DD 4E 36             LD   C,(IX+INDEX)
  5459.           035B    FD 4E 36             LD   C,(IY+INDEX)
  5460.           035E    4F                   LD   C,A
  5461.           035F    48                   LD   C,B
  5462.           0360    49                   LD   C,C
  5463.           0361    4A                   LD   C,D
  5464.           0362    4B                   LD   C,E
  5465.           0363    4C                   LD   C,H
  5466.           0364    4D                   LD   C,L
  5467.           0365    0E 49                LD   C,NN
  5468.                                 
  5469.  
  5470.  
  5471.           0367    56                   LD   D,(HL)
  5472.  
  5473.  
  5474.                                        81
  5475.  
  5476.  
  5477.  
  5478.  
  5479.  
  5480.                       APPENDIX B - ZILOG MNEMONICS       
  5481.  
  5482.  
  5483.           0368    DD 56 36             LD   D,(IX+INDEX)
  5484.           036B    FD 56 36             LD   D,(IY+INDEX)
  5485.           036E    57                   LD   D,A
  5486.           036F    50                   LD   D,B
  5487.           0370    51                   LD   D,C
  5488.           0371    52                   LD   D,D
  5489.           0372    53                   LD   D,E
  5490.           0373    54                   LD   D,H
  5491.           0374    55                   LD   D,L
  5492.           0375    16 49                LD   D,NN
  5493.                                 
  5494.                                 
  5495.           0377    ED 5B 123F           LD   DE,(NNNN)
  5496.           037B    11 123F              LD   DE,NNNN
  5497.                                 
  5498.                                 
  5499.           037E    5E                   LD   E,(HL)
  5500.           037F    DD 5E 36             LD   E,(IX+INDEX)
  5501.           0382    FD 5E 36             LD   E,(IY+INDEX)
  5502.           0385    5F                   LD   E,A
  5503.           0386    58                   LD   E,B
  5504.           0387    59                   LD   E,C
  5505.           0388    5A                   LD   E,D
  5506.           0389    5B                   LD   E,E
  5507.           038A    5C                   LD   E,H
  5508.           038B    5D                   LD   E,L
  5509.           038C    1E 49                LD   E,NN
  5510.                                 
  5511.                                 
  5512.           038E    66                   LD   H,(HL)
  5513.           038F    DD 66 36             LD   H,(IX+INDEX)
  5514.           0392    FD 66 36             LD   H,(IY+INDEX)
  5515.           0395    67                   LD   H,A
  5516.           0396    60                   LD   H,B
  5517.           0397    61                   LD   H,C
  5518.           0398    62                   LD   H,D
  5519.           0399    63                   LD   H,E
  5520.           039A    64                   LD   H,H
  5521.           039B    65                   LD   H,L
  5522.           039C    26 49                LD   H,NN
  5523.                                 
  5524.                                 
  5525.           039E    2A 123F              LD   HL,(NNNN)
  5526.           03A1    21 123F              LD   HL,NNNN
  5527.                                 
  5528.                                 
  5529.           03A4    ED 47                LD   I,A
  5530.                                 
  5531.                                 
  5532.           03A6    DD 2A 123F           LD   IX,(NNNN)
  5533.           03AA    DD 21 123F           LD   IX,NNNN
  5534.                                 
  5535.                                 
  5536.           03AE    FD 2A 123F           LD   IY,(NNNN)
  5537.           03B2    FD 21 123F           LD   IY,NNNN
  5538.  
  5539.  
  5540.                                        82
  5541.  
  5542.  
  5543.  
  5544.  
  5545.  
  5546.                       APPENDIX B - ZILOG MNEMONICS       
  5547.  
  5548.  
  5549.  
  5550.  
  5551.  
  5552.           03B6    6E                   LD   L,(HL)
  5553.           03B7    DD 6E 36             LD   L,(IX+INDEX)
  5554.           03BA    FD 6E 36             LD   L,(IY+INDEX)
  5555.           03BD    6F                   LD   L,A
  5556.           03BE    68                   LD   L,B
  5557.           03BF    69                   LD   L,C
  5558.           03C0    6A                   LD   L,D
  5559.           03C1    6B                   LD   L,E
  5560.           03C2    6C                   LD   L,H
  5561.           03C3    6D                   LD   L,L
  5562.           03C4    2E 49                LD   L,NN
  5563.                                 
  5564.                                 
  5565.           03C6    ED 4F                LD   R,A
  5566.                                 
  5567.                                 
  5568.           03C8    ED 7B 123F           LD   SP,(NNNN)
  5569.           03CC    F9                   LD   SP,HL
  5570.           03CD    DD F9                LD   SP,IX
  5571.           03CF    FD F9                LD   SP,IY
  5572.           03D1    31 123F              LD   SP,NNNN
  5573.                                 
  5574.                                 
  5575.           03D4    ED A8                LDD
  5576.           03D6    ED B8                LDDR
  5577.           03D8    ED A0                LDI
  5578.           03DA    ED B0                LDIR
  5579.                                 
  5580.                                 
  5581.           03DC    ED 44                NEG
  5582.                                 
  5583.                                 
  5584.           03DE    00                   NOP
  5585.                                 
  5586.                                 
  5587.           03DF    B6                   OR   (HL)
  5588.           03E0    DD B6 36             OR   (IX+INDEX)
  5589.           03E3    FD B6 36             OR   (IY+INDEX)
  5590.           03E6    B7                   OR   A
  5591.           03E7    B0                   OR   B
  5592.           03E8    B1                   OR   C
  5593.           03E9    B2                   OR   D
  5594.           03EA    B3                   OR   E
  5595.           03EB    B4                   OR   H
  5596.           03EC    B5                   OR   L
  5597.           03ED    F6 49                OR   NN
  5598.                                 
  5599.                                 
  5600.           03EF    ED BB                OTDR
  5601.           03F1    ED B3                OTIR
  5602.                                 
  5603.                                 
  5604.  
  5605.  
  5606.                                        83
  5607.  
  5608.  
  5609.  
  5610.  
  5611.  
  5612.                       APPENDIX B - ZILOG MNEMONICS       
  5613.  
  5614.  
  5615.           03F3    ED 79                OUT   (C),A
  5616.           03F5    ED 41                OUT   (C),B
  5617.  
  5618.  
  5619.  
  5620.           03F7    ED 49                OUT   (C),C
  5621.           03F9    ED 51                OUT   (C),D
  5622.           03FB    ED 59                OUT   (C),E
  5623.           03FD    ED 61                OUT   (C),H
  5624.           03FF    ED 69                OUT   (C),L
  5625.           0401    D3 49                OUT   (NN),A
  5626.                                 
  5627.                                 
  5628.           0403    ED AB                OUTD
  5629.           0405    ED A3                OUTI
  5630.                                 
  5631.                                 
  5632.           0407    F1                   POP   AF
  5633.           0408    C1                   POP   BC
  5634.           0409    D1                   POP   DE
  5635.           040A    E1                   POP   HL
  5636.           040B    DD E1                POP   IX
  5637.           040D    FD E1                POP   IY
  5638.                                 
  5639.                                 
  5640.           040F    F5                   PUSH   AF
  5641.           0410    C5                   PUSH   BC
  5642.           0411    D5                   PUSH   DE
  5643.           0412    E5                   PUSH   HL
  5644.           0413    DD E5                PUSH   IX
  5645.           0415    FD E5                PUSH   IY
  5646.                                 
  5647.                                 
  5648.           0417    CB 86                RES   0,(HL)
  5649.           0419    DD CB 36 86          RES   0,(IX+INDEX)
  5650.           041D    FD CB 36 86          RES   0,(IY+INDEX)
  5651.           0421    CB 87                RES   0,A
  5652.           0423    CB 80                RES   0,B
  5653.           0425    CB 81                RES   0,C
  5654.           0427    CB 82                RES   0,D
  5655.           0429    CB 83                RES   0,E
  5656.           042B    CB 84                RES   0,H
  5657.           042D    CB 85                RES   0,L
  5658.                                 
  5659.                                 
  5660.           042F    CB 8E                RES   1,(HL)
  5661.           0431    DD CB 36 8E          RES   1,(IX+INDEX)
  5662.           0435    FD CB 36 8E          RES   1,(IY+INDEX)
  5663.           0439    CB 8F                RES   1,A
  5664.           043B    CB 88                RES   1,B
  5665.           043D    CB 89                RES   1,C
  5666.           043F    CB 8A                RES   1,D
  5667.           0441    CB 8B                RES   1,E
  5668.           0443    CB 8C                RES   1,H
  5669.           0445    CB 8D                RES   1,L
  5670.  
  5671.  
  5672.                                        84
  5673.  
  5674.  
  5675.  
  5676.  
  5677.  
  5678.                       APPENDIX B - ZILOG MNEMONICS       
  5679.  
  5680.  
  5681.                                 
  5682.                                 
  5683.           0447    CB 96                RES   2,(HL)
  5684.           0449    DD CB 36 96          RES   2,(IX+INDEX)
  5685.           044D    FD CB 36 96          RES   2,(IY+INDEX)
  5686.           0451    CB 97                RES   2,A
  5687.           0453    CB 90                RES   2,B
  5688.           0455    CB 91                RES   2,C
  5689.           0457    CB 92                RES   2,D
  5690.           0459    CB 93                RES   2,E
  5691.           045B    CB 94                RES   2,H
  5692.           045D    CB 95                RES   2,L
  5693.                                 
  5694.                                 
  5695.           045F    CB 9E                RES   3,(HL)
  5696.           0461    DD CB 36 9E          RES   3,(IX+INDEX)
  5697.           0465    FD CB 36 9E          RES   3,(IY+INDEX)
  5698.           0469    CB 9F                RES   3,A
  5699.           046B    CB 98                RES   3,B
  5700.           046D    CB 99                RES   3,C
  5701.           046F    CB 9A                RES   3,D
  5702.           0471    CB 9B                RES   3,E
  5703.           0473    CB 9C                RES   3,H
  5704.           0475    CB 9D                RES   3,L
  5705.                                 
  5706.                                 
  5707.           0477    CB A6                RES   4,(HL)
  5708.           0479    DD CB 36 A6          RES   4,(IX+INDEX)
  5709.           047D    FD CB 36 A6          RES   4,(IY+INDEX)
  5710.           0481    CB A7                RES   4,A
  5711.           0483    CB A0                RES   4,B
  5712.           0485    CB A1                RES   4,C
  5713.           0487    CB A2                RES   4,D
  5714.           0489    CB A3                RES   4,E
  5715.           048B    CB A4                RES   4,H
  5716.           048D    CB A5                RES   4,L
  5717.                                 
  5718.                                 
  5719.           048F    CB AE                RES   5,(HL)
  5720.           0491    DD CB 36 AE          RES   5,(IX+INDEX)
  5721.           0495    FD CB 36 AE          RES   5,(IY+INDEX)
  5722.           0499    CB AF                RES   5,A
  5723.           049B    CB A8                RES   5,B
  5724.           049D    CB A9                RES   5,C
  5725.           049F    CB AA                RES   5,D
  5726.           04A1    CB AB                RES   5,E
  5727.           04A3    CB AC                RES   5,H
  5728.           04A5    CB AD                RES   5,L
  5729.                                 
  5730.                                 
  5731.           04A7    CB B6                RES   6,(HL)
  5732.           04A9    DD CB 36 B6          RES   6,(IX+INDEX)
  5733.           04AD    FD CB 36 B6          RES   6,(IY+INDEX)
  5734.           04B1    CB B7                RES   6,A
  5735.           04B3    CB B0                RES   6,B
  5736.  
  5737.  
  5738.                                        85
  5739.  
  5740.  
  5741.  
  5742.  
  5743.  
  5744.                       APPENDIX B - ZILOG MNEMONICS       
  5745.  
  5746.  
  5747.           04B5    CB B1                RES   6,C
  5748.           04B7    CB B2                RES   6,D
  5749.           04B9    CB B3                RES   6,E
  5750.           04BB    CB B4                RES   6,H
  5751.           04BD    CB B5                RES   6,L
  5752.                                 
  5753.                                 
  5754.  
  5755.           04BF    CB BE                RES   7,(HL)
  5756.           04C1    DD CB 36 BE          RES   7,(IX+INDEX)
  5757.           04C5    FD CB 36 BE          RES   7,(IY+INDEX)
  5758.           04C9    CB BF                RES   7,A
  5759.           04CB    CB B8                RES   7,B
  5760.           04CD    CB B9                RES   7,C
  5761.           04CF    CB BA                RES   7,D
  5762.           04D1    CB BB                RES   7,E
  5763.           04D3    CB BC                RES   7,H
  5764.           04D5    CB BD                RES   7,L 
  5765.                                 
  5766.                                 
  5767.           04D7    C9                   RET
  5768.           04D8    D8                   RET   C
  5769.           04D9    F8                   RET   M
  5770.           04DA    D0                   RET   NC
  5771.           04DB    C0                   RET   NZ
  5772.           04DC    F0                   RET   P
  5773.           04DD    E8                   RET   PE
  5774.           04DE    E0                   RET   PO
  5775.           04DF    C8                   RET   Z
  5776.                                 
  5777.                                 
  5778.           04E0    ED 4D                RETI
  5779.           04E2    ED 45                RETN
  5780.                                 
  5781.                                 
  5782.           04E4    CB 16                RL   (HL)
  5783.           04E6    DD CB 36 16          RL   (IX+INDEX)
  5784.           04EA    FD CB 36 16          RL   (IY+INDEX)
  5785.           04EE    CB 17                RL   A
  5786.           04F0    CB 10                RL   B
  5787.           04F2    CB 11                RL   C
  5788.           04F4    CB 12                RL   D
  5789.           04F6    CB 13                RL   E
  5790.           04F8    CB 14                RL   H
  5791.           04FA    CB 15                RL   L
  5792.                                 
  5793.                                 
  5794.           04FC    17                   RLA
  5795.                                 
  5796.                                 
  5797.           04FD    CB 06                RLC   (HL)
  5798.           04FF    DD CB 36 06          RLC   (IX+INDEX)
  5799.           0503    FD CB 36 06          RLC   (IY+INDEX)
  5800.           0507    CB 07                RLC   A
  5801.           0509    CB 00                RLC   B
  5802.  
  5803.  
  5804.                                        86
  5805.  
  5806.  
  5807.  
  5808.  
  5809.  
  5810.                       APPENDIX B - ZILOG MNEMONICS       
  5811.  
  5812.  
  5813.           050B    CB 01                RLC   C
  5814.           050D    CB 02                RLC   D
  5815.           050F    CB 03                RLC   E
  5816.           0511    CB 04                RLC   H
  5817.           0513    CB 05                RLC   L
  5818.                                 
  5819.                                 
  5820.           0515    07                   RLCA
  5821.                                 
  5822.  
  5823.           0516    ED 6F                RLD
  5824.                                 
  5825.                                 
  5826.           0518    CB 1E                RR   (HL)
  5827.           051A    DD CB 36 1E          RR   (IX+INDEX)
  5828.           051E    FD CB 36 1E          RR   (IY+INDEX)
  5829.           0522    CB 1F                RR   A
  5830.           0524    CB 18                RR   B
  5831.           0526    CB 19                RR   C
  5832.           0528    CB 1A                RR   D
  5833.           052A    CB 1B                RR   E
  5834.           052C    CB 1C                RR   H
  5835.           052E    CB 1D                RR   L
  5836.                                 
  5837.                                 
  5838.           0530    1F                   RRA
  5839.                                 
  5840.                                 
  5841.           0531    CB 0E                RRC   (HL)
  5842.           0533    DD CB 36 0E          RRC   (IX+INDEX)
  5843.           0537    FD CB 36 0E          RRC   (IY+INDEX)
  5844.           053B    CB 0F                RRC   A
  5845.           053D    CB 08                RRC   B
  5846.           053F    CB 09                RRC   C
  5847.           0541    CB 0A                RRC   D
  5848.           0543    CB 0B                RRC   E
  5849.           0545    CB 0C                RRC   H
  5850.           0547    CB 0D                RRC   L
  5851.                                 
  5852.                                 
  5853.           0549    0F                   RRCA
  5854.                                 
  5855.                                 
  5856.           054A    ED 67                RRD
  5857.                                 
  5858.                                 
  5859.           054C    C7                   RST   0
  5860.           054D    CF                   RST   08H
  5861.           054E    D7                   RST   10H
  5862.           054F    DF                   RST   18H
  5863.           0550    E7                   RST   20H
  5864.           0551    EF                   RST   28H
  5865.           0552    F7                   RST   30H
  5866.           0553    FF                   RST   38H
  5867.                                 
  5868.  
  5869.  
  5870.                                        87
  5871.  
  5872.  
  5873.  
  5874.  
  5875.  
  5876.                       APPENDIX B - ZILOG MNEMONICS       
  5877.  
  5878.  
  5879.                                 
  5880.           0554    9E                   SBC   A,(HL)
  5881.           0555    DD 9E 36             SBC   A,(IX+INDEX)
  5882.           0558    FD 9E 36             SBC   A,(IY+INDEX)
  5883.           055B    9F                   SBC   A,A
  5884.           055C    98                   SBC   A,B
  5885.           055D    99                   SBC   A,C
  5886.           055E    9A                   SBC   A,D
  5887.           055F    9B                   SBC   A,E
  5888.           0560    9C                   SBC   A,H
  5889.           0561    9D                   SBC   A,L
  5890.           0562    DE 49                SBC   A,NN
  5891.           0564    ED 42                SBC   HL,BC
  5892.           0566    ED 52                SBC   HL,DE
  5893.           0568    ED 62                SBC   HL,HL
  5894.           056A    ED 72                SBC   HL,SP
  5895.                                 
  5896.                                 
  5897.           056C    37                   SCF
  5898.                                 
  5899.                                 
  5900.           056D    CB C6                SET   0,(HL)
  5901.           056F    DD CB 36 C6          SET   0,(IX+INDEX)
  5902.           0573    FD CB 36 C6          SET   0,(IY+INDEX)
  5903.           0577    CB C7                SET   0,A
  5904.           0579    CB C0                SET   0,B
  5905.           057B    CB C1                SET   0,C
  5906.           057D    CB C2                SET   0,D
  5907.           057F    CB C3                SET   0,E
  5908.           0581    CB C4                SET   0,H
  5909.           0583    CB C5                SET   0,L
  5910.                                 
  5911.                                 
  5912.           0585    CB CE                SET   1,(HL)
  5913.           0587    DD CB 36 CE          SET   1,(IX+INDEX)
  5914.           058B    FD CB 36 CE          SET   1,(IY+INDEX)
  5915.           058F    CB CF                SET   1,A
  5916.           0591    CB C8                SET   1,B
  5917.           0593    CB C9                SET   1,C
  5918.           0595    CB CA                SET   1,D
  5919.           0597    CB CB                SET   1,E
  5920.           0599    CB CC                SET   1,H
  5921.           059B    CB CD                SET   1,L
  5922.                                 
  5923.                                 
  5924.           059D    CB D6                SET   2,(HL)
  5925.           059F    DD CB 36 D6          SET   2,(IX+INDEX)
  5926.           05A3    FD CB 36 D6          SET   2,(IY+INDEX)
  5927.           05A7    CB D7                SET   2,A
  5928.           05A9    CB D0                SET   2,B
  5929.           05AB    CB D1                SET   2,C
  5930.           05AD    CB D2                SET   2,D
  5931.           05AF    CB D3                SET   2,E
  5932.           05B1    CB D4                SET   2,H
  5933.           05B3    CB D5                SET   2,L
  5934.  
  5935.  
  5936.                                        88
  5937.  
  5938.  
  5939.  
  5940.  
  5941.  
  5942.                       APPENDIX B - ZILOG MNEMONICS       
  5943.  
  5944.  
  5945.                                 
  5946.                                 
  5947.           05B5    CB DE                SET   3,(HL)
  5948.           05B7    DD CB 36 DE          SET   3,(IX+INDEX)
  5949.           05BB    FD CB 36 DE          SET   3,(IY+INDEX)
  5950.           05BF    CB DF                SET   3,A
  5951.           05C1    CB D8                SET   3,B
  5952.           05C3    CB D9                SET   3,C
  5953.           05C5    CB DA                SET   3,D
  5954.           05C7    CB DB                SET   3,E
  5955.           05C9    CB DC                SET   3,H
  5956.           05CB    CB DD                SET   3,L
  5957.                                 
  5958.                                 
  5959.           05CD    CB E6                SET   4,(HL)
  5960.           05CF    DD CB 36 E6          SET   4,(IX+INDEX)
  5961.           05D3    FD CB 36 E6          SET   4,(IY+INDEX)
  5962.           05D7    CB E7                SET   4,A
  5963.           05D9    CB E0                SET   4,B
  5964.           05DB    CB E1                SET   4,C
  5965.           05DD    CB E2                SET   4,D
  5966.           05DF    CB E3                SET   4,E
  5967.           05E1    CB E4                SET   4,H
  5968.           05E3    CB E5                SET   4,L
  5969.                                 
  5970.                                 
  5971.           05E5    CB EE                SET   5,(HL)
  5972.           05E7    DD CB 36 EE          SET   5,(IX+INDEX)
  5973.           05EB    FD CB 36 EE          SET   5,(IY+INDEX)
  5974.           05EF    CB EF                SET   5,A
  5975.           05F1    CB E8                SET   5,B
  5976.           05F3    CB E9                SET   5,C
  5977.           05F5    CB EA                SET   5,D
  5978.           05F7    CB EB                SET   5,E
  5979.           05F9    CB EC                SET   5,H
  5980.           05FB    CB ED                SET   5,L
  5981.                                 
  5982.                                 
  5983.           05FD    CB F6                SET   6,(HL)
  5984.           05FF    DD CB 36 F6          SET   6,(IX+INDEX)
  5985.           0603    FD CB 36 F6          SET   6,(IY+INDEX)
  5986.           0607    CB F7                SET   6,A
  5987.           0609    CB F0                SET   6,B
  5988.           060B    CB F1                SET   6,C
  5989.           060D    CB F2                SET   6,D
  5990.           060F    CB F3                SET   6,E
  5991.           0611    CB F4                SET   6,H
  5992.           0613    CB F5                SET   6,L
  5993.                                 
  5994.                                 
  5995.           0615    CB FE                SET   7,(HL)
  5996.           0617    DD CB 36 FE          SET   7,(IX+INDEX)
  5997.           061B    FD CB 36 FE          SET   7,(IY+INDEX)
  5998.           061F    CB FF                SET   7,A
  5999.           0621    CB F8                SET   7,B
  6000.  
  6001.  
  6002.                                        89
  6003.  
  6004.  
  6005.  
  6006.  
  6007.  
  6008.                       APPENDIX B - ZILOG MNEMONICS       
  6009.  
  6010.  
  6011.           0623    CB F9                SET   7,C
  6012.           0625    CB FA                SET   7,D
  6013.           0627    CB FB                SET   7,E
  6014.           0629    CB FC                SET   7,H
  6015.           062B    CB FD                SET   7,L
  6016.                                 
  6017.                                 
  6018.           062D    CB 26                SLA   (HL)
  6019.           062F    DD CB 36 26          SLA   (IX+INDEX)
  6020.           0633    FD CB 36 26          SLA   (IY+INDEX)
  6021.           0637    CB 27                SLA   A
  6022.           0639    CB 20                SLA   B
  6023.           063B    CB 21                SLA   C
  6024.           063D    CB 22                SLA   D
  6025.           063F    CB 23                SLA   E
  6026.           0641    CB 24                SLA   H
  6027.           0643    CB 25                SLA   L
  6028.                                 
  6029.                                 
  6030.           0645    CB 2E                SRA   (HL)
  6031.           0647    DD CB 36 2E          SRA   (IX+INDEX)
  6032.           064B    FD CB 36 2E          SRA   (IY+INDEX)
  6033.           064F    CB 2F                SRA   A
  6034.           0651    CB 28                SRA   B
  6035.           0653    CB 29                SRA   C
  6036.           0655    CB 2A                SRA   D
  6037.           0657    CB 2B                SRA   E
  6038.           0659    CB 2C                SRA   H
  6039.           065B    CB 2D                SRA   L
  6040.                                 
  6041.                                 
  6042.           065D    CB 3E                SRL   (HL)
  6043.           065F    DD CB 36 3E          SRL   (IX+INDEX)
  6044.           0663    FD CB 36 3E          SRL   (IY+INDEX)
  6045.           0667    CB 3F                SRL   A
  6046.           0669    CB 38                SRL   B
  6047.           066B    CB 39                SRL   C
  6048.           066D    CB 3A                SRL   D
  6049.           066F    CB 3B                SRL   E
  6050.           0671    CB 3C                SRL   H
  6051.           0673    CB 3D                SRL   L
  6052.                                 
  6053.                                 
  6054.           0675    96                   SUB   (HL)
  6055.           0676    DD 96 36             SUB   (IX+INDEX)
  6056.           0679    FD 96 36             SUB   (IY+INDEX)
  6057.           067C    97                   SUB   A
  6058.           067D    90                   SUB   B
  6059.           067E    91                   SUB   C
  6060.           067F    92                   SUB   D
  6061.           0680    93                   SUB   E
  6062.           0681    94                   SUB   H
  6063.           0682    95                   SUB   L                           
  6064.           0683    D6 49                SUB   NN
  6065.                                 
  6066.  
  6067.  
  6068.                                        90
  6069.  
  6070.  
  6071.  
  6072.  
  6073.  
  6074.                       APPENDIX B - ZILOG MNEMONICS       
  6075.  
  6076.  
  6077.                                 
  6078.           0685    AE                   XOR   (HL)
  6079.           0686    DD AE 36             XOR   (IX+INDEX)
  6080.           0689    FD AE 36             XOR   (IY+INDEX)
  6081.           068C    AF                   XOR   A
  6082.           068D    A8                   XOR   B
  6083.           068E    A9                   XOR   C
  6084.           068F    AA                   XOR   D
  6085.           0690    AB                   XOR   E
  6086.           0691    AC                   XOR   H
  6087.           0692    AD                   XOR   L
  6088.           0693    EE 49                XOR   NN
  6089.  
  6090.  
  6091.  
  6092.  
  6093.  
  6094.  
  6095.  
  6096.  
  6097.  
  6098.  
  6099.  
  6100.  
  6101.  
  6102.  
  6103.  
  6104.  
  6105.  
  6106.  
  6107.  
  6108.  
  6109.  
  6110.  
  6111.  
  6112.  
  6113.  
  6114.  
  6115.  
  6116.  
  6117.  
  6118.  
  6119.  
  6120.  
  6121.  
  6122.  
  6123.  
  6124.  
  6125.  
  6126.  
  6127.  
  6128.  
  6129.  
  6130.  
  6131.  
  6132.  
  6133.  
  6134.                                        91
  6135.  
  6136.  
  6137.  
  6138.  
  6139.  
  6140.                       APPENDIX B - ZILOG MNEMONICS       
  6141.  
  6142.  
  6143.  
  6144.  
  6145.  
  6146.  
  6147.  
  6148.  
  6149.  
  6150.  
  6151.  
  6152.  
  6153.  
  6154.  
  6155.  
  6156.  
  6157.  
  6158.  
  6159.  
  6160.  
  6161.  
  6162.  
  6163.  
  6164.  
  6165.  
  6166.  
  6167.  
  6168.  
  6169.  
  6170.  
  6171.  
  6172.  
  6173.  
  6174.  
  6175.  
  6176.  
  6177.  
  6178.  
  6179.  
  6180.  
  6181.  
  6182.  
  6183.  
  6184.  
  6185.  
  6186.  
  6187.  
  6188.  
  6189.  
  6190.  
  6191.  
  6192.  
  6193.  
  6194.  
  6195.  
  6196.  
  6197.  
  6198.  
  6199.  
  6200.  
  6201.  
  6202.  
  6203.  
  6204.  
  6205.  
  6206.                       APPENDIX B - ZILOG MNEMONICS       
  6207.  
  6208.  
  6209.  
  6210.  
  6211.                          APPENDIX C - SYSTEM MEMORY MAP
  6212.  
  6213.                        ||||||||||||||||||||||||||||||||||||     FFFF
  6214.                        ||                                ||
  6215.                        ||                                ||
  6216.                        ||      CP/M (BDOS and BIOS)      ||
  6217.                        ||                                ||
  6218.                        ||                                ||
  6219.                        ||||||||||||||||||||||||||||||||||||
  6220.                        ||                                ||
  6221.                        ||    Z8E (Approx 8.75 BYTES)     ||
  6222.                        ||                                ||
  6223.                        ||||||||||||||||||||||||||||||||||||
  6224.                        ||                                ||
  6225.                        ||     OPTIONAL SYMBOL TABLE      ||
  6226.                        ||                                ||
  6227.                        ||||||||||||||||||||||||||||||||||||
  6228.                        ||                                ||
  6229.                        ||                                ||
  6230.                        ||                                ||               
  6231.                        ||                                ||
  6232.                        ||                                ||
  6233.                        ||                                ||
  6234.                        ||              TPA               ||
  6235.                        ||                                ||
  6236.                        ||                                ||
  6237.                        ||                                ||
  6238.                        ||                                ||
  6239.                        ||                                ||
  6240.                        ||                                ||
  6241.                        ||                                ||
  6242.                        ||||||||||||||||||||||||||||||||||||  --- 0100
  6243.                        ||                                ||
  6244.                        ||      PAGE ZERO  RESERVED       || 
  6245.                        ||                                || 
  6246.                        ||||||||||||||||||||||||||||||||||||  ___ 0000
  6247.  
  6248.  
  6249.  
  6250.  
  6251.  
  6252.  
  6253.  
  6254.  
  6255.  
  6256.  
  6257.  
  6258.  
  6259.  
  6260.  
  6261.  
  6262.  
  6263.  
  6264.  
  6265.  
  6266.                                        93
  6267.  
  6268.  
  6269.  
  6270.  
  6271.  
  6272.                       APPENDIX B - ZILOG MNEMONICS       
  6273.  
  6274.  
  6275.                             COMMAND SUMMARY REFERENCE
  6276.  
  6277.         CMD         Description                      Arguments
  6278.  
  6279.          A        Inline  Assembly             StartAddr 
  6280.          B        Set Breakpoint               Addr1[,Pass Count]  [Addr2..AddrN]
  6281.          C        Clear Breakpoint             Addr1               [Addr2..AddrN]
  6282.          D        Dump Memory                  [StartAddr]         [End/Count] 
  6283.          E        Examine Memory               StartAddr
  6284.          F        Find                         StartAddr           MatchData
  6285.          G        Go                           ExecutionAddr
  6286.          H        Display Symbol Table         [FirstSymbol]
  6287.          I        Initialize command line      [string1..stringN]
  6288.          J        Full Screen/Animated Debug   [/] [*] [Addr]      [Timeout]
  6289.          K        Set Memory Window            StartAddr           [Size]
  6290.          L        Load File                    FileName            [,Load Address]
  6291.          M        Move Memory                  SourceStart    SourceEnd    DestStart
  6292.          N        Output to Port NO Pre-Read   [(] PortAddr [)]
  6293.          O        Output Current Breakpoints
  6294.          P        Exam/Modify PSW (Flag Reg)
  6295.          Q        Query I/O Port               [(] PortAddr [)]
  6296.          R        Examine/Modify Registers     RegSpecifier
  6297.          S        Single-Step                  [/]  [Count]
  6298.          U        Write Symbol Table To Disk   FileName    
  6299.          V        Verify Memory                SourceStart     SourceEnd   DestStart
  6300.          W        Write to Disk                FileName        [StartAddr] [EndAddr] 
  6301.          X        Examine Machine State
  6302.          Y        Fill Memory                  FromAddr        ToAddr       Data
  6303.          Z        Disassemble                  StartAddr       End/Count    FileName
  6304.  
  6305.  
  6306.  
  6307.         []        Denotes Optional Argument
  6308.         [/]       Do Not Trace Subroutine
  6309.         [*]       Do Not Trace BDOS Call  
  6310.         [(] [)]   I/O Port Monitor Mode
  6311.  
  6312.  
  6313.  
  6314.  
  6315.  
  6316.                        Z8E   Copyright (c) 1984  AERO-SOFT
  6317.  
  6318.  
  6319.  
  6320.  
  6321.  
  6322.  
  6323.  
  6324.  
  6325.  
  6326.  
  6327.  
  6328.  
  6329.  
  6330.  
  6331.  
  6332.                                        94
  6333.  
  6334.  
  6335.  
  6336.  
  6337.  
  6338.