home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / BEEHIVE / ZCAT / Z80DIS21.LBR / Z80DIS21.DZC / Z80DIS21.DOC
Text File  |  2000-06-30  |  41KB  |  1,255 lines

  1.  
  2.  
  3.  
  4. Z80DIS SHORT USER MANUAL
  5. A new Z80 disassembler
  6. by KENNETH GIELOW
  7. 11 JANUARY 86
  8.  
  9.  
  10.  
  11.  
  12.  
  13.                - PART 1 -
  14.               INTRODUCTORY REMARKS
  15.               --------------------
  16.  
  17. Z80DIS    is  an entirely new disassembler for Z80 based CP/M  sys-
  18. tems.    Z80DIS    is written in TURBO PASCAL.  Z80DIS generates Z80
  19. mnemonics  and    prepares  an assembly  language  file  with  many
  20. special  features  for    ease of understanding the intent  of  the
  21. code.
  22.  
  23. The program and documentation are (C) Copyright 1986,  by Kenneth
  24. Gielow, Palo Alto, CA.      All Rights Reserved.      At this time, I
  25. do  not intend any release of the 5000-plus lines of source  code
  26. for the disassembler, which will be controlled as a Trade Secret.
  27.  
  28. This short user manual is written in 4 parts:
  29.  
  30.      PART 1:    These introductory remarks
  31.      PART 2:    Features of Z80DIS
  32.      PART 3:    How to use the program
  33.      APPENDIX A:    Adaptation to your terminal
  34.      APPENDIX B:    Z80DIS revision history
  35.  
  36. This  program may be used freely for non-commercial  purposes.    A
  37. license is extended to users to copy and exchange the program and
  38. documentation with the sole restrictions that authorship  notices
  39. are  not to be removed or circumvented and that such distribution
  40. must  be  non-commercial  in nature (this is not  to  imply  that
  41. charges  for  such  things as diskettes and  modest  copying  and
  42. mailing  fees are of themselves commercial in nature.) All  other
  43. rights are reserved to the author, Kenneth Gielow.
  44.  
  45. The  following    files will be found on this program  distribution
  46. library package:
  47.  
  48.      Z80DIS.COM   - the disassembler main program
  49.      Z80DIS.000   - overlay file for Z80DIS
  50.      Z80DIS.001   - overlay file for Z80DIS
  51.  
  52.      ZDINSTAL.COM - the installation program
  53.      ZDINSTAL.MSG - contains text of ZDINSTAL messages
  54.      ZDINSTAL.DTA - contains terminal characteristics data
  55.  
  56.      Z80DIS20.DOC - short  user manual in ready to print  format.
  57.             For a better manual see DOCUMENTATION  NOTICE
  58.             (below.)
  59.  
  60.  
  61.  
  62.  
  63.               - page 1 -
  64.  
  65.  
  66.  
  67. Z80DIS -   a Z80 native code disassembler for CP/M   -    11 JAN 86
  68.  
  69.  
  70. The  Z80DIS  binary is in three files (see PART 3 for  use.)  The
  71. ZDINSTAL  files  will  tailor the interactive  displays  to  your
  72. terminal  (see    APPENDIX  A.) The DOC file is the text    for  this
  73. short form of the user manual ( SEE DOCUMENTATION NOTICE .)
  74.  
  75. The distributed version is compiled for a standard somewhat small
  76. CP/M  system for maximum compatibility with the larger    CP/M  3.0
  77. and  for users of the ZCPR3 extensions to CP/M.  TPA memory  size
  78. has been set for 50K;  the top address is C7FF hex.  A Z80  based
  79. CP/M system is required. Also needed is a printer with 80 columns
  80. minimum. The program is configurable for terminal differences but
  81. most  displays    are formatted to look best on a  screen  with  at
  82. least 80 columns and 24 lines.
  83.  
  84.                    -0-
  85.  
  86.  
  87.             - DOCUMENTATION NOTICE -
  88.               --------------------
  89.  
  90. The original, verison 1,  user manual gave extensive examples and
  91. used  disassembly of the public domain program D.COM as an  exam-
  92. ple.  Unfortunately,  with  the additions to document  the  newer
  93. features  and  give  additional suggestions for  use,  that  user
  94. manual    and program together have both gotten so large that  most
  95. system operators would not carry the complete library.
  96.  
  97. Something  had to give.  I feel that the program is largely  self
  98. explanatory  so that you can get started very well with  a  shor-
  99. tened manual. This abbreviated manual is included here. The short
  100. user  manual deals mainly with installing the Z80DIS program  and
  101. doing  a  simple  disassembly.    This short manual is all  that    a
  102. casual user would probably need.
  103.  
  104. The  longer manual expands on the discussion of the features  and
  105. explains  the  step-wise  approach to dealing  with  much  larger
  106. source codes. The manual also deals with disassembling code which
  107. relocates  itself.  Extensive  examples are included.  All  error
  108. messages and secondary options are discussed in detail.
  109.  
  110. The full Z80DIS USER MANUAL is available by mail.  I am asking    a
  111. nominal  charge  of $ 20.00 which includes the    manual,  postage,
  112. handling, and an update notification service. You are granted the
  113. right  to make not-for-profit copies of the manual.  The  program
  114. itself    is  not  available by mail as I do  not  have  extensive,
  115. multi-format disk copy capability.  The notification service will
  116. consist  of a letter to you anytime a new version is released  so
  117. that you may be on the lookout for it.
  118.  
  119. To  order a copy of the Z80DIS USER MANUAL,  send a request  with
  120. your name, address, and a check for $ 20.00 to --
  121.  
  122.            Kenneth Gielow
  123.            79 Tulip Lane
  124.            Palo Alto, CA  94303
  125.  
  126.  
  127.  
  128.  
  129.               - page 2 -
  130.  
  131.  
  132.  
  133. Z80DIS -       Part 2: Features of Z80DIS         -    11 JAN 86
  134.  
  135.  
  136.                - PART 2 -
  137.                FEATURES OF Z80DIS
  138.                ------------------
  139.  
  140. The  major  feature  of Z80DIS is an extensive    analysis  of  the
  141. memory    usage by the program under investigation.  This  analysis
  142. capability  forms the basis for an automatic partitioning of  the
  143. code to generate the break table.  This analysis also produces    a
  144. fully annotated cross reference of all addresses reference by the
  145. code under analysis.
  146.  
  147.      A    break  table  tells a disassembler how to  interpret  the
  148. binary    bytes  that it is examining.  A  disassembler  must  know
  149. whether  the bytes are instructions or data in order to  proceed.
  150. Z80DIS    is the first disassembler to produce its own break table.
  151. Some previous programs,  such as RESOURCE, have included a search
  152. for ASCII text regions, but have left the verification and inter-
  153. pretation up to the user.  Most other disassemblers are fooled by
  154. the  trick  of    adding nonsense bytes after jumps  to  cause  the
  155. analysis  to  fall out of synchronization with    instruction  code
  156. interpretation.   Z80DIS  gives you the option of calling on  the
  157. built in expert system to evaluate all of the interactions of the
  158. code to correctly separate the instructions from the data.
  159.  
  160.      To  get  an automatic break table,  you enter '*'    when  the
  161. program asks for break table inputs. This triggers an analysis of
  162. the structure and relationships of the input code to extract  the
  163. start  address of each region.    You are given the opportunity  to
  164. edit and/or save the resulting break table before continuing with
  165. the disassembly.  Regions of instructions,  bytes,  words,  ASCII
  166. data, and un-set buffers are all identified for you.
  167.  
  168.      Z80DIS also gives you an address listing  which itemizes all
  169. addresses  referenced by the code,  distinguishes types of  label
  170. references,  marks  subroutines  and jumps and produces an  fully
  171. annotated cross-reference.  This listing shows the exact mode  of
  172. usage for every reference:  Jump absolute,  Jump relative,  Call,
  173. Restart, Load 16-bit, Store 16-bit, Immediate 16-bit, Load 8-bit,
  174. Store  8-bit.  In version 2.1,    this listing also shows the break
  175. table region of residency for each label so that you may  inspect
  176. the list for inconsistencies.
  177.  
  178.      The  address  of each reference is given.    The type of  each
  179. reference is shown by a one or two letter code:
  180.  
  181.       J  = Jump           Jr = Jump relative
  182.       C  = Call           Cr = Call by Restart
  183.       Lw = Load word       Lb = Load byte
  184.       Sw = Store word       Sb = Store byte
  185.       Iw = Immediate word
  186.  
  187.      Z80DIS  uses an address labeling convention which assists in
  188. understanding the assembly code generated.  Each label    generated
  189. on  the assembly listing indicates,  by format,  both the generic
  190. type of any references and the singularity of the reference:
  191.  
  192.  
  193.  
  194.  
  195.               - page 3 -
  196.  
  197.  
  198.  
  199. Z80DIS -       Part 2: Features of Z80DIS         -    11 JAN 86
  200.  
  201.  
  202. Where a CP/M address can be assumed, then that name is used:
  203.  
  204.      0005h=>BDOS, 005Ch=>FCB1, 006Dh=>FCB2, 0080h=>DBUF, etc.
  205.  
  206. Otherwise,  the label takes the form L.hhhh and consists of three
  207. parts:
  208.  
  209.      The first character is usually a "J", "C", "D", "I" or "X".
  210.       J = JUMP (JP, JR references only)
  211.       C = CALL (CALL, RST, JP, JR only)
  212.       D = DATA (8- or 16-bit Load, Store or Immediate only)
  213.       I = Immediate 16-bit only
  214.       X = any other combination (a suspicious mixture)
  215.       . = the  address  is not referenced,    but  is  included
  216.            because     it  is  the  beginning  of  a    data   or
  217.            instruction code segment.
  218.  
  219.      The second character indicates the singularity of the label.
  220.       . = multiple references
  221.       # = singular reference
  222.  
  223.      The third through sixth characters are the hex address.
  224.  
  225.      For example,  J#02E3  would be used at address 02E3  if  one
  226.       reference  was made to that address and that    reference
  227.       was a JUMP.
  228.  
  229.      In  addition to helping you by automatic analysis of  memory
  230. use,  Z80DIS also assists you by styling the presentation of  the
  231. disassembled code.  The disassembled code is output in two forms:
  232. Both the usual *.MAC file and a, printer formatted, *.PRN file.
  233.  
  234.      The *.PRN file is a major aid to understanding the intent of
  235. the  code.  The  file looks like the output of an assembler  with
  236. both the instructions and assembled bytes shown.  The  juxtaposi-
  237. tion  of the hexadecimal bytes and the assembly mnemonics  allows
  238. the  user  to recognize errors caused by an  incorrectly  defined
  239. break table.
  240.  
  241.      Separation  comment lines are used to assist in  visualizing
  242. the  flow of the program.  A blank comment line is inserted after
  243. every CALL or CONDITIONAL JUMP.  A bar-of-dashes comment line  is
  244. inserted  after every UNCONDITIONAL JUMP.  All CALL  instructions
  245. are indented one space to highlight them.
  246.  
  247.      All  subroutines  are  marked with a  header  comment  which
  248. separates them from the other code and allows you to annotate the
  249. purpose  of the subroutine.  All immediate 8-bit data is shown in
  250. both hex and decimal or ASCII.
  251.  
  252.      Version 2.1 allows you the option of suppressing either  the
  253. *.MAC  file or the *.PRN file.    This allows conserving disk space
  254. needed for the assembly language output file while you are analy-
  255. zing the code via the list file. You may now direct the list file
  256. directly to your LST device to save further disk space.
  257.  
  258.  
  259.  
  260.  
  261.               - page 4 -
  262.  
  263.  
  264.  
  265. Z80DIS -       Part 3: INSTRUCTIONS FOR EXECUTION    -    11 JAN 86
  266.  
  267.  
  268.                - PART 3 -
  269.            INSTRUCTIONS FOR EXECUTION
  270.            --------------------------
  271.  
  272. Z80DIS    is  a batch program with user interactive set-up  of  the
  273. control parameters.  You start Z80DIS by typing "Z80DIS" with  no
  274. parameters.  The  program  will prompt you for    inputs.  In  most
  275. cases,    default  entries are shown in DIM intensity already occu-
  276. pying the data field.  If you type only the RETURN key,  the  de-
  277. fault will be used.
  278.  
  279. Z80DIS.COM  may be on the drive of your choice and executed via a
  280. drive prefix (e.i.  B:Z80DIS),    the overlay files, Z80DIS.000 and
  281. Z80DIS.001, must be on your logged drive, drive A, or drive B.
  282.  
  283. There are four phases of execution. The first two are user inter-
  284. active: Basic parameter set-up and definition of the break table.
  285. The second two are automatic:  Disassembly pass 1 and disassembly
  286. pass 2. These will be dealt with in parts   3.1 through 3.4 which
  287. follow.
  288.  
  289.                    -0-
  290.  
  291. PART  3.1 -- BASIC PARAMETER DEFINITION:   After a brief  sign-on
  292.      message,    you   will  be    asked  to  supply  the    following
  293.      information:
  294.  
  295. =================================================================
  296.  
  297.   INPUT   file name: ______________
  298.   OUTPUT  file name: ______________
  299.   LISTING file name: ______________
  300.   Descriptive TITLE: __________________________________________
  301.  
  302.      file LOAD  address: ____ HEX
  303.   disassembly START address: ____ HEX
  304.   disassembly STOP  address: ____ HEX
  305.  
  306.   Do you wish to run a FULL output (as opposed to XREF only)? _
  307.   On which disk do you wish the scratch file to reside? (A-G) _
  308.   Do You wish to process all Z80 codes (as opposed 8080 subset)?
  309.  
  310.   Are all inputs OK so far? _
  311.  
  312. =================================================================
  313.  
  314. Each question is presented one-at-a-time from the top.    The para-
  315. graphs below discuss the purpose,  defaults,  editing  capability
  316. and error checking for each answer.
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.               - page 5 -
  328.  
  329.  
  330.  
  331. Z80DIS -       Part 3: INSTRUCTIONS FOR EXECUTION    -    11 JAN 86
  332.  
  333.  
  334. -----------------------------------
  335. INPUT file name: ______________
  336.  
  337.      Z80DIS  wants the name of the file you wish to  disassemble.
  338. This  file must be in the absolute binary format common  to  CP/M
  339. ".COM" files.  The file need not be a .COM file and need not load
  340. into  memory  at address 0100 hex.  Z80DIS will ask for the  load
  341. address at a later step.
  342.  
  343. -----------------------------------
  344. OUTPUT file name: ______________
  345.  
  346.      Z80DIS wants the name of the file to be used for the  disas-
  347. sembled output.
  348.  
  349.      The  program  provides a default file name which  is  NONE:.
  350. this file name will suppress production of this file.  To write a
  351. file you must supply a name.
  352.  
  353. -----------------------------------
  354. LISTING file name: ______________
  355.  
  356.      Z80DIS wants the name of the file to be used for the listing
  357. of the cross-reference and the disassembly.  A standard CP/M file
  358. name is expected. To suppress list output you may enter NONE:. To
  359. direct the listing to your printer you may enter LST:.
  360.  
  361. -----------------------------------
  362. Descriptive TITLE: __________________________________________
  363.  
  364.      You may enter a free-form, 42-character title to be included
  365. as identification on your listings and output code.  Some form of
  366. date, time, cracking attempt number are useful.
  367.  
  368. -----------------------------------
  369. file LOAD  address: ____ HEX
  370.  
  371.      Z80DIS wants the hex memory address at which the first  word
  372. of the file resides when loaded and ready to run. This is usually
  373. 0100 hex for normal .COM files.  If you enter only <CR>, you will
  374. get the 0100 default.
  375.  
  376. -----------------------------------
  377. disassembly START address: ____ HEX
  378.  
  379.      Z80DIS  wants  the hex memory address at which to start  the
  380. disassembly. This is usually the same as the LOAD address. If you
  381. enter  only  <CR>,  you will get the value you    entered  as  LOAD
  382. address  as default.  The START address must be at or higher than
  383. the LOAD address.
  384.  
  385. NOTICE: for the break table '*',  automatic assignment, option to
  386.       function  correctly,    the START and STOP addresses must
  387.       correspond  to entire program  file.    Use the defaults.
  388.  
  389. -----------------------------------
  390.  
  391.  
  392.  
  393.               - page 6 -
  394.  
  395.  
  396.  
  397. Z80DIS -       Part 3: INSTRUCTIONS FOR EXECUTION    -    11 JAN 86
  398.  
  399.  
  400. disassembly STOP  address: ____ HEX
  401.  
  402.      Z80DIS  wants  the hex memory address at which to    stop  the
  403. disassembly.  If you enter only <CR>, you will get a value accor-
  404. ding to the file length on the disk.
  405.  
  406. -----------------------------------
  407. Do you wish to run FULL output (as opposed to XREF only)? (Y/N) _
  408.  
  409.      If you answer Y,  you will get a full disassembly    including
  410. both  the cross-reference part and the instruction code part.  If
  411. you answer N, you will only get a cross-reference.
  412.  
  413.      The "N" answer processes faster and is a good place to start
  414. to get a feel for the memory layout.
  415.  
  416. -----------------------------------
  417. On which disk do you wish the scratch file to reside? (A-G) _
  418.  
  419.      This  allows  you to place the Z80DIS scratch file(s)  on    a
  420. specific  drive.  If you answer <CR>,  then the logged    drive  is
  421. used.
  422.  
  423. -----------------------------------
  424. Do you wish to process all Z80 codes
  425.               (as opposed 8080 subset only) ? (Y/N) _
  426.  
  427.      Many  of the public domain,  and other,  programs which  run
  428. under  CP/M are written in pure 8080 code without the Z80  exten-
  429. sions  to the instruction set.    Such programs should be disassem-
  430. bled with a "N" answer to this question. The NO answer will still
  431. generate Z80 mnemonics,  but will mark as invalid all instruction
  432. bytes corresponding to the unexpected Z80 extensions to the  8080
  433. code set.
  434.  
  435.      You  should  use  the "Y" answer only if you know    that  the
  436. program will run only on a Z80 based CP/M system.
  437.  
  438. -----------------------------------
  439. Are all inputs OK so far? (Y/N) _
  440.  
  441.      This question gives you a chance to re-examine your  answers
  442. to the other questions before continuing.  If you answer "N", the
  443. program  will  return to the INPUT file question.  If you  answer
  444. "Y", you will continue on to setting up your break table.
  445.  
  446. -----------------------------------------------------------------
  447.  
  448. That completes the set-up phase of the disassembly  process.  The
  449. next  step  is to define the type of disassembly to be    used  for
  450. each part of the program memory.
  451.  
  452.                    -0-
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.               - page 7 -
  460.  
  461.  
  462.  
  463. Z80DIS -       Part 3: INSTRUCTIONS FOR EXECUTION    -    11 JAN 86
  464.  
  465.  
  466. PART 3.2  -- DEFINITION  OF  THE  BREAK  TABLE:  After    you  have
  467.       answered YES to the "Inputs OK" question, Your terminal
  468.       will now display the following:
  469.  
  470. =================================================================
  471.  >>>  Z80DIS version 2.1
  472.  You may now enter CONTROL BREAK addresses  to define the type of
  473.    disassembly for each part of the code;  each control break de-
  474.    fines the first address  of a part which ends at the beginning
  475.    of the next part-1 byte.
  476.  
  477.  TO SEE DETAILS OF YOUR COMMAND CHOICES, type H
  478.  
  479.  ?: _
  480. =================================================================
  481.  
  482. A  break  table tells a disassembler how to interpret the  binary
  483. bytes that it is examining.  A disassembler must know whether the
  484. bytes are instructions or data in order to proceed.
  485.  
  486. A  "break"  is defined to be an address in the memory  where  you
  487. wish to either force a break, or you wish to change from one type
  488. of  disassembly to another.  The break table is defined to  be    a
  489. list  of the break addresses for a given binary file.  The  break
  490. table may be written to a break file.
  491.  
  492. If  this  is your first attempt to disassemble a new program  and
  493. you have no idea where anything is stored, use the new "*" option
  494. by  entering "*".  The "*" command will generate the break  table
  495. for  you.  After the automatic assignment returns,  you  will  be
  496. shown the break table. Enter "FS" to store the break table or "Q"
  497. to quit the break definition process and start disassembly.
  498.  
  499. Z80DIS    can  operate in six byte interpretation modes  which  are
  500. defined by typing on of the six mode identifiers:
  501.  
  502.      I = Instructions
  503.      A = ASCII text using DEFM with quoted strings
  504.      B = Byte storage using DEFB with hex byte values
  505.      W = Word storage using DEFW with hex word values
  506.      T = Table of addresses using DEFW with address labels
  507.      S = Space using DEFS and the length
  508.  
  509. Each  break  address  defines the start of that  mode.    The  mode
  510. remains in effect until one byte before the next break address or
  511. the end of the program memory.
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.               - page 8 -
  526.  
  527.  
  528.  
  529. Z80DIS -       Part 3: INSTRUCTIONS FOR EXECUTION    -    11 JAN 86
  530.  
  531.  
  532. In  addition to the six break setting commands,  there are  eight
  533. other commands that may be entered:
  534.  
  535.      *    = Request for automatic assignment of breaks by Z80DIS
  536.         artificial intelligence heuristics.
  537.      C    = Clear all of break table
  538.      FL = Load (append) a break file to the break table
  539.      FS = Store break table as a break file
  540.      L    = List break table for review
  541.      H    = Display Help for break table editing commands
  542.      K    = Kill existing break at an address
  543.      P    = Print break table on "LST:" CP/M device
  544.      Q    = Quit break entry process (start the disassembly)
  545.  
  546.                    -0-
  547.  
  548.  
  549.               THE COMMANDS
  550.               ------------
  551.  
  552. Commands  may  be given in any order with the  exception  of  "Q"
  553. which terminates command entry.  Each command is presented below.
  554.  
  555. -----------------------------------
  556. *
  557.      Initiates    automatic  assignment of break points within  the
  558. program code. Z80DIS is the first disassembler to produce its own
  559. break  table.  Most other disassemblers are fooled by such  anti-
  560. disassembly  tricks as adding nonsense bytes after jumps to cause
  561. the analysis to fall out of synchronization with instruction code
  562. interpretation.  Z80DIS gives you the new option of triggering an
  563. analysis of the structure and relationships of the input code  to
  564. extract the start address of each region.
  565.  
  566.     Regions of instructions, bytes, words, ASCII data, and un-set
  567. buffers are all identified for you.
  568.  
  569. -----------------------------------
  570. C
  571.      Clears  entire break table to empty.  An empty  break  table
  572. defines the entire code segment to be instructions.  As this is a
  573. fairly drastic thing to do, you will be asked to confirm.
  574.  
  575. -----------------------------------
  576. FS
  577.      Store  break  table as a break file.  Z80DIS  will ask for a
  578. file name.
  579.  
  580. -----------------------------------
  581. FL
  582.      Load  break table from a break file.  Z80DIS  will ask for a
  583. file name.
  584.  
  585. -----------------------------------
  586.  
  587.  
  588.  
  589.  
  590.  
  591.               - page 9 -
  592.  
  593.  
  594.  
  595. Z80DIS -       Part 3: INSTRUCTIONS FOR EXECUTION    -    11 JAN 86
  596.  
  597.  
  598. L
  599.      List  the    break  table to your console  display  device  as
  600. follows:
  601.  
  602.   Typ 0000-0000  Typ 0000-0000    Typ 0000-0000  Typ 0000-0000 ....
  603.   Typ 0000-0000  Typ 0000-0000    Typ 0000-0000  Typ 0000-0000 ....
  604.  
  605. -----------------------------------
  606. H
  607.      Request display of short crib notes on break table commands.
  608. The following screen of information is displayed:
  609.  
  610. |================================================================
  611. |
  612. | command   long name     break code    meaning
  613. |---------/------------/------------/----------------------------
  614. |    C        Clear         -          clear all of break table
  615. |    FL     File Load         -          Load (append) file to table
  616. |    FS     File Store         -          Store table as file
  617. |    L        List         -          List break table for review
  618. |    H        Help         -          Re-list these instructions
  619. |    K        Kill         -          Kill break at address
  620. |    P        Print         -          Print break table on LST:
  621. |    Q        Quit         -          Quit break entry process
  622. |
  623. |
  624. |    *        AUTO ASSIGN      -          Automatic assignment
  625. |
  626. |    I        Instructions    Ins       set Instruction break
  627. |    A        ASCII        Asc       set ASCII break
  628. |    B        Bytes        Byt       set Byte break
  629. |    W        Words        Wrd       set Word break
  630. |    T        Table of addr   Adt       set address Table break
  631. |    S        Space        Spc       set Space break
  632. |
  633. |================================================================
  634.  
  635. -----------------------------------
  636. K
  637.      Remove  a break point from the table.  Z80DIS will  complete
  638. the command and position the cursor for entry of an address.
  639.  
  640. -----------------------------------
  641. P
  642.      Print  the  break table to your CP/M  LST:  device  in  same
  643. manner    as  L command above.  Output is always immediate to  LST:
  644. regardless of any file assignments you made in part 3.1.
  645.  
  646. -----------------------------------
  647. Q
  648.      Quit break table processing and proceed with disassembly. If
  649. you  have not saved your definitions onto a file for  future  use
  650. since your last change to the table, Z80DIS will remind you.
  651.  
  652. -----------------------------------
  653.  
  654.  
  655.  
  656.  
  657.               - page 10 -
  658.  
  659.  
  660.  
  661. Z80DIS -       Part 3: INSTRUCTIONS FOR EXECUTION    -    11 JAN 86
  662.  
  663.  
  664. I
  665. A
  666. B
  667. W
  668. T
  669. S
  670.      These  six  commands  set break table  addresses  to  define
  671. transition  points  in    the disassembly mode.  The  program  will
  672. complete the command line and position the cursor for entry of    a
  673. Hexadecimal number:
  674.  
  675.         I at .... hex
  676.  
  677. You enter the address followed by <CR>. Any number that you enter
  678. will be right justified in the four digits when you push <CR>. If
  679. you  enter  a  break  at the same address as  an  existing  break
  680. address, the former definition is overwritten without comment.
  681.  
  682. This disassembler can operate in six modes:
  683.  
  684.      I = Instructions
  685.       (Either Z80 full set or 8080 sub-set)
  686.      A = ASCII text using DEFM with quoted strings
  687.       (an ASCII region is output as strings of characters)
  688.      B = Byte storage using DEFB with hex byte values
  689.       (blocks of single bytes interpreted as numbers)
  690.      W = Word storage using DEFW with hex word values
  691.       (blocks of double byte words interpreted as numbers)
  692.      T = Table of addresses using DEFW with address labels
  693.       (blocks of byte pairs interpreted as addresses)
  694.      S = Space using DEFS and the length
  695.       (blocks of empty space of uninterpreted content)
  696.  
  697. -----------------------------------
  698. _      ( any other command not listed above )
  699.  
  700.      If  you can't think of any  commands,  enter  anything.  The
  701. program will respond with a short crib note giving you acceptable
  702. command characters.
  703.  
  704. -----------------------------------
  705.  
  706.                    -0-
  707.  
  708.  
  709. PART  3.3  -- EXECUTION  PASS ONE:  Upon entry of the Quit  break
  710.       table  command,  the    actual    disassembly  will  begin.
  711.       During  this pass the code is cracked according to  the
  712.       break  table,  the  cross reference list  structure  is
  713.       linked into the PASCAL heap space in upper memory,  the
  714.       cracked  code is copied with context information onto a
  715.       scratch file called Z80DIS.$$$.  During pass one,  your
  716.       console screen will display the following:
  717.  
  718. During processing of pass 1 or pass 2, Z80DIS will display a line
  719. like the following:
  720.  
  721.  
  722.  
  723.               - page 11 -
  724.  
  725.  
  726.  
  727. Z80DIS -       Part 3: INSTRUCTIONS FOR EXECUTION    -    11 JAN 86
  728.  
  729.  
  730.        working at 05F0 Asc
  731.  
  732. The  "working  at"  line is animated and will  show  the  current
  733. address and disassembly mode. In the illustrated case the program
  734. has  just finished processing the file D.COM and the  last  break
  735. type was ASCII.
  736.  
  737. During any execution phase,  you may type ^C to abort that phase.
  738. If  you abort during pass one,    the program will treat that as    a
  739. premature  end    of file and go on to process what it has  through
  740. pass two.
  741.  
  742.                    -0-
  743.  
  744.  
  745.  
  746. PART 3.4  -- EXECUTION PASS TWO: During this pass all user output
  747.       files and listings are produced and the scratch file is
  748.       erased.
  749.  
  750. The display will take you step by step through pass two and  show
  751. you what the program is doing at each step.
  752.  
  753. Informative messages about file and memory space will let you see
  754. just  how  close to your memory and disk capacity the program  is
  755. running.
  756.  
  757. When the program is complete, Z80DIS will ring your terminal bell
  758. twice and terminate.
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.               - page 12 -
  790.  
  791.  
  792.  
  793. Z80DIS -    Appendix A: ADAPTATION TO YOUR TERMINAL  -    11 JAN 86
  794.  
  795.  
  796.              - APPENDIX A -
  797.           ADAPTATION OF Z80DIS TO YOUR TERMINAL
  798.           -------------------------------------
  799.  
  800. CP/M  is a generic operating system,  but most of  the    terminals
  801. used  with  CP/M  have features not anticipated  by  CP/M.  These
  802. features  include  CURSOR ADDRESSing and  BRIGHT/DIM  display  of
  803. characters.  This  program utilizes such features to improve  the
  804. operator interaction.    As the program itself is written in TURBO
  805. PASCAL,  the  TURBO installation support feature has been used to
  806. make this adaptation easy.  Therefore,    before you use this prog-
  807. ram, it must be installed to your particular terminal.
  808.  
  809. The following files are part of this program installation package
  810. and  must  be  present during terminal    installation  (the  three
  811. ZDINSTAL.*  files  may then be deleted after installation  if  no
  812. other terminals are to be supported)..
  813.  
  814.      Z80DIS.COM    - the program you will be installing
  815.      Z80DIS.000    - overlay file for Z80DIS
  816.      Z80DIS.001    - overlay file for Z80DIS
  817.  
  818.      ZDINSTAL.COM  - the installation program
  819.      ZDINSTAL.MSG  - contains text of ZDINSTAL messages
  820.      ZDINSTAL.DTA  - contains terminal characteristics data
  821.  
  822.          - THE INSTALLATION PROCEDURE -
  823.            --------------------------
  824.  
  825. Start  the  installation  by typing ZDINSTAL  at  your    terminal.
  826. Select Screen installation from the main menu.
  827.  
  828. A  numbered menu listing a number of popular terminals    will  ap-
  829. pear, inviting you to choose one by entering its number.
  830.  
  831. If your terminal is mentioned,    just enter the corresponding num-
  832. ber,  and  the installation is complete.  Before installation  is
  833. actually performed, you are asked the question..
  834.  
  835. Do you want to modify the definition before installation? _
  836.  
  837.      This  allows  you to modify one or more of the values  being
  838. installed  as described in the following.  If you do not want  to
  839. modify the terminal definition, just type N, and the installation
  840. will  complete by asking you the operating frequency of your  CPU
  841. to establish parameters for timing loops.
  842.  
  843. If your terminal is NOT on the menu, however, you must define the
  844. required values yourself.  The values can most probably be  found
  845. in the manual supplied with your terminal.
  846.  
  847. Enter  the  number corresponding to None of the above and  answer
  848. the questions one by one as they appear on the screen.
  849.  
  850. In  the following,  each command you may install is described  in
  851. detail.  Your terminal may not support all the commands that  can
  852. be installed.  If so,  just pass the command not needed by typing
  853.  
  854.  
  855.                page A-1
  856.  
  857.  
  858.  
  859. Z80DIS -    Appendix A: ADAPTATION TO YOUR TERMINAL  -    11 JAN 86
  860.  
  861.  
  862. RETURN in response to the prompt. If Delete-line, Insert-line, or
  863. Erase-to-end-of-line  is not installed,  these functions will  be
  864. emulated in software, slowing screen performance somewhat.
  865.  
  866. Commands  codes  may  be entered either simply    by  pressing  the
  867. appropriate  keys or by entering the decimal or hexadecimal ASCII
  868. value  of the command.    If a command requires the two  characters
  869. 'ESCAPE' and '=', you may...
  870.  
  871. either      press first the escape key,  then the =. The entry will
  872.       be echoed with appropriate labels, i.e. <ESC> =.
  873.  
  874. or      Enter  the decimal or hexadecimal values  separated  by
  875.       spaces.  Hexadecimal    values    must  be  preceded  by    a
  876.       dollar-sign.    Enter e.g. 27 61  or  $1B 61  or  $1B $3D
  877.       which are all equivalent.
  878.  
  879. The  two methods cannot be mixed,  i.e.  once you have entered    a
  880. non-numeric  character,  the rest of that command must be defined
  881. in that mode, and vise versa.
  882.  
  883. A hyphen entered as the very first character is used to delete    a
  884. command, and echoes the text Nothing.
  885.  
  886. -----------------------------------
  887. Terminal type: ______________________
  888.  
  889.      Enter  the  name of the terminal you are about  to  install.
  890. When  you complete ZDINSTAL,  the values will be stored,  and the
  891. terminal  name will appear on the initial list of  terminals.  If
  892. you later need to re-install Z80DIS to this terminal,  you can do
  893. that by choosing it from the list.
  894.  
  895. -----------------------------------
  896. Send an initialization string to the terminal? _
  897.  
  898.      If  you want to initialize your terminal when Z80DIS  starts
  899. (e.g.  to down load commands to programmable function keys),  you
  900. answer Y for yes to this question. If not, just hit RETURN.
  901.  
  902.      If you answer Y, you may choose between entering the command
  903. directly  or defining a file name containing the command  string.
  904. The  latter is a good idea if the initialization string is  long,
  905. as e.g. a string to program a number of function keys would be.
  906.  
  907. -----------------------------------
  908. Send a reset string to the terminal? _
  909.  
  910.      Here,  you  may  define a string to be sent to the  terminal
  911. when  Z80DIS terminates.  The description of  the  initialization
  912. command above applies here.
  913.  
  914. -----------------------------------
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.                page A-2
  922.  
  923.  
  924.  
  925. Z80DIS -    Appendix A: ADAPTATION TO YOUR TERMINAL  -    11 JAN 86
  926.  
  927.  
  928. CURSOR LEAD-IN command: _
  929.  
  930.      Cursor  Lead-in  is a special sequence of    characters  which
  931. tells  your terminal that the following characters are an address
  932. on the screen on which the cursor should be placed.
  933.  
  934.      When  you define this command,  you are asked the    following
  935. supplementary questions..
  936.  
  937. -----------------------------------
  938. CURSOR POSITIONING COMMAND to send between line and column: _
  939.  
  940.      Some terminals need a command between the two numbers  defi-
  941. ning the row and column cursor address.
  942.  
  943. -----------------------------------
  944. CURSOR POSITIONING COMMAND to send after line and column: _
  945.  
  946.      Some terminals need a command after the two numbers defining
  947. the row and column cursor address.
  948.  
  949. -----------------------------------
  950. Column first? _
  951.  
  952.      Most terminals require the address on the format: first ROW,
  953. then COLUMN.  If this is the case on your terminal,  answer N. If
  954. your terminal wants COLUMN first, then ROW, then answer Y.
  955.  
  956. -----------------------------------
  957. OFFSET to add to LINE _
  958.  
  959.      Enter the number to add to the LINE (ROW) address.
  960.  
  961. -----------------------------------
  962. OFFSET to add to COLUMN _
  963.  
  964.      Enter the number to add to the COLUMN address.
  965.  
  966. -----------------------------------
  967. Binary address? _
  968.  
  969.      Most  terminals need the cursor address sent on binary form.
  970. If  that is true for your terminal,  enter Y.  If  your  terminal
  971. expects the cursor address as ASCII digits,  enter N.  If so, you
  972. are asked the supplementary question..
  973.  
  974. -----------------------------------
  975. 2 or 3 ASCII digits? _
  976.  
  977.      Enter the number of digits in the cursor address for    your
  978. terminal.
  979.  
  980. -----------------------------------
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.                page A-3
  988.  
  989.  
  990.  
  991. Z80DIS -    Appendix A: ADAPTATION TO YOUR TERMINAL  -    11 JAN 86
  992.  
  993.  
  994. CLEAR SCREEN command: _
  995.  
  996.      Enter  the  command that will clear the entire  contents  of
  997. your screen, both foreground and background, if applicable.
  998.  
  999. -----------------------------------
  1000. Does CLEAR SCREEN also HOME cursor? _
  1001.  
  1002.      This is normally the case; if it is not so on your terminal,
  1003. enter N, and define the cursor HOME command.
  1004.  
  1005. -----------------------------------
  1006. DELETE LINE command: _
  1007.  
  1008.      Enter the command that deletes the entire line at the cursor
  1009. position.
  1010.  
  1011. -----------------------------------
  1012. INSERT LINE command: _
  1013.  
  1014.      Enter  the  command that inserts a line at the cursor  posi-
  1015. tion.
  1016.  
  1017. -----------------------------------
  1018. ERASE TO END OF LINE command: _
  1019.  
  1020.      Enter  the command that erases the line at the cursor  posi-
  1021. tion from the cursor position through the right end of the line.
  1022.  
  1023. -----------------------------------
  1024. START OF 'LOW VIDEO' command: _
  1025.  
  1026.      If your terminal supports different video intensities,  then
  1027. define    the command that initiates the DIM video  here.  If  this
  1028. command is defined, the following question is asked . . .
  1029.  
  1030. -----------------------------------
  1031. START OF 'NORMAL VIDEO' command: _
  1032.  
  1033.      Define  the command that sets the screen to show  characters
  1034. in 'normal' video.
  1035.  
  1036. -----------------------------------
  1037. Number of rows (lines) on your screen: _
  1038.  
  1039.      Enter the number of horizontal lines on your screen.
  1040.  
  1041. -----------------------------------
  1042. Number of columns on your screen: _
  1043.  
  1044.      Enter the number of column positions on your screen.
  1045.  
  1046. -----------------------------------
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.                page A-4
  1054.  
  1055.  
  1056.  
  1057. Z80DIS -    Appendix A: ADAPTATION TO YOUR TERMINAL  -    11 JAN 86
  1058.  
  1059.  
  1060. Delay after CURSOR ADDRESS (0-255 ms): _
  1061. Delay after CLEAR, DELETE, and INSERT (0-255 ms): _
  1062. Delay after ERASE TO END OF LINE and HIGHLIGHT On/Off (0-255 ms):
  1063.  
  1064.  
  1065.      Enter the delay in milliseconds required after the functions
  1066. specified. RETURN means 0 (no delay).
  1067.  
  1068. -----------------------------------
  1069. Is this definition correct? _
  1070.  
  1071.      If you have made any errors in the definitions, enter N. You
  1072. will then return to the terminal selection menu. The installation
  1073. data  you have just entered will be included in the  installation
  1074. data file and appear on the terminal selection menu,  but instal-
  1075. lation will not be performed.
  1076.  
  1077.      When  you    enter  Y in response to this  question,  you  are
  1078. asked..
  1079.  
  1080. -----------------------------------
  1081. Operating frequency of your microprocessor in MHz (for delays): _
  1082.  
  1083.      As  the  delays  specified  earlier  are  depending  on  the
  1084. operating frequency of your CPU,  you must define this value.  If
  1085. your  processor operates at a fractional speed    (i.e.  2.5  MHz),
  1086. enter the next larger integer value (3 MHz for this example.)
  1087.  
  1088. -----------------------------------
  1089.  
  1090.                    -0-
  1091.  
  1092. The  installation  is finished,  installation data is written  to
  1093. Z80DIS,  and you return to the outer menu.  New installation data
  1094. is also saved in the installation data file and the new  terminal
  1095. will  appear on the terminal selection list when you run ZDINSTAL
  1096. in the future.
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.                page A-5
  1120.  
  1121.  
  1122.  
  1123. Z80DIS -    Appendix B: Z80DIS REVISION HISTORY      -    11 JAN 86
  1124.  
  1125.  
  1126.              - APPENDIX B -
  1127.              Z80DIS REVISION HISTORY
  1128.              -----------------------
  1129.  
  1130. -----------------------------------------------------------------
  1131.  
  1132. Version 1.5                  Released: July 30, 1985
  1133.  
  1134.      First version released for public use.
  1135.  
  1136.  
  1137. -----------------------------------------------------------------
  1138.  
  1139. Version 1.6                 Released: September 12, 1985
  1140.  
  1141.      A bug fix and some enhancements.
  1142.  
  1143.      1)  Backwards  referencing relative jumps have  been  fixed.
  1144.      They  had been working originally,  but a bug had slipped in
  1145.      when  making  other  changes.  Forward  references  were  OK
  1146.      before.
  1147.  
  1148.      2)  The assembly output file now uses a capital H suffix  on
  1149.      hex.  I  like the small h better as it shows better next  to
  1150.      numbers, but some assemblers can not handle lower case.
  1151.  
  1152.      3)  The  program  no longer skips a line  after  "RST  38H".
  1153.      Normally  all calls are followed by a skip to set them  off,
  1154.      but  RST  38H corresponds to FFh which  often  fills  unused
  1155.      space and generates too many useless line of code.
  1156.  
  1157.      4)  The .PRN file now ends with a form-feed.  This  prevents
  1158.      leaving your printer in mid page.
  1159.  
  1160.  
  1161. -----------------------------------------------------------------
  1162.  
  1163. Version 2.1                   Released: January 11, 1986
  1164.  
  1165.      This is a major re-organization of Z80DIS:  Adds a  built-in
  1166.      expert  system  for  assignment of  break    table  addresses;
  1167.      Enhances and improves many options and defaults.
  1168.  
  1169.      1) When the program asks for break table inputs, you may now
  1170.      enter  '*'  which    will trigger a detailed analysis  of  the
  1171.      structure and relationships of the input code to extract the
  1172.      start address of each region.  You are given the opportunity
  1173.      to  edit  and/or  save  the  resulting  break  table  before
  1174.      continuing  with the disassembly.    Regions of  instructions,
  1175.      bytes,  words,  ASCII  data,  and    un-set    buffers  are  all
  1176.      identified for you.
  1177.  
  1178.      2)  The COM file and overlay files for Z80DIS no longer need
  1179.      to  be on your default disk drive.  The program will  search
  1180.      the connected drive,  the A drive,  and the B drive in  that
  1181.      order.  The program does assume,  however, that both overlay
  1182.      files are on the same drive.
  1183.  
  1184.  
  1185.                page B-1
  1186.  
  1187.  
  1188.  
  1189. Z80DIS -    Appendix B: Z80DIS REVISION HISTORY      -    11 JAN 86
  1190.  
  1191.  
  1192.  
  1193.      3)  The  cross-reference listing now shows the  break  table
  1194.      region  of residency for each label so that you may  inspect
  1195.      the list for inconsistencies.
  1196.  
  1197.      4)  Overflow of memory or disk space during pass 1 will  now
  1198.      terminate    the  pass  and process what  has  been    collected
  1199.      so far through pass 2. The previous version just aborted.
  1200.  
  1201.      5)  You  may  now    disassemble direct  to    your  printer  by
  1202.      specifying LST: as the list file name.
  1203.  
  1204.      6)  You may now suppress either the assembly language output
  1205.      file or the list output file ( but not both ) by  specifying
  1206.      the  file    name NONE:.  The default for the assembly  output
  1207.      (*.MAC file) is NO assembly output file (NONE:).
  1208.  
  1209.      7) The default name for the break table save file is now the
  1210.      same as that of your input file.  Previously the default was
  1211.      always SAVE.BRK.
  1212.  
  1213.      8)  Many  internal  enhancements to  make    the  program  run
  1214.      faster.
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222. =================================================================
  1223.  
  1224. You may leave your comments, messages, usage notes or bug reports
  1225. for 'Kenneth Gielow' on one of the following RCP/M boards:
  1226.  
  1227.      FOG # 5, Palo Alto  (415) 424-1482
  1228.  
  1229.      POTPOURRI RCP/M     (408) 378-7474   (requires registration)
  1230.  
  1231. =================================================================
  1232.  
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243. _________________________________________________________________
  1244.  
  1245. CP/M is a registered trademark of Digital Research Inc.,
  1246. TURBO PASCAL is a trademark of Borland International,
  1247. Z-80 is a trademark of Zilog Corp.
  1248.  
  1249.  
  1250.  
  1251.                page B-2
  1252.  
  1253.  
  1254.  
  1255.