Z8E USER'S MANUAL Copyright 1984 by RICK SURWILO 23 PLMOUTH ROAD STAMFORD,CONNECTICUT 06906 (203) 324-3809 TABLE OF CONTENTS Section Page I. INTRODUCTION 1 II. INSTALLATION 3                      III. INVOKING Z8E AT THE CP/M COMMAND LEVEL 13 IV. INITIALIZATION 19 V. COMMAND INPUT 23 VI. BREAKPOINTS 29 VII. COMMANDS: A Assemble 32 B Set Breakpoint 26 C Clear Breakpoint 27 D Dump 28 E Examine 29 F Find 31 G Go 33 H Display Symbol Table 34 I Input File 35 J Animated Full Screen Debugging 37 K Set Memory Window Address for J command 49 M Move Memory 50 N Output to I/O Port without Pre-read 51 O Output Current Breakpoints to Console 53 P Examine Flag Register 54 Q Query I/O Ports 55 R Register 57 S Single Step 58 U Save Symbol Table to Disk 60 V Verify Memory 61 W Write Memory Segment to Disk 62 X Display Machine State 63 Y Fill Memory 64 Z Disassemble 65 APPENDIX A - Symbol File Formats 69 APPENDIX B - ZILOG Mnemonics 73 APPENDIX C - System Memory Map 91 Z8E - Z80 DEBUG MONITOR Rick Surwilo Z8E - Z8° DEBUGGINÇ MONITOR I® INTRODUCTION Z8Å ió á professionaì qualitù interactivå debugginç tooì designeä tï speeä thå testinç oæ Z8° assemblù languagå programs®  Origin- allù writteî aó á standalonå monitor¬  Z8Å waó useä iî thå  deve- lopemenô  oæ thå world'ó largesô Touch-Tonå Input/Voicå  Responså system®  No÷ redonå tï ruî iî á CP/Í oò TurboDOÓ environmenô Z8Å containó  morå featureó iî lesó memorù thaî anù comparablå  soft- warå product® Occupyinç lesó thaî 9Ë oæ memory¬ Z8Å includeó thå followinç amonç itó manù features:       - Fulì screeî animateä displaù oæ thå prograí undeò         tesô whilå iô ió beinç executeä bù thå Z8°      - Completå Z8° inlinå assembler¬  witè labels¬ sym-         bols¬  expressions¬  anä directives¬  usinç Ziloç         mnemonics - Interactivå  disassemblù witè labeló anä  symboló         tï  consolå  oò disë allowó thå useò  tï  specifù         outpuô formató anä adä commentó       - Fullù  traceä prograí executioî includinç á  fulì         screeî singlå steð commanä thaô instructó Z8Å  tï         disassemblå  codå  anä tï movå thå cursoò tï  thå         nexô instructioî tï execute - Uð tï 1¶ useò settablå breakpointó witè  optionaì         pasó counts - Truå  symboliã  debugginç  usinç thå  inpuô  froí         multiplå  Microsofô  MACRO-8° .PRΠ anä  LINK-8°         .SYÍ  fileó anä Z80ASÍ .LSÔ anä SLRNË anä  Z80ASÍ         .SYÍ fileó froí SLÒ Systemó. - Dynamiã relocatioî oæ Z8Å aô loaä timå tï thå toð         oæ  useò  memorù regardlesó oæ  size®  Nï  useò         configuratioî oæ anù kinä ió required® Yoõ  maù  wanô tï spenä somå timå familarizinç yourselæ witè  thå manuaì anä Z8E'ó commanä structure¬ especiallù thå EXAMINÅ memorù command¬ beforå turninç tï thå INSTALLATIOÎ section. 1 Z8E - Z80 DEBUG MONITOR Rick Surwilo This Page Intentionally Left Blank. 2 Z8E - Z80 DEBUG MONITOR Rick Surwilo II. INSTALLATION Firsô makå á workinç copù oæ Z8E¬  theî placå youò originaì disk- ettå  iî  á safå place®  Makå alì modificationó tï  thå  workinç copy¬ noô thå original® Z8E'ó  (E)xaminå  memorù  commanä wilì bå useä tï  changå  memorù contents®  Thió  commanä ió describeä brieflù below®  Foò á  morå detaileä  explanatioî pleaså refeò tï SECTIOÎ Ö oæ  thió  manual¬ COMMAND INPUT. Z8Å requireó aî addressablå cursoò whicè caî bå patcheä  symboli- callù aó follows: Firsô instrucô Z8Å tï loaä itselæ aó welì aó thå symboì      file:        A>Z8E Z8E.COM Z8E.SYM      Thå  symboì filå Z8E.SYÍ containó thå namå anä  addresó      of each parameter which may need to be modified.      Uså thå (E)xaminå memorù commanä tï changå thå requireä      bytes®  Yoõ  maù  enteò commandó iî responså tï  Z8E'ó      asterisë  prompt®  Oncå yoõ enteò "E¢ followeä  bù  thå      symboliã  namå oæ thå addresó yoõ whicè tï change¬  Z8Å      wilì responä bù displayinç thå actuaì addresó followeä      bù  thå heø anä ASCIÉ representatioî oæ thå bytå  beinç      examineä (non-printablå characteró arå showî aó á "~")®      Foò exampleº      *Å MXYCÐ      285Å  ² þ XØ ;XØ representó your input      285F 1B ~ XX      2860 3D = XX      2861 00 ~ . ;PERIOD ENDS COMMAND      *      IMPORTANT:      Alwayó  patcè usinç thå symboliã namå oæ thå  variable»      thå addresseó showî iî thå examplå abovå arå foò demon-      stratioî onlù anä dï noô necessarilù reflecô thå actuaì      locationó oæ thå variableó iî memory. 3 Z8E - Z80 DEBUG MONITOR Rick Surwilo      Listeä  belo÷ arå thå symboliã nameó oæ  thå  addresseó      whicè maù havå tï bå patcheä foò youò CRT® MXYCP  - Cursoò addressinç lead-iî string®  Thå  firsô               bytå  (thå numbeò ² iî thå abovå example©  re-               presentó  thå  numbeò oæ byteó iî thå  string®               Thå strinç maù bå uð tï 1° byteó  long®  Thió               actuaì  lead-iî strinç shoulä immediatelù fol-               lo÷ thå counô byte.               Default is the two character string:                               1B (Hex), 3D (Hex)               ASCII ESCAPE, followed by EQUAL SIGN.                    ROWB4? - Set this byte as follows: NOT ZERO - Row is sent before Column ZERO - Column is sent before Row               Default is NOT ZERO, row sent before column.               ROW - Seô  thió bytå tï contaiî thå valuå whicè ió tï  bå               addeä ro÷ numbeò beforå iô ió senô tï thå screen. Default is 20 Hex, ASCII space. COLUMN - Seô  thió bytå tï contaiî thå valuå whicè ió tï  bå               addeä  columî  numbeò  beforå  iô ió  senô  tï  thå               screen® Defaulô ió 2° Hex¬ ASCIÉ space. CASE  - Thió  bytå  controló whetheò  yoõ  prefeò  enterinç               symboì  nameó  iî  uppeò oò loweò  case®  Iô  alsï               controló whetheò disassemblù wilì bå donå iî  uppeò               oò   loweò  case®   Patcè  as follows:       FF - lower case (DEFAULT)       00 - UPPER CASE      MAXLEN - Thió  ió  thå maximuí lengtè oæ permitteä  foò               symboì  names®  Thå permissablå valueó arå  ¶               anä  14®  Iæ patcheä tï anù otheò valuå  theî               Z8Å  wilì uså 6®  Thå maximuí lengtè  oæ  thå               symboì ió requireä bù Z8Å iî ordeò tï allocatå               spacå foò loadinç thå symboì table® Iæ MAXLEÎ               equaló  ¶ theî Z8Å reserveó ¸ bytå peò symbol¬               ¶  foò thå namå anä twï foò thå  address®  Iæ               thå  numbeò  1´ ió useä theî Z8Å  reserveó  1¶               byteó  peò symbol®  Hencå MAXLEÎ impactó  thå               amounô oæ TPÁ availablå tï thå prograí sincå á               symboì  tablå oæ 1¶ byteó peò entrù  obviouslù Š 4 Z8E - Z80 DEBUG MONITOR Rick Surwilo               takeó  uð  twicå aó mucè spacå aó onå  witè  ¸               bytå entries®               If¬  whilå  readinç iî thå symboló froí  disk¬               Z8Å  encounteró á symboì longeò thaî thå valuå               specifieä   iî  MAXLEΠ thå  symboì  namå   ió               truncated to MAXLEN.                6 - Maximum Symbol Length (DEFAULT)                              14 - Optional Symbol Length TO SAVE THE PATCHED PROGRAM: *W ANYNAME.COM (Writes the File to Disk) Thió completeó thå installatioî oæ Z8E® Typinç iî ^à (Controì C© iî  responså  tï  Z8E'ó asterisë prompô wilì returî  yoõ  tï  thå operatinç system. 5 Z8E - Z80 DEBUG MONITOR Rick Surwilo USER CODED CONSOLE I/O Thå followinç sectioî provideó detailó oî á methoä oæ  optionallù replacinç  thå  BDOÓ  calló foò Consolå I/Ï whicè Z8Å  useó  witè physicaì consolå I/Ï routineó oò direcô BIOÓ calls® Tï  modifù  theí uså thå symboì nameó listeä belo÷  anä  assemblå youò  routinå  aô thå appropriatå addresó (viá  Z8E'ó  (A)ssemblå commanä - Seå Manual). TTYQ: Thió  routinå checkó thå statuó oæ  thå  console®                 Iæ á characteò ió waitinç iô ió read»  otherwise¬                 TTYQ  returnó  á  zerï iî Á tï indicatå  thaô  nï                 characteò ió waiting.      TTYIº Reaä á character¬ waitinç untiì onå arrives.       Return Character in A.      TTYOº Outpuô á character¬ waitinç untiì iô ió sent.       Character passed in A. Listeä belo÷ ió thå codå thaô Z8Å useó tï dï consolå I/O»  uså iô aó  á model®  Youò routineó shoulä replacå thå instructionó  witè thå  doublå  semicolons®  Bå surå tï savå thå reqisteró aó  sho÷ below® Thå sizå oæ eacè routinå musô noô exceeä 3² bytes® 6 Z8E - Z80 DEBUG MONITOR Rick Surwilo TTYQ: push bc push de push hl ld c,11 ;;Check Console Status call BDOS ;;BDOS returns: A = 00 No Character ;; A = NZ Input Waiting ;; and a ;;Character Here? ld c,6 ;; ld e,0ffh ;; calì nz,BDOÓ ;;Iæ Characteò Herå Reaä It... ;; Else Fall Thru pop hl pop de pop bc and 7fh ret org TTYQ+32 TTYI: push bc push de push hl TTYI00: ld c,06 ;;Unadorned Console Input ld e,0ffh ;;Tell CP/M this is Input Request call BDOS ;; and 7fh ;;Strip Parity jr z,TTYI00 ;;Loop til Input Arrives pop hl pop de pop bc ret org TTYI+32 TTYO: push af push bc push de push hl ld c,02 ;; ld e,a ;; call BDOS ;;Console Output pop hl pop de pop bc pop af ret org TTYO+32 7 Z8E - Z80 DEBUG MONITOR Rick Surwilo Thå symboló TTYQ¬ TTYI¬ anä TTYÏ arå includeä iî Z8E.SYM® There- forå  theså  routineó  caî bå patcheä  symbolicallù  usinç  Z8E'ó assemblå command¬ foò exampleº *A TTYQ 1F76 C5 TTYQ: PUSH BC Z8Å  alsï containó á provisioî foò useò installeä  initializatioî code®  Aó  sooî aó Z8Å ió loaded¬  buô beforå iô relocateó itselæ intï higè memory¬  iô makeó á calì tï INIT®  Aó presentlù confi- gureä INIÔ merelù containó á REÔ instruction®  Howeveò thå  useò maù adä uð tï 12· byteó oæ initializatioî code® Thió codå maù bå useä  foò anù purpose¬  foò example¬  tï changå youò SIÏ oò  Uarô froí  interrupô driveî tï non-interrupô driveî iî thå evenô  thaô thå  Z8Å  consolå routineó werå replaced®  Anù codå installeä  aô INIÔ  ió executeä oncå anä ió noô moveä tï higè memorù  witè  thå resô oæ Z8E® Yoõ neeä noô savå anù registers. 8 Z8E - Z80 DEBUG MONITOR Rick Surwilo SUPPLYING YOUR OWN CURSOR ADDRESSING ROUTINE Iæ  youò computeò requireó á custoí cursoò addressinç routinå  iô can be easily added by following the steps listed below: 1.  Examinå  thå Z8E.SYÍ filå thaô tï determinå thå addresó      oæ  Z8E'ó standarä cursoò addressinç routinå  whicè  ió      calleä XYCP®  Associateä witè namå XYCÐ iî thå filå ió      itó absolutå address. 2.   Usinç youò owî texô editoò codå youò routinå and prefacå  iô      witè thå followinç puedo-ops:       ASEG       .PHASE XXXXH       Wherå  XXXØ  representó thå  absolutå  hexadecimaì           addresó obtaineä iî steð 1. 9 Z8E - Z80 DEBUG MONITOR Rick Surwilo      Z8Å wilì pasó thå ro÷ addresó iî thå  REGISTEÒ anä thå      columî  addresó  iî thå à REGISTER®  Ro÷ numberó  rangå      froí ° tï 2³ whilå columî numberó rangå froí ° tï 79®      Youò joâ ió tï translatå theså twï numbeò intï á cursoò      postion on the screen of your CRT.      Savå  alì  registeró includinç BC®  Uså  thå  followinç      skeletoî aó á guide:       ASEG       .PHASÅ XXXØ ;From  Z8E.SYM       YOURS:       PUSH BC       PUSH DE       PUSH HL       CURSOR ADDRESSING CODE HERE       POP HL       POP DE       POP BC       RET       END            Uså  Z8E'ó outpuô routinå TTYÏ aó describeä  abovå  (oò      youò  owî  routine©  tï outpuô thå characteró  iî  youò      cursoò addressinç sequence® Obtaiî thå absolutå addresó      oæ  TTYÏ froí thå filå Z8E.SYM®  Codå thå calì  tï  thå      subroutinå  usinç thå absolutå addresó iî  hexadecimal®      For instance, if Z8E.SYM contains the entry:       2FE2 TTYO      then code your call statements as:       CALL 2FE2H      Z8Å imposeó onlù onå restrictioî oî thå codå yoõ write®      Iî  ordeò  tï guaranteå thaô youò routinå caî bå  relo-      cateä  intï higè memorù bù Z8Å dï noô loaä anù  1¶  biô      constantó  intï  registeò pairs»  insteaä dï twï ¸  biô      loads®  Foò example¬  dï noô uså thå followinç  state-      ment:       LD HL,1234H      Rather, code it like this:       LD H,12H       LD L,34H Š 10 Z8E - Z80 DEBUG MONITOR Rick Surwilo      Thió  ió  thå onlù restrictioî otheò thaî  thå  maximuí      codå  lengtè whicè ió placeä oî youò codå whicè ió  12¸      bytes. 3.   Assemblå  youò routinå witè eitheò Macro-8° oò  Z80ASM®      Link it with either Link-80 or SLRNK. 11 Z8E - Z80 DEBUG MONITOR Rick Surwilo 4.   Load Z8E.COM using Z8E:       A>Z8E Z8E.COM Z8E.SYM       * 5.   Now overlay Z8E's cursor address code with your own:       *I YOURCODE.COM,XYCP      Z8Å wilì loaä youò cursoò addressinç routinå oî toð itó      owî  beginninç  aô  thå  addresó  associateä  witè  thå      symbol XYCP.          6.   Save the new file using a name of your choosing:       *W NEWDEBUG.COM 7.   Exiô  bacë  tï  thå  operatinç  systeí  bå  enterinç  á      Control-C at the asterisk prompt. 12 Z8E - Z80 DEBUG MONITOR Rick Surwilo This Page Intentionally Left Blank. 13 Z8E - Z80 DEBUG MONITOR Rick Surwilo III. INVOKING Z8E AT THE CP/M COMMAND LEVEL Upoî  invokatioî aô thå CP/Í commanä leveì Z8E loadó aô  thå  lo÷ enä  oæ thå Transienô Prograí Areá (TPA© whicè beginó aô absolutå addresó 100H®  Thå TPÁ ió thå areá iî memorù wherå useò  programó arå executed® Oncå  loadeä Z8Å determineó thå sizå oæ thå TPÁ bù examininç  thå addresó  fielä oæ thå jumð instructioî aô locatioî 5®  Thió  ad- dresó  representó  botè thå entrù poinô intï CP/Í anä thå enä  oæ thå TPA®  Z8Å loweró thió addresó bù approximatelù 9Ë byteó  anä relocateó intï thió areá bù adjustinç alì addresseó withiî itselæ tï reflecô itó ne÷ location®  Thå jumð instructioî aô locatioî µ ió similiarlù modifieä tï reflecô thå ne÷ sizå oæ thå TPA®  Thuó alì  programó  whicè uså thió addresó tï determinå thå amounô  oæ availablå memorù caî ruî unchanged®  Z8Å completeó itó initiali- zatioî  bù storinç á jumð instructioî tï itó breakpoinô  handlinç softwarå aô absolutå addresó 3¸ (hexadecimal)® Symboló whicè arå loadeä froí fileó arå storeä bù Z8Å iî á symboì tablå aô thå toð oæ thå TPÁ jusô belo÷ Z8E® Z8Å wilì dynamicallù allocatå  thå  storagå necessarù tï holä alì symboló loadeä  froí files» however¬ Z8Å alsï allowó thå useò tï enteò hió owî symboló froí  thå  keyboarä viá thå (A)ssemblå  command®  Z8Å  doeó  NOT reservå ANY spacå iî memorù foò useò generateä symbols® Thå useò musô  explicitlù  requesô memorù spacå oî thå CP/Í commanä  line® Thió ió accomplisheä bù enterinç thå numbeò oæ symboló foò  whicè spacå  shoulä bå reserveä aó á decimaì number®  Thió numbeò musô bå encloseä iî parentheseó anä musô appeaò aó thå firsô  argumenô oî thå commanä linå aó showî below: A>Z8E (32) Iî  thió examplå thå useò haó requesteä spacå foò 3² useò defineä symbols®  Iæ  MAXLEÎ haó bå seô tï ¶ (Seå INSTALLATIOΠ Section© theî  eacè symboì requireó ¸ byteó oæ  storage¬  hence¬  iî  thió examplå  Z8Å wilì seô asidå 25¶ byteó oæ memorù foò useò  defineä symbols® Subsequenô actioî ió baseä oî thå formaô oæ thå remaindeò oæ  thå commanä linå aó entereä bù thå user® Iî thå exampleó thaô follo÷ beaò  iî  minä  thaô anù oæ theså commanä lineó maù  contaiî  thå argumenô  requestinç memorù spacå foò useò symboì tablå  entries® Thå argumenô woulä appeaò immmediatå afteò "Z8E¢ iî everù case. 1® A>Z8E Z8E resideó aó á standalonå prograí iî memory. 2. A>Z8E USERFILE.COM                    USERFILE.COÍ ió loadeä aô thå beginninç oæ thå Š 14 Z8E - Z80 DEBUG MONITOR Rick Surwilo                    TPÁ  anä ió readù tï bå acteä oî bù  Z8E  com-                    mands®  3. A>Z8E USERFILE.COM USERFILE.SYM [,bias]                    USERFILE.SYÍ ió reaä iî bù Z8E anä alì  symboì                    nameó containeä iî thå filå arå entereä intï á                    tablå  whicè beginó aô thå startinç addresó oæ                    Z8E (thå endinç addresó oæ thå "new¢ TPA©  anä                    extendó  downwarä  iî  memory®  Thå  optionaì                    bias¬  iæ  specified¬  ió á 1¶ biô valuå whicè                    wilì bå addeä tï thå 1¶ biô addresó associateä                    witè eacè symboì iî thå file®  (Iî thió exam-                    plå á .SYÍ filå ió shown»  however¬ sincå alì                    addresseó  appearinç iî á .SYÍ filå arå  abso-                    lutå  thå optionaì biaó woulä probablù noô  bå                    used.)                    USERFILE.COÍ ió loadeä aô thå starô oæ thå TPÁ                    onlù afteò thå .SYÍ filå haó beeî reaä anä thå                    symboì  tablå built®                       4® A>Z8E USERFILE.COÍ USERFILE.PRN [,bias]                                         Aó  iî  thå previouó examplå  USERFILE.COÍ  ió                    loadeä  aô thå beginninç oæ thå  TPA¬  buô  iî                    thió instancå á .PRÎ filå ió useä tï construcô                    thå  symboì table®  Thå optionaì biaó becomeó                    verù  usefuì iæ thå .LSÔ oò .PRΠ filå  repre-                    sentó  thå  listinç oæ á relocatablå  program®                    Relocatablå programó linkeä usinç  Microsoft'ó                    LINK-8° defaulô tï á loaä addresó oæ 103È witè                    thå  threå  byteó  oæ memorù locateä  aô  100È                    containinç  á jumð tï thå entrù poinô  oæ  thå                    program®  Therefore¬  iæ  thå useò supplieó á                    biaó  oæ 10³ iî thå commanä linå alì  relocat-                    ablå  symboló iî thå filå wilì  bå  associateä                    witè  theiò actuaì addresseó iî  memory®  Anù                    biaó  specifieä  wilì onlù bå addeä  tï  thoså                    symboló  whicè arå flaggeä aó codå relativå iî                    thå .PRÎ file® Á biaó wilì noô bå addeä tï anù                    symboì  flaggeä  aó  ABSOLUTE¬   EXTERANL¬  OÒ                    COMMON.                    USERFILE.COÍ ió loadeä aô thå starô oæ thå TPÁ                    onlù afteò thå .LSÔ oò .PRÎ filå haó beeî reaä                    anä thå symboì tablå built. 15 Z8E - Z80 DEBUG MONITOR Rick Surwilo 5® A>Z8E USERFILE.COÍ USERFILE.SYÍ [,biasÝ NFILE.LST [,bias]                                         Thå truå poweò oæ Z8E'ó symboì loadinç ió besô                    evidenceä wheî loadinç multiplå symboì  tableó                    froí  severaì files®  Thå firsô filå ió  gen-                    erallù  á .SYÍ filå specifyinç alì thå  globaì                    symboì nameó iî thå prograí tï bå tested® Thå                    subsequenô fileó specifieä oî thå commanä linå                    arå  usuallù .PRÎ oò .LSÔ fileó oæ thå indivi-                    duaì  sourcå moduleó thaô werå originallù  as-                    sembleä  anä theî linkeä (whicè  produceä  thå                    .SYÍ file)® Althougè onlù twï fileó (USERFILÅ                    anä NFILE© arå showî iî thió example¬ iî actu-                    alitù thå numbeò oæ .SYÍ anä .PRÎ fileó speci-                    fieä  iî  thå commanä linå ió limiteä onlù  bù                    thå  sizå  oæ Z8E'ó inpuô buffeò whicè  ió  8°                    characteró long.                    USERFILE.COÍ  ió loadeä aô thå starô  oæ  thå                    TPÁ  onlù  afteò alì .SYÍ anä .PRN/.LSÔ  fileó                    havå beeî reaä anä thå symboì tablå built.                    Note:                    Iæ nï biaó ió specified¬  Z8E wilì uså á  biaó                    oæ zero® Iæ  morå thaî onå .LSÔ oò .PRÎ filå ió beinç  loaded¬  theî  eacè filå  namå caî bå specifieä witè itó owî bias®  Thå biaó maù  bå entereä iî thå forí oæ á symboì name¬ hexadecimaì number¬ decimaì number¬  oò  anù combinatiioî oæ thå threå iî aî expressioî usinç thå  « anä - operators®  Iæ thå individuaì modulå haó  á  globaì entrù  point¬  thå namå oæ whicè waó previouslù loaded¬  thå useò caî  biaó alì symboló witè thå valuå associateä witè  thió  name® Iî  thió  waù alì symbols¬  botè absolutå  anä  relocatable¬  arå associateä witè theiò actuaì locatioî iî memory. Z8Å  aó  presentlù configureä caî builä á symboì tablå  froí  thå list files produced by the following programs: 1. Microsoft MACRO-80 V3.37 .PRN Files May 8, 1980 2. Microsoft MACRO-80 V3.44 .PRN Files Dec 9, 1981 3. Microsoft LINK-80 V3.44 .SYM Files Dec 9, 1981 4. SLR Systems Z80ASM V1.07 .LST Files 5. SLR Systems SLRNK V1.07 .SYM Files Z80ASÍ anä SLRNË maù bå configureä foò 8° oò 13² columî output. Z8Å  useó thå filå namå extensioî (thå threå characteró appearinç tï thå righô oæ thå period© tï determinå thå formaô oæ thå  file® Eacè  oæ  thå abovå filå typeó haó á distinguishinç  format®  Thå characteritics of each type are described in APPENDIX A. Š 16 Z8E - Z80 DEBUG MONITOR Rick Surwilo Durinç thå loadinç procesó Z8E displayó statuó anä erroò messageó oî  thå  consolå relatinç tï thå activitù iî  progresó  aó  showî below:          STATUS MESSAGE DESCRIPTION 1. Loading: USERFILE.COM          Z8E  ió attemptinç tï opeî                                        thå  nameä  filå (iî  thió                                        case, USERFILE.COM) 2. Number of symbols loaded: Followinç  thå loadinç  oæ                                        alì symboló froí á listinç                                        filå  oò  á .SYÍ filå, thå                                        numbeò  oæ symboló  loadeä                                        froí thå specifieä filå ió                                        displayeä  aó  á   decimaì                                        number. 3. Loaded: 100 YYYY Z8E displayó thå  startinç           Pages:  ZZZ                  anä  endinç memorù addres-                                        seó  oæ  thå  targeô  filå                                        (thå firsô filå  specifieä                                        oî  thå CP/Í commanä  linå                                        anä thå onå whicè ió goinç                                        tï bå debugged).                                       "Pages:¢   referó  tï  thå                                        decimaì  numbeò  oæ  pageó                                        anä  ió thå counô  oæ  25¶                                        bytå  pageó  iî thå  file®                                        Thió numbeò maù bå subse-                                        quentlù useä witè thå CP/Í                                        SAVÅ commanä oncå thå  de-                                        buç sessioî ends® ERROR MESSAGE DESCRIPTION 1.  File not found               Thå  filå specifieä iî thå                                        commanä coulä noô bå founä                                        oî thå specifieä drive. 2.  Symbol table not found       Thå   specifieä  filå  waó                                        founä buô diä noô  contaiî                                        á  properlù formatteä sym-                                        boì table. 3.  Invalid offset - using 0000 Thå  useò haó specifieä aî                                        invaliä offseô tï bå addeä                                        tï eacè loadeä symbol® Z8E                                        wilì continuå tï loaä thió                                        symboì  filå buô wilì  noô                                        adä  anù biaó tï thå  sym-Š 17 Z8E - Z80 DEBUG MONITOR Rick Surwilo                                        bols® Thió erroò maù havå                                        occureä  becauså thå  useò                                        specifieä aî offseô iî thå                                        forí oæ á symboì whicè haä                                        noô    beeî     previouslù                                        loaded¬  oò  thå useò  maù                                        havå  specifieä á  numeriã                                        valuå  whicè containeä  aî                                        illegaì character. 4. Syntax Error Thå  filå namå waó  incor-                                        rectlù specified® Afteò  alì useò files¬  botè symboì fileó anä thå .COÍ filå tï bå debugged¬  havå beeî loadeä Z8E displayó currenô memorù usagå  aó follows: Total Symbols: XXXX Symbol Table: XXXX - XXXX Z8E relocated: XXXX - XXXX Top of memory: XXXX     Iô  ió importanô tï notå thaô Z8E expectó thå fileó appearinç  iî thå  commanä  linå tï bå appeaò iî á specifiã order®  Thå  firsô filå  namå  appearinç iî thå commanä linå ió assumeä  tï  bå  thå targeô filå whicè ió tï bå debugged®  Iô ió alwayó thå lasô filå tï  bå loaded®  Alì filå nameó followinç thå targeô filå namå arå assumeä tï bå symboì inpuô fileó anä theù arå loadeä iî thå ordeò iî whicè theù appear. Thå  firsô  filå  nameä  iî thå commanä  linå  ió  alwayó  loadeä startinç aô addresó 10° hex®  Thå "I¢ commanä containó aî optioî tï  allo÷  thå filå tï bå loadeä aô á  differenô  address®  Thió feature is not available at the CP/M command line level. Foò á discussioî oæ thå formaô oæ symboì fileó seå APPENDIØ A. 18 Z8E - Z80 DEBUG MONITOR Rick Surwilo This Page Intentionally Left Blank. 19 Z8E - Z80 DEBUG MONITOR Rick Surwilo IV. INITIALIZATION Oncå Z8E haó beeî loaded¬ anä haó iî turî loadeä alì fileó speci- fieä oî thå commanä line¬  iô initializeó alì useò registeró tï ° witè thå followinç exceptions: Thå  user'ó prograí counteò containó addresó  10°  heø      whicè ió thå starô oæ thå TPA®       Thå  user'ó  stacë pointeò ió seô tï thå startinç  ad-      dresó  oæ Z8Å (thå toð oæ thå TPA© minuó  two®  Theså      twï  byteó  arå seô tï zerï iî  accordancå  witè  CP/Í      convention®  Wheî CP/Í loadó á prograí iô initializeó      á  stacë foò thå loadeä prograí bù pushinç thå addresó      oæ  thå jumð tï thå systeí warí booô routinå ontï  it®      Thuó useò programó (STAT.COÍ ió aî example© caî chooså      tï terminatå themselveó anä returî tï CP/Í bù  execu-      tinç  aî REÔ througè thió addresó oî thå  stack®  Z8Å      accomplisheó  thå  samå objectiveº  thå 000°  oî  thå      stacë  permitó thå useò prograí tï returî tï CP/Í  viá      addresó  000°  whicè  alwayó containó á  jumð  tï  thå      system'ó warí booô routine®            Thå  useò  É (interrupt© registeò ió seô tï thå  valuå      containeä  iî  thå  É registeò wheî  Z8E  waó  loaded®      Modifù aô youò owî risk. Alì  inpuô anä outpuô bù Z8E ió accomplisheä usinç  bufferó  con- taineä withiî itself® Z8E doeó noô uså thå defaulô DMÁ buffeò aô absolutå  locatioî  8° noò doeó iô uså thå defaulô  Filå  Controì Blocë  (FCB©  aô absolutå locatioî 5C. Note:            Wheî  CP/Í finisheó loadinç  anù  program¬            includinç  Z8E¬  iô moveó thå commanä linå            taiì tï thå defaulô DMÁ buffeò aô absolutå            addresó  8° (hex© anä initializeó thå  de-            faulô  FC aô absolutå addresó 5à tï  thå            namå oæ thå firsô filå (oò firsô twï fileó            iæ twï oò morå arå specified© appearinç iî            thå commanä line®  Z8E makeó uså oæ thió            informatioî  iî  ordeò tï loaä  thå  useò            prograí  anä  anù symboì  files®  Iæ  thå            prograí  tï bå testeä alsï expectó aî ini-            tializeä FC and/oò DMÁ buffeò (aó ió verù            ofteî thå case)¬ theî thå useò musô effecô            thió  beforå  attemptinç  tï  executå  thå            program®             Foò  example¬  manù texô editinç  programó            arå  invokeä  bù  typinç thå namå  oæ  thå            editoò prograí followeä bù thå namå oæ thå Š 20 Z8E - Z80 DEBUG MONITOR Rick Surwilo            prograí tï ediô oî thå CP/Í commanä  line¬            aó iî hypotheticaì case:             A>EDIT B:FYL2EDIT.BAS            Oncå thå prograí EDIT.COÍ ió loadeä iô maù            expecô  tï finä thå defaulô FC tï bå  al-            readù    seô   uð   tï   reaä   thå   filå            FYL2EDIT.BAS®  EDIT.COÍ  maù alsï  expecô            thå  DMÁ buffeò tï contaiî thå  numbeò  oæ            characteró  iî thå commanä linå aô addresó            80¬  aó  welì thå thå texô oæ thå  commanä            linå startinç aô addresó 81® Iî thió exam-            plå  locatioî 8° woulä contaiî á  hexadec-            imaì Æ (decimaì 15© representinç thå  num-            beò   oæ  characters¬   anä  locationó  8±            througè 8Æ woulä contaiî thå 1µ characteró            (spacå througè S)®  Similiarly¬  thå firsô            bytå  oæ  thå defaulô FC  aô  addresó  5à            woulä  contaiî thå numbeò ± (numeriã equi-            valenô  oæ drivå B© anä thå nexô 1±  byteó            woulä  contaiî thå filå namå  FYL2EDIÔ  iî            ASCII®  Iæ  thå namå FYL2EDIÔ waó shorteò            thaî ¸ characters¬  theî thå remaindeò  oæ            thå  filå  namå fielä iî thå FC woulä  bå            filleä witè ASCIÉ spaces® Thå nexô ³ byteó            woulä contaiî thå filå typå iî  ASCII»  iî            thió  examplå thå filå typå ió BAS®  Iæ nï            filå typå waó specified¬  thió fielä woulä            contaiî ³ ASCIÉ spaces.            Now¬  iæ  thå  useò waó tï debuç thå  EDIÔ            prograí usinç Z8E¬  thió initializatioî oæ            thå  defaulô  DMÁ buffeò anä  defaulô  FC            musô  bå accomplisheä "bù hand¢  prioò  tï            attemptinç tï debuç EDIT.COM¬ owinç tï thå            facô thaô CP/Í haó alreadù seô uð theså tï            areaó  witè thå datá froí thå commanä linå            whicè waó typeä iî tï loaä Z8E® Iî short¬            EDIÔ musô bå trickeä intï believinç iô waó            loadeä bù CP/Í anä noô bù Z8Å anä thå useò            musô  perforí thå initializatioî oæ  theså            twï areas® Thå useò maù uså thå Å commanä            (tï  storå botè ASCIÉ anä numeriã datá  iî            memory© tï simulatå aî initializeä commanä            linå buffeò anä FCB®  Furtheò informatioî            regardinç  thå formaô oæ thå FC  anä  DMÁ            buffeò  maù må founä iî Digitaì Research'ó            CP/Í 2.° INTERFACÅ GUIDE. 21 Z8E - Z80 DEBUG MONITOR Rick Surwilo DEBUGGING HINT: Iô  ió  noô necessarù tï initializå thå defaulô  FC  and/oò  thå defaulô  (commanä  line©  DMÁ buffeò everù timå á prograí  tï  bå testeä ió loadeä (iæ indeeä thió prograí utilizeó them)® Insteaä follo÷ thå procedurå listeä belo÷ (Iæ yoõ haven'ô reaä thå  indi- viduaì commanä summarieó thå followinç maù makå morå senså later):           Oncå  yoõ  havå  loadeä thå prograí  tï  tesô           perforí  thå requireä initializatioî  oæ  thå           FCB'ó  aô  5CÈ anä 6CÈ anä thå  commanä  linå           buffeò  aô 80È usinç thå Å command®  Uså  thå           ASCIÉ strinç optioî witè thå Å commanä tï seô           thå  texô  portions®  Uså thå  numeriã  inpuô           functioî tï intializå thå drivå specificatioî           aô addresó 5à anä thå characteò counô aô 80H®           Uså  thå × commanä tï writå ouô memorù start-           inç aô addresó ZERO® Aó in: *W NEWFILE.COM 0 XXXX           Wherå XXXØ ió thå highesô addresó yoõ wisè tï           save®  No÷ thå nexô timå yoõ loaä thió  filå           iô  wilì oæ courså loaä aô addresó 100H®  Uså           thå  Í  (movå memorù command© tï movå  iô  tï           locatioî 0000®  Youò FC anä DMÁ buffeò  arå           initialized® *M 100 XXXX+100 0 22 Z8E - Z80 DEBUG MONITOR Rick Surwilo This Page Intentionally Left Blank. 23 Z8E - Z80 DEBUG MONITOR Rick Surwilo V. COMMAND INPUT   Oncå  filå  anä  symboì tablå loadinç  haó  beeî  completed¬  Z8E promptó  thå  operatoò foò commanä inpuô bù  displayinç  thå  "*¢ character® Thå operatoò caî theî typå anù oæ Z8E'ó singlå letteò commands®  Somå  commandó requirå nï argumentó whilå otheró  re- quirå betweeî onå anä four® Argumentó maù bå iî anù oæ thå formó listeä  belo÷ (excepô aó noteä iî thå descriptioî oæ thå  indivi- duaì commands)º SYMBOL:       Anù  symboì previouslù loadeä  oò  previouslù                     entereä  viá thå keyboarä (seå Á command© maù                     appeaò aó á commanä argument® Alì symboló arå                     treateä aó 1¶ biô values.                      HEX: Á  1¶  biô  heø numbeò maù bå entereä  aó  aî                     argument®  Onlù thå lasô fouò characteró  en-                     tereä arå treateä aó significanô inpuô iæ Z8E                     ió  expectinç  á 1¶ biô  argument®  Iî  thoså                     instanceó wherå Z8E expectó á ¸ biô argument¬                     onlù thå lasô twï characteró arå significant®                     Aó  such¬  thå useò maù elecô tï correcô mis-                     takeó bù eitheò backspacinç anä retyping¬  oò                     bù  continuinç tï enteò thå numbeò anä  ensu-                     rinç  thaô thå erroneouó digiô doeó noô  ap-                     peaò  iî thå rightmosô fouò (oò two©  charac-                     teró aó showî iî thå followinç example:                        *E 1E21F4                               Iæ  á 1¶ biô argumenô  ió  expecteä                               Z8E  woulä  ignorå  thå  firsô  twï                               digitó  (± anä E© anä woulä examinå                               thå  contentó  oæ  memorù  locatioî                               21F4.                     Iæ  nï symboì tablå ió presenô iî memorù theî                     hexadecimaì numberó (¸ oò 1¶ bitó iî  length©                     maù begiî witè anù digiô ° - F®  However¬ iæ                     á  symboì tablå ió iî memorù theî alì hexade-                     cimaì numberó whicè begiî witè á digiô iî thå                     rangå  Á  - Æ arå evaluateä firsô  aó  symboì                     names®  Iæ nï correspondinç namå ió founä iî                     thå symboì tablå theî Z8Å attemptó tï reeval-                     uatå thå namå aó á hexadecimaì  number®  Foò                     example¬  thå  tokeî  DEAÄ ió á valiä  symboì                     nameó aó welì aó á valiä hexadecimaì  number®                     Iæ  á symboì tablå ió presenô theî Z8Å  firsô                     searcheó  thå  symboì tablå lookinç  foò  thå                     strinç  DEAD.  Iæ  nï matcè occuró theî  Z8Å Š 24 Z8E - Z80 DEBUG MONITOR Rick Surwilo                     treató DEAÄ aó thå hexadecimaì numbeò  0DEAD®                     Tï  forcå  Z8Å tï evaluatå aî argumenô  aó  á                     hexadecimaì numbeò prefiø thå argumenô witè á                     leadinç zerï aó iî 0DEAD® REGISTER: Valiä Z8° 1¶ biô registeò nameó arå  permit-                     teä  aó arguments®  Iæ á 1¶ biô registeò namå                     ió  entered¬   Z8E  useó  thå  1¶  biô  valuå                     currentlù containeä iî thå specifieä registeò                     paiò  iî thå user'ó registeò seô aó aî  argu-                     ment®                      *D HL 8                               instructó  Z8Å  tï dumð  thå  firsô                               eighô  oæ  memorù byteó  whicè  arå                               locateä aô thå addresó containeä iî                               thå user'ó HÌ registeò pair Valid 16 bit register names: AF - Accumulator and Flag BC - BC register pair DE - DE register pair HL - HL register pair SP - Stack Pointer P - Program Counter PC - Program Counter IX - IX index register IY - IY index register                     Notå  thaô thå prograí counteò maù bå  speci-                     fieä iî eitheò oæ twï ways®  Thå singlå cha-                     racteò "P¢ caî bå useä tï specifù thå prograí                     counteò  provideä  iô doeó noô appeaò  iî  aî                     expression®  Tï includå thå currenô valuå oæ                     thå  user'ó prograí counteò iî aî  expressioî                     thå mnemoniã "PC¢ musô bå used.                     Iæ aî expressioî useä aó aî argumenô containó                     á  registeò  paiò aó onå oæ  itó  terms¬  thå                     registeò paiò musô bå thå firsô term®  Also¬                     onlù  onå registeò paiò maù bå includeä iî aî                     expression:                      HL+4 valid expression                      5+DE invaliä expressioî - registeò                                    paiò ió noô thå firsô term                                                  HL+BC      invaliä   expressioî  - morå                                    thaî  onå  registeò paiò  waó Š 25 Z8E - Z80 DEBUG MONITOR Rick Surwilo                                    specified                          P-3      invaliä   expressioî   - "PC¢                                    musô  bå useä tï includå  thå                                    currenô  valuå oæ thå prograí                                    counter in an expression                                                         Tï   differentiatå  betweeî  thå  hexadecimaì                     numberó AF¬  BC¬  anä DÅ anä thå Z8° registeò                     pairó oæ thå samå namå bå surå tï prefiø  thå                     numericaì versioî witè á leadinç 0.                     Notå  alsï thaô thå Z8° primå registeò  nameó                     arå  noô alloweä aó argumentó excepô iî thå Ò                     command.      REGISTER  Z8Å allowó thå useò tï specifù thå datá  con- INDIRECT:     taineä iî thå memorù locatioî pointeä tï bù á                     registeò paiò aó aî argument®  Foò instance¬                     iæ thå user'ó HÌ registeò paiò containeä 18EÅ                     anä thå addresseó 18EÅ anä 18EÆ containeä thå                     byteó  4² anä 6± respectively¬  theî thå com-                     manä *Å (HL© woulä examinå thå  contentó                     oæ  memorù locatioî 6142®  Notå thaô registeò                     indirecô  memorù referenceó arå indicateä  bù                     enclosinç  thå registeò paiò namå  iî  PAREN-                     THESEÓ whicè followó thå ZILOÇ mnemoniã meth-                     oä oæ signifyinç "thå contentó of".                     Thå  mosô usefuì applicatioî oæ registeò  in-                     direcô  argumentó  ió tï seô  breakpointó  aô                     subroutinå  returî addresses®  Consideò  thå                     situatioî  oæ  á prograí whicè  ió  currentlù                     suspendeä  viá á breakpoinô somewherå iî  thå                     middlå  oæ  á  subroutine®  Thå useò  ió  nï                     longeò  interesteä debugginç thå bodù oæ  thå                     subroutine»  hå onlù careó abouô gettinç bacë                     tï thå instructioî thaô followó thå CALÌ thaô                     goô  hií intï thå subroutine®  Registeò  in-                     direcô formaô allowó hií tï enter:                      *B (SP)                     Thió  informó Z8Å tï seô á breakpoinô aô  thå                     addresó  pointeä  tï  bù  thå  stacë  pointeò                     register.      DECIMAL: Decimaì numberó iî thå rangå ° - 6553µ maù bå                     entereä aó arguments®  Alì digitó oæ thå num-                     beò  musô  bå iî thå rangå  0-9®  Á  decimaì                     numbeò  musô bå followeä bù á "#¢  character¬ Š 26 Z8E - Z80 DEBUG MONITOR Rick Surwilo                     otherwiså Z8E wilì treaô iô aó á heø  number®                     Thå  followinç examplå showó á decimaì numbeò                     beinç inpuô aó parô oæ thå Å command:                  *E 512#                                                    instructó  Z8E  tï  examinå  memorù                               locatioî  51² decimaì (200 hex) LITERAL:   ASCIÉ  literaló uð tï 7¸ byteó iî lengtè  arå                     permitteä aó argumentó (Z8E'ó inpuô buffeò ió                     8°  characteró  lonç  lesó  thå  openinç  anä                     trailinç  quotå characters)®  ASCIÉ literaló                     musô bå encloseä iî quotes®  Thå quotå char-                     acteò  itselæ ió thå onlù characteò noô  per-                     mitteä aó á literal®  Commandó whicè dï  noô                     permiô  thå uså oæ ARGUMENT-STRINGó (seå  be-                     low©  wilì stilì accepô inpuô iî thå forí  oæ                     quoteä  strings®  Iî  sucè á caså  Z8Å  wilì                     ignorå alì buô thå lasô twï characteró oæ thå                     quoteä  literal¬  treatinç thå inpuô aó á  1¶                     biô number® Foò examplå iæ thå useò entered:                                 *Z 'ABCD'                     Z8Å woulä begiî treaô 'BC§ aó á 1¶ biô numbeò                     and begin disassembling at address at 4243.   ARGUMENT-         Thå Æ (find)¬  Å (examinå memory)¬  Π (querù   STRINGS:          I/Ï  portó withouô pre-read)¬  Ñ (querù I/Ï                     ports)¬  anä  Ù (filì memory© commandó permiô                     thå uså oæ ARGUMENT-STRINGS¬ whicè arå simplù                     combinationó  oæ  alì  valiä  argumenô  typeó                     separateä bù commas® ARGUMENT-STRINGó maù bå                     anù  lengtè  uð tï thå limiô oæ  Z8E'ó  inpuô                     buffeò  whicè ió 8°  byteó  long®  ARGUMENT-                     STRINGó  maù  bå terminateä bù eitheò á  car-                     riagå returî oò thå firsô spacå characteò noô                     appearinç  iî betweeî quotå characters®  Thå                     followinç   ió  aî  examplå  oæ  á  1µ   bytå                     ARGUMENT-STRINGÓ  strinç whicè combineó  SYM-                     BOLS¬ LITERALS¬ HEX¬ anä DECIMAÌ numbers:                      SYMBOL,'xyZ',4F,12E4,9,21#,511#,'ABc'                     Assuminç  thaô SYMBOÌ ió equaì tï  177È  theî                     the above ARGUMENT-STRING would evaluate to:                                          01 77 78 79 5A 4F 12 E4 09 15 01 FF 41 42 63 Again¬  ARGUMENT-STRINGÓ  arå  terminateä  bù                     eitheò  á  carriagå returî oò  bù  thå  firsô                     spacå  characteò  thaô doeó noô appeaò  iî  á Š 27 Z8E - Z80 DEBUG MONITOR Rick Surwilo                     quoteä literaì string. Z8E permitó expressionó usinç thå « anä - operators®  Anù argu- menô typå maù bå combineä witè anù otheò type®  Thå lengtè oæ aî expressioî  ió  limiteä  onlù bù thå sizå oæ  thå  inpuô  buffer® Expressionó  arå  evaluateä  froí left to right anä  thå  uså  oæ parentheseó ió noô permitted® Z8E  indicateó argumenô erroró bù printinç á questioî marë. Arguments maù  bå  line-editeä usinç thå  standarä  CP/Í  controì characters: backspace: erase the last character typed control X: erase the entire line control C: return to CP/M via warm boot Alì inpuô ió truncateä tï thå sizå oæ Z8E'ó inpuô buffeò whicè ió 8° characteró long® Alì alphabetiã inpuô tï Z8Å maù bå iî uppercaså oò lowercase® Alì outpuô bù Z8Å followó thå dictateó oæ thå CASÅ bytå aó patcheä bù thå useò (seå INSTALLATION). Iî  thió  manuaì thå appearancå oæ squarå bracketó Û Ý arounä  aî argumenô alwayó indicateó thaô thå argumenô ió optional. 28 Z8E - Z80 DEBUG MONITOR Rick Surwilo This Page Intentionally Left Blank. 29 Z8E - Z80 DEBUG MONITOR Rick Surwilo VI. BREAKPOINTS Breakpointó  arå  thoså addresseó iî thå prograí  undeò  tesô  aô whicè  thå useò wisheó tï suspenä executioî anä returî controì tï Z8E®  Thå  useò maù set¬  clear¬  anä displaù breakpointó aô  anù time¬  viá thå appropriatå commanä iî responså tï Z8E'ó  asterisë prompt®  Z8E'ó  implementatioî oæ breakpointó doeó noô forcå thå useò tï tediouslù enteò breakpoinô addresseó everù timå executioî ió resumed®  Rather¬  thå useò maù enteò uð tï 1¶ breakpoinô  ad- dresseó anä eacè breakpoint¬  oncå set¬ ió storeä iî onå oæ Z8E'ó internaì tableó anä remainó iî effecô untiì explicitlù cleareä bù thå useò viá thå Cleaò breakpoinô commanä (seå à command). Z8Å alsï allowó yoõ tï specifù á pasó counô tï bå associateä witè anù breakpoinô thaô ió set®  Pasó countó indicatå thå numbeò  oæ timeó  á particulaò instructioî musô bå executeä beforå Z8Å  wilì regain control. Furthermore¬  Z8E  doeó noô modifù anù codå iî thå  useò  prograí untiì  á GÏ commanä ió issueä (seå Ç command)®  Thió permitó  thå useò tï examinå code¬  anä makå patcheó iæ desired¬  aô anù poinô iî thå debuç session. Wheî  á breakpoinô ió reacheä iî thå useò prograí anä Z8E regainó control¬  thå messageº  *BP*XXXØ ió displayeä wherå XXXØ representó thå hexadecimaì addresó oæ thå breakpoint®  Iî  addi- tion¬  Z8E  wilì displaù thå symboliã namå oæ thió addresó iæ onå existó  iî thå symboì table®  Z8E followó thió witè á displaù  oæ thå  asterisë  prompô indicatinç iô ió readù  readù  foò  commanä processing. Thå  messageº  *ERROR*BP*XXXØ ió displayeä oî thå consolå wheneveò Z8Å determineó thaô controì haó beeî regaineä withouô  á valiä  breakpoinô havinç beeî reached®  Thió ió generallù causeä bù á useò prograí whicè haó gonå ofæ thå deeð end®  Iæ thå  useò examineó  thå  currenô contentó oæ thå registeró (viá thå Ø  com- mand© thå currenô prograí counteò wilì mosô assuredlù contaiî  aî addresó  whicè  haä  noô  previouslù beeî seô  aó  á  breakpoint® Thingó tï looë foò wheî thió situatioî ariseó includeº á prograí thaô ble÷ itó stack¬ á prograí thaô performeä á ² 1/² gaineò witè á fulì twisô indirecô througè á register»  ie®  JÐ (HL© intï  thå greaô  unknown¬  anä  attemptinç tï tracå wherå wiså meî feaò  tï treaä (BIOÓ anä BDOÓ I/Ï routines). Z8Å  wilì  allo÷ yoõ tï singlå steð (trace© anä  seô  breakpointó anywherå iî memory®  However¬  beaò iî minä thaô aó yoõ enteò thå BIOÓ  anä BDOÓ netherworlä youò stacë pointeò wilì aô somå  poinô bå  saveä  directlù iî memorù aó CP/Í switcheó tï itó  owî  stacë (youò  stacë  pointeò ió noô saveä oî á stacë  bù  CP/M)®  Iæ  á breakpoinô haó beeî seô aô aî instructioî somewherå iî BDOÓ oò iî thå  BIOÓ (afteò thió savå oæ youò stacë pointeò haó occured© anä thió breakpoinô ió reached¬  Z8Å wilì itselæ calì á BDOÓ  routinå iî aî attempô tï displaù thå *BP*XXXØ messagå oî thå console®  Aô thió  poinô CP/Í wilì savå Z8E'ó stacë pointeò anä overlaù youró Š 30 Z8E - Z80 DEBUG MONITOR Rick Surwilo iî memory®  Wheî BDOÓ eventuallù restoreó thå stacë pointeò  anä executeó  á  REÔ instructioî yoõ wilì noô returî tï youò  prograí anä  youò  stacë pointeò wilì bå gone®  Theså  routineó  caî  bå traced¬ albeiô witè difficulty¬ buô yoõ musô keeð aî eyå oî whaô CP/Í ió doinç witè thå stacë pointer. 31 Z8E - Z80 DEBUG MONITOR Rick Surwilo This Page Intentionally Left Blank. 32 Z8E - Z80 DEBUG MONITOR Rick Surwilo A Assemble _________________________________________________________________ Thå  Á commanä permitó thå useò tï effecô inlinå assemblù oæ  Z8° assembleò sourcå code¬  includinç labeló anä symbols¬  usinç  thå fulì  Z8°  instructioî set®  Iî addition¬  thå assembleò  acceptó standarä  Ziloç mnemonicó (APPENDIX B)¬  expressionó usinç thå  « anä - operators¬  aó welì aó thå followinç fivå assembleò  direc- tivesº  ORG¬ DEFB¬ DDB¬ EQU¬ anä DEFW® Thå formaô oæ thå commanä is: *A ARG1 wherå  ARG1  representó thå startinç addresó  aô  whicè           assembly will take place           ARG1 may be of any type Z8E  initiallù  promptó  thå  useò  bù  firsô  disassemblinç  anä displayinç thå instructioî currentlù locateä aô thå addresó  spe- cifieä bù ARG1® Thió ió donå aó á conveniencå tï permiô thå useò tï  ensurå thaô anù patcheó wilì bå assembleä intï memorù aô  thå intendeä location® Z8E theî outputó á carriagå return/linå feed¬ displayó  thå addresó specifieä aó ARG1¬  anä awaitó  input®  Z8E wilì  noô disassemblå beforå everù linå oæ sourcå codå entereä bù thå user¬ onlù beforå thå firsô one® Z8E expectó assembler input in the following format: LABEL: opcode [operand1] [,operand2] Thå labeì fielä ió alwayó optional¬ thå opcodå fielä ió mandatorù onlù  iæ  nï  labeì  waó entered¬  anä  thå  operanä  fielä  musô naturallù  bå  includeä foò thoså Z8° instructionó whicè  requirå one® Thå threå fieldó maù bå separateä froí onå anotheò bù spaceó oò taâ characters. Z8Å  doeó noô automaticallù reservå spacå withiî itselæ foò  useò supplieä symboì names® Useò supplieä symbols¬ aó opposeä tï thoså loadeä  froí files¬  arå entereä froí thå keyboarä iî  thå  labeì fielä  usinç thå (A)ssemblå command®  Symboì tablå spacå tï  holä useò  supplieä  symboì nameó musô bå explicitlù requesteä oî  thå CP/Í commanä linå aó explaineä iî thå sectioî "INVOKINÇ Z8Å aô oî thå CP/Í COMMANÄ LEVEL"®  Theså useò supplieä symbols¬  oncå  en- tered¬  maù  bå referenceä iî thå operanä fielä oæ anù subsequenô assemblù  statemenô oò iî thå argumenô fielä oæ anù Z8Å  command® Theså  symboló  comå iî handù wheî disassemblinç .COÍ  fileó  foò whicè nï sourcå listinç existó anä alsï wheî patchinç code. Thå  assembleò ió á onå pasó assembleò anä forwarä referenceó  tï Š 33 Z8E - Z80 DEBUG MONITOR Rick Surwilo symboló  whicè  dï  noô alreadù appeaò iî thå  symboì  tablå  arå flaggeä  aó  errors®  However¬  Z8Å allowó thå uså oæ  thå  ORÇ directivå  (seå discussioî below© whicè allowó thå useò tï  mani- pulatå thå assembler'ó locatioî counter¬  whicè helpó tï minimizå thå nï forwarä referencå limitation. Labeló  maù begiî iî anù column¬  buô alì labeló musô bå followeä bù á coloî eveî thoså appearinç iî aî EQÕ statement®  Labeló maù bå oæ anù lengtè buô onlù thå firsô ¶ characteró arå significant® Z8Å  alwayó assignó thå 1¶ biô valuå oæ thå  assembler'ó  currenô locatioî counteò tï thå labeì beinç entered¬ unlesó thå statemenô ió  aî EQÕ directive®  Labeló neeä noô bå followeä bù aî  opcodå anä thió (aó welì aó thå EQÕ directive© provideó á convenienô waù tï  assigî á valuå tï á symboì name®  Merelù seô thå  assembleró locatioî counteò (viá thå ORÇ directivå oò aó ARG1 iî thå commanä line© tï thå valuå yoõ wisè tï assign¬  theî typå thå symboì namå followeä bù á carriagå return® Nï objecô codå ió produceä anä nï useò  memorù areaó arå modifieä buô thå symboì anä itó associateä valuå  arå  entereä intï thå useò symboì table®  Z8Å  doeó  noô treaô  duplicatå symboì nameó aó errors®  Rather¬  iæ  thå  useò enteró  á symboì namå whicè alreadù appearó iî thå symboì  table¬ thå  valuå associateä witè thå ne÷ symboì replaceó thå onå  asso- ciateä witè thå old® Foò example¬ iæ thå symboì ENTRYÐ existó iî thå  symboì  tablå anä ió associateä witè thå valuå 23DÁ anä  thå useò assembleó thå followinç instruction: 41FF 0E 04 ENTRYP: LD C,4 Z8E would replace 23DA with 41FF. Assembleò statementó whicè dï noô contaiî labeló maù begiî iî anù column¬  includinç  columî one®  Therå ió NÏ neeä tï  inserô  á leadinç  spacå oò taâ beforå aî opcodå iæ thå opcodå ió noô  pre- cedeä bù á label. Operandó  appearinç iî thå operanä fielä oæ thå instructioî tï bå assembleä  maù bå anù oæ thå followinç typeó subjecô onlù tï  thå provisï thaô 1¶ biô valueó cannoô appeaò aó operanä foò thoså Z8° instructionó  whicè requirå ¸ biô values®  Expressionó combininç anù oæ thå followinç fouò typeó (witè thå « anä - operators©  arå alsï permissable® SYMBOL (from symbol table) HEX LITERAL (two bytes maximum) DECIMAL Iî  additioî  thå  dollaò sigî ($© maù alsï appeaò iî  botè  thå operanä  fielä oæ anù instructioî iî whicè á 1¶ biô  operanä  ió allowed¬  anä  alsï  iî thå operanä fielä oæ anù  relativå  jumð instruction®  Thå  dollaò sigî representó thå currenô valuå  oæ thå assembler'ó locatioî counter¬ thaô is¬ thå addresó appearinç oî thå linå aô whicè thå assemblù ió takinç place. Š 34 Z8E - Z80 DEBUG MONITOR Rick Surwilo Thå  operanä fielä oæ á relativå jumð instructioî caî bå  entereä iî  eitheò oæ twï ways®  Thå useò maù codå thå operanä usinç thå dollaò sigî mentioneä abovå aó iî thå followinç examples: JR NZ,$+11    ;jump to address PC+11 (hex) DJNZ $-24# ;jump to address PC-24 (decimal) Thå useò maù alternativelù specifù á 1¶ biô valuå iî thå  operanä fielä  oæ  á relativå jumð instructioî anä leô Z8E calculatå  thå relativå  displacemenô  froí thå assembler'ó prograí  counteò  aó showî below: JR  C,LABEL Assuminç LABEÌ exists¬ iî thå symboì                              tablå Z8Å wilì calculatå thå offset®                              LABEÌ  musô  bå withiî +12¹ oò  -12¶                              byteó froí thå assembler'ó  locatioî                              counteò  oò  aî assemblù erroò  wilì                              result. JR   NZ,1080  Z8E  calculateó thå displacemenô be-                              tweeî thå assembler'ó currenô  loca-                              tioî  counteò  anä thå addresó  108°                              (hex). Z8E indicateó error-freå inpuô bù firsô displayinç thå resultanô objecô  codå  anä  theî displayinç (oî thå nexô  line©  thå  nexô addresó aô whicè assemblù wilì takå place® Assemblù erroró arå alwayó indicateä bù á doublå paiò oæ questioî markó whicè appeaò followinç thå locatioî counter® Aî erroò flaç ió alsï printeä anä wilì bå onå oæ thå following: ERROR FLAG MEANING L   Label starts with numeric character                                O Invaliä opcode S         Syntax error T Symbol table full Õ   Instructioî referenceó an undefined symbol name Ö  Valuå error - a 1¶ biô  valuå waó specifieä aó aî operanä foò aî  instructioî  whicè  permitó onlù ¸ biô numbers® Iæ  aî  erroò occurs¬  Z8E wilì reprompô thå useò witè  thå  samå Š 35 Z8E - Z80 DEBUG MONITOR Rick Surwilo location counter address. Aó waó mentioneä previouslù thå Z8E assmebleò useó standarä Ziloç mnemonics®  Thå  onå exceptioî tï thió ió thå EØ AF,AF§ instruc- tion®  Tï assemblå thió instructioî thå trailinç quotå characteò musô bå omitted. Z8Å  supportó thå ORÇ directivå whicè allowó thå useò  tï  changå thå valuå oæ thå assemblù locatioî counter®  Thå operanä fielä oæ thå  ORÇ directivå maù bå á 1¶ biô argumenô oæ anù  type®  Afteò settinç thå ne÷ assemblù locatioî counteò Z8Å displayó thå disas- sembleä instructioî aô thå ne÷ address. Z8E supportó thå DEFB¬  DEFW¬  anä DD directiveó whicè givå  thå useò  thå abilitù tï assemblå datá constantó intï  memory®  DEF acceptó  aî  ¸  biô operand»  thå valuå oæ whicè iî  placeä  intï memorù  aô thå addresó oæ thå assembler'ó currenô locatioî  coun- ter® DEF× allowó thå useò tï specifù á 1¶ biô operanä value¬ thå lo÷  ordeò bytå oæ whicè ió placeä intï memorù aô thå addresó  oæ thå  assembler'ó currenô locatioî counter¬  whilå thå higè  ordeò bytå  oæ thå operanä ió placeä intï memorù aô thå addresó oæ  thå assembler'ó currenô locatioî counteò pluó one®  Thió ió iî accor- dancå witè thå 8080/Z8° conventioî oæ storinç thå higè ordeò bytå oæ  1¶ biô datá towarä thå higè enä oæ memory®  Thå  DD  (definå doublå  byte© directivå allowó thå useò tï specifù á 1¶ biô valuå which¬  iî  contrasô tï thå DEF× directive¬  ió storeä iî  memorù witè thå higè ordeò bytå towarä thå lo÷ enä oæ memory®  Thaô is¬ á DD directivå instructó Z8E tï storå thå mosô significanô  bytå oæ  thå  1¶  biô operanä valuå iî memorù aô thå  addresó  oæ  thå assembler'ó  currenô locatioî counter¬  anä thå leasô significanô (lo÷  order©  bytå ió placeä intï memorù aô thå  addresó  oæ  thå assembler'ó currenô locatioî counteò pluó one® Thå EQÕ directivå allowó thå useò tï assigî á valuå tï á  symbol® Aî EQÕ directivå doeó noô generatå objecô code® Iô merelù allowó thå  useò  tï  referencå á numeriã valuå bù á  symboliã  namå  iî subsequenô assemblù statementó oò monitoò commands®  Iô ió espe- ciallù  usefuì  wheî useä prioò tï disassemblinç (seå Ú  command© codå  foò whicè nï symboì tablå exists®  Thå EQÕ  directivå  re- quireó  thå useò tï supplù á symboliã namå iî thå labeì fielä  oæ thå instruction®  Iæ Z8E indicateó erroró iî aî EQÕ statemenô bù printinç questioî marks® Iæ aî EQÕ statemenô ió correctlù assem- bleä  bù  Z8E¬  thå addresó oæ thå assembler'ó  currenô  locatioî counteò  ió  eraseä  sincå aî EQÕ statemenô generateó  nï  objecô code® Operandó appearinç iî EQÕ statementó arå evaluateä tï á 1¶ biô  value®  Z8E wilì displaù thå valuå oæ thió 1¶ biô numbeò  aó fouò heø digitó iî thå objecô codå fielä oî thå console. 36 Z8E - Z80 DEBUG MONITOR Rick Surwilo B Set Breakpoint _________________________________________________________________ Breakpointó  arå  thoså  addresseó aô whicè thå  user  wisheó  tï suspenä executioî oæ thå prograí undeò test®  Breakpointó maù bå seô aô anù timå iî responså tï Z8E'ó asterisë prompt® Z8E allowó thå  useò tï seô uð tï 1¶ individuaì breakpointó iî hió  program® Z8Å alsï allowó thå useò tï specifù á pasó counô tï bå associateä with any breakpoint. Thå commanä ió invokeä aó follows: *B ARG1[,pass count] [ARG2... ARGn] wherå eacè argumenô representó thå addresó iî thå  useò           program at which a breakpoint is to be set Normally¬  thaô ió wheî nï pasó counô ió specifed¬  executioî  oæ thå  useò  prograí stopó anä controì returnó tï thå  Z8Å  commanä leveì aó sooî aó á breakpoinô ió reached® Pasó countó arå useä tï inforí  Z8Å  thaô executioî oæ thå useò prograí shoulä halô  onlù wheî  thå  specifieä breakpoinô ió reacheä thå  numbeò  oæ  timeó timeó indicateä bù thå pasó count® Pasó  countó  arå specifieä bù followinç thå  breakpoinô  addresó witè á commá anä theî enterinç á pasó counô immediatelù followinç thå comma. Aî existinç pasó counô maù bå changeä tï á differenô valuå bù re- enterinç thå samå breakpoinô address¬  followinç iô witè á comma¬ and then specifying the new pass count. Tï breaë oî á multi-bytå Z8° instructioî thå addresó specifieä aó thå  breakpoinô  addresó musô bå thaô oæ thå firsô  bytå  oæ  thå instruction®  Useró whï faiì tï observå thió rulå wilì generallù finä theiò programó hoppinç thå nexô buó tï never-neveò land®  Iæ á patcè ió madå aô aî addresó oæ á breakpoinô currentlù iî effecô bå  surå  thå breakpoinô addresó ió stilì pointinç aô  thå  firsô bytå  oæ  thå ne÷ instruction®  Multiplå breakpointó maù bå seô witè thå samå  commanä bù  sepa- ratinç eacè onå witè á singlå space® Iæ multiplå breakpointó arå specifieä  anä Z8E detectó aî erroneouó argumenô (á  non-existenô symboì  foò  example© á questioî marë wilì bå  printed¬  anä  thå commanä  terminates®  Alì valiä breakpointó specifieä uð tï  thå invaliä onå will be set® Z8E  displayó  á  questioî marë wheî á attempô ió madå tï  seô  á seventeentè breakpoint. 37 Z8E - Z80 DEBUG MONITOR Rick Surwilo C Clear Breakpoint _________________________________________________________________ Thå à commanä clearó individuaì breakpointó previouslù seô bù á  command® Thå formaô oæ thå commanä is: *C ARG1 [ARG2...ARGn] wherå eacè arç maù bå anù valiä argumenô typå                whicè  evaluateó tï aî addresó previouslù seô                as a breakpoint Multiplå  breakpointó  maù  bå cleareä bù thå samå à commanä  bù separating each argument with a single space. Z8E  displayó á questioî marë wheî aî attempô ió madå tï cleaò  á non-existent breakpoint. Tï  cleaò  ALÌ  breakpointó enterº  *à ª  wherå  thå  asterisë indicates ALL. 38 Z8E - Z80 DEBUG MONITOR Rick Surwilo D Dump _________________________________________________________________ Thå Ä commanä allowó thå useò tï dumð memorù iî botè hexadecimaì anä ASCIÉ tï thå consolå iî useò specifieä blocë sizeó. The formaô oæ thå commanä is: *D [ARG1] [ARG2] where ARG1 = the starting address to dump ARG2 =  dictateó    thå    dumð    formaô                                 dependinç oî itó value®  Iæ ARG2                                 ió  iî thå rangå ° - 25µ theî  iô                                 ió  treateä  aó á blocë sizå  anä                                 representó thå numbeò oæ byteó tï                                 bå  displayeä  (° ió  treateä  aó                                 256)® Iæ ARG2 ió greateò thaî 25µ                                 theî ARG2 ió treateä aó aî endinç                                 addresó anä memorù wilì bå dumpeä                                 non-interactively to the console.               ARG1 and ARG2 may be of any argument type. Iæ  ARG1  ió omitteä theî thå dumð resumeó froí thå  lasô  memory addresó  +±  aó displayeä viá thå previouó invocatioî  oæ  thå  Ä command®  Iæ  nï previouó Ä commanä haä beeî giveî theî memorù ió dumped starting at address 100H. Iæ  ARG² ió omitteä theî thå mosô recenô valuå oæ ARG² (froí  thå lasô Ä command© ió used. Thå  dumð commanä displayó thå contentó oæ memorù iî  hexadecimaì oî  thå  lefô sidå oæ thå consolå whilå thå ASCIÉ  equivalenô  oæ eacè bytå ió showî oî thå righô side® Durinç  á  blocë bù blocë dumð (ARG² ¼ 25¶ signifieó á  blocë  bù blocë  dump©  Z8Å waitó foò useò inpuô afteò eacè blocë  ió  dis- played®  Á  carriagå returî entereä bù thå useò causeó thå  nexô sequentiaì  blocë tï bå dumpeä whilå anù otheò  characteò  causeó thå commanä tï terminate. Foò  non-interactivå dumps¬  startinç addresó tï endinç  address¬ pressinç anù keù terminateó thå dump. Thå  dumð  commanä provideó aî especiallù easù waù  oæ  examininç tabulaò data¬  foò examplå iî scanninç thå disë parameteò headeró iî youò BIOS®  Thaô is¬  bù specifyinç thå baså addresó aó  ARG1 anä  thå  tablå  sizå aó ARG2 thå useò caî walë  througè  memory¬ tablå bù table. 39 Z8E - Z80 DEBUG MONITOR Rick Surwilo E Examine Memory _________________________________________________________________ Thå  Å  commanä allowó thå useò tï examinå anä optionallù  modifù the contents of memory. The format of the command is: *E ARG1 wherå  ARG1 ió thå addresó oæ thå firsô bytå  tï                examine ARG1 maù bå anù symboì type Upoî  receipô oæ ARG1 Z8Å wilì reaä thå contentó oæ thå specifieä memorù  addresó anä displaù thå bytå iî botè heø anä  ASCII®  Aô thió  poinô thå useò haó twï options®  Thå useò maù specifù  re- placemenô  datá  tï bå writteî tï memorù startinç aô thå  currenô address¬  oò  hå  maù  chooså tï continuå  tï  passivelù  examinå memory®  Thå choicå ió determineä bù thå character(s© whicè  arå inpuô afteò thå contentó oæ aî addresó arå displayed® Iæ  thå  useò  wisheó tï modifù memorù startinç  aô  thå  currenô memorù address¬  theî aî ARGUMENT-STRING maù bå entereä followinç thå  displayeä  byte®  Z8Å wilì evaluatå thå entirå  strinç  anä writå  thå  evaluateä equivalenô oæ thå strinç  intï  consecutivå memorù  locationó startinç witè thå currenô memorù  address®  Foò examplå thå useò coulä enteò thå followinç ARGUMENT-STRINGº *E 45F9 45F9 42 B 'This is a string',0D,0A,13,4F,9,'More Text',05 ^ ^ Thå useò inpuô apprearó betweeî thå arrowó  anä                   would be evaluated to the following 31 bytes:                                      54 68 69 73 20 49 73 20 61 20 73 74 72 69 6E 67                   0D 0A 13 4F 09 4D 6F 62 65 20 74 65 78 74 05                   Theså  3±  byteó  woulä bå storeä  intï  memory                   locationó  45F¹  tï 4617 anä thå  nexô  addresó                   displayed on the screen would be 4618.      4618 23 # Remembeò  thaô  ARGUMENT-STRINGÓ maù bå terminateä  bù  eitheò  á carriagå  returî  oò bù thå firsô spacå characteò whicè doeó  noô appeaò  iî  á quoteä literaì string®  Thå  choicå  oæ  terminatoò determineó  thå whicè addresó wilì bå displayeä next®  Iæ á car- riagå  returî ió useä tï terminatå thå ARGUMENT-STRING¬  theî Z8Å wilì displaù thå nexô sequentiaì memorù address® Foò example: *E 1002 1002 45 E 12,8F,00 1005 28 ( Š 40 Z8E - Z80 DEBUG MONITOR Rick Surwilo Thå useò entereä aî ARGUMENT-STRINÇ 12,8F,0° whicè waó  evaluateä tï  ³ bytes®  Sincå thå ARGUMENT-STRINÇ waó terminateä bù á car- riagå returî thå nexô addresó displayeä waó 1002+³ oò 1005® Bù  terminatinç  thå  ARGUMENT-STRINÇ witè á spacå thå  useò  caî verifù  thå contentó oæ memorù jusô  modified®  ARGUMENT-STRINGÓ terminateä  bù  á spacå causå Z8Å tï redisplaù thå  startinç  ad- dress»  thió  makeó  thå  datá jusô  entereä  availalbå  foò  re- inspection: *E 1002 1002 45 E 12,8F,00 1002 12 ~ Iæ thå useò doeó noô wanô tï writå anù datá tï thå currenô memorù address¬  theî thå characteò entereä shoulä bå á spacå character¬ up arrow (carret) character, or a carriage return.                 CHARACTER ACTION                                 space   reaä nexô sequentiaì mem-                                         orù addresó up arrow   reaä previouó memorù  ad-                                         dresó                                                          reaä nexô sequentiaì mem-                                         orù address command period               terminate command                                          Thå  useò maù alsï changå thå currenô memorù addresó bù  enterinç aî  equaì  sigî "=¢ followeä bù á valiä  argument®  Thå  addresó obtaineä  bù  evaluatinç thió argumenô becomeó  thå  ne÷  currenô memory address as shown below: *E 1344 1344 89 ~ 1345 6F o 1346 52 R =9F34 9F34 63 c 41 Z8E - Z80 DEBUG MONITOR Rick Surwilo F Find _________________________________________________________________ Thå  finä commanä allowó thå useò tï searcè memorù foò multi-bytå strings in memory. The format of the command is: *F ARG1 ARG2 where ARG1 = thå  startinç addresó aô whicè tï begiî                           the search, it may be of any type                                    ARG2 = ió  aî ARGUMENT-STRINÇ representinç thå                           patterî  tï searcè for»  thå  useò  maù                           specifù  anù  combinatioî oæ  argumentó                           separateä bù commaó oò spaceó uð tï thå                           limiô  oæ  Z8E'ó  commanä  linå  buffeò                           whicè  ió 8° byteó  long®  Thå  actuaì                           numbeò oæ byteó searcheä foò dependó oî                           ho÷ thå strinç ió ultimatelù evaluated.                            Z8E wilì displaù everù addresó whicè containó datá matchinç ARG2® The search continues until the end of memory is reached. Thå useò maù elecô tï canceì thå searcè aô anù timå bù depressinç any key on the keyboard. Iæ  ARG² ió á singlå argumenô (aó opposeä tï aî argumenô  string© anä  iæ thió argumenô ió á symboì namå theî Z8Å wilì reverså  thå ordeò oæ thå twï byteó comprisinç thå 1¶ biô operand® Mosô 1¶ biô valueó iî Z8° programó arå storeä witè thå leasô significanô bytå aô  á  giveî addresó anä thå mosô significanô bytå aô  thå  giveî address+± (towarä thå higè enä oæ memory)® Thió ió iî accordancå witè thå Z8° conventioî oæ storinç thå mosô significanô bytå oæ á 16 bit argument toward the high end of memory. The following are examples of the FIND command: *F 0 SYMBOL      Assuminç  thaô thå symboì "SYMBOL¢ ió  associateä  witè      thå  heø  valuå 3BÆ theî Z8Å woulä attempô tï finä  alì      addresó  containinç  thå bytå paiò BÆ anä  0³  iî  thaô      order¬ witè thå searcè beginninç aô addresó 0000® Notå      thaô thå ordeò oæ thå twï byteó ió reverseä becauså thå      symboì "SYMBOL¢ existó iî thå symboì table®  Tï searcè      foò  thå  bytå  paiò 0³ anä BÆ iî thaô ordeò  thå  useò      shoulä enteò thå argumenô aó eitheò á 1¶ biô heø numbeò      (3BF© oò aó twï ¸ biô heø numberó (03,BF)® *F 100 87,32#,'ABCD',0C3,symbol,'p',271F Assuminç  thaô thå symboì "symbol¢ ió  associateä  witè Š 42 Z8E - Z80 DEBUG MONITOR Rick Surwilo      thå  heø  valuå 3BÆ theî Z8Å woulä attempô tï finä  alì      startinç addresseó oæ thå followinç 12 bytå string:        87 20 41 42 43 44 C3 03 BF 70 27 1F      Noticå  thaô Z8Å woulä searcè foò thå twï bytå  patterî      0³ BÆ aó thå valuå foò "symbol"®  Iæ thå useò happeneä      tï  bå  tryinç tï finä thå  instructioî  JР symboì      thå searcè woulä faiì becauså aó mentioneä abovå 1¶ biô      valueó  arå  storeä  lo÷ ordeò bytå  first®  Thå  useò      should have entered C3 BF 03.      Thå twï byteó whicè represenô thå addresó oæ symboì arå      noô  reverseä aó iî thå examplå abovå becauså  ARG²  ió      specifieä  aó aî ARGUMENT-STRINÇ aó opposeä tï á singlå      argument. Z8E would begin its search at address 100 (ARG1). 43 Z8E - Z80 DEBUG MONITOR Rick Surwilo G Go _________________________________________________________________ Thå  Ç commanä instructó Z8E tï begiî oò resumå executioî oæ  thå useò program. The format of the command is: *G ARG1 wherå  ARG1  ½  thå  addresó  oæ  thå  firsô instruction the user wishes                                      to execute. ARG1 may be any argument type Upoî  receipô oæ thió commanä Z8E initializeó alì breakpointó  iî thå  useò  program¬  restoreó alì useò registers¬  anä  transferó controì  tï thå useò prograí undeò tesô aô thå addresó  specifieä iî ARG1®  Executioî withiî thå useò prograí wilì continuå  untiì thå  useò  prograí reacheó á breakpoint¬  aô whicè poinô  controì wilì  returî tï Z8E®  Thió ió thå onlù waù thå useò ió  ablå  tï returî controì tï Z8E oncå thå GÏ commanä ió issued. Z8Å breakpoinô techniquå haó beeî designeä sucè thaô Z8Å wilì noô directlù  initializå  á  breakpoinô aô thå addresó  specifieä  iî ARG1®  Iî  actualiitù iô woulä bå impossiblå tï dï sï  sincå  aî attempô  woulä  bå madå tï resumå executioî aô  thió  address¬  á breakpoinô woulä havå beeî seô aô thió address¬ anä controì woulä immediatelù  returî tï thå monitoò withouô thió instructioî  eveò havinç beeî executed®  Thió limitatioî haó beeî overcomå iî Z8Å bù  actuallù  copyinç thå singlå instructioî locateä aô  ARG±  tï Z8E'ó  memory¬  THEÎ settinç thå breakpoinô aô thå ARG±  address¬ anä  finallù executinç thå "moved¢ versioî oæ thå instructioî  iî Z8E'ó memorù ratheò thaî iî thå useò program® Z8Å compensateó foò thå  thaô CALÌ anä RELATIVÅ JUMÐ instructionó arå affecteä bù thå addresó aô whicè theù arå executed® Thió entirå procesó ió total- lù  transparenô anä iô allowó thå useò tï debuç loopó bù  settinç onlù á singlå breakpoinô withiî thå rangå oæ á loop¬ obviateó thå neeä  tï cleaò anù breakpointó whicè arå locateä aô  thå  addresó wherå  executioî ió tï resume¬  anä eveî allowó breakpointó aô  á DJNÚ ¤ instructions! HINT: Wheî  proceedinç froí á breakpoinô iô ió simplesô tï uså thå forí oæ thå GÏ commandº  *Ç Ð where ARG1 must be a symbol name Iæ  ARG±  ió  omitteä Z8Å wilì displaù thå  entirå  symboì  tablå startinç witè thå firsô symboì iî thå table®  Iæ ARG± ió presenô Z8Å  wilì  begiî thå displaù witè thaô symbol®  Z8Å  displayó  á blocë  oæ  3²  symboló theî waitó foò useò input®  Iæ  thå  useò enteró  á  carriagå returî thå thå nexô blocë oæ  3²  symboló  ió displayed®  Iæ  thå useò entereó anù otheò characteò thå  commanä terminates. Iæ  á  symboì namå entereä aó ARG1 cannoô bå founä iî thå  symboì table Z8E prints a question mark. 45 Z8E - Z80 DEBUG MONITOR Rick Surwilo I Input file _________________________________________________________________ Thå  É commanä allowó thå useò tï loaä fileó intï thå  TPÁ  afteò the debug session has started. The format of the command is: *I ARG1[,ARG2]                ARG1 ió á singlå unambiguouó filå namå  con-                forminç tï standarä CP/Í syntaø rules:                                 - optionaì  drivå  namå followeä bù  á  coloî                                     - mandatory primary file name                     - optionaì  secondarù filå namå precedeä bù á                      period                ARG2 ió aî optionaì loaä address®  Iæ ARG2 ió  noô                specifieä thå nameä filå ió loadeä aô thå starô oæ                thå  TPÁ (addresó 10° hex)®  Iæ ARG2 ió giveî thå                filå wilì bå loadeä aô thió address® Z8E wilì NOÔ                relocatå  individuaì addresseó withiî thå filå  tï                reflecô thå ne÷ loaä address®  ARG2 maù bå oæ anù                type.                NOTE: Iæ  nï argumentó arå entereä theî Z8Å  wilì                       redisplaù thå startinç address¬  endinç ad-                       dress¬  anä thå numbeò oæ 25¶ bytå pageó oæ                       thå lasô filå loaded® If Z8E detectó á erroò iî thå filå namå specificatioî thå messagå "Syntaø  error¢  ió  printeä  oî  thå  consolå  anä  thå  commanä terminates. Iæ  Z8E  ió unablå tï locatå thå filå oî thå specifieä drivå  thå messagå  "Filå  noô  found¢ ió printeä oî  thå  consolå  anä  thå command terminates. Z8E containó nï faciltieó foò convertinç .HEØ (Inteì Heø  format© objecô fileó tï loadablå memorù image®  Alì files¬ regardlesó oæ type¬  arå  loadeä  intï memorù iî exactlù thå samå forí aó  theù appeaò oî disk®  Tï debuç á .HEØ filå thå useò shoulä firsô loaä thå  filå witè thå CP/Í LOAÄ commanä anä savå thå filå  witè  thå CP/Í  SAVÅ commanä whicè produceó aî absolutå memorù imagå  load- ablå  bù Z8E®  Alì .COÍ fileó arå oæ courså alreadù iî  loadablå forí anä nï LOADinç anä SAVEinç ió required. Iæ  thå  filå  wilì  noô fiô intï thå TPA¬  Z8E  wilì  prinô  thå message: Out of memory - Continue? Š 46 Z8E - Z80 DEBUG MONITOR Rick Surwilo Iæ  thå  useò answeró "Y"¬  Z8E wilì resumå loadinç thå  filå  aô addresó 10° heø iæ ARG2 waó noô entered¬ oò aô thå addresó speci- fieä aó ARG2®  Iæ thå useò typeó anù otheò response¬ thå loadinç procesó terminateó anä Z8E returnó tï thå commanä level® However¬ thå  useò maù resumå loadinç thå filå aô á lateò timå bù  issuinç thå É commanä anä specifyinç thå filå namå ".¢ (á singlå period)® Thå  useò  maù  chooså  tï specifù á ne÷  startinç  loaä  addresó followinç  thå period»  iæ ARG2 ió omitteä theî thå loaä  addresó defaultó bacë tï 10° hex¬  thå starô oæ thå TPA®  Iæ thå useò haó donå  anù  subsequenô  disë I/Ï (sucè aó loadinç á  ne÷  filå  oæ disassemblinç  tï disk© iî betweeî thå timå loadinç waó suspendeä anä theî restarted¬  Z8Å wilì treaô thå filå namå ".¢ aó á syntaø error® Thå  useò maù occasionallù neeä tï overlaù á sectioî oæ codå iî á prograí whicè alreadù resideó iî memorù witè inpuô froí á filå oî disk¬  foò examplå iî modifyinç á BIOÓ iî preparatioî foò MOVCPM® Whilå  thió  ió possiblå witè loaderó whicè procesó  .HEØ  objecô files¬  iô ió noô feasiblå witè Z8E® Thå useò caî circumvenô thió limitatioî  bù loadinç thå filå froí disë intï aî unuseä  sectioî oæ memorù anä theî usinç Z8E'ó movå commanä tï movå onlù thå datá needeä tï accomplisè thå overlay. 47 Z8E - Z80 DEBUG MONITOR Rick Surwilo J Animated Full Screen Debugger ________________________________________________________________ Thå  Ê commanä provideó thå useò witè thå abilitù tï "see¢ insidå thå  Z8°  aó iô executeó á program®  Thå Z8Å  animateä  debuggeò allowó thå useò tï vie÷ registers¬ memory¬ anä instructionó whilå thå  Z8°  ió simultaneouslù executinç code®  Iî  addtioî  thå  Ê commanä  provideó  thå  useò witè thå  abilitù  tï  interactivelù single-steð througè á prograí usinç thå fulì screeî facilitieó oæ thå command® Thå formaô oæ thå Ê commanä is: *J [/] [*] [ARG1] [ARG2] USÅ  OÆ  THÅ  Ê  COMMANÄ FOÒ  SINGLÅ  STEPPINÇ  IÓ                DESCRIBEÄ  AÔ  THÅ  ENÄ  OÆ  THIÓ  SECTION®  THIÓ                SECTIOΠ DESCRIBEÓ THÅ NON-INTERACTIVÅ VERSIOΠ OÆ                THÅ  Ê  COMMANÄ DURINÇ WHICÈ THÅ USEÒ  TURNÓ  OVEÒ                COMPLETÅ  CONTROÌ OÆ THÅ EXECUTIOÎ OÆ THÅ  PROGRAÍ                UNDER TEST TO Z8E. ARG±  ió  thå startinç addresó oæ thå displaù  anä                maù  bå oæ anù valiä argumenô type®  Foò  example¬                thå useò maù specifù *J Ð tï resumå executioî                aô thå poinô wherå iô haä previoulù been stopped®                Thå  slasè anä staò controì subroutinå tracinç  aó                follows:                "/" Slasè  informó  Z8Å noô tï tracå anù  subrou-                     tineó aô all.                       "*" Asterisë informó Z8Å noô tï tracå anù subrou-                     tinå  calló tï addresseó locateä iî thå rangå                     ° tï FF®  Thió featurå ió intendeä tï  screeî                     ouô  calló  tï locatioî µ (BDOS© iî ordeò  tï                     prevenô  Z8E'ó  anä  thå  user'ó  stacë  froí                     becominç hopelesslù entangled.                                ARG2 representó aî optionaì timeouô paramteò whicè                affectó  thå speeä aô whicè instructionó arå  exe-                cuted®  Thió  numbeò maù bå iî thå rangå ° - 255¬                witè  1° (decimal© aó thå defaulô iæ nï  valuå  ió                entered® Á timeouô valuå oæ 1° yieldó approximate-                lù  á onå halæ seconä delaù betweeî thå  executioî                oæ sequentiaì instructions®  Á valuå oæ °  repre-                sentó  NÏ timå delaù anä ió iî actualitù thå fast-                esô ratå á whicè thå Ê commanä caî run. Oncå  thå Ê commanä commences¬  Z8Å takeó oveò thå Z8°  anä  fur- nisheó thå useò witè á "peephole¢ intï thå CPU® Z8Å executeó onå instructioî  aô á timå iî thå useò prograí pausinç afteò eacè onå tï dynamicallù updatå thå screeî display®  Thå Ê commanä  divideó thå screeî intï threå areasº registeò map¬ disassembleä code¬ anä memorù  window®  Thå registeò mað displayó alì registeró oî  thå Š 48 Z8E - Z80 DEBUG MONITOR Rick Surwilo toð  twï  lineó  oæ thå screeî alonç witè thå contentó oæ  thå  Æ registeò whicè ió showî iî mnemoniã form®  Z8Å alsï disassembleó 1¸  instructionó baseä oî thå currenô Pà valuå anä displayó  theí oî  thå screen»  finally¬  usinç thå parameteró entereä iî thå  × command¬  Z8Å  snapshotó á blocë oæ memorù anä displayó iô  aó  á windo÷ oî thå screen® Executioî oæ thå useò prograí continueó untiì anù non-numeriã keù oî thå keyboarä ió presseä whicè endó thå command®  Iæ á numeriã keù ió pressed¬ theî Z8Å respondó bù changinç thå timeouô parame- teò oî thå fly® Thå useò maù uså thå keyó ° - ¹ aó á throttlå tï goverî thå executioî speed®  Zerï beinç thå fastest»  ninå beinç thå slowest. Thå commanä alsï terminateó wheneveò á useò defineä breakpoinô ió reached®  Thaô  is¬  iæ thå useò haä seô á breakpoinô viá thå  Â commanä  anä thió addresó ió reacheä thå Ê commanä endó  anä  Z8Å promptó  thå useò foò thå nexô command®  Iæ thå breakpoinô haä á pasó  counô associateä witè it¬  thå pasó counô musô  reacè  zerï beforå thå Ê commanä will terminate. USING THE J COMMAND FOR SINGLE STEPPING Z8Å  permitó  thå  useò tï single-steð througè  á  prograí  whilå allowinç  á  continuouó full-screeî vie÷ oæ thå  registers¬  codå beinç executed¬  anä thå contentó oæ á blocë oæ memorù aó  speci- fieä bù thå Ë command® Iî ordeò tï invokå thå fulì screeî single- steð thå useò enteró thå followinç command: *J [/] [*] ¯ instructó Z8Å noô tï tracå anù  subroutineó                     aô all                     ª  instructó Z8Å noô tï tracå anù subroutineó                     locatioî   belo÷   addresó   100È   anä    ió                     specificallù  designeä tï allo÷ thå useò  thå                     optioî  oæ  noô becominç tangleä iî BDOÓ  anä                     BIOS.                     Notå  thaô  thió versioî oæ thå Ê commanä  ió                     differentiateä   froí   thå   non-interactivå                     versioî  bù  thå  absencå  oæ  anù   argumenô                     indicating a execution address. Thió  versioî allowó thå useò tï executå onå instructioî  iî  hió prograí  anä theî regaiî controì aô thå Z8Å commanä  level®  Z8Å wilì executå thå instructioî pointeä tï bù thå user'ó currenô PC® Afteò  thå instructioî ió executeä aî ARRO× ¨ =¾ © pointó tï  thå nexô instructioî tï bå executed. Thå ¯ anä ª optionó arå onlù valiä iæ thå nexô instructioî tï  bå executeä  ió á CALL®  Iæ thå prograí counteò ió pointinç aô  anù other instruction then the / and * have no effect. 49 Z8E - Z80 DEBUG MONITOR Rick Surwilo K Set Memory Window Parameters for Use With the J Command ________________________________________________________________ Thå  K  commanä setó thå startinç addresó anä blocë sizå  oæ  thå memorù  windo÷ displaù durinç thå Ê command®  Thå formaô oæ  thå command is: *K ARG1 [,ARG2] ARG1  representó  thå startinç addresó  oæ  thå  memorù           block.           ARG2 ió aî optionaì sizå paramter¬ iæ omitteä thå blocë           size defaults to the maximum. Thå  maximuí  blocë sizå ió 14´ decimaì whicè  ió  9°  hex®  Thå startinç  addresó oæ thå memorù blocë caî bå anywherå iî  memory» iô doeó noô havå tï bå withiî thå confineó oæ thå useò program. 50 Z8E - Z80 DEBUG MONITOR Rick Surwilo M Move Memory _________________________________________________________________ Thå  Í  commanä allowó thå useò tï movå blockó oæ datå  froí  anù addresó iî memorù tï anù otheò addresó iî memory®  Thå formaô oæ thå commanä is: *M ARG1 ARG2 ARG3 where  ARG1  = thå   startinç  addresó  oæ   thå                                 sourcå datá blocë                                                ARG2  =  thå  endinç addresó oæ thå sourcå                                 datá block ARG3 = thå   startinç  addresó  oæ   thå                                 destinatioî datá blocë arguments may be of any type Z8Å automaticallù decideó whetheò á head-to-heaä oò  tail-to-taiì movå  ió  requireä baseä oî thå threå argumentó  entered®  If  á head-to-heaä  movå  ió needeä theî thå firsô bytå oæ  thå  sourcå datá  blocë  wilì  bå writteî tï thå firsô bytå positioî  oæ  thå destinatioî datá block»  thå seconä bytå oæ thå sourcå datá blocë wilì  bå writteî tï thå seconä bytå positioî oæ  thå  destinatioî datá block¬ anä sï oî untiì thå endinç addresó oæ thå destinatioî datá blocë ió reached® Oî  thå otheò hand¬  iæ á tail-to-taiì movå ió necessarù Z8Å wilì movå  thå  lasô bytå oæ thå sourcå datá blocë tï  thå  lasô  bytå positioî oæ thå destinatioî datá block¬ followeä bù thå seconä tï lasô  bytå  oæ thå sourcå datá blocë tï thå seconä tï  lasô  bytå positioî  oæ  thå  destinatioî datá block¬  anä sï oî  untiì  thå startinç addresó oæ thå destinatioî blocë ió reached® Á  taiì tï taiì movå woulä bå necessarù iî thå followinç  examplå to prevent the overwriting of the destination data block: *M 1000 100F 1008 51 Z8E - Z80 DEBUG MONITOR Rick Surwilo N Output to I/O Ports Without Pre-Read _________________________________________________________________ Thió  commanä allowó thå useò tï outpuô datá tï aî I/Ï porô with- ouô  firsô readinç thå porô (aó occuró iî thå  Ñ  command)®  Thå formaô oæ thå commanä is: *N [ARG1] where ARG± ió thå porô numbeò tï whicè thå                              datá wilì bå written.                              Iæ ARG± ió omitteä theî Z8Å useó thå                              lasô  porô  addresó whicè  haä  beeî                              inpuô bù á previouó Î oò Ñ command® Z8Å wilì prompô thå useò bù displayinç thå currenô porô numbeò oî thå  lefô hanä sidå oæ thå consolå anä postioninç thå cursoò  twï spaceó thå thå right®  Aô thió poinô thå useò caî enteò thå datá tï  bå senô tï thå porô iî thå forí oæ aî  ARGUMENT-STRING®  Thå ARGUMENT-STRINÇ  allowó  thå useò tï miø variouó  argumenô  typeó sucè aó heø datá anä ASCIÉ literaì strings®  Oæ courså thå  useò caî  elecô tï merelù outpuô singlå byteó iæ desired®  Thå Î com- manä  ió particularlù usefuì wheî programminç variouó  Z8°  peri- pheraì  chipó sucè aó thå DMÁ anä SIÏ chipó whicè expecô  initia- lizatioî byteó tï arrivå iî á streaí withouô interveninç reads. *N 80 80 'T',00,12#,998 Thió  ARGUMENT-STRINÇ woulä bå evaluateä intï thå                 µ bytesº 5´ 0° 0à 0¹ 98® Theså fivå byteó woulä                 bå senô tï porô 8° viá aî OTIÒ  instruction®  Nï                 delaù occuró betweeî successivå bytes® Afteò thå datá haó beeî entereä anä afteò iô haó beeî senô tï thå I/Ï  porô  Z8Å  repromptó thå useò bù displayinç  thå  samå  porô number®  Thió  giveó thå useò tï oppportunitù tï senä  addtionaì datá  tï thå samå port®  However¬  bù noô enterinç datá thå useò caî  changå  thå  currenô porô addresó bù  enterinç  anù  oæ  thå following: 52 Z8E - Z80 DEBUG MONITOR Rick Surwilo CARRIAGE   Thå nexô sequentiaì porô numbeò iî  ascendinç          RETURN ordeò becomeó thå currenô porô address. UP ARROW    Thå nexô sequentiaì porô numbeò iî descendinç                     ordeò becomeó thå currenô porô address. =ARG       Anù argumenô appearinç immediatelù afteò  thå                     equaì  sigî  (nï interveninç spaces© ió  eva-                     luateä aó aî ¸ biô number¬ anä iæ founä tï bå                     valiä  theî iô becomeó thå ne÷  currenô  porô                     address. PERIOD  Terminate command Thå  useò  caî  alsï monitoò aî I/Ï porô witè thå  Î  commanä  bù enclosinç  thå  porô numbeò oî thå commanä linå  iî  parentheses® Monitoò  modå  viá  thå Î commanä ió identicaì tï thaô oæ  thå  Ñ command (see Q command). 53 Z8E - Z80 DEBUG MONITOR Rick Surwilo O Output Current Breakpoints to Console _________________________________________________________________ Thå  Ï commanä allowó thå useò tï vie÷ alì breakpointó  currentlù in effect. The format of the command is: *O no arguments are required Iæ  Z8E  findó  á symboì namå correspondinç tï thå  absolutå  heø addresó oæ á breakpoinô addresó iî thå symboì tablå (iæ á  symboì tablå  exists© theî thå symboì namå aó welì aó thå memorù addresó ió displayed® Iæ nï symboì correspondinç tï thå addresó ió founä onlù thå hex addresó ió displayed® Iæ  anù  pasó countó arå currentlù iî effecô theù  arå  displayeä nexô tï thå breakpoinô addresó witè whicè theù arå associated. 54 Z8E - Z80 DEBUG MONITOR Rick Surwilo P Examine/Modify PSW (Flag Register) _________________________________________________________________ Thå  Ð  commanä  provideó á convenienô methoä  oæ  examininç  anä optionallù  modifyinç  thå F(lag© registeò iî thå  useò  registeò set® Thå formaô oæ thå commanä is: *P no arguments are required on the command line Upoî  receipô oæ thå Ð commanä Z8E displayó thå mnemonicó corres- pondinç  tï  thå currenô statå oæ thå fouò  user-modifiablå  bitó (sign¬ carry¬ zero¬ parity© iî Flaç register: MNEMONIC MEANING BIT STATUS P positive reset M minus set NC no carry reset C carry set PO parity odd reset PE parity even set NZ not zero reset Z zero set Z8E  printó  thå mnemoniã correspondinç tï thå currenô  statå  oæ eacè  oæ  thå  fouò  flaç  bits®  Z8E  theî  issueó  á  carriagå return/linå feeä anä pauseó foò useò input®  Thå useò maù modifù anù  oæ  thå fouò flaç bitó bù typinç  thå  appropriatå  mnemoniã followeä  bù  á  carriagå return®  Thå useò maù  enteò  multiplå mnemonicó bù separatinç eacè onå witè á space® Iæ  nï mnemonicó arå entered¬  nï flagó bitó arå altereä anä  thå command terminates. Iæ aî invaliä flaç biô mnemoniã ió entereä Z8E printó á  questioî mark. 55 Z8E - Z80 DEBUG MONITOR Rick Surwilo Q Query I/O Ports _________________________________________________________________ Thå  Ñ  commanä allowó thå useò flexiblå accesó tï I/Ï  portó  bù providinç  thå abilitù tï perforí singlå bytå  input¬  continuouó inpuô (monitoò mode)¬ anä singlå oò multi-bytå outpuô followinç á pre-reaä oæ thå port® Thå formaô oæ thå commanä is: *Q [(] [ARG1] [)] wherå ARG1 ió aî ¸ biô porô addresó iî thå range 0 - 255 ARG1 maù bå anù symboì type¬  howeveò iæ á 1¶  biô                valuå  ió  specifieä  onlù thå lo÷ ordeò  bytå  ió                significanô                Iæ  nï  argumenô ió giveî Z8Å wilì  uså  thå  mosô                recenô porô numbeò aó entereä bù thå useò viá aî Î                oò Ñ command.                Iæ  ARG1 ió encloseä iî parentheseó Z8Å wilì enteò                MONITOÒ MODE. Upoî  receipô  oæ ARG1 Z8Å wilì reaä thå specifieä I/Ï  porô  anä displaù  thå bytå reaä aó botè ¸ biô hexadecimaì valuå  anä  it'ó ASCIÉ equivalent® Commanä optionó oncå á bytå haó beeî reaä froí thå I/Ï porô arå aó follows:      SINGLE BYTE INPUT         Bù  enterinç  á SPACE immediatelù  followinç  thå         displayeä  contentó oæ thå I/Ï porô thå useò  caî         instrucô  Z8Å tï continuå readinç froí  thå  samå         I/Ï port: *Q EE EE 24 $ EE 24 $                  Bù  enterinç á CARRIAGE RETURN followinç thå dis-         playeä  contentó  oæ thå I/Ï porô  thå  useò  caî         instrucô   Z8Å  tï  reaä  thå  nexô  porô  numbeò         (ascendinç order): *Q EE EE 24 $ EF C1 A         Bù  enterinç á careô "^¢ followinç thå  displayeä         contentó  oæ thå I/Ï porô thå useò  caî  instrucô Š 56 Z8E - Z80 DEBUG MONITOR Rick Surwilo         Z8Å  tï reaä thå previouó porô numbeò (descendinç         order): *Q EE EE 24 $ ^ (up arrow entered by user) ED 06 ~         Bù enterinç aî equaì sigî "=¢ followeä bù á valiä         argument¬  thå  useò caî switcè tï readinç á  ne÷         port address:          *Q EE          EE 24 '$' =90          90 BF '?'           CONTINUOUS INPUT (MONITOR MODE)         Z8Å provideó thå useò witè thå abilitù tï monitoò         aî  inpuô  port®  Z8Å wilì continouslù reaä  thå         selecteä  inpuô porô anä displaù thå contentó  oî         thå  screen®  Z8Å displayó thå bytå iî botè  heø         anä  binary®  Thió  featurå ió  useful  iî  thå         testinç  oæ I/Ï ports®  Depressinç anù keù oî thå         keyboard exits monitor mode.      MULTI-BYTE OUTPUT         Followinç  thå  reaä oæ aî I/Ï porô thå useò  maù         elecô  tï  outpuô data®  Thå useò  maù  enteò  aî         ARGUMENT-STRINÇ whicè wilì bå senô tï thå porô oî         á  bytå  bù bytå basió witè nï interveninç  readó         betweeî outputó aó showî below:          *Q 50 50 44 'D' 23,9,'B2E',00,F723,81          ^ ^              strinç  aó entereä bù                         useò appearó  betweeî                         arrowó         Thå  datá aó entereä bù thå useò iî thió  examplå         woulä  firsô  bå converteä tï thå ¹  byteó  showî         below: 23 09 42 32 45 00 F7 23 81         Theså  ¹ byteó woulä theî bå senô tï porô 5°  onå         bytå  afteò anotheò withouô anù interveninç readó         oò statuó checks. 57 Z8E - Z80 DEBUG MONITOR Rick Surwilo R Examine/Modify Register Contents _________________________________________________________________ Thå  Ò  commanä allowó thå useò tï examinå anä optionallù  modifù registeró  anä  registeò pairó iî thå  useò  registeò  set®  Thå format of the command is: *R ARG1 or space wherå  ARG1  ió anù oæ thå 2²  registeò  mnemonicó                listeä below:                  A B C D E H L        AF BC DE HL IX IY SP        AF' BC' DE' HL' I R P PC (thå  prograí  counteò maù  bå  specifieä  aó                     eitheò Ð oò PC) Tï  examinå á registeò thå useò enteró á mnemoniã froí thå  abovå lisô followeä bù á carriagå returî oò á space®  Z8E wilì displaù thå  currenô contentó oæ thå registeò oî thå samå line®  Aô thió poinô thå useò haó thå optioî oæ enterinç aî argumenô oæ anù typå iæ  thå  contentó  oæ thå registeò oò registeò  paiò  arå  tï  bå changed®  Thå  replacemenô valuå maù bå terminateä bù eitheò  á carriagå  returî oò á space®  Iæ nï valuå ió entereä Z8E issueó á carriagå return/linå feeä anä waitó foò thå nexô registeò  mnemo- niã tï bå entered. Iæ  thå useò specifieó á 1¶ biô valuå aó thå ne÷ contentó oæ aî ¸ bit register only the low order byte of the value is used. Thå commanä terminateó wheî á carriagå returî oò spacå ió entereä wheî Z8E ió waitinç foò á registeò mnemonic. 58 Z8E - Z80 DEBUG MONITOR Rick Surwilo S Single Step _________________________________________________________________                               Thå Ó commanä allowó thå useò tï executå á prograí instructioî bù instruction®  Thå  Ó  commanä provideó foò fulì tracinç  oæ  thå user program® Thå formaô oæ thå commanä is: *S [/] [ARG1]                wherå  ARG1 ió thå numbeò oæ instructionó tï  exe-                cutå iî thå useò program¬  iæ nï argumenô ió giveî                Z8E defaults to 1                                ARG1 may be of any type Thå slasè "/¢ allowó thå useò controì oveò thå tracinç oæ subrou- tines®  Iæ  á slasè ió includeä beforå thå counô (iæ á  counô  ió entered)¬  oò  iæ thå slasè ió thå onlù characteò oî thå  commanä linå  theî subroutineó wilì noô bå traced®  Á slasè affectó onlù CALÌ  instructionó whicè liå withiî thå rangå oæ  ARG1®  Iî  thå mosô  typicaì  caså nï ARG1 ió presenô anä thå single steð  counô defaultó  tï 1®  Iæ thå currenô PC¬  100° iî  thió  example¬  ió pointinç tï á calì instructioî theî thå command: *S / 1000 CD 56 30 RASRTN: CALL ANYSUB 1003 FE 04 CP 4 1005 CA 17 10 JP Z,AHEAD wilì  causå  thå  entirå  subroutinå ANYSU tï  bå  executeä  anä controì  wilì  returî tï thå useò aô addresó 1003®  Iæ ARG± ió omitteä Z8Å wilì transfeò controì tï thå useò  prograí anä  onå instruction¬  thå onå pointeä tï bù thå currenô contentó oæ thå user'ó prograí counter¬  wilì bå executed®  Followinç thå executioî  oæ thå instructioî (oò grouð oæ instructionó  iæ  ARG² waó  greateò  thaî 1© Z8Å regainó controì anä automaticallù  dis- playó thå currenô contentó oæ alì thå useò registers. Thå  useò maù optionallù indicatå thaô morå thaî onå  instructioî ió  tï  bå executeä bù enterinç á valuå greateò thaî ± foò  ARG1® Z8E wilì transfeò controì tï thå useò prograí anä regaiî  controì onlù  wheî  thå specifieä numbeò oæ instructionó havå  beeî  exe- cuted®  Thió featurå ió usefuì iî debugginç smalì loops» iî thaô thå  useò caî seô ARG1 equaì tï thå numbeò oæ instructionó iî thå rangå oæ thå loop®  Z8E wilì displaù thå registeò contentó afteò eacè  instructioî oæ thå looð ió executeä anä returî  controì  tï thå useò afteò everù iteratioî oæ thå loop. Thå  singlå  steð commanä alwayó causeó thå executioî oæ thå  in- structioî  pointeä tï bù thå currenô contentó oæ thå user'ó  pro- graí counter®  Thió ió thå instructioî thaô appearó iî disassem-Š 59 Z8E - Z80 DEBUG MONITOR Rick Surwilo bleä  forí  aó  parô oæ thå outpuô oæ thå  "X¢  commanä  (displaù machinå  state)®  Beaò iî minä thaô ARG1 ió noô thå  addresó  aô whicè singlå steppinç ió tï begin» iô ió á counô tï thå numbeò oæ instructionó  tï execute®  Iæ thå useò desireó tï singlå steð aô aî  addresó otheò thaî thå onå containeä iî thå prograí  counter¬ theî  thå Pà registeò musô bå modifieä viá thå Ò  commanä  beforå thå singlå steð commanä ió issueä tï Z8E. Allowinç  thå  conveniencå oæ enterinç "S¢ ®  Iæ  yoõ changå youò minä anä wanô tï canceì thå command¬ typå iî aî inva- liä  argumenô  aó ARG1®  Thió wilì causå á questioî marë  tï  bå displayed» however¬ nï instructioî wilì bå executed® Durinç  blocë  tracinç (ARG1 greateò thaî 1© thå commanä  maù  bå terminated by hitting any key on the keyboard. Thå  Ó commanä doeó noô relocatå instructionó beforå executioî aó doeó thå Ç commanä (seå Ç command)® Hence¬ iô ió noô possiblå tï single step through each iteration of a DJNZ $ instruction. 60 Z8E - Z80 DEBUG MONITOR Rick Surwilo U Write Symbol Table to Disk _________________________________________________________________ Thå  Õ commanä allowó thå useò tï writå thå currenô symboì  tablå to a disk file. The format of the command is: *U ARG1                ARG±  ió thå namå oæ thå filå tï whicè thå  symboì                table is to be written. Thió  commanä ió usefuì tï savå anù symboì nameó entereä  bù  thå useò  viá thå Á command®  Thå entirå symboì tablå ió writteî  tï disë usinç thå formaô oæ á .SYÍ filå (seå appendiø A)® Thå tablå caî bå subsequentlù loadeä aô thå nexô invokatioî oæ Z8E. Notå  thaô sincå thå filå ió storeä aó á .SYÍ formatteä filå  thå useò shoulä uså á filå namå extensioî thaô begiî witè thå letteò "S"®  Thió  ió duå tï thå facô thaô thå nexô timå Z8Å loadó thió symboì  filå iô wilì examinå thå thå firsô characteò oæ thå  filå namå extension®  Iæ thå firsô characteò ió aî "S¢ thå formaô  ió assumeä tï bå .SYÍ anä thå symboì tablå ió builô accordingly» thå appearancå  oæ anù otheò letteò ió takeî tï indicatå á .PRÎ file® Iæ  á filå witè thå namå ARG± alreadù existó oî disë iô  wilì  bå deleted® 61 Z8E - Z80 DEBUG MONITOR Rick Surwilo V Verify two memory blocks _________________________________________________________________ Thå  Ö  commanä allowó thå useò tï comparå twï blockó oæ  memory® Z8E wilì displaù alì differenceó betweeî thå two®  Thå formaô oæ thå commanä is: *V ARG1 ARG2 ARG3 where ARG1 = the starting address of memory block 1                  ARG2 = the ending address of memory block 1 ARG3 =  the starting address of memory block 2 Z8E compareó memorù blocë ± tï memorù blocë ² bytå bù byte® If á mismatcè  occuró  Z8E wilì displaù thå addresó iî eacè  blocë  aô whicè  thå mismatcè waó found¬  aó welì aó thå bytå containeä  aô eacè address®  Thå comparisoî continueó untiì thå endinç addresó ió reached. Thå  useò maù halô thå commanä aô anù timå bù depressinç anù  keù on the keyboard. 62 Z8E - Z80 DEBUG MONITOR Rick Surwilo W write memory to disk _________________________________________________________________ Thå  × commanä allowó thå useò tï writå thå contentó oæ memorù tï a disk file. The format of the command is: *W arg1 [arg2 arg3] ARG±  ió thå namå oæ á filå tï whicè writinç  wilì                takå place.                ARG² anä ARG³ arå thå optionaì startinç anä endinç                addresseó  oæ thå portioî oæ memorù tï bå  writteî                tï  thå disk®  Iæ thå addresseó omitteä theî  thå                memorù  blocë  tï  bå writteî ió  defineä  bù  thå                startinç  anä  endinç addresseó oæ thå  lasô  filå                loaded®  Theså  addresseó caî bå  redisplayeä  bù                enterinç thå É commanä witè nï arguments. Z8Å  alwayó  deleteó anù filå oî disë whoså namå ió thå  samå  aó ARG1® Iæ nï filå bù thió namå existó theî Z8Å wilì automaticallù creatå it. Z8Å wilì echï thå startinç memorù addresó anä continuallù  updatå thå endinç memorù addresó aó thå writinç tï disë takeó place. 63 Z8E - Z80 DEBUG MONITOR Rick Surwilo X display machine state _________________________________________________________________ Thå   Ø  commanä  displayó  thå  currenô  contentó  oæ  alì  useò registers. The format of the command is: *X no arguments are required Z8Å  displayó displayó alì registers¬  excepô thå É registeò  anä thå Ò register¬  oî twï lineó oæ thå console®  Iî addition¬  thå instructioî pointeä tï bù thå user'ó prograí counteò ió disassem- bleä anä displayeä oî thå seconä line®  Thinë oæ thió aó thå "oî deck¢  instructionº  thå instructioî thaô wilì bå executeä  upoî thå receipô oæ thå nexô Ç (GO© oò Ó (SINGLÅ STEP© command. To inspect the I or R registers use the R command. 64 Z8E - Z80 DEBUG MONITOR Rick Surwilo Y fill memory _________________________________________________________________ Thå  Ù commanä filló á useò specifieä blocë oæ memorù witè á useò specifieä  patterî oæ bytes¬  thå lengtè oæ whicè ió limiteä onlù by the length of Z8E's input buffer which is 80 bytes long: *Y ARG1 ARG2 ARG3 where ARG1 = thå  startinç addresó oæ thå blocë                                tï fill ARG2 = thå endinç addresó oæ thå blocë tï                                fill ARG3 = ió thå datá patterî tï bå  writteî                                tï  memory®  ARG3 ió evaluateä bù                                Z8Å aó typå ARGUMENT-STRINÇ  whicè                                maù  bå oæ anù lengtè iî thå rangå                                oæ  ± througè thå numbeò oæ  byteó                                remaininç iî thå inpuô buffeò oncå                                ARG1 anä ARG2 havå been input. Thå Ù commanä giveó thå useò thå capabilitù to initializå memorù tï  anù  datá pattern®  Thå capabilitù  oæ  enterinç  multi-bytå stringó  aó thå datá patterî witè whicè tï filì memorù allowó thå useò tï storå repeatinç patternó oæ datá iî memorù witè á  singlå command. For example if the user entered the command: *Y 1000 127C 'abcd',16,77 Z8Å  woulä  begiî writinç thå ¶ bytå patterî (6± 6² 6³ 6´ 1¶ 77© entereä  aó ARG³ startinç aô addresó 1000®  Thió  patterî  woulä repeaô aô addresó 1006¬ 100C¬ 1012¬ etc® Thå commanä endó afteò á bytå ió writteî tï thå ARG² addresó eveî iæ  thió bytå doeó noô represenô thå lasô bytå iî thå ARG³ block® Iî thå abovå examplå thå commanä woulä enä wheî á bytå ió writteî tï addresó 127à eveî iæ thaô bytå ió noô 77® 65 Z8E - Z80 DEBUG MONITOR Rick Surwilo Z disassemble command _________________________________________________________________ Thå  Ú  commanä allowó thå useò tï disassemblå á blocë  oæ  data® Z8E  performó  disassembly¬  whicè ió thå translatioî  oæ  binarù memorù datá intï sourcå codå format¬  usinç thå fulì Z8° instruc- tioî seô anä Ziloç mnemonics®  Thå resultanô sourcå codå maù  bå directeä  tï thå consolå oò tï thå consolå anä á disë filå simul- taneously® Z8E alsï allowó thå useò tï disassemblå interactivelù wheî ARG2 ió equaì tï 1® Thå formaô oæ thå commanä is: *Z ARG1 [ARG2 ARG3] where  ARG1  =  thå starô addresó aô whicè disa-                                  ssemblù ió tï begin ARG2 =   ió  optionaì anä represents  thå                                  uppeò  limiô oæ thå  disassemblù                                  procesó (seå detailó below) ARG3 =  ió  aî optionaì filå namå speci-                                  ficatioî foò disassemblù tï disë                ARG1 maù bå oæ anù argumenô type®                ARG2  ió  treateä iî onå oæ twï wayó dependinç  oî                itó  value:                   1) Iæ  ARG2 evaluateó tï á numbeò betweeî ±  anä                     25µ  (decimal© Z8E wilì disassemblå iî "blocë                     mode¢ anä ARG2 becomeó á counô oæ thå  numbeò                     oæ instructionó peò blocë tï disassemble®  Aó                     wilì  bå  explaineä below¬  Z8E pauseó  afteò                     eacè  blocë  ió disassembleä anä  allowó  thå                     useò tï continuå oò tï terminatå thå command.                     Iæ ARG2 ió omitteä altogetheò á defaulô blocë                     sizå oæ ± ió used®                                          Wheneveò ARG2 equaló 1¬  eitheò explicitlù oò                     bù default¬  Z8E allowó interactivå disassem-                     blù whicè allowó thå useò tï chooså thå  out-                     puô  formaô oæ thå data®  Interactivå disas-                     semblù ió discusseä below.                  2) Iæ  ARG2 evaluateó tï á numbeò  greateò  thaî                     25µ  iô  ió assumeä tï bå aî endinç  address®                     Iî  thió caså disassemblù wilì  proceeä  froí                     startinç  addresó  (ARG1© tï  endinç  addresó                     (ARG2© anä nï useò interventioî ió required.                ARG3¬  iæ present¬  ió assumeä tï bå thå namå oæ á                disë  filå intï whicè thå disassembleä outpuô wilì                bå written®  Z8E searcheó thå specifieä disë  foò Š 66 Z8E - Z80 DEBUG MONITOR Rick Surwilo                thå  nameä file®  Iæ thå filå ió found¬  theî alì                disassembleä outpuô wilì bå writteî tï  it¬  over-                writinç anù datá thaô existeä there®  Iæ thå filå                doeó  noô exisô thå filå wilì bå createä usinç thå                namå specifieä iî ARG3®                NOTEº  Iæ  ARG3 ió presenô ARG2 musô bå explicitlù                specified¬ otherwiså Z8E wilì mistakenlù treaô thå                filå namå aó ARG2. Z8E outputs to the console using the following format: ADDRESS OBJECT CODE LABEL: OPCODE OPERAND Z8E writes to disk using the following formart: LABEL: OPCODE OPERAND Z8E  disassembleó  memorù blocë bù blocë iî  thå  useò  specifieä blocë  size®  Afteò  eacè  blocë ió outpuô Z8E pauseó  foò  useò input®  Á carriagå returî inpuô bù thå useò terminateó thå  com- mand¬  whilå  anù  otheò  characteò causeó thå nexô blocë  tï  bå disassembleä (unlesó interactivå modå ió iî effect)® Perhapó thå mosô convenienô waù tï disassemblå ió tï specifù á counô oæ  one¬ eitheò explicitù oò bù omittinç ARG2¬ anä tï uså thå spacå baò aó aî  on/ofæ switch®  Holdinç dowî thå spacå baò produceó  output¬ releasinç  thå  spacå  baò endó output. Z8E'ó  disassembleò ió especiallù powerfuì wheî useä iî  conjunc- tioî  witè thå symboì facility®  Bù buildinç á symboì tablå witè botè  .PRÎ anä .SYÍ files¬  and/oò creatinç useò  defineä  symboì nameó  viá  thå  Á command¬  thå useò caî virtuallù  recreatå  aî assembleò outpuô listinç (minuó thå comments© witè Z8E  insertinç labeló anä symboliã operandó whereveò possible. Iæ  Z8E cannoô matcè aî operanä iî thå disassembleä  instructioî tï  á correspondinç symboì iî thå symboì table¬  oò iæ nï  symboì tablå exists¬ Z8E useó thå hexadecimaì value. Iæ multiplå symboló iî thå symboì tablå arå equaì tï thå samå  1¶ biô  valuå  oò address¬  Z8E disassembleó usinç thå firsô  symboì namå  encountereä  iî  thå searcè oæ thå symboì  tablå  whicè  ió equateä tï thå 1¶ biô operanä specifieä iî thå instructioî  beinç disassembled®  Thió  wilì unavoidablù producå aî occasionaì mis- nameä  operanä wheî morå thaî onå symboì namå ió equateä  tï  thå samå  1¶  biô value®  Z8Å  doeó noô substitutå symboì nameó iî thoså  Z8°  instructionó whicè referencå ¸ biô immediatå datá (ie®  LÄ A,24H)® Eighô biô immediatå  datá  ió disassembleä aó á quoteä ASCIÉ  characteò  iæ it'ó absolutå valuå ió iî thå rangå 2° heø tï 7Å hex»  otherwise¬ iô ió disassembleä aó á heø byte. Outpuô bù Z8E tï á disë filå ió instantlù assemblablå bù mosô anù Š 67 Z8E - Z80 DEBUG MONITOR Rick Surwilo assembleò whicè acceptó Ziloç mnemonicó withouô anù modificationó other than addinç aî ENÄ statemenô aô thå enä oæ thå file. Wheî  disassemblinç á blocë oæ memorù (startinç addresó tï endinç address©  thå  disassemblù procesó maù bå halteä aô anù  timå  bù depressinç anù keù oî thå keyboard. Interactivå  disassemblù allowó thå useò tï specifù thå formaô oæ thå sourcå codå produceä bù disassemblù oî á linå bù linå  basis® Interactivå  mode¬  whicè  ió alwayó iî effecô wheneveò  ARG2  ió equaì tï 1¬  causeó Z8E tï pauså afteò eacè instructioî ió disas- sembled®  Thió  pauså foò inpuô permitó thå useò tï enteò onå oæ thå followinç commandó tï chooså thå desireä outpuô format: CHARACTER OUTPUT FORMAT EXAMPLE Á ASCIÉ DEFB DEFB 'Q' B HEX DEFB DEFB 23H C CODE EX DE,HL D HEX DEFW DEFW 02FCH or DEF× LABEL ; add COMMENT ;This is a Comment carriage (terminate command) return any other PROCEED TO THE character NEXT INSTRUCTION      ASCII DEFB:      Thå  contentó oæ memorù aô thå currenô disassemblù  ad-      dresó ió converteä tï á quoteä ASCIÉ character® Valueó      lesó  thaî hexadecimaì 2° (ASCIÉ space© oò greateò thaî      hexadecimaì  7Å  (ASCIÉ tilde© cannoô  bå  disassembleä      intï thió format®      HEX DEFB:      Thå ¸ biô contentó oæ memorù aô thå currenô disassemblù      addresó arå converteä tï á heø byte.      CODE:      Thió  ió thå normaì defaulô foò  disassembly®  Aó  Z8E      moveó  oî  tï á ne÷ addresó iô wilì alwayó displaù  thå      contentó  oæ memorù aó á Z8° instruction®  Thå "C¢  ió      onlù  needeä tï redisplaù thå contentó oæ memorù aó  aî      instructioî haä onå oæ thå otheò characteró (A¬  B¬  oò      D© alreadù havå beeî entered® Š 68 Z8E - Z80 DEBUG MONITOR Rick Surwilo      HEX DEFW:      Thå contentó oæ thå twï byteó oæ memorù startinç aô thå      loactioî oæ thå currenô disassemblù addresó arå  outpuô      aó  á  definå  worä directive®  Thå  bytå  pointeä  tï      directlù bù thå currenô disassemblù addresó becomeó thå      lo÷ ordeò bytå oæ thå operand® Thå bytå aô disassemblù      addresó pluó onå becomeó thå higè ordeò byte.     NOTE:             Iæ  Z8E haä jusô disassembleä  á  multi-             bytå  Z8°  instructioî anä thå useò  en-             tereä anù oæ thå characteró listeä abovå             (A¬  B¬ C¬ oò D© onlù thå firsô byte¬ oò             firsô  twï foò "D"¬  oæ thå  instructioî             woulä  bå  converteä  tï  thå  requesteä             format®  Thå  remaininç  byteó  oæ  thå             instructioî  woulä bå treateä aó  á  ne÷             Z8°  instructioî oncå thå useò proceedeä             tï thå nexô disassemblù address®      ADDING COMMENTS      Z8Å  allowó  thå  useò tï adä onå commenô peò  linå  oæ      disassembleä code® Iæ MAXLEÎ ió seô tï ¶ theî commentó      maù bå uð tï 2¹ characteró iî length®  Iæ MAXLEÎ ió seô      tï  1´  theî  commentó maù bå uð tï  1¶  characteró  iî      length. Iæ  durinç  disassembly¬  Z8E  encounteró datá  whicè  cannoô  bå disassembleä  intï  á valiä Z8° instructioî iô wilì  displaù  thå data as DEFB's. 69 APPENDIX A FILE FORMAT FOR SYMBOL TABLES Z8Å  ió  currentlù seô uð tï bå ablå tï reaä anù oæ  thå  listinç fileó whicè appeaò below: 1. Microsoft MACRO-80 V3.37 .PRN Files May 8, 1980 2. Microsoft MACRO-80 V3.44 .PRN Files Dec 9, 1981 3. Microsoft LINK-80 V3.44 .SYM Files Dec 9, 1981 4. SLR Systems Z80ASM V1.07 .LST Files     5. SLR Systems SLRNK V1.07 .SYM Files       The unique characteristics of each are:     MACRO-80 V3.37     Z8Å  searcheó  foò  thå ¸ bytå strinç "Symbols:¢  iî  thå     file®  Oncå thió strinç ió found¬  Z8Å expectó aî  ASCIÉ     carriagå  returî characteò anä aî ASCIÉ linå feeä charac-     teò  tï bå thå nexô twï byteó iî thå file®  Thå  symboì     tablå listinç shoulä begiî iî thå nexô characteò positioî     iî thå file.     Eacè  linå  oæ  thå symboì tablå  listinç  containó  fouò     symboì nameó anä aî associateä address®     Iæ  thå characteò followinç thå symbol'ó heø valuå ió  aî     apostophe¬  thå  symboì ió considereä tï bå prograí rela-     tive®  Iæ  thå useò specifieä á biaó iî thå commanä  linå     thå biaó wilì bå addeä tï thå symbol'ó value.     Iæ  thå characteò followinç thå symbol'ó heø valuå ió  aî     "I¢  (meaninç  thaô thå symboì ió globallù defined©  theî     thå  characteò followinç thå "I¢ ió  examined®  Iæ  thió     characteò ió aî apostrophå iô ió considereä tï bå prograí     relativå  anä  thå  bias¬  iæ specifieä ió addeä  tï  thå     value.     Iæ  thå characteò followinç thå heø symboì valuå  oò  thå     "I¢ ió anù characteò besideó aî apostrophe¬ thå symboì ió     considereä absolutå anä thå biaó wilì noô bå added.     Thå  filå shoulä bå terminateä witè thå CP/Í  end-of-filå     characteò (controì Ú whicè ió equivalenô tï á heø 1A).     Iæ  thå strinç "Symbols¢ ió neveò found¬  Z8Å printó  thå     messageº Symboì Tablå noô Found 70 APPENDIX A     MACRO-8° V3.44     Z8Å  searcheó  foò  thå ¸ bytå strinç "Symbols:¢  iî  thå     file®  Oncå thió strinç ió found¬  Z8Å expectó aî  ASCIÉ     carriagå  returî characteò anä aî ASCIÉ linå feeä charac-     teò  tï bå thå nexô twï byteó iî thå file®  Thå  symboì     tablå listinç shoulä begiî iî thå nexô characteò positioî     iî thå file.     Iî  thió  releaså oæ MACRO-8° thå formaô  oæ  thå  symboì     tablå ió completelù oppositå oæ V3.37®  Thaô is¬ thå heø     valuå appearó beforå thå symboì name®  Iî addition¬ theså     heø value/symboì namå combinatioî appeaò threå peò line.     Thå  characteò  appearinç afteò thå heø valuå  ió  inter-     preteä aó describeä foò versioî 3.37®     Iæ  thå strinç "Symbols¢ ió neveò found¬  Z8Å printó  thå     messageº Symboì Tablå noô Found          LINK-80 V3.44     LINK-8°  caî  optionallù producå á linë mað  (.SYÍ  file©     whicè  listó  alì  globallù defineä symboló iæ  thå  useò     specifieó  thå  "Y¢ optioî thå  L8°  commanä  line®  Z8Å     treató  alì symboló nameó loadeä froí á LINK-8° .SYÍ filå     aó absolutå (non-relocatable©  addresses®  Nevertheless¬     iæ  thå useò specifieó á bias¬  iô wilì bå addeä tï everù     symboì valuå reaä iî froí thå .SYÍ file.     Z8Å  expectó  thå firsô symboì valuå iî á  .SYÍ  filå  tï     begiî  iî  thå  firsô bytå positioî iî  thå  file®  Eacè     symboì valuå consistó oæ fouò hexadecimaì byteó iî  ASCIÉ     followeä  bù á taâ character®  Immediatelù afteò thå taâ     characteò ió thå symboì namå whicè maù bå betweeî onå anä     siø alphanumeriã characteró iî length®  Thå symboì  namå     ió  followeä  bù á taâ anä thå sequencå  repeats®  Everù     fourtè  symboì value/symboì namå paiò shoulä bå  followeä     bù á carriagå returî anä linå feed.     Thå  filå shoulä bå terminateä witè thå CP/Í  end-of-filå     characteò (controì Ú whicè ió equivalenô tï á heø 1A).     Z80ASM     Z80ASÍ  maù  bå configureä tï producå eitheò  8°  oò  13²     columî output.     Z8Å searcheó foò thå ¸ bytå strinç "Symboì Table:¢ iî thå     file®  Thió  strinç neeä noô bå aô thå beginninç oæ  thå     file»  Z8Å wilì scaî thå entirå filå lookinç foò it® Oncå     thió  strinç  ió found¬  Z8Å expectó  aî  ASCIÉ  carriagå     returî  characteò anä aî ASCIÉ linå feeä characteò tï  bå Š 71 APPENDIX A     thå nexô twï byteó iî thå file®  Thå symboì tablå list-     inç  shoulä  begiî iî thå nexô characteò positioî iî  thå     file.     Iî  á Z80ASÍ .LSÔ filå thå heø valuå appearó  beforå  thå     symboì  name®  Heø value/symboì namå combinationó  appeaò     threå peò line®  Z80ASÍ symboì nameó maù contaiî uð tï 1¶     characters® Z8Å wilì accepô thå firsô 1´ characteró oæ á     symboì namå iæ MAXLEÎ ió seô tï 1´ oò thå firsô ¶ charac-     teró iæ MAXLEÎ ió seô tï 6®     Iæ thå strinç "Symboì Table:¢ ió neveò found¬  Z8Å printó     thå messageº Symboì Tablå Noô Found     SLRNK     SLRNË  caî  optionallù  producå á linë  mað  (.SYÍ  File©     similaò  tï thå onå produceä bù Link-80®  Z8Å treató  alì     symboló  loadeä froí á SLRNË .SYÍ filå aó  absolutå  sym-     bols® However¬ aó iî thå caså oæ Link-8° .SYÍ files¬ Z8Å     wilì  adä  á  relocatioî biaó tï eacè symboì  iæ  onå  ió     specified.     Eacè  symboì valuå iî á SLRNË .SYÍ filå consistó oæ  fouò     hexadecimaì  byteó  followeä bù á spacå followeä  bù  thå     symboì  name®  Thå symboì namå ió followeä bù twï  ASCIÉ     taâ characters®      Use SLRNK's /M option to produce a link map. NOTE:     Whilå readinç iî á MACRO-8° .PRÎ file¬  oò á Z80ASÍ  .LSÔ     file¬  Z8Å ió capablå oæ readinç aî entirå assemblù list-     inç  filå  lookinç foò thå "Symbols:¢ strinç  oò  "Symboì     Table:¢ string®  Theså stringó neeä noô bå locateä aô thå     beginninç  oæ  thå file®  However¬  thå loadinç  oæ  thå     symboì  tablå  wilì  bå speedeä uð  considerablù  iæ  thå     symboì  tablå  ió  thå onlù datá iî thå  file®  Thió  ió     accomplisheä quitå easilù iî botè MACRO-8° bù turninç ofæ     thå  listinç  durinç aî assemblù througè thå uså  oæ  thå     .XLISÔ directive® Thå listinç caî theî bå turneä bacë oî     jusô prioò tï thå ENÄ directivå viá á .LISÔ directivå  tï     ensurå thaô thå symboì tablå ió writteî tï disk.     Iæ  yoõ  arå usinç Z80ASÍ uså thå /Ó optioî  tï  instrucô     Z80ASÍ tï producå á symboì file. Z8Å  ió ablå tï procesó symboì tableó whicè occupù multiplå pageó iî anù oæ thå filå typeó mentioneä above® Headingó whicè precedå Š 72 APPENDIX A eacè pagå arå automaticallù ignoreä bù Z8E® APPENDIX B - ZILOG MNEMONICS 0049 NN EQU 49H ;8 BIT OPERAND 123F NNNN EQU 123FH ;16 BIT OPERAND 0036 INDEX EQU 36H ;INDEX REGISTER INDEX 010B 8E ADC A,(HL) 010C DD 8E 36 ADC A,(IX+INDEX) 010F FD 8E 36 ADC A,(IY+INDEX) 0112 8F ADC A,A 0113 88 ADC A,B 0114 89 ADC A,C 0115 8A ADC A,D 0116 8B ADC A,E 0117 8C ADC A,H 0118 8D ADC A,L 0119 CE 49 ADC A,NN 011B ED 4A ADC HL,BC 011D ED 5A ADC HL,DE 011F ED 6A ADC HL,HL 0121 ED 7A ADC HL,SP 0123 86 ADD A,(HL) 0124 DD 86 36 ADD A,(IX+INDEX) 0127 FD 86 36 ADD A,(IY+INDEX) 012A 87 ADD A,A 012B 80 ADD A,B 012C 81 ADD A,C 012D 82 ADD A,D 012E 83 ADD A,E 012F 84 ADD A,H 0130 85 ADD A,L 0131 C6 49 ADD A,NN 0133 09 ADD HL,BC 0134 19 ADD HL,DE 0135 29 ADD HL,HL 0136 39 ADD HL,SP 0137 DD 09 ADD IX,BC 0139 DD 19 ADD IX,DE 013B DD 29 ADD IX,IX 013D DD 39 ADD IX,SP 013F FD 09 ADD IY,BC 0141 FD 19 ADD IY,DE 0143 FD 29 ADD IY,IY 0145 FD 39 ADD IY,SP 0147 A6 AND (HL) 0148 DD A6 36 AND (IX+INDEX) 014B FD A6 36 AND (IY+INDEX) 014E A7 AND A 014F A0 AND B 0150 A1 AND C 0151 A2 AND D Š 74 APPENDIX B - ZILOG MNEMONICS 0152 A3 AND E 0153 A4 AND H 0154 A5 AND L 0155 E6 49 AND NN 0157 CB 46 BIT 0,(HL) 0159 DD CB 36 46 BIT 0,(IX+INDEX) 015D FD CB 36 46 BIT 0,(IY+INDEX) 0161 CB 47 BIT 0,A 0163 CB 40 BIT 0,B 0165 CB 41 BIT 0,C 0167 CB 42 BIT 0,D 0169 CB 43 BIT 0,E 016B CB 44 BIT 0,H 016D CB 45 BIT 0,L 016F CB 4E BIT 1,(HL) 0171 DD CB 36 4E BIT 1,(IX+INDEX) 0175 FD CB 36 4E BIT 1,(IY+INDEX) 0179 CB 4F BIT 1,A 017B CB 48 BIT 1,B 017D CB 49 BIT 1,C 017F CB 4A BIT 1,D 0181 CB 4B BIT 1,E 0183 CB 4C BIT 1,H 0185 CB 4D BIT 1,L 0187 CB 56 BIT 2,(HL) 0189 DD CB 36 56 BIT 2,(IX+INDEX) 018D FD CB 36 56 BIT 2,(IY+INDEX) 0191 CB 57 BIT 2,A 0193 CB 50 BIT 2,B 0195 CB 51 BIT 2,C 0197 CB 52 BIT 2,D 0199 CB 53 BIT 2,E 019B CB 54 BIT 2,H 019D CB 55 BIT 2,L 019F CB 5E BIT 3,(HL) 01A1 DD CB 36 5E BIT 3,(IX+INDEX) 01A5 FD CB 36 5E BIT 3,(IY+INDEX) 01A9 CB 5F BIT 3,A 01AB CB 58 BIT 3,B 01AD CB 59 BIT 3,C 01AF CB 5A BIT 3,D 01B1 CB 5B BIT 3,E 01B3 CB 5C BIT 3,H 01B5 CB 5D BIT 3,L 01B7 CB 66 BIT 4,(HL) Š 75 APPENDIX B - ZILOG MNEMONICS 01B9 DD CB 36 66 BIT 4,(IX+INDEX) 01BD FD CB 36 66 BIT 4,(IY+INDEX) 01C1 CB 67 BIT 4,A 01C3 CB 60 BIT 4,B 01C5 CB 61 BIT 4,C 01C7 CB 62 BIT 4,D 01C9 CB 63 BIT 4,E 01CB CB 64 BIT 4,H 01CD CB 65 BIT 4,L 01CF CB 6E BIT 5,(HL) 01D1 DD CB 36 6E BIT 5,(IX+INDEX) 01D5 FD CB 36 6E BIT 5,(IY+INDEX) 01D9 CB 6F BIT 5,A 01DB CB 68 BIT 5,B 01DD CB 69 BIT 5,C 01DF CB 6A BIT 5,D 01E1 CB 6B BIT 5,E 01E3 CB 6C BIT 5,H 01E5 CB 6D BIT 5,L 01E7 CB 76 BIT 6,(HL) 01E9 DD CB 36 76 BIT 6,(IX+INDEX) 01ED FD CB 36 76 BIT 6,(IY+INDEX) 01F1 CB 77 BIT 6,A 01F3 CB 70 BIT 6,B 01F5 CB 71 BIT 6,C 01F7 CB 72 BIT 6,D 01F9 CB 73 BIT 6,E 01FB CB 74 BIT 6,H 01FD CB 75 BIT 6,L 01FF CB 7E BIT 7,(HL) 0201 DD CB 36 7E BIT 7,(IX+INDEX) 0205 FD CB 36 7E BIT 7,(IY+INDEX) 0209 CB 7F BIT 7,A 020B CB 78 BIT 7,B 020D CB 79 BIT 7,C 020F CB 7A BIT 7,D 0211 CB 7B BIT 7,E 0213 CB 7C BIT 7,H 0215 CB 7D BIT 7,L 0217 DC 123F CALL C,NNNN 021A FC 123F CALL M,NNNN 021D D4 123F CALL NC,NNNN 0220 CD 123F CALL NNNN 0223 C4 123F CALL NZ,NNNN 0226 F4 123F CALL P,NNNN 0229 EC 123F CALL PE,NNNN 022C E4 123F CALL PO,NNNN Š 76 APPENDIX B - ZILOG MNEMONICS 022F CC 123F CALL Z,NNNN 0232 3F CCF 0233 BE CP (HL) 0234 DD BE 36 CP (IX+INDEX) 0237 FD BE 36 CP (IY+INDEX) 023A BF CP A 023B B8 CP B 023C B9 CP C 023D BA CP D 023E BB CP E 023F BC CP H 0240 BD CP L 0241 FE 49 CP NN 0243 ED A9 CPD 0245 ED B9 CPDR 0247 ED A1 CPI 0249 ED B1 CPIR 024B 2F CPL 024C 27 DAA 024D 35 DEC (HL) 024E DD 35 36 DEC (IX+INDEX) 0251 FD 35 36 DEC (IY+INDEX) 0254 3D DEC A 0255 05 DEC B 0256 0B DEC BC 0257 0D DEC C 0258 15 DEC D 0259 1B DEC DE 025A 1D DEC E 025B 25 DEC H 025C 2B DEC HL 025D DD 2B DEC IX 025F FD 2B DEC IY 0261 2D DEC L 0262 3B DEC SP 0263 F3 DI 0264 10 04 DJNZ $+6 Š 77 APPENDIX B - ZILOG MNEMONICS 0266 FB EI 0267 E3 EX (SP),HL 0268 DD E3 EX (SP),IX 026A FD E3 EX (SP),IY 026C 08 EX AF,AF' 026D EB EX DE,HL 026E D9 EXX 026F 76 HALT 0270 ED 46 IM 0 0272 ED 56 IM 1 0274 ED 5E IM 2 0276 ED 78 IN A,(C) 0278 DB 49 IN A,(NN) 027A ED 40 IN B,(C) 027C ED 48 IN C,(C) 027E ED 50 IN D,(C) 0280 ED 58 IN E,(C) 0284 ED 60 IN H,(C) 0286 ED 68 IN L,(C) 0288 34 INC (HL) 0289 DD 34 36 INC (IX+INDEX) 028C FD 34 36 INC (IY+INDEX) 028F 3C INC A 0290 04 INC B 0291 03 INC BC 0292 0C INC C 0293 14 INC D 0294 13 INC DE 0295 1C INC E 0296 24 INC H 0297 23 INC HL 0298 DD 23 INC IX 029A FD 23 INC IY 029C 2C INC L 029D 33 INC SP 029E ED AA IND 02A0 ED BA INDR 02A2 ED A2 INI 02A4 ED B2 INIR 02A6 E9 JP (HL) 02A7 DD E9 JP (IX) Š 78 APPENDIX B - ZILOG MNEMONICS 02A9 FD E9 JP (IY) 02AB DA 123F JP C,NNNN 02AE FA 123F JP M,NNNN 02B1 D2 123F JP NC,NNNN 02B4 C3 123F JP NNNN 02B7 C2 123F JP NZ,NNNN 02BA F2 123F JP P,NNNN 02BD EA 123F JP PE,NNNN 02C0 E2 123F JP PO,NNNN 02C3 CA 123F JP Z,NNNN 02C6 38 04 JR C,$+6 02C8 18 04 JR $+6 02CA 30 04 JR NC,$+6 02CC 20 04 JR NZ,$+6 02CE 28 04 JR Z,$+6 02D0 02 LD (BC),A 02D1 12 LD (DE),A 02D2 77 LD (HL),A 02D3 70 LD (HL),B 02D4 71 LD (HL),C 02D5 72 LD (HL),D 02D6 73 LD (HL),E 02D7 74 LD (HL),H 02D8 75 LD (HL),L 02D9 36 49 LD (HL),NN 02DB DD 77 36 LD (IX+INDEX),A 02DE DD 70 36 LD (IX+INDEX),B 02E1 DD 71 36 LD (IX+INDEX),C 02E4 DD 72 36 LD (IX+INDEX),D 02E7 DD 73 36 LD (IX+INDEX),E 02EA DD 74 36 LD (IX+INDEX),H 02ED DD 75 36 LD (IX+INDEX),L 02F0 DD 36 36 49 LD (IX+INDEX),NN 02F4 FD 77 36 LD (IY+INDEX),A 02F7 FD 70 36 LD (IY+INDEX),B 02FA FD 71 36 LD (IY+INDEX),C 02FD FD 72 36 LD (IY+INDEX),D 0300 FD 73 36 LD (IY+INDEX),E 0303 FD 74 36 LD (IY+INDEX),H 0306 FD 75 36 LD (IY+INDEX),L 0309 FD 36 36 49 LD (IY+INDEX),NN 030D 32 123F LD (NNNN),A 0310 ED 43 123F LD (NNNN),BC 0314 ED 53 123F LD (NNNN),DE 0318 22 123F LD (NNNN),HL Š 79 APPENDIX B - ZILOG MNEMONICS 031B DD 22 123F LD (NNNN),IX 031F FD 22 123F LD (NNNN),IY 0323 ED 73 123F LD (NNNN),SP 0327 0A LD A,(BC) 0328 1A LD A,(DE) 0329 7E LD A,(HL) 032A DD 7E 36 LD A,(IX+INDEX) 032D FD 7E 36 LD A,(IY+INDEX) 0330 3A 123F LD A,(NNNN) 0333 7F LD A,A 0334 78 LD A,B 0335 79 LD A,C 0336 7A LD A,D 0337 7B LD A,E 0338 7C LD A,H 0339 ED 57 LD A,I 033B 7D LD A,L 033C 3E 49 LD A,NN 033E ED 5F LD A,R 0340 46 LD B,(HL) 0341 DD 46 36 LD B,(IX+INDEX) 0344 FD 46 36 LD B,(IY+INDEX) 0347 47 LD B,A 0348 40 LD B,B 0349 41 LD B,C 034A 42 LD B,D 034B 43 LD B,E 034C 44 LD B,H 034D 45 LD B,L 034E 06 49 LD B,NN 0350 ED 4B 123F LD BC,(NNNN) 0354 01 123F LD BC,NNNN 0357 4E LD C,(HL) 0358 DD 4E 36 LD C,(IX+INDEX) 035B FD 4E 36 LD C,(IY+INDEX) 035E 4F LD C,A 035F 48 LD C,B 0360 49 LD C,C 0361 4A LD C,D 0362 4B LD C,E 0363 4C LD C,H 0364 4D LD C,L 0365 0E 49 LD C,NN 0367 56 LD D,(HL) Š 80 APPENDIX B - ZILOG MNEMONICS 0368 DD 56 36 LD D,(IX+INDEX) 036B FD 56 36 LD D,(IY+INDEX) 036E 57 LD D,A 036F 50 LD D,B 0370 51 LD D,C 0371 52 LD D,D 0372 53 LD D,E 0373 54 LD D,H 0374 55 LD D,L 0375 16 49 LD D,NN 0377 ED 5B 123F LD DE,(NNNN) 037B 11 123F LD DE,NNNN 037E 5E LD E,(HL) 037F DD 5E 36 LD E,(IX+INDEX) 0382 FD 5E 36 LD E,(IY+INDEX) 0385 5F LD E,A 0386 58 LD E,B 0387 59 LD E,C 0388 5A LD E,D 0389 5B LD E,E 038A 5C LD E,H 038B 5D LD E,L 038C 1E 49 LD E,NN 038E 66 LD H,(HL) 038F DD 66 36 LD H,(IX+INDEX) 0392 FD 66 36 LD H,(IY+INDEX) 0395 67 LD H,A 0396 60 LD H,B 0397 61 LD H,C 0398 62 LD H,D 0399 63 LD H,E 039A 64 LD H,H 039B 65 LD H,L 039C 26 49 LD H,NN 039E 2A 123F LD HL,(NNNN) 03A1 21 123F LD HL,NNNN 03A4 ED 47 LD I,A 03A6 DD 2A 123F LD IX,(NNNN) 03AA DD 21 123F LD IX,NNNN 03AE FD 2A 123F LD IY,(NNNN) 03B2 FD 21 123F LD IY,NNNN Š 81 APPENDIX B - ZILOG MNEMONICS 03B6 6E LD L,(HL) 03B7 DD 6E 36 LD L,(IX+INDEX) 03BA FD 6E 36 LD L,(IY+INDEX) 03BD 6F LD L,A 03BE 68 LD L,B 03BF 69 LD L,C 03C0 6A LD L,D 03C1 6B LD L,E 03C2 6C LD L,H 03C3 6D LD L,L 03C4 2E 49 LD L,NN 03C6 ED 4F LD R,A 03C8 ED 7B 123F LD SP,(NNNN) 03CC F9 LD SP,HL 03CD DD F9 LD SP,IX 03CF FD F9 LD SP,IY 03D1 31 123F LD SP,NNNN 03D4 ED A8 LDD 03D6 ED B8 LDDR 03D8 ED A0 LDI 03DA ED B0 LDIR 03DC ED 44 NEG 03DE 00 NOP 03DF B6 OR (HL) 03E0 DD B6 36 OR (IX+INDEX) 03E3 FD B6 36 OR (IY+INDEX) 03E6 B7 OR A 03E7 B0 OR B 03E8 B1 OR C 03E9 B2 OR D 03EA B3 OR E 03EB B4 OR H 03EC B5 OR L 03ED F6 49 OR NN 03EF ED BB OTDR 03F1 ED B3 OTIR Š 82 APPENDIX B - ZILOG MNEMONICS 03F3 ED 79 OUT (C),A 03F5 ED 41 OUT (C),B 03F7 ED 49 OUT (C),C 03F9 ED 51 OUT (C),D 03FB ED 59 OUT (C),E 03FD ED 61 OUT (C),H 03FF ED 69 OUT (C),L 0401 D3 49 OUT (NN),A 0403 ED AB OUTD 0405 ED A3 OUTI 0407 F1 POP AF 0408 C1 POP BC 0409 D1 POP DE 040A E1 POP HL 040B DD E1 POP IX 040D FD E1 POP IY 040F F5 PUSH AF 0410 C5 PUSH BC 0411 D5 PUSH DE 0412 E5 PUSH HL 0413 DD E5 PUSH IX 0415 FD E5 PUSH IY 0417 CB 86 RES 0,(HL) 0419 DD CB 36 86 RES 0,(IX+INDEX) 041D FD CB 36 86 RES 0,(IY+INDEX) 0421 CB 87 RES 0,A 0423 CB 80 RES 0,B 0425 CB 81 RES 0,C 0427 CB 82 RES 0,D 0429 CB 83 RES 0,E 042B CB 84 RES 0,H 042D CB 85 RES 0,L 042F CB 8E RES 1,(HL) 0431 DD CB 36 8E RES 1,(IX+INDEX) 0435 FD CB 36 8E RES 1,(IY+INDEX) 0439 CB 8F RES 1,A 043B CB 88 RES 1,B 043D CB 89 RES 1,C 043F CB 8A RES 1,D 0441 CB 8B RES 1,E 0443 CB 8C RES 1,H 0445 CB 8D RES 1,L Š 83 APPENDIX B - ZILOG MNEMONICS 0447 CB 96 RES 2,(HL) 0449 DD CB 36 96 RES 2,(IX+INDEX) 044D FD CB 36 96 RES 2,(IY+INDEX) 0451 CB 97 RES 2,A 0453 CB 90 RES 2,B 0455 CB 91 RES 2,C 0457 CB 92 RES 2,D 0459 CB 93 RES 2,E 045B CB 94 RES 2,H 045D CB 95 RES 2,L 045F CB 9E RES 3,(HL) 0461 DD CB 36 9E RES 3,(IX+INDEX) 0465 FD CB 36 9E RES 3,(IY+INDEX) 0469 CB 9F RES 3,A 046B CB 98 RES 3,B 046D CB 99 RES 3,C 046F CB 9A RES 3,D 0471 CB 9B RES 3,E 0473 CB 9C RES 3,H 0475 CB 9D RES 3,L 0477 CB A6 RES 4,(HL) 0479 DD CB 36 A6 RES 4,(IX+INDEX) 047D FD CB 36 A6 RES 4,(IY+INDEX) 0481 CB A7 RES 4,A 0483 CB A0 RES 4,B 0485 CB A1 RES 4,C 0487 CB A2 RES 4,D 0489 CB A3 RES 4,E 048B CB A4 RES 4,H 048D CB A5 RES 4,L 048F CB AE RES 5,(HL) 0491 DD CB 36 AE RES 5,(IX+INDEX) 0495 FD CB 36 AE RES 5,(IY+INDEX) 0499 CB AF RES 5,A 049B CB A8 RES 5,B 049D CB A9 RES 5,C 049F CB AA RES 5,D 04A1 CB AB RES 5,E 04A3 CB AC RES 5,H 04A5 CB AD RES 5,L 04A7 CB B6 RES 6,(HL) 04A9 DD CB 36 B6 RES 6,(IX+INDEX) 04AD FD CB 36 B6 RES 6,(IY+INDEX) 04B1 CB B7 RES 6,A 04B3 CB B0 RES 6,B Š 84 APPENDIX B - ZILOG MNEMONICS 04B5 CB B1 RES 6,C 04B7 CB B2 RES 6,D 04B9 CB B3 RES 6,E 04BB CB B4 RES 6,H 04BD CB B5 RES 6,L 04BF CB BE RES 7,(HL) 04C1 DD CB 36 BE RES 7,(IX+INDEX) 04C5 FD CB 36 BE RES 7,(IY+INDEX) 04C9 CB BF RES 7,A 04CB CB B8 RES 7,B 04CD CB B9 RES 7,C 04CF CB BA RES 7,D 04D1 CB BB RES 7,E 04D3 CB BC RES 7,H 04D5 CB BD RES 7,L 04D7 C9 RET 04D8 D8 RET C 04D9 F8 RET M 04DA D0 RET NC 04DB C0 RET NZ 04DC F0 RET P 04DD E8 RET PE 04DE E0 RET PO 04DF C8 RET Z 04E0 ED 4D RETI 04E2 ED 45 RETN 04E4 CB 16 RL (HL) 04E6 DD CB 36 16 RL (IX+INDEX) 04EA FD CB 36 16 RL (IY+INDEX) 04EE CB 17 RL A 04F0 CB 10 RL B 04F2 CB 11 RL C 04F4 CB 12 RL D 04F6 CB 13 RL E 04F8 CB 14 RL H 04FA CB 15 RL L 04FC 17 RLA 04FD CB 06 RLC (HL) 04FF DD CB 36 06 RLC (IX+INDEX) 0503 FD CB 36 06 RLC (IY+INDEX) 0507 CB 07 RLC A 0509 CB 00 RLC B Š 85 APPENDIX B - ZILOG MNEMONICS 050B CB 01 RLC C 050D CB 02 RLC D 050F CB 03 RLC E 0511 CB 04 RLC H 0513 CB 05 RLC L 0515 07 RLCA 0516 ED 6F RLD 0518 CB 1E RR (HL) 051A DD CB 36 1E RR (IX+INDEX) 051E FD CB 36 1E RR (IY+INDEX) 0522 CB 1F RR A 0524 CB 18 RR B 0526 CB 19 RR C 0528 CB 1A RR D 052A CB 1B RR E 052C CB 1C RR H 052E CB 1D RR L 0530 1F RRA 0531 CB 0E RRC (HL) 0533 DD CB 36 0E RRC (IX+INDEX) 0537 FD CB 36 0E RRC (IY+INDEX) 053B CB 0F RRC A 053D CB 08 RRC B 053F CB 09 RRC C 0541 CB 0A RRC D 0543 CB 0B RRC E 0545 CB 0C RRC H 0547 CB 0D RRC L 0549 0F RRCA 054A ED 67 RRD 054C C7 RST 0 054D CF RST 08H 054E D7 RST 10H 054F DF RST 18H 0550 E7 RST 20H 0551 EF RST 28H 0552 F7 RST 30H 0553 FF RST 38H Š 86 APPENDIX B - ZILOG MNEMONICS 0554 9E SBC A,(HL) 0555 DD 9E 36 SBC A,(IX+INDEX) 0558 FD 9E 36 SBC A,(IY+INDEX) 055B 9F SBC A,A 055C 98 SBC A,B 055D 99 SBC A,C 055E 9A SBC A,D 055F 9B SBC A,E 0560 9C SBC A,H 0561 9D SBC A,L 0562 DE 49 SBC A,NN 0564 ED 42 SBC HL,BC 0566 ED 52 SBC HL,DE 0568 ED 62 SBC HL,HL 056A ED 72 SBC HL,SP 056C 37 SCF 056D CB C6 SET 0,(HL) 056F DD CB 36 C6 SET 0,(IX+INDEX) 0573 FD CB 36 C6 SET 0,(IY+INDEX) 0577 CB C7 SET 0,A 0579 CB C0 SET 0,B 057B CB C1 SET 0,C 057D CB C2 SET 0,D 057F CB C3 SET 0,E 0581 CB C4 SET 0,H 0583 CB C5 SET 0,L 0585 CB CE SET 1,(HL) 0587 DD CB 36 CE SET 1,(IX+INDEX) 058B FD CB 36 CE SET 1,(IY+INDEX) 058F CB CF SET 1,A 0591 CB C8 SET 1,B 0593 CB C9 SET 1,C 0595 CB CA SET 1,D 0597 CB CB SET 1,E 0599 CB CC SET 1,H 059B CB CD SET 1,L 059D CB D6 SET 2,(HL) 059F DD CB 36 D6 SET 2,(IX+INDEX) 05A3 FD CB 36 D6 SET 2,(IY+INDEX) 05A7 CB D7 SET 2,A 05A9 CB D0 SET 2,B 05AB CB D1 SET 2,C 05AD CB D2 SET 2,D 05AF CB D3 SET 2,E 05B1 CB D4 SET 2,H 05B3 CB D5 SET 2,L Š 87 APPENDIX B - ZILOG MNEMONICS 05B5 CB DE SET 3,(HL) 05B7 DD CB 36 DE SET 3,(IX+INDEX) 05BB FD CB 36 DE SET 3,(IY+INDEX) 05BF CB DF SET 3,A 05C1 CB D8 SET 3,B 05C3 CB D9 SET 3,C 05C5 CB DA SET 3,D 05C7 CB DB SET 3,E 05C9 CB DC SET 3,H 05CB CB DD SET 3,L 05CD CB E6 SET 4,(HL) 05CF DD CB 36 E6 SET 4,(IX+INDEX) 05D3 FD CB 36 E6 SET 4,(IY+INDEX) 05D7 CB E7 SET 4,A 05D9 CB E0 SET 4,B 05DB CB E1 SET 4,C 05DD CB E2 SET 4,D 05DF CB E3 SET 4,E 05E1 CB E4 SET 4,H 05E3 CB E5 SET 4,L 05E5 CB EE SET 5,(HL) 05E7 DD CB 36 EE SET 5,(IX+INDEX) 05EB FD CB 36 EE SET 5,(IY+INDEX) 05EF CB EF SET 5,A 05F1 CB E8 SET 5,B 05F3 CB E9 SET 5,C 05F5 CB EA SET 5,D 05F7 CB EB SET 5,E 05F9 CB EC SET 5,H 05FB CB ED SET 5,L 05FD CB F6 SET 6,(HL) 05FF DD CB 36 F6 SET 6,(IX+INDEX) 0603 FD CB 36 F6 SET 6,(IY+INDEX) 0607 CB F7 SET 6,A 0609 CB F0 SET 6,B 060B CB F1 SET 6,C 060D CB F2 SET 6,D 060F CB F3 SET 6,E 0611 CB F4 SET 6,H 0613 CB F5 SET 6,L 0615 CB FE SET 7,(HL) 0617 DD CB 36 FE SET 7,(IX+INDEX) 061B FD CB 36 FE SET 7,(IY+INDEX) 061F CB FF SET 7,A 0621 CB F8 SET 7,B Š 88 APPENDIX B - ZILOG MNEMONICS 0623 CB F9 SET 7,C 0625 CB FA SET 7,D 0627 CB FB SET 7,E 0629 CB FC SET 7,H 062B CB FD SET 7,L 062D CB 26 SLA (HL) 062F DD CB 36 26 SLA (IX+INDEX) 0633 FD CB 36 26 SLA (IY+INDEX) 0637 CB 27 SLA A 0639 CB 20 SLA B 063B CB 21 SLA C 063D CB 22 SLA D 063F CB 23 SLA E 0641 CB 24 SLA H 0643 CB 25 SLA L 0645 CB 2E SRA (HL) 0647 DD CB 36 2E SRA (IX+INDEX) 064B FD CB 36 2E SRA (IY+INDEX) 064F CB 2F SRA A 0651 CB 28 SRA B 0653 CB 29 SRA C 0655 CB 2A SRA D 0657 CB 2B SRA E 0659 CB 2C SRA H 065B CB 2D SRA L 065D CB 3E SRL (HL) 065F DD CB 36 3E SRL (IX+INDEX) 0663 FD CB 36 3E SRL (IY+INDEX) 0667 CB 3F SRL A 0669 CB 38 SRL B 066B CB 39 SRL C 066D CB 3A SRL D 066F CB 3B SRL E 0671 CB 3C SRL H 0673 CB 3D SRL L 0675 96 SUB (HL) 0676 DD 96 36 SUB (IX+INDEX) 0679 FD 96 36 SUB (IY+INDEX) 067C 97 SUB A 067D 90 SUB B 067E 91 SUB C 067F 92 SUB D 0680 93 SUB E 0681 94 SUB H 0682 95 SUB L 0683 D6 49 SUB NN Š 89 APPENDIX B - ZILOG MNEMONICS 0685 AE XOR (HL) 0686 DD AE 36 XOR (IX+INDEX) 0689 FD AE 36 XOR (IY+INDEX) 068C AF XOR A 068D A8 XOR B 068E A9 XOR C 068F AA XOR D 0690 AB XOR E 0691 AC XOR H 0692 AD XOR L 0693 EE 49 XOR NN 90 APPENDIX B - ZILOG MNEMONICS APPENDIX B - ZILOG MNEMONICS APPENDIX C - SYSTEM MEMORY MAP |||||||||||||||||||||||||||||||||||| FFFF || || || || || CP/M (BDOS and BIOS) || || || || || |||||||||||||||||||||||||||||||||||| || || || Z8E (Approx 8.75 BYTES) || || || |||||||||||||||||||||||||||||||||||| || || || OPTIONAL SYMBOL TABLE || || || |||||||||||||||||||||||||||||||||||| || || || || || || || || || || || || || TPA || || || || || || || || || || || || || || || |||||||||||||||||||||||||||||||||||| --- 0100 || || || PAGE ZERO RESERVED || || || |||||||||||||||||||||||||||||||||||| ___ 0000 92 APPENDIX B - ZILOG MNEMONICS COMMAND SUMMARY REFERENCE CMD Description Arguments Á   Inlinå  Assemblù  StartAddr B Set Breakpoint Addr1[,Pass Count] [Addr2..AddrN] C Clear Breakpoint Addr1 [Addr2..AddrN] D Dump Memory [StartAddr] [End/Count] E Examine Memory StartAddr F Find StartAddr MatchData G Go ExecutionAddr H Display Symbol Table [FirstSymbol] I Input File FileName [,Load Address] J Full Screen/Animated Debug [/] [*] [Addr] [Timeout] K Set Memory Window StartAddr [Size] M Move Memory SourceStart SourceEnd DestStart N Output to Port NO Pre-Read [(] PortAddr [)] O Output Current Breakpoints P Exam/Modify PSW (Flag Reg) Q Query I/O Port [(] PortAddr [)] R Examine/Modify Registers RegSpecifier S Single-Step [/] [Count] U Write Symbol Table To Disk FileName V Verify Memory SourceStart SourceEnd DestStart W Write to Disk FileName [StartAddr] [EndAddr] X Examine Machine State Y Fill Memory FromAddr ToAddr Data Z Disassemble StartAddr End/Count FileName [] Denotes Optional Argument [/] Do Not Trace Subroutine [*] Do Not Trace BDOS Call [(] [)] I/O Port Monitor Mode Z8E Copyright (c) 1984 AERO-SOFT 93  .