home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / ASMUTL / Z80_22.ZIP / Z80MU.DOC < prev    next >
Encoding:
Text File  |  1986-11-25  |  191.7 KB  |  5,657 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.                  "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide
  11.                  "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide
  12.  
  13.                                        or
  14.  
  15.                    The Care and Feeding of Your Imaginary Z80
  16.                    The Care and Feeding of Your Imaginary Z80
  17.  
  18.                                        or
  19.  
  20.                          Fakeware For The Techie Masses!
  21.                          Fakeware For The Techie Masses!
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.                       A Guide to the Complete Z80 Emulator
  30.                       A Guide to the Complete Z80 Emulator
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.      Describing the first of a two-part series of 8080, Z80, and CP/M
  41.      emulators for the IBM PC. This document describes Z80MU (version 2.1,
  42.                                                        Z80MU
  43.      dated 10/30/85), a software emulation of the Z80 and CP/M 2.2.  The
  44.      second product - if it ever gets out the door - includes hardware
  45.      emulation of the 8080, using the NEC V20 8088-compatible processor
  46.      chip.
  47.  
  48.      Program written by Joan Riff for Computerwise Consulting Services.
  49.                         Joan Riff
  50.  
  51.      Placed in the public domain. No copyright notice. No legal mumbo-jumbo.
  52.      No request for a financial contribution. No warrantee. Just a bunch of
  53.      marvelous software magic.
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  65.  
  66.  
  67.  
  68.  
  69.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 1
  70.      INTRODUCTION
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.                                   INTRODUCTION
  85.                                   INTRODUCTION
  86.  
  87.  
  88.      What is it? 
  89.      ___________
  90.  
  91.  
  92.      Z80MU is a software emulator of the ZILOG Z80 processor, which runs on
  93.      the IBM PC. It also provides an emulation of Digital Research's CP/M
  94.      version 2.2 operating system. 
  95.  
  96.  
  97.      It includes the following facilities: 
  98.  
  99.           Complete emulation of Z80 object code, including all six
  100.                active bits within the Z80 Flags Register. 
  101.       
  102.           Emulation of CP/M 2.2, with the exception of hardware-specific
  103.                functions. 
  104.       
  105.           Advanced commands for debugging Z80 software (eliminating the
  106.                need for DDT.COM), including: 
  107.       
  108.                Illegal Opcode control (treat 'em as FAULTs or NOPs). 
  109.       
  110.                BDOS function trace. 
  111.       
  112.                Instruction TRACE and NOTRACE, with Z80 PC traceback. 
  113.       
  114.                Breakpoints. 
  115.       
  116.                Dump CP/M memory in HEX and ASCII. 
  117.       
  118.                Patch CP/M memory in HEX, decimal, binary, ASCII charac-
  119.                     ters, or ASCII strings. 
  120.       
  121.                Symbolic labels may be defined and used instead of CP/M
  122.                     addresses. 
  123.  
  124.  
  125.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  126.  
  127.  
  128.  
  129.  
  130.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 2
  131.      INTRODUCTION
  132.  
  133.       
  134.                Z80 register and flag display and alter, including
  135.                     alternate regs/flags and IFF1, IFF2, IMF, I, R regs.
  136.       
  137.                CP/M memory move and find. 
  138.       
  139.                Intel HEX files can be properly read into CP/M memory,
  140.                     as well as created from CP/M memory. 
  141.       
  142.           An "emulated terminal" for full-screen CP/M applications.
  143.       
  144.  
  145.           A full disassembler much like Ward Christensen's RESOURCE,
  146.                built right in, with: 
  147.       
  148.                Symbolic addresses. 
  149.       
  150.                Control breakpoints for Instructions, Bytes (DB), Words
  151.                     (DW), Table of Words (DW), and Storage (DS). 
  152.       
  153.                Automatic label generation. 
  154.       
  155.                Comments associated with Z80 addresses.
  156.       
  157.       
  158.           Online help summaries. 
  159.       
  160.           SUBMIT file support (built right in - no need for SUBMIT.COM).
  161.       
  162.           Access to all PCDOS programs and commands. 
  163.       
  164.           CP/M software reads and writes PCDOS files, and can be
  165.                organized with PCDOS directory structure (instead of
  166.                using CP/M's "user number" idea). 
  167.       
  168.  
  169.      Z80MU (from now on called "the Emulator") can be used quite transpar-
  170.      ently to run CP/M applications on the IBM PC. It contains many advanced
  171.      commands not found in CP/M, but there's no law that says that you have
  172.      to use 'em all. By ignoring the advanced commands, you can run the
  173.      emulated CP/M all day long and you'll swear that you're running CP/M. 
  174.       
  175.      You can also take advantage of the advanced commands and features, and
  176.      have a user interface more powerful than that available with CP/M. 
  177.       
  178.      Advanced Z80 programmers can even ignore CP/M entirely and use the
  179.      Emulator as a generic Z80 development tool for developing device
  180.      controllers and other non-CP/M based Z80 code.
  181.       
  182.  
  183. COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  184.  
  185.  
  186.  
  187.  
  188.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 3
  189.      INTRODUCTION
  190.  
  191.      At CCS, we use the Emulator to develop things like Z80-based hard disk
  192.      controller card software, device-switching hardware, and even a few
  193.      boring old standard CP/M applications. We have also used it to regen-
  194.      erate the source code for the 32K ROM in the Radio Shack Model 100
  195.      laptop computer, to figure out how it works. 
  196.       
  197.      The Emulator consists of a high-speed 8088 assembler subroutine (which
  198.      does the actual Z80 emulation), and a 'C'-language main program which
  199.      provides the CP/M-like interface to the user, the disassembler, the
  200.      RESOURCE facility, and the rest of the advanced features. 
  201.  
  202.  
  203.      Why Did We Do It?
  204.      _________________
  205.  
  206.      At CCS, we have quite an investment in CP/M software. Most of that
  207.      software consists of fairly esoteric software development tools, things
  208.      that are hard to find in the IBM PC world. Furthermore, we continue to
  209.      develop software for the Z80. The old chip just won't die, although
  210.      nowadays it is used more in controller boards than as a primary system
  211.      processor.
  212.  
  213.      We wanted to keep these Z80 tools, yet apply our numerous IBM PC tools
  214.      (especially some fantastic IBM PC editors like SPF/PC) to our Z80
  215.      development process.
  216.  
  217.      We were also keenly interested in creating source code for some object-
  218.      only Z80 applications, with a view to converting them to 8088 assembler
  219.      source code for re-assembly as native IBM PC programs.
  220.  
  221.      We scouted around and discovered several software packages which sup-
  222.      posedly allowed us to run CP/M on the IBM PC. Needless to say, they
  223.      just couldn't cut it. The Heath User's Group (HUG) emulator, 80Mate by
  224.      Vertex, and a few similar packages were considered. We weren't impressed
  225.      by the speed of emulation, or by the accuracy of the emulation, or by
  226.      the user interface. What's more, we kept bumping into more and more
  227.      people who were in the business of Z80 development, and who kept
  228.      badgering us to solve this problem "the right way" (whatever that
  229.      means).
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  243.  
  244.  
  245.  
  246.  
  247.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 4
  248.      INTRODUCTION
  249.  
  250.  
  251.      How Does It Work?
  252.      _________________
  253.       
  254.      When it runs under PCDOS, the Emulator looks like this: 
  255.       
  256.           +------------------------------------+ 
  257.           | Z80MU 'C' main program             | 
  258.             Z80MU 'C' main program
  259.           |                                    | 
  260.           | This is what you talk to, the guy  | 
  261.           | that emulates CP/M Console Command | 
  262.           | Processor.                         | 
  263.           |                                    | 
  264.           +------------------------------------+ 
  265.           | Z80 Emulation 8088 Assembler Code  | 
  266.             Z80 Emulation 8088 Assembler Code
  267.           |                                    | 
  268.           | Which actually emulates the Z80 as | 
  269.           | it "executes" in the CP/M Segment. | 
  270.           |                                    | 
  271.           +------------------------------------+ 
  272.           | 64K CP/M Segment                   | 
  273.             64K CP/M Segment
  274.           |                                    | 
  275.           | In which the Z80 code is held as   | 
  276.           | it executes. The size of the       | 
  277.           | Transient Program Area is 65022    | 
  278.           | bytes.                             | 
  279.           |                                    | 
  280.           |                                    | 
  281.           |                                    | 
  282.           |                                    | 
  283.           |                                    | 
  284.           |                                    | 
  285.           |                                    | 
  286.           | - - - - - - - - - - - - - - - - - -| 
  287.           | BDOS and BIOS hooks                | 
  288.             BDOS and BIOS hooks
  289.           |                                    |
  290.           | Which trap CP/M BIOS and BDOS      | 
  291.           | calls, so that they can be         |
  292.           | emulated.                          |
  293.           |                                    |
  294.           +------------------------------------+ 
  295.       
  296.  
  297.      The main program accepts the user's commands, and processes them. When
  298.      and if it comes time to run a Z80 program, the Z80 code is loaded into
  299.      the CP/M Segment, and the 8088 assembler code which actually emulates
  300.      the Z80 is called to run the program there.
  301.  
  302.      As the Z80 program executes, it accesses the outside world via calls to
  303.      the BDOS and BIOS hooks. The code that is executed for a given BDOS or
  304.  
  305.  
  306.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  307.  
  308.  
  309.  
  310.  
  311.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 5
  312.      INTRODUCTION
  313.  
  314.      BIOS function actually resides within the 8088 assembler code that
  315.      emulates the Z80.
  316.       
  317.       
  318.      What Does It Require To Run? 
  319.      ____________________________
  320.       
  321.      The Emulator runs on the IBM PC under PCDOS 2.x or above. The Emulator
  322.      itself is about 93K in size. The first thing that it does when it runs
  323.      is allocate 64K to be used as CP/M memory (the "CP/M Segment"). 
  324.       
  325.      So you had better have 93K + 64K = 157K available when you run the
  326.                             93K + 64K = 157K
  327.      Emulator. Note that the amount of memory required may vary as improved
  328.      versions of the Emulator are released. 
  329.       
  330.      Some CP/M applications expect to control the screen cursor by sending
  331.      control characters through the BDOS. For these programs, you may want
  332.      to have the PCDOS ANSI.SYS device driver loaded via your CONFIG.SYS
  333.                        ANSI.SYS
  334.      file.
  335.       
  336.       
  337.      How Accurate an Emulation Is It? 
  338.      ________________________________
  339.       
  340.      There are two aspects to the accuracy of the Emulator: 
  341.       
  342.           1) How accurately it emulates the Z80 
  343.           2) How accurately it emulates CP/M 
  344.       
  345.      The Emulator emulates the Z80 almost perfectly, even down to an exact
  346.      emulation of all six flag bits in the Flags Register. Even the untest-
  347.      able Half-carry and Add/Subtract flag bits are emulated. For faster
  348.      execution, the Emulator ignores the two unused bits in the Flags
  349.      Register, so these will not act exactly as they would on a real Z80.
  350.  
  351.      Input/Output instructions (the IN's and OUT's) perform everything except
  352.      the actual strobe of the I/O data lines. You can't very well have Z80
  353.      code accessing I/O addresses that mean something entirely different on
  354.      the IBM PC. So the actual data transfer has been disabled. But any
  355.      setup, auto-increment of registers, and flag effects have been emulated
  356.      even for the IN's and OUT's. 
  357.       
  358.      The Z80 HALT instruction is used as a hook to return control to the main
  359.      'C' program, and as a call to the emulated CP/M BIOS and BDOS. 
  360.  
  361.      When it came to emulating CP/M 2.2, we took a less precise approach. We
  362.      weren't interested in emulating the limitations of CP/M. We wanted to
  363.      include many of the benefits of PCDOS. And we wanted to add many more
  364.      "builtin" commands than were available with CP/M. We also demanded the
  365.      largest possible TPA (Transient Program Area - the amount of memory
  366.  
  367.  
  368.  
  369.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  370.  
  371.  
  372.  
  373.  
  374.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 6
  375.      INTRODUCTION
  376.  
  377.      available to be used by a Z80 program). Yet we wanted to keep the
  378.      interface very close to CP/M's.
  379.       
  380.      So we decided to support "standard" CP/M applications, ones that stood a
  381.      good chance of executing on a wide variety of CP/M systems and thus were
  382.      hardware independent. 
  383.       
  384.      This we have succeeded in doing. 
  385.       
  386.      The user interface is just like CP/M's, so that someone used to CP/M
  387.      will feel right at home. 
  388.       
  389.      The program interface (via the BIOS and BDOS) is exactly the same as
  390.      CP/M's. There are some BIOS and BDOS functions that are hardware-
  391.      specific. These are in general not supported. The differences are
  392.      explained in a later section. 
  393.       
  394.      The handling of commands and command arguments (the command "tail")
  395.      appears to the Z80 application exactly as it would on a real CP/M
  396.      system. The default FCB at 5Ch is formatted with the filename implied by
  397.      the first command-line argument, and the FCB at 6Ch with the second
  398.      argument. The byte at 80h is set to the number of characters in the
  399.      command tail, and is followed by an uppercase version of the command
  400.      tail as typed by the user.
  401.       
  402.      We have achieved a TPA size of 65022 bytes. This is more than is
  403.      available on almost all "real" CP/M systems, including the Baby Blue Z80
  404.      add-on board (for the IBM PC) from MicroLog. 
  405.       
  406.      We have also built a terminal emulator into the Emulator, since many
  407.      CP/M applications (especially those doing full-screen editing) assume
  408.      that they are being run from an ASCII terminal.
  409.       
  410.      All in all, the compatability of the Emulator is so good that we have
  411.      been able to move almost all of our CP/M applications to the Emulator,
  412.      and to have them run perfectly (although a tad slow). 
  413.       
  414.      Here is a partial list of CP/M applications that we have tested with the
  415.      Emulator and found to run as they do on a "real" CP/M system: 
  416.       
  417.           ASM 
  418.           LOAD 
  419.           ED
  420.           DDT
  421.           DUMP
  422.           PIP
  423.           M80 
  424.           L80
  425.           LIB
  426.  
  427.  
  428.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  429.  
  430.  
  431.  
  432.  
  433.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 7
  434.      INTRODUCTION
  435.  
  436.           MBASIC 
  437.           LASM 
  438.           MAC 
  439.           dBase II 
  440.           WORDSTAR 3.0 & 3.3 with MAILMERGE (but not SPELSTAR!) 
  441.           PMATE-80 rev. 3.02 
  442.           Software Toolworks 'C' compiler
  443.           Telecon 'C' compiler
  444.           Chang Labs' MemoPlan 
  445.  
  446.  
  447.      This is more a list of the software that we happened to have on hand
  448.      than an exhaustive list of software that will run under the Emulator.
  449.  
  450.  
  451.      What WON'T Run Under the Emulator?
  452.      __________________________________
  453.  
  454.      There are some CP/M programs (like STAT.COM provided by Digital Re-
  455.      search) which are hardware-specific. These cannot be run under the
  456.      Emulator, or must be run "carefully" to avoid functions that look to the
  457.      hardware. STAT, for instance, starts out by interrogating the physical
  458.      layout of the diskette. Since this is unsupported under the Emulator,
  459.      STAT is immediately aborted by the Emulator. 
  460.  
  461.      WORDSTAR's SPELSTAR won't work, either. It tries to call CP/M's CCP
  462.      directly. It's really quite sad. It goes to a lot of work to calculate
  463.      just where in Z80 memory the CCP is, relative to the BDOS address held
  464.      in location 0005h. Then it calls that address. Unfortunately, there's
  465.      nothing there...
  466.  
  467.       
  468.       
  469.      How Fast Is It? 
  470.      _______________
  471.       
  472.      Aye, there's the rub. 
  473.       
  474.      Because the Z80 used by the Emulator is an imaginary one whose instruc-
  475.      tions must be emulated in software, the effective speed of a Z80 program
  476.      is considerably less than the speed of the IBM PC. One 12-cycle Z80
  477.      instruction, for example, may take from 47 to over 100 IBM PC cycles
  478.      (depending on the instruction, its addressing mode, etc). 
  479.       
  480.      For detail on the effective speed of the emulated Z80 and what it means,
  481.      see the description of the "speed?" and "howfast?" Builtin Commands
  482.                                  speed?       howfast?
  483.      later in this Guide. 
  484.       
  485.      We have not found the speed of the emulated Z80 to be entirely accept-
  486.      able. Z80MU is the fastest software-based true Z80 emulator available
  487.      today for the IBM PC. Yet we would like to have something that would run
  488.  
  489.  
  490.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  491.  
  492.  
  493.  
  494.  
  495.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 8
  496.      INTRODUCTION
  497.  
  498.      the standard CP/M utilities on an IBM PC at an effective cpu speed of at
  499.      least 1 MegaHertz, and still have all of the subtleties (like flag
  500.      updating) performed with 100% accuracy. 
  501.       
  502.      One solution is to run the Emulator on an IBM PC/AT with a hard disk.
  503.      This is perhaps the best solution, but doesn't help those who don't have
  504.      access to an AT. 
  505.       
  506.      An alternative solution is to use the NEC V20 processor chip in the IBM
  507.      PC, and get rid of the Intel 8088. The NEC V20 is a tad faster than the
  508.      8088. More importantly, it performs full-speed hardware emulation of the
  509.      Intel 8080 chip. Many CP/M utilities do not use the extended instruc-
  510.      tions offered by the Z80, and will run just fine on an 8080 chip. Such a
  511.      hardware-based emulator would offer superior speed. It would, however,
  512.      be limited to 8080 operation. 
  513.       
  514.      We are developing such an emulator. There is no firm release date.
  515.       
  516.      In the meantime, you should equip your IBM PC with a NEC V20 chip to
  517.      speed things up. We paid $16 apiece for ours, and there is no more cost-
  518.      effective hardware upgrade for the IBM PC! See the ads in back of BYTE
  519.      magazine for sources and prices. 
  520.  
  521.       
  522.       
  523.      How Do I Get My CP/M Programs Into The IBM PC? 
  524.      ______________________________________________
  525.       
  526.      Assuming that you want to emulate some CP/M applications on the IBM PC,
  527.      the first realization is that these CP/M files don't already reside on
  528.      the PC. What's more, they currently exist (by definition) on disks
  529.      formatted for CP/M, not for the IBM PC. So they can't be read by a
  530.      vanilla IBM PC using PCDOS. They must be copied to standard PCDOS disk
  531.      files. 
  532.       
  533.      We have used several approaches, all with excellent results. 
  534.       
  535.      The first approach is to transfer the CP/M files straight from the CP/M
  536.      disks to PCDOS disks using a utility that runs on the IBM PC and is
  537.      capable of reading the foreign CP/M format. Such utilities include:
  538.       
  539.           CONVERT  (from Selfware, Inc.  Fairfax, VA) 
  540.           CONVERT
  541.           XENOCOPY (from Vertex Systems, Inc.  L.A., Calif) 
  542.           XENOCOPY
  543.       
  544.  
  545.      This approach is nice, when it works. The major disadvantages are:
  546.  
  547.           Only certain CP/M formats are recognized by each of these
  548.                utilities. Apple ][ and NorthStar Horizon CP/M disks, for
  549.  
  550.  
  551.  
  552.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  553.  
  554.  
  555.  
  556.  
  557.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 9
  558.      INTRODUCTION
  559.  
  560.                example, cannot be read on the IBM PC without special
  561.                hardware.
  562.  
  563.           You must have the CP/M disks at hand. 
  564.       
  565.      Another approach is to transfer the CP/M files to the IBM PC via a
  566.      communications line. This is Joan Riff's personal favorite. If the
  567.      CP/M system is at hand, then the two machines are direct-connected and
  568.      cranked up to 9600 baud. If the CP/M system is not handy, then the
  569.      transfer is made over the phone at whatever speeds the respective modems
  570.      can handle. In either case, the CP/M system running BYE and XMODEM is
  571.      controlled by the IBM PC running Crosstalk VI version 3.5 (from Micro-
  572.      Stuf) and Joan Riff's excellent XMODEM (with CRC) Crosstalk RUN command.
  573.  
  574.       
  575.      When direct connected, files really fly across at 9600 baud. 
  576.       
  577.      The major advantages of this approach are: 
  578.       
  579.           Who cares what the CP/M disk format is? If the CP/M system can
  580.                read its own files, then we can get them. This works very
  581.                well when transferring Apple ][ and NorthStar Horizon
  582.                CP/M files. 
  583.  
  584.           Public Domain CP/M software can be gathered just by dialing
  585.                into a CP/M Bulletin Board or RCPM system. You need never
  586.                know what hardware system is on the other end. 
  587.       
  588.       
  589.      CP/M and PCDOS files are similar enough that we have never had to alter
  590.      a file that was transferred using either of the above two approaches.
  591.      We just download the files to the IBM PC and run 'em under the Emulator.
  592.       
  593.      The biggest problem is remembering which files are PCDOS files and
  594.      which are CP/M files. If you transfer a CP/M file called DUMP.COM, for
  595.      example, from a CP/M system to the IBM PC's disk, you really do want to
  596.      remember that it is a CP/M file (to be run with the Emulator) and not an
  597.      IBM PC .COM file. If you accidentally invoke DUMP.COM from PCDOS, you
  598.      will be unpleasantly surprised. The CP/M DUMP.COM file contains Z80
  599.      opcodes, which will be executed by the IBM PC as 8088 opcodes. Time to
  600.      reach for the Big Red Switch... 
  601.       
  602.      You must run such CP/M command (.COM) files under the Emulator! 
  603.          must
  604.       
  605.      At CCS, we keep things straight by storing CP/M files under separate
  606.      PCDOS directories. The "Z80PATH" environment string (explained else-
  607.      where) makes this particularly convenient. 
  608.       
  609.  
  610.  
  611. COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  612.  
  613.  
  614.  
  615.  
  616.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 10
  617.      INTRODUCTION
  618.  
  619.      The saving grace to this CP/M-to-PCDOS conversion is that it needs to be
  620.      done only once for a given file. We spent quite a while transferring 10
  621.      megabytes of CP/M files to the IBM PC. But we need never do it again.
  622.      Now we just run everything on the IBM PC. 
  623.  
  624.  
  625.  
  626.      How Do I Run It? 
  627.      _________________
  628.       
  629.      The Emulator is just another PCDOS program. There are no arguments to
  630.      give it. There is no syntax. Just type 
  631.       
  632.           Z80MU 
  633.           Z80MU
  634.       
  635.      and bingo! - you're in CP/M. 
  636.          bingo!
  637.       
  638.      To make things easier, you may want to copy Z80MU.EXE to one of your
  639.      PCDOS "PATH" directories (if you have any). If you don't have any PATH
  640.      directories set up, then just insert the floppy that holds Z80MU, start
  641.      the program, and then remove the floppy. You don't need it until you
  642.      want to run the Emulator again. 
  643.       
  644.      The next section ("The PCDOS Environment") describes the PCDOS environ-
  645.      ment that applies to the Emulator. You may want to study it before you
  646.      run the thing. 
  647.  
  648.       
  649.       
  650.      What Can Go Wrong?
  651.      __________________
  652.  
  653.      The Emulator is as safe a program as ever you'll find on the IBM PC.
  654.      You will probably never experience any problem with it.
  655.  
  656.      There is one important thing to watch out for, however:
  657.  
  658.           If the Emulator itself is ever aborted, then you should
  659.           If the Emulator itself is ever aborted, then you should
  660.           immediately reboot your IBM PC.
  661.           immediately reboot your IBM PC.
  662.  
  663.      Why? Because the Emulator must trap the IBM PC's BREAK interrupt. When
  664.      the Emulator returns to PCDOS (via the "exit" command), it restores this
  665.                                              exit
  666.      interrupt the way it was before. If the Emulator never gets a chance to
  667.      exit gracefully, then it never gets a chance to restore this interrupt.
  668.      The thing is left pointing to now-dead code somewhere in the IBM PC's
  669.      memory. This is bad news for you, and good news for that big red switch
  670.      on the side of your PC...
  671.  
  672.  
  673.  
  674.  
  675.  
  676.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  677.  
  678.  
  679.  
  680.  
  681.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 11
  682.      INTRODUCTION
  683.  
  684.      Why might the Emulator abort? Well, there is always the possibility of
  685.                                                is
  686.      an Emulator bug that we haven't found. But the most likely reason is a
  687.      disk error that results in the familiar message:
  688.  
  689.                               Abort, Retry, Ignore?
  690.                               Abort, Retry, Ignore?
  691.  
  692.      If you select Abort, then you've just aborted the Emulator and left the
  693.                    Abort
  694.      BREAK interrupt in limbo. So reboot to be safe.
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.  
  735.  
  736.  
  737.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  738.  
  739.  
  740.  
  741.  
  742.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 12
  743.      THE PCDOS ENVIRONMENT
  744.  
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757.                              THE PCDOS ENVIRONMENT 
  758.                              THE PCDOS ENVIRONMENT 
  759.                                                    
  760.  
  761.      The Z80 Emulator runs as a normal application program under PCDOS
  762.      (version 2.0 and above). There are a few things that you should keep in
  763.      mind, in order to get the most out of the Emulator. 
  764.  
  765.       
  766.      PCDOS's use of COMMAND.COM 
  767.      __________________________
  768.  
  769.      Certain Emulator commands ("dir", "!xxxxxx", etc) are handled by calling
  770.                                  dir    !xxxxxx
  771.      PCDOS to perform the associated operation. The first thing that PCDOS
  772.      does when called in this way is reload its COMMAND.COM file from disk.
  773.      To speed things up, you should make sure that PCDOS's COMMAND.COM file
  774.      is in a RAMdisk, or on a hard disk. You can tell PCDOS where to find
  775.      COMMAND.COM by using the "SET COMSPEC=" command in your AUTOEXEC.BAT
  776.      file. 
  777.       
  778.      Certain versions of PCDOS (2.0 and 2.1, and maybe others) have trouble
  779.      obeying the "COMSPEC=" command. They try to reload COMMAND.COM from the
  780.      boot disk, regardless of the current "COMSPEC=" parameter. If you use
  781.      one of these versions of PCDOS, then you may avoid problems by keeping
  782.      COMMAND.COM always available on the boot drive. Alternatively, you may
  783.      apply one of the public domain COMZAP patches to fix your copy of PCDOS.
  784.  
  785.       
  786.      The "Z80PATH=" Environment String
  787.      _________________________________
  788.  
  789.      The Emulator has a facility which is equivalent to the PCDOS "PATH"
  790.      command. It allows you to tell the Emulator where to look for Z80
  791.      command (.COM) files. 
  792.       
  793.      This facility is implemented by a new PCDOS environment string, called
  794.      "Z80PATH". This string is a list of fully-qualified names of directories
  795.      which are to be searched when the Emulator is looking for a .COM file to
  796.      load and run. The various directory names must be separated with
  797.      semicolon (";") characters, as follows: 
  798.       
  799.  
  800. COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  801.  
  802.  
  803.  
  804.  
  805.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 13
  806.      THE PCDOS ENVIRONMENT
  807.  
  808.  
  809.           SET Z80PATH=c:\cpm;c:\z80\mystuff;c:\ 
  810.           SET Z80PATH=c:\cpm;c:\z80\mystuff;c:\
  811.  
  812.      This example tells the Emulator to search for Z80 programs first in the
  813.      directory "CPM" on drive C:, and then (if not found there) in the
  814.      directory "Z80\MYSTUFF" on drive C:, and finally (if still not found) in
  815.      the root directory of drive C:. 
  816.       
  817.      A Z80PATH string should be defined in your AUTOEXEC.BAT file, so that
  818.      it is always present when you run the Emulator.
  819.  
  820.      The trailing "\" character of each directory name is optional. If it is
  821.      absent, a "\" character is automatically applied to the directory name
  822.      before the name is used in the search.
  823.       
  824.      The Z80PATH search order is used whenever an "unqualified" program name
  825.      is used as a command to the Emulator. An "unqualified" program name is a
  826.      legal filename (up to 8 characters) which: 
  827.       
  828.           1) has no drive ID on the front of it (no ":" character), and
  829.           2) has no directory names imbedded in it (no "\" characters), and 
  830.           3) is not the name of an Emulator Builtin Command.
  831.  
  832.      For example, let's say that you give the following command to the
  833.      Emulator: 
  834.       
  835.           Z80 A>asm dump.aaz 
  836.                 asm dump.aaz
  837.  
  838.      The Emulator first checks to see if the command ("ASM") is one that it
  839.      recognizes - a so-called Builtin Command (see the "Builtin Commands"
  840.      section). If it is not, then the Emulator acts just like CP/M and
  841.      attaches a .COM extension to the command, yielding "ASM.COM". It then
  842.      looks in the current PCDOS directory on the current disk (in this case,
  843.      drive A:) for a file by the name of ASM.COM. If it finds such a file,
  844.      then it loads it into the CP/M Segment and runs it. 
  845.       
  846.      If the file is not found on the current drive, then the Emulator
  847.      searches the various Z80PATH directories, looking for a file with the
  848.      right name (ASM.COM). The directories are searched in the order that
  849.      they appear in the Z80PATH string. The first ASM.COM file that is found
  850.      is the one loaded and run. 
  851.       
  852.      If there is no Z80PATH string defined in the PCDOS environment, then the
  853.      search stops with the current disk drive's current PCDOS directory. 
  854.       
  855.      If no matching filename is found after all of this, then the Emulator
  856.      echos the command line
  857.  
  858.           asm? 
  859.  
  860.  
  861.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  862.  
  863.  
  864.  
  865.  
  866.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 14
  867.      THE PCDOS ENVIRONMENT
  868.  
  869.  
  870.  
  871.      indicating that it doesn't know what you mean. 
  872.  
  873.      Note that no search takes place if the command is "qualified". A
  874.      "qualified" command includes a drive ID or a pathname, such as:
  875.  
  876.           Z80 A>b:asm dump.aaz
  877.                 b:asm dump.aaz
  878.           Z80 A>\bin\asm dump.aaz
  879.                 \bin\asm dump.aaz
  880.  
  881.      In such a case, the Emulator tries only once to open the Z80 .COM file,
  882.      using the exact name given. If such a file cannot be found, then the
  883.      command fails as mentioned above.
  884.  
  885.  
  886.  
  887.      The AUTOEXEC.Z80 File
  888.      _____________________
  889.  
  890.      When the Emulator first starts up, it automatically executes the
  891.      following command:
  892.  
  893.           Z80 A>SUBMIT AUTOEXEC.Z80
  894.                 SUBMIT AUTOEXEC.Z80
  895.  
  896.      If there is no file by the name of AUTOEXEC.Z80 in the current directory
  897.      when the Emulator is run, then an error message is displayed and the
  898.      Emulator just waits for you to enter commands from the keyboard.
  899.  
  900.      If there is such a file, however, then the Emulator reads its commands
  901.               is
  902.      from that file, until EOF. See the "submit" builtin command for more
  903.                                          submit
  904.      details about submit files.
  905.  
  906.      This is an easy way to automate the Emulator. At CCS, we use a different
  907.      AUTOEXEC.Z80 file in each work directory in order to set up the parti-
  908.      cular environment that we want to work with. The AUTOEXEC.Z80 file
  909.      within the Radio Shack Model 100 directory, for example, automatically
  910.      reads in the 64K Model 100 image from disk ("read 0 model100.mem"), and
  911.                                                   read 0 model100.mem
  912.      the disassembler control file ("control read model100.ctl"). It also
  913.                                      control read model100.ctl
  914.      sets up the disassembler format that we want ("list include A O"). So
  915.                                                     list include A O
  916.      when we start up the Emulator while within that directory, the thing
  917.      comes up ready to do real work.
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  929.  
  930.  
  931.  
  932.  
  933.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 15
  934.      THE PCDOS ENVIRONMENT
  935.  
  936.  
  937.      I/O Redirection With The Emulator 
  938.      __________________________________
  939.       
  940.      The Emulator reads its commands from the standard input as defined by
  941.      PCDOS. It writes its output to the standard output that is defined by
  942.      PCDOS. So regular old PCDOS I/O redirection can be used when you start
  943.      the Emulator. 
  944.       
  945.      For example, the following PCDOS command can be used to run the Emulator
  946.      and capture all Emulator output to file OUTPUT.DOC: 
  947.  
  948.           Z80MU >OUTPUT.DOC 
  949.           Z80MU >OUTPUT.DOC
  950.  
  951.      You may also append output to an existing file with:
  952.  
  953.           Z80MU >>OUTPUT.DOC 
  954.           Z80MU >>OUTPUT.DOC
  955.  
  956.      And the following can be used to have the Emulator read all of its
  957.      commands from the file INPUT.BAT: 
  958.       
  959.           Z80MU <INPUT.BAT 
  960.           Z80MU <INPUT.BAT
  961.       
  962.      You may combine input and output redirection, as follows: 
  963.       
  964.           Z80MU <INPUT.BAT >OUTPUT.DOC 
  965.           Z80MU <INPUT.BAT >OUTPUT.DOC
  966.       
  967.      This is perfect for automating the Emulator. Some of the samples
  968.      displayed later in this document were captured by redirecting the
  969.      Emulator's output to a file, and then editing that file into this
  970.      document. 
  971.       
  972.      There are a few things to bear in mind, however. 
  973.       
  974.      First of all, remember that there are several parts of the Emulator:
  975.  
  976.       
  977.           The main program, which reads your commands and in general
  978.           The main program
  979.           acts like the CP/M CCP. It does all I/O via PCDOS, so it is
  980.           subject to I/O redirection. 
  981.        
  982.           The actual Z80 emulator, which does no I/O at all.
  983.           The actual Z80 emulator
  984.        
  985.           The CP/M BIOS emulator. It does I/O at the IBM PC ROM BIOS
  986.           The CP/M BIOS emulator
  987.           level, so PCDOS never sees what's going on. CP/M BIOS terminal
  988.           I/O goes through the emulated "terminal" inside the Emulator,
  989.           and then straight to the IBM PC screen. So I/O redirection
  990.           does not apply there. 
  991.       
  992.  
  993.  
  994. COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  995.  
  996.  
  997.  
  998.  
  999.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 16
  1000.      THE PCDOS ENVIRONMENT
  1001.  
  1002.  
  1003.           The CP/M BDOS emulator. The BDOS emulator does its I/O via PCDOS,
  1004.           The CP/M BDOS emulator
  1005.           so I/O redirection does apply to it, and to any Z80 programs that
  1006.           use BDOS functions for I/O. 
  1007.  
  1008.  
  1009.      Now the question arises: Will my CP/M application obey any I/O redirec-
  1010.      tion that I specify when I run the Emulator? 
  1011.       
  1012.      The answer, of course, depends on your application. 
  1013.       
  1014.      Most "standard" CP/M applications do their I/O via BDOS functions. So
  1015.      these will obey your I/O redirection. 
  1016.       
  1017.      Full-screen editors, in general, use the BIOS instead of the BDOS, for a
  1018.      lot of very good reasons. So these will automatically be exempt from
  1019.      your I/O redirection. 
  1020.  
  1021.      When constructing a file to be read via input redirection, remember to
  1022.      include all characters that are to be read either by the Emulator itself
  1023.      or by the CP/M application. This usually means that your input file will
  1024.      be a jumbled mix of Emulator and application input. 
  1025.       
  1026.      Let's say, for example, that you have a CP/M application named TEST.COM
  1027.      that asks for your name, prints some silly message based upon your name,
  1028.      and then exits back to CP/M. A complete input file to execute that
  1029.      program would look like this: 
  1030.       
  1031.           test
  1032.           test           (Emulator command to run TEST.COM) 
  1033.           Joan Riff
  1034.           Joan Riff      (Input to CP/M application program) 
  1035.           exit
  1036.           exit           (Emulator command to exit back to PCDOS) 
  1037.       
  1038.       
  1039.      If this text is saved on a file called AUTONAME, we can run the Emula-
  1040.      tor, tell it to run TEST.COM, answer TEST's question, and then exit the
  1041.      Emulator back to PCDOS by entering the following PCDOS command: 
  1042.       
  1043.           Z80MU <AUTONAME 
  1044.           Z80MU <AUTONAME
  1045.       
  1046.       
  1047.      Please remember that all Emulator input and/or all Emulator output is
  1048.                           all                       all
  1049.      redirected at once. If you redirect the output only, meaning to enter
  1050.      commands from the keyboard, don't be real surprised if you can't see any
  1051.      of the Emulator's prompts. They are being written to the redirected
  1052.      output file, and not to the screen. 
  1053.  
  1054.           NOTE: When you redirect output to a disk file, your input
  1055.           keypresses are supposed to be sent to the output file (not to
  1056.           the screen). Some versions of PCDOS, however, contain a bug
  1057.  
  1058.  
  1059.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  1060.  
  1061.  
  1062.  
  1063.  
  1064.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 17
  1065.      THE PCDOS ENVIRONMENT
  1066.  
  1067.  
  1068.           that causes your keypresses to appear on the screen instead.
  1069.           We have seen public domain patches to fix this bug floating
  1070.           around the Bulletin Boards, but can't vouch for any of them. 
  1071.  
  1072.           ALSO: Input that comes from Input I/O Redirection is not
  1073.           echoed, so you won't see it anywhere. Input from submit
  1074.                                                            submit
  1075.           files, however, IS echoed.
  1076.  
  1077.       
  1078.      Using The Keyboard 
  1079.      __________________
  1080.       
  1081.      As mentioned previously, the Emulator reads its input from the standard
  1082.      input as defined by PCDOS. So if you don't redirect the input to the
  1083.      Emulator, then input comes from the keyboard. 
  1084.       
  1085.      The Emulator could have done its own direct keyboard and screen I/O.
  1086.      This would speed things up considerably. PCDOS is notoriously slow when
  1087.      it comes to writing to the screen. 
  1088.       
  1089.      We decided, however, not to circumvent PCDOS when writing to the screen
  1090.      and reading from the keyboard. The Emulator is slower as a result. But
  1091.      we gain a few conveniences as a result: 
  1092.       
  1093.           We achieve something closer to true CP/M emulation, 'cause
  1094.           PCDOS automatically handles ^P and ^S/^Q in a manner close to
  1095.           CP/M's handling of them. 
  1096.       
  1097.           We get automatic I/O redirection. 
  1098.       
  1099.           We get PCDOS expanding macro keys and interpreting function
  1100.           keys. 
  1101.       
  1102.       
  1103.      The F3 key, for instance, can still be used to repeat the last command
  1104.      entered to the Emulator. The ESC key cancels the current input line. And
  1105.      F1 recreates the last command one character at a time. Other PCDOS
  1106.      keyboard conventions (like Ctrl-NumLock, Ctrl-PrtSc, and so on) are also
  1107.      handled by PCDOS in a way that we're all used to. 
  1108.       
  1109.      The addition of keyboard enhancers like CED and Sidekick can confuse
  1110.      things, so that the function keys don't act quite right. You'll just
  1111.      have to experiment with it.
  1112.  
  1113.      If you want to copy screen output to the printer, then press ^P or
  1114.      Ctrl-PrtSc. A second press will turn printer echo off. Remember that
  1115.      such PCDOS redirection applies to Emulator output (like dumps, disassem-
  1116.      blies, etc) as well as to the output of any CP/M applications being run
  1117.      under the Emulator that use BDOS functions for output.
  1118.  
  1119.  
  1120.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  1121.  
  1122.  
  1123.  
  1124.  
  1125.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 18
  1126.      THE PCDOS ENVIRONMENT
  1127.  
  1128.  
  1129.       
  1130.      If text is scrolling off of the screen too fast to read (not real
  1131.      likely, with PCDOS being as slow as it is), you can pause and restart it
  1132.      with ^S/^Q, or Ctrl-NumLock. 
  1133.  
  1134.      The actions of ^S/^Q, ^P and Ctrl-PrtSc may vary, depending on the
  1135.      particular CP/M application being run. CP/M's BDOS function number 6
  1136.      (Direct Console I/O), for example, is handled by CP/M without it
  1137.      checking for ^S or ^P. The Emulator mimics this action.
  1138.  
  1139.  
  1140.      Filenames!
  1141.      __________
  1142.  
  1143.      CP/M filenames may contain certain characters that PCDOS objects to. In
  1144.      general, don't use the "\" or "/" characters in filenames, or the I/O
  1145.      redirection characters ">" and "<", and so on.
  1146.  
  1147.      And watch out for PCDOS device names that are perfectly innocent
  1148.      filenames under CP/M. Things like "CON.ASM" will fool you.
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  1180.  
  1181.  
  1182.  
  1183.  
  1184.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 19
  1185.      THE CP/M ENVIRONMENT
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.  
  1198.  
  1199.  
  1200.                               THE CP/M ENVIRONMENT
  1201.                               THE CP/M ENVIRONMENT
  1202.  
  1203.  
  1204.      This section describes the environment set up by the Emulator, under
  1205.      which your Z80 programs will run.
  1206.  
  1207.  
  1208.  
  1209.      Emulated Terminal 
  1210.      __________________
  1211.       
  1212.      If a Z80 program does character I/O by invoking CP/M BDOS functions (not
  1213.      BIOS calls), then its input and output come from PCDOS, and this section
  1214.      does not apply. 
  1215.       
  1216.      When a Z80 program does character I/O by calling the emulated CP/M BIOS
  1217.      (not using BDOS functions, but BIOS calls), then it is communicating
  1218.      with an imaginary, emulated ASCII terminal which is maintained by the
  1219.      Emulator. The Emulator interprets ASCII codes that are sent to this
  1220.      "terminal", and translates them into appropriate calls to the IBM ROM to
  1221.      control the IBM's display. 
  1222.       
  1223.      Most ASCII characters that are sent to the emulated "terminal" are
  1224.      displayable characters - letters, numbers, and so on. They appear on the
  1225.      screen for the user to read. Other ASCII characters - called "control
  1226.      sequences" - are used not to display anything, but to cause the "ter-
  1227.      minal" to perform special functions like clearing the screen, switching
  1228.      between high- and low-intensity, and so on. 
  1229.  
  1230.      The builtin "terminal" obeys VT52 control sequences, which are the
  1231.                                   VT52 control sequences
  1232.      same ones used by the Heath/Zenith H19 and H89 machines when in ZDS
  1233.                            Heath/Zenith H19     H89
  1234.      mode. They are as follows:
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  1242.  
  1243.  
  1244.  
  1245.  
  1246.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 20
  1247.      THE CP/M ENVIRONMENT
  1248.  
  1249.  
  1250.  
  1251.           ESC H Homes cursor 
  1252.           ESC H
  1253.  
  1254.           ESC C Advances cursor 1 char to right. Stays on same line. 
  1255.           ESC C
  1256.       
  1257.           ESC D Backspaces cursor one char to left. Stays on same line. 
  1258.           ESC D
  1259.  
  1260.           ESC B Moves cursor down 1 line, staying in same column. Screen
  1261.           ESC B
  1262.                is scrolled if necessary.
  1263.       
  1264.           ESC A Moves cursor up 1 line, staying in same column. No
  1265.           ESC A
  1266.                scrolling occurs. 
  1267.       
  1268.           ESC I (uppercase letter "I", HEX 049h) Moves cursor up 1 line,
  1269.           ESC I
  1270.                staying in same column. Scrolling occurs if cursor was on
  1271.                top line. 
  1272.       
  1273.           ESC n Causes current cursor position to be returned via
  1274.           ESC n
  1275.                emulated "keyboard" as ESC Y line# column#. This control
  1276.                                                            ____________
  1277.                sequence is ignored (not supported) by the Emulator.
  1278.                ____________________________________________________
  1279.       
  1280.           ESC j Saves cursor position for later restore via ESC k. 
  1281.           ESC j
  1282.       
  1283.           ESC k Returns cursor to position that was saved via ESC j. 
  1284.           ESC k
  1285.  
  1286.           ESC Y line# column# Direct cursor addressing sequence. Screen
  1287.           ESC Y line# column#
  1288.                lines are numbered 1 to 25. Screen columns are numbered 1
  1289.                to 80. Line# and column# args are obtained by adding 31
  1290.                (01Fh) to the desired line or column number. Alternative-
  1291.                ly, you may think of lines as being numbered from 0 to
  1292.                24, columns from 0 to 79, and the offset to add to each
  1293.                being 32 (020h).
  1294.  
  1295.                To position to line 5, column 10, for example, the
  1296.                following is sent: 
  1297.       
  1298.                ESC Y $ ) 
  1299.                ESC Y $ )
  1300.       
  1301.                which is represented in HEX as 01Bh 059h 024h 029H and in
  1302.                                               01Bh 059h 024h 029H
  1303.                decimal as 27 89 36 41. Note that the line# arg is
  1304.                           27 89 36 41
  1305.                obtained by 5 + 31 = 36 (024h), and the column# arg by 10
  1306.                                     36
  1307.                + 31 = 41 (029h). 
  1308.                       41
  1309.       
  1310.                Line# or column# args less than 32 default to 32 (i.e. -
  1311.                to line or column 1). An arg value that is too large
  1312.                defaults to the max legal value (25 for line, 80 for
  1313.                column). 
  1314.  
  1315.  
  1316.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  1317.  
  1318.  
  1319.  
  1320.  
  1321.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 21
  1322.      THE CP/M ENVIRONMENT
  1323.  
  1324.  
  1325.           ESC F Erases the entire screen and homes the cursor. 
  1326.           ESC F
  1327.       
  1328.           ESC b Erases from the start of the screen to the cursor,
  1329.           ESC b
  1330.                including the cursor position. 
  1331.       
  1332.           ESC J Erases from the cursor to the end of the screen (inclu-
  1333.           ESC J
  1334.                ding the cursor position). 
  1335.       
  1336.           ESC l (lowercase letter "L", HEX 06Ch) Erases the entire line
  1337.           ESC l
  1338.                that the cursor is on, positions the cursor to the left
  1339.                edge of that line. 
  1340.  
  1341.           ESC o (lowercase letter "O", HEX 06Fh) Erases from the
  1342.           ESC o
  1343.                beginning of the line to the cursor (including the cursor
  1344.                position). 
  1345.       
  1346.           ESC K Erases from the cursor to the end of the line (including
  1347.           ESC K
  1348.                the cursor position). 
  1349.       
  1350.           ESC L Inserts a blank line before the line that the cursor is
  1351.           ESC L
  1352.                on, shifts following lines (including the cursor line)
  1353.                down to make room. Cursor is moved to start of new blank
  1354.                line. 
  1355.       
  1356.           ESC M Deletes the line that the cursor is on, scrolls follow-
  1357.           ESC M
  1358.                ing lines up to fill its place. Cursor moves to left edge
  1359.                of its line. 
  1360.       
  1361.           ESC N Deletes the character under the cursor, shifts remaining
  1362.           ESC N
  1363.                text to left to cover it up. 
  1364.       
  1365.           ESC @ (At-sign character, HEX 040h) Enters Insert Mode.
  1366.           ESC @
  1367.                Displayed characters cause others on the same line to be
  1368.                moved right to make room. This can be pretty pokey,
  1369.                thanks to the IBM ROM BIOS!
  1370.  
  1371.           ESC O (uppercase letter "O", HEX 04Fh) Exits Insert Mode. 
  1372.           ESC O
  1373.  
  1374.           ESC p Enters Reverse Video or Highlight mode.
  1375.           ESC p
  1376.  
  1377.           ESC q Exits Reverse Video or Highlight mode.
  1378.           ESC q
  1379.  
  1380.           BEL (decimal 7) Beeps bell. 
  1381.           BEL
  1382.       
  1383.           BS (decimal 8) Backspaces cursor one character position. 
  1384.           BS
  1385.  
  1386.           HT (decimal 9) Tabs cursor to next mod-8 column boundary
  1387.           HT
  1388.  
  1389.  
  1390.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  1391.  
  1392.  
  1393.  
  1394.  
  1395.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 22
  1396.      THE CP/M ENVIRONMENT
  1397.  
  1398.  
  1399.           LF (decimal 10, HEX 0Ah) Advances cursor to next line, same
  1400.           LF
  1401.                column. 
  1402.  
  1403.           FF (decimal 12, HEX 0Ch) Clears screen and homes cursor. 
  1404.           FF
  1405.  
  1406.           CR (decimal 13, HEX 0Dh) Returns cursor to start of current
  1407.           CR
  1408.                line. 
  1409.  
  1410.  
  1411.       
  1412.      The other standard ASCII control characters (below 032 or 20h) and those
  1413.      from 128 (80h) through 255 (FFh) display various graphic symbols. See
  1414.      the IBM Tech Ref Manual for details. 
  1415.       
  1416.      The emulated VT52 "terminal" also translates input from the IBM key-
  1417.      board. Most keypresses are returned to the Z80 program as single ASCII
  1418.      characters. The "extended" codes that are generated by IBM function
  1419.      keys, arrow keys, ALT keys, and so on, are translated into 2-byte
  1420.      keyboard sequences as follows: 
  1421.  
  1422.           The first byte is an ESCAPE character (Decimal 027, HEX 1Bh).
  1423.                                ESCAPE
  1424.  
  1425.           The second byte is the keyboard scan code, as defined in the
  1426.                                  keyboard scan code
  1427.           IBM Tech Ref Manual. 
  1428.       
  1429.      Additionally, the NUL extended code (CTRL-@) is translated into a
  1430.                        NUL
  1431.      single ASCII character (Decimal 000). 
  1432.       
  1433.      For example, assume that the user presses the PgUp key on the IBM
  1434.      keyboard. The next time that the Z80 program calls the CP/M BIOS to read
  1435.      a keypress from the "terminal", an ESCAPE character will be returned.
  1436.      The time after that, a Decimal 073 (HEX 49h) will be returned. This is
  1437.      the scan code for the PgUp key. 
  1438.       
  1439.       
  1440.      The above information may be used to configure particular Z80 applica-
  1441.      tions for use with the Emulator's "terminal".  Remember that this
  1442.      emulated "terminal" only appears at the CP/M BIOS interface. Applica-
  1443.      tions that do I/O via BDOS functions (which includes most of the
  1444.      standard CP/M utilities) do not see this behavior. 
  1445.       
  1446.      WORDSTAR, dBase II, Target Plannercalc  and PMATE, for example, do at
  1447.      least some of their terminal I/O via the CP/M BIOS, so they must be
  1448.      configured for the particular terminal being used. Refer to the above
  1449.      information when installing such applications for use under the Emula-
  1450.      tor, using this emulated VT52 "terminal". Please bear in mind, however,
  1451.      that things can get very confusing when one application (like dBase II)
  1452.  
  1453.  
  1454.  
  1455.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  1456.  
  1457.  
  1458.  
  1459.  
  1460.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 23
  1461.      THE CP/M ENVIRONMENT
  1462.  
  1463.  
  1464.      does terminal I/O via both the BIOS and the BDOS. Just experiment until
  1465.      you get something useful.
  1466.  
  1467.           NOTE: This emulated terminal facility may be enabled and
  1468.           disabled via the "terminal" builtin command, which is des-
  1469.                             terminal
  1470.           cribed in the "Builtin Commands" section.
  1471.  
  1472.       
  1473.      ^C and BREAK Handling 
  1474.      _____________________
  1475.       
  1476.      The ^C (Ctrl-C) and BREAK (Ctrl-Scroll Lock) keys are handled in a
  1477.      special way on the IBM PC. Under normal circumstances, these keypresses
  1478.      are trapped by PCDOS and cause the executing PCDOS program (in this
  1479.      case, the Emulator) to be aborted. 
  1480.       
  1481.      This is undesirable. 
  1482.       
  1483.      Additionally, CP/M includes an important assumption, to wit: ^C is a
  1484.      keypress like any other, and must be passed through all the way to the
  1485.      Z80 program for processing. Several standard CP/M programs (PIP.COM,
  1486.      M80.COM, WORDSTAR, etc) use ^C as a command, and must not be aborted
  1487.                                                       must not
  1488.      when it is typed. 
  1489.  
  1490.      For this reason, the Emulator traps ^C and BREAK keypresses. It decides
  1491.      what to do with them as follows: 
  1492.       
  1493.           When not running a Z80 program (i.e. - when the Emulator is
  1494.                accepting commands), the BREAK key does nothing and the ^C
  1495.                keypress does various things depending on the mood of PCDOS. 
  1496.       
  1497.           When executing a Z80 program, pressing ^C causes a ^C character
  1498.                (Decimal 003) to be queued as keyboard input. Pressing BREAK
  1499.                causes the Z80 to be stopped (with an appropriate message),
  1500.                and a return to the Emulator awaiting your command.
  1501.  
  1502.                NOTE: If the Z80 program is in the process of reading a
  1503.                line of keyboard input when you press BREAK, then you
  1504.                may have to press RETURN (to terminate that read) before
  1505.                the BREAK will be recognized.
  1506.  
  1507.  
  1508.      When the Emulator stops ("aborts") a Z80 program due to a BREAK key-
  1509.      press, it displays a message to that effect. It suspends the Z80 in
  1510.      perfect order, maintaining all registers, flags, etc. It then accepts
  1511.      Emulator commands. 
  1512.       
  1513.      At this point you may inspect registers, run another Z80 program, or
  1514.  
  1515.  
  1516.  
  1517.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  1518.  
  1519.  
  1520.  
  1521.  
  1522.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 24
  1523.      THE CP/M ENVIRONMENT
  1524.  
  1525.  
  1526.      whatever. You may also continue execution of the aborted program with
  1527.      the "go" command. 
  1528.           go
  1529.       
  1530.      This is a very powerful tool for debugging, which is not available with
  1531.      true (hardware) Z80 systems. You may in effect interrupt the Z80 at any
  1532.                                                                          any
  1533.      point, actually pausing it between Z80 instructions. 
  1534.       
  1535.      This also maintains compatability with existing CP/M programs that want
  1536.      to read the ^C character. To exit PIP, for example, you need only press
  1537.      ^C and then RETURN. This ^C is passed to PIP, who interprets it as a
  1538.      request to exit the program. 
  1539.       
  1540.      Note that RETURN must be pressed after the ^C in some cases (like when
  1541.      entering a command line into PIP). This is one area of PCDOS-CP/M
  1542.      incompatability, for which Joan Riff offers her apologies. A Z80
  1543.      program (like PIP) that requests a line of input from CP/M won't see the
  1544.      ^C until the entire line is terminated with RETURN. A Z80 program that
  1545.      asks for one character at a time, however, will see the ^C immediately. 
  1546.  
  1547.           NOTE: When running PCDOS commands like type, dir, and so on,
  1548.                                                  type  dir
  1549.           the BREAK key is unavailable to you. If you want to interrupt
  1550.           the output from such programs that are run "underneath" the
  1551.           Emulator, you will have to use the ^C key.
  1552.       
  1553.       
  1554.      
  1555.      
  1556.      Common PCDOS and CP/M File System 
  1557.      _________________________________
  1558.       
  1559.      The Emulator goes to great lengths to allow CP/M programs to read and
  1560.      write PCDOS files. Thus the PCDOS file system serves as a common
  1561.      environment for both PCDOS and CP/M files. This allows you to use your
  1562.      favorite IBM PC editor, for example, to edit source files that are then
  1563.      compiled within CP/M (using the Emulator) with ASM.COM, M80.COM,
  1564.      F80.COM, or whatever. 
  1565.       
  1566.      CP/M's "User Number" concept, however, is primitive compared to the
  1567.      directory structure available with PCDOS. So although the emulated BDOS
  1568.      supports the setting of a user number, the user number is ignored by the
  1569.      Emulator when it comes time to actually access files. 
  1570.       
  1571.      Likewise, the concept of a Read-Only disk drive is not necessary under
  1572.      the Emulator. And the fatal CP/M flaw that crops up when you change
  1573.      disks and forget to type ^C to Warm Boot the system has been virtually
  1574.      eliminated by PCDOS. 
  1575.  
  1576.  
  1577.      CP/M and its CCP (or lack of them) 
  1578.      __________________________________
  1579.       
  1580.  
  1581. COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  1582.  
  1583.  
  1584.  
  1585.  
  1586.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 25
  1587.      THE CP/M ENVIRONMENT
  1588.  
  1589.  
  1590.      One thing that we did in order to achieve such a large TPA size (65022
  1591.      bytes) and such fast emulation was remove the console command part of
  1592.      CP/M (the Console Command Processor, or CCP) from the CP/M Segment. In
  1593.      fact, we did away with CP/M entirely. 
  1594.       
  1595.      The CCP is the part of a normal CP/M system which accepts commands from
  1596.      the user and processes them. The Digital Research CCP that comes with
  1597.      CP/M 2.2 is fairly limited in its power. 
  1598.       
  1599.      In the Emulator, it is the main Z80MU 'C'-language program which
  1600.      contains all of the functions of CP/M's CCP, and does a whole lot more.
  1601.      In fact, it is this program which emulates all of CP/M (with a lot of
  1602.      help from PCDOS). 
  1603.  
  1604.      For this reason, there are certain CP/M enhancements (like ZCPR) which
  1605.      will have a whole lot of trouble working under the Emulator. The good
  1606.      news is that they are largely irrelevant under the Emulator, as the
  1607.      Emulator itself provides a powerful increase in console power even
  1608.      without ZCPR. 
  1609.       
  1610.      So if you have dreams of running ZCPR (or any CP/M enhancement which
  1611.      counts on patching CP/M), you ought to forget about it. When using the
  1612.      Emulator, there's no CP/M for such programs to patch. It's all fakeware,
  1613.      invisible to Z80 programs. 
  1614.       
  1615.      Stick with CP/M programs which interact with the outside world via the
  1616.      standard, unmodified BIOS and BDOS interfaces. 
  1617.       
  1618.       
  1619.  
  1620.      CP/M 2.2 BIOS and BDOS Emulation 
  1621.      ________________________________
  1622.       
  1623.      The Emulator tries very hard to look to Z80 programs like CP/M version
  1624.      2.2, at least in terms of its BIOS calls and BDOS support functions.
  1625.      Most Z80 programs that are run under the Emulator will have no idea that
  1626.      they aren't being run on a Z80 machine running Digital Research's CP/M.
  1627.       
  1628.      There are some hardware-specific aspects of CP/M, however, that make no
  1629.      sense on a PCDOS system. 
  1630.       
  1631.      Many CP/M BIOS calls, for example, deal with the physical layout and
  1632.      operation of the floppy disk. Some of these are ignored. Others cause a
  1633.      fault of the Z80 program, with the display of a message to the effect
  1634.      that the program invoked an unsupported BIOS call. 
  1635.       
  1636.      There are a few BDOS functions which likewise are irrelevant, and which
  1637.      cause the Z80 program to be aborted. 
  1638.       
  1639.  
  1640. COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  1641.  
  1642.  
  1643.  
  1644.  
  1645.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 26
  1646.      THE CP/M ENVIRONMENT
  1647.  
  1648.  
  1649.      The following is a list of the various BIOS calls that are supported by
  1650.      CP/M 2.2, and their effects under the Emulator. Calls that are marked
  1651.      "unsupported" cause the Z80 program to be aborted.
  1652.  
  1653.      The addresses listed are absolute addresses within the CP/M Segment.
  1654.      Note that when the CP/M segment is Cold Booted, CP/M's location zero is
  1655.      set to JMP BIOS+3 (FF03h - the Warm Boot vector). The only safe way for
  1656.                                                                 safe
  1657.      a Z80 program to locate this BIOS jump table in any CP/M system (not
  1658.      just the Emulator) is to look at address 0001 within CP/M's memory.
  1659.  
  1660.           BIOS
  1661.           BIOS
  1662.           Address
  1663.           Address   Function 
  1664.                     Function
  1665.  
  1666.           FF00h     Cold Start CP/M segment
  1667.           FF03h     Warm Start CP/M segment 
  1668.           FF06h     Set A-reg to FFh if Emulated VT52 Terminal has keypress
  1669.                          to be read, 00h if not
  1670.           FF09h     Get keypress from Emulated VT52 Terminal to A-reg, via
  1671.                          IBM's ROM BIOS 
  1672.           FF0Ch     Output C-reg to Emulated VT52 Terminal via IBM's ROM BIOS
  1673.           FF0Fh     Output C-reg to LPT1: via IBM's ROM BIOS
  1674.           FF12h     Output C-reg to COM1: via IBM's ROM BIOS 
  1675.           FF15h     Get char from COM1: to A-reg via IBM's ROM BIOS 
  1676.           FF18h     Home Disk (unsupported) 
  1677.           FF1Bh     Select Disk (unsupported) 
  1678.           FF1Eh     Set Track (unsupported) 
  1679.           FF21h     Set Sector (unsupported) 
  1680.           FF24h     Set DMA address (unsupported) 
  1681.           FF27h     Read Sector (unsupported) 
  1682.           FF2Ah     Write Sector (unsupported) 
  1683.           FF2Dh     Set A-reg to FFh if LPT1: ready for output, 00h if not,
  1684.                          as reported by IBM's ROM BIOS
  1685.           FF30h     Sector Translate (unsupported) 
  1686.        
  1687.       
  1688.      Similarly, here is a table of the various BDOS functions (in Decimal/-
  1689.      HEX), and their actions under the Emulator. Note that a CP/M BDOS
  1690.      function is invoked by loading the function number into C-reg, and
  1691.      doing a CALL 0005h. See standard CP/M documentation for detailed
  1692.      calling conventions.
  1693.  
  1694.           BDOS
  1695.           BDOS
  1696.           Function
  1697.           Function  Action
  1698.                     Action
  1699.       
  1700.           00/00h    Warm Boot. Returns to accept more Emulator commands. Does
  1701.                          not alter memory in the CP/M Segment. 
  1702.                          not
  1703.           01/01h    Read char from PCDOS standard input to A-reg. 
  1704.           02/02h    Send E-reg to PCDOS standard output. 
  1705.  
  1706.  
  1707.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  1708.  
  1709.  
  1710.  
  1711.  
  1712.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 27
  1713.      THE CP/M ENVIRONMENT
  1714.  
  1715.  
  1716.           03/03h    Read char from PCDOS AUX: device into A-reg. 
  1717.           04/04h    Send E-reg to PCDOS AUX: device 
  1718.           05/05h    Send E-reg to PCDOS PRN device 
  1719.           06/06h    If E-reg on entry = FFh, then return in A-reg next char
  1720.                          from PCDOS standard input, or 00h if none available
  1721.                          at this instant. 
  1722.                     If E-reg on entry <> FFh, then send E-reg to PCDOS
  1723.                          standard output. 
  1724.           07/07h    Get IOBYTE to A-reg. 
  1725.           08/08h    Store E-reg into IOBYTE. 
  1726.           09/09h    Output string at (DE) to PCDOS standard output. 
  1727.           10/0Ah    Input line from PCDOS standard input to (DE). 
  1728.           11/0Bh    Set A-reg to FFh if char from PCDOS standard input is
  1729.                          ready to be read, or 00h if not. 
  1730.           12/0Ch    Return CP/M version to HL. Sets reg L to 22h (for CP/M
  1731.                          version 2.2), and reg H to 00h.
  1732.           13/0Dh    Reset disk system. Sets DMA to 80h. Does not change
  1733.                                                              not
  1734.                          selected drive to A: (like CP/M does), as this is
  1735.                          not necessary with PCDOS. 
  1736.           14/0Eh    Set default drive to E-reg. 
  1737.           15/0Fh    Open file whose FCB is at (DE). Sets A-reg to 00h if
  1738.                          successful, else to FFh. 
  1739.           16/10h    Close file whose FCB is at (DE).  Sets A-reg to 00h if
  1740.                          successful, else to FFh. 
  1741.           17/11h    Search for first file that matches pattern in FCB at
  1742.                          (DE).  Sets A-reg to 00h if successful, else to FFh.
  1743.           18/12h    Search for next file that matches last pattern used. 
  1744.                          Sets A-reg to 00h if successful, else to FFh. 
  1745.           19/13h    Delete file(s) represented by FCB is at (DE).  Sets A-reg
  1746.                          to 00h if successful, else to FFh. 
  1747.  
  1748.           20/14h    Read next sequential record from file whose FCB is
  1749.                          at (DE). Sets A-reg to status as follows:
  1750.       
  1751.                          0 = successful 
  1752.                          1 = reading unwritten data (EOF) 
  1753.                          FFh = PCDOS returned error # 2: "No room in DTA for
  1754.                               record" 
  1755.  
  1756.                     Note that a short record is filled out by the Emulator
  1757.                          with ^Z (eof) characters. 
  1758.  
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  1767.  
  1768.  
  1769.  
  1770.  
  1771.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 28
  1772.      THE CP/M ENVIRONMENT
  1773.  
  1774.  
  1775.           21/15h    Write next sequential record to file whose FCB is at
  1776.                          (DE). Returns status in A-reg as follows: 
  1777.       
  1778.                          0 = successful 
  1779.                          5 = diskette full 
  1780.                          6 = PCDOS returned error # 2: "No room in DTA for
  1781.                               record" 
  1782.       
  1783.           22/16h    Create (and open) file whose FCB is at (DE).  Sets A-reg
  1784.                          to 00h if successful, else to FFh. 
  1785.           23/17h    Rename file(s) per special FCB at (DE).  Sets A-reg to
  1786.                          00h if successful, else to FFh. 
  1787.           24/18h    Return login vector (bitmap of known disks) to HL. Calls
  1788.                          PCDOS to discover number of available drives. 
  1789.           25/19h    Return default drive number in A-reg. 
  1790.           26/1Ah    Set DMA to DE. 
  1791.           27/1Bh    Return allocation information (unsupported - aborts Z80
  1792.                          program). See note below. 
  1793.           28/1Ch    Write-protect drive (ignored). 
  1794.           29/1Dh    Return write-protect vector (bitmap of $R/O drives) to
  1795.                          HL. Sets HL to zero (nobody's write-protected).
  1796.           30/1Eh    Set file attributes (ignored, but returns A-reg of 00h to
  1797.                          indicate success). 
  1798.           31/1Fh    Return physical disk information (unsupported - aborts
  1799.                          Z80 program). See note below. 
  1800.  
  1801.           32/20h    If E-reg on entry is FFh, then current user number is
  1802.                          returned in A-reg. 
  1803.       
  1804.                     If E-reg on entry <> FFh, then current user number is set
  1805.                          to E-reg MOD 32. 
  1806.       
  1807.                     This only updates the byte at CP/M address 4. The
  1808.                          Emulator ignores this byte when accessing files. 
  1809.       
  1810.           33/21h    Read random record from file whose FCB is at (DE).
  1811.                          Returns A-reg status as follows: 
  1812.  
  1813.                          0 = successful 
  1814.                          1 = reading unwritten data 
  1815.                          3 = (CP/M "Cannot close current extent" error):
  1816.                               PCDOS returned error # 2: "No space in DTA for
  1817.                               record" 
  1818.       
  1819.                     Note that a partial record is filled out by the Emulator
  1820.                          with ^Z (eof) characters. 
  1821.       
  1822.  
  1823.  
  1824. COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  1825.  
  1826.  
  1827.  
  1828.  
  1829.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 29
  1830.      THE CP/M ENVIRONMENT
  1831.  
  1832.  
  1833.           34/22h    Write random record to file whose FCB is at (DE). Returns
  1834.                          A-reg status as follows: 
  1835.       
  1836.                          0 = successful 
  1837.                          3 = (CP/M "Cannot close current extent" error):
  1838.                               PCDOS returned error # 2: "No space in DTA for
  1839.                               record" 
  1840.                          5 = (CP/M "Directory Overflow" error): Diskette full
  1841.  
  1842.       
  1843.           35/23h    Compute file size for file whose FCB is at (DE). Result
  1844.                          goes into random record field of FCB. 
  1845.           36/24h    Set random record field per FCB at (DE). 
  1846.           37/25h    Reset drive (accepted but ignored) 
  1847.           38/26h    (unsupported - aborts Z80 program) 
  1848.           39/27h    (unsupported - aborts Z80 program) 
  1849.           40/28h    Write random record with zero fill. In the Emulator, this
  1850.                          is translated to a function 34/22h (above). 
  1851.  
  1852.           NOTE: If someone will kindly provide us with a coherent
  1853.           writeup of the disk parameter block and allocation information
  1854.           as returned by BDOS functions 31/1Fh and 27/1Bh above, then
  1855.           we will gladly emulate these functions in the next release.
  1856.  
  1857.       
  1858.      In CP/M the BDOS routines call the BIOS routines. This is not true in
  1859.      the Emulator. The Emulator's BDOS functions in general invoke the
  1860.      corresponding PCDOS functions, and the Emulator's BIOS routines call the
  1861.      IBM PC ROM BIOS routines.
  1862.  
  1863.  
  1864.  
  1865.  
  1866.  
  1867.  
  1868.  
  1869.  
  1870.  
  1871.  
  1872.  
  1873.  
  1874.  
  1875.  
  1876.  
  1877.  
  1878.  
  1879.  
  1880.  
  1881.  
  1882.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  1883.  
  1884.  
  1885.  
  1886.  
  1887.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 30
  1888.      EMULATOR BUILTIN COMMANDS
  1889.  
  1890.  
  1891.  
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.                                 BUILTIN COMMANDS 
  1903.                                 BUILTIN COMMANDS 
  1904.                                                  
  1905.  
  1906.      This section describes those commands that are recognized and acted
  1907.      upon by the Emulator itself. Such commands do not involve a search of
  1908.      the disk for a corresponding .COM file, since the Emulator recognizes
  1909.      them as special commands which are to be handled within the Emulator
  1910.      itself. This process is roughly equivalent to the handling of CP/M's CCP
  1911.      commands.
  1912.  
  1913.  
  1914.      Command Name Conflicts
  1915.      ______________________
  1916.  
  1917.      You may have a .COM (Z80 command) file that has the same name as one of
  1918.      these Builtin Commands. How do you tell the Emulator to run your .COM
  1919.      file, instead of doing its corresponding Builtin Command? All that you
  1920.      have to do is convince the Emulator that your command is indeed a disk
  1921.      file. This can be done by including a drive ID or pathname as part of
  1922.      your command:
  1923.  
  1924.           Z80 A>a:dump foobar.asc
  1925.                 a:dump foobar.asc
  1926.           Z80 A>b:\bin\dump foobar.asc
  1927.                 b:\bin\dump foobar.asc
  1928.           Z80 A>\mystuff\dump foobar.asc
  1929.                 \mystuff\dump foobar.asc
  1930.  
  1931.      Alternatively, you may want to rename your .COM file so that it no
  1932.      longer conflicts with an Emulator Builtin Command name.
  1933.  
  1934.  
  1935.  
  1936.      Numeric Arguments 
  1937.      _________________
  1938.       
  1939.      Some Builtin Commands accept numeric arguments. These may represent
  1940.      addresses to be dumped, the number of pages to save, or whatever.
  1941.                      dump                           save
  1942.       
  1943.      A numeric argument may be entered in any of several ways: 
  1944.       
  1945.           As a HEX number. No prefix is required in this case, as this is
  1946.                the default numeric radix. 
  1947.  
  1948.  
  1949.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  1950.  
  1951.  
  1952.  
  1953.  
  1954.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 31
  1955.      EMULATOR BUILTIN COMMANDS
  1956.  
  1957.  
  1958.       
  1959.                Examples: ffff  0  7F  -5  +3FF 
  1960.  
  1961.           As a decimal number, prefixed by a period ("."). 
  1962.  
  1963.                Examples: .10  .0  -.1  +.256  .65022 
  1964.       
  1965.           As a binary number, prefixed with the percent sign ("%"). 
  1966.  
  1967.                Examples: %0  %1010101011110000  -%1 
  1968.       
  1969.           As an ASCII character, prefixed by the apostrophe ("'"). 
  1970.  
  1971.                Examples: 'A  '"  '0  -'Z
  1972.       
  1973.           As an ASCII escape sequence, prefixed by an apostrophe and back-
  1974.                slash ("'\"). 
  1975.  
  1976.                Examples: 
  1977.  
  1978.                     '\\            (single "\" char) 
  1979.                     '\0            (NUL byte) 
  1980.                     '\b or '\B     (Backspace char) 
  1981.                     '\t or '\T     (TAB char) 
  1982.                     '\n or '\N     (LINEFEED char) 
  1983.                     '\r or '\R     (CARRIAGE RETURN char) 
  1984.                     '\'            (single apostrophe ("'") char) 
  1985.                     '\"            (single double-quote char ) 
  1986.                     '\xFF or '\XFF (byte with HEX value of FF) 
  1987.       
  1988.           As a label which has been defined with the "label" builtin command.
  1989.                                                       label
  1990.  
  1991.                Examples: fcb1  program_start  BDOS  -reserved 
  1992.       
  1993.           As two or more of the above entries, connected with "+" or "-"
  1994.                operators. 
  1995.  
  1996.                Examples: 
  1997.  
  1998.                     fcb1+5 
  1999.                     program_end-table_length 
  2000.                     'A-40+'a 
  2001.                     table-5+offset 
  2002.       
  2003.       
  2004.  
  2005.  
  2006.  
  2007.  
  2008. COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  2009.  
  2010.  
  2011.  
  2012.  
  2013.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 32
  2014.      EMULATOR BUILTIN COMMANDS
  2015.  
  2016.  
  2017.  
  2018.      The Builtin Commands are presented by functional grouping:
  2019.  
  2020.           - The PCDOS pass-through command prefix
  2021.           - CP/M Builtins that are emulated
  2022.           - Emulator Builtins that are similar to CP/M's
  2023.           - General Emulator commands
  2024.           - Emulator DEBUG commands
  2025.           - CP/M Environment and file control commands
  2026.           - RESOURCE commands
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.  
  2054.  
  2055.  
  2056.  
  2057.  
  2058.  
  2059.  
  2060.  
  2061.  
  2062.  
  2063.  
  2064.  
  2065.  
  2066.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  2067.  
  2068.  
  2069.  
  2070.  
  2071.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 33
  2072.      BUILTIN COMMANDS: PCDOS PASS-THROUGH
  2073.  
  2074.  
  2075.       
  2076.      Builtin:
  2077.      ________  !xxxxxx
  2078.                !xxxxxx
  2079.       
  2080.      Passes command xxxxxx to PCDOS. This gives you a way to use the usual
  2081.      PCDOS utilities from within the emulator, without having them interpret-
  2082.      ed as CP/M commands. Everything after the "!" character is passed as a
  2083.      command to PCDOS. 
  2084.       
  2085.      This command requires the reloading (by PCDOS) of the PCDOS COMMAND.COM
  2086.      file from disk. See the section on "The PCDOS Environment" for more
  2087.      detail on this subject. 
  2088.       
  2089.      Since PCDOS handles the command (and any command arguments that may be
  2090.      present), the standard PCDOS "PATH" environment string may apply. So may
  2091.      all other PCDOS conventions, like I/O redirection, wildcards, PCDOS
  2092.      device names, etc. 
  2093.       
  2094.      The given command is executed above the Emulator's memory. This implies
  2095.      that there had better be enough memory available above the Emulator to
  2096.      run the given command. 
  2097.       
  2098.      You may use this facility to "drop into" PCDOS for a while (perhaps to
  2099.      use a PCDOS screen editor on a CP/M source file), and then return to the
  2100.      Emulator. Use "!command" to drop into DOS, and "exit" to leave PCDOS and
  2101.                     !command                         exit
  2102.      return to the Emulator. 
  2103.       
  2104.      This is also the primary way to take advantage of PCDOS's directory
  2105.      structure while within CP/M. You may issue "CHDIR", "MKDIR", and other
  2106.      directory-related commands directly to PCDOS. The effect of such
  2107.      commands carries over to the Emulator. 
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.  
  2117.  
  2118.  
  2119.  
  2120.  
  2121.  
  2122.  
  2123.  
  2124.  
  2125.  
  2126.  
  2127.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  2128.  
  2129.  
  2130.  
  2131.  
  2132.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 34
  2133.      BUILTIN COMMANDS: PCDOS PASS-THROUGH
  2134.  
  2135.  
  2136.  
  2137.      Example (from an actual session):
  2138.       
  2139.           Z80 A>!cd \foo 
  2140.                 !cd \foo
  2141.           Z80 A>!cd \ 
  2142.                 !cd \
  2143.           Z80 A>!rd \foo
  2144.                 !rd \foo
  2145.           Z80 A>!chkdsk b: 
  2146.                 !chkdsk b:
  2147.       
  2148.       
  2149.              362496 bytes total disk space 
  2150.                1024 bytes in 1 directories 
  2151.              272384 bytes in 10 user files 
  2152.               89088 bytes available on disk 
  2153.       
  2154.              423936 bytes total memory 
  2155.              152384 bytes free 
  2156.       
  2157.           Z80 A>!md foo 
  2158.                 !md foo
  2159.           Z80 A>!cd foo 
  2160.                 !cd foo
  2161.           Z80 A>stat *.* 
  2162.                 stat *.*
  2163.       
  2164.       
  2165.                Volume in drive A has no label 
  2166.                Directory of  A:\foo 
  2167.       
  2168.                .         <DIR>     11-19-85   1:15a 
  2169.                ..        <DIR>     11-19-85   1:15a 
  2170.                2 File(s)    144384 bytes free 
  2171.       
  2172.           Z80 A>!command 
  2173.                 !command
  2174.        
  2175.       
  2176.           The IBM Personal Computer DOS 
  2177.           Version 2.00 (C)Copyright IBM Corp 1981, 1982, 1983 
  2178.       
  2179.           Tue 11-19-1985 1:16:00.18 
  2180.           A:>chkdsk 
  2181.              chkdsk
  2182.       
  2183.       
  2184.              362496 bytes total disk space 
  2185.                1024 bytes in 1 directories 
  2186.              217088 bytes in 17 user files 
  2187.              144384 bytes available on disk 
  2188.       
  2189.              423936 bytes total memory 
  2190.              149264 bytes free 
  2191.       
  2192.       
  2193.  
  2194. COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  2195.  
  2196.  
  2197.  
  2198.  
  2199.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 35
  2200.      BUILTIN COMMANDS: PCDOS PASS-THROUGH
  2201.  
  2202.  
  2203.           Tue 11-19-1985 1:16:16.17 
  2204.           A:>exit 
  2205.              exit
  2206.  
  2207.           Z80 A>!format a: 
  2208.                 !format a:
  2209.  
  2210.  
  2211.  
  2212.  
  2213.  
  2214.  
  2215.  
  2216.  
  2217.  
  2218.  
  2219.  
  2220.  
  2221.  
  2222.  
  2223.  
  2224.  
  2225.  
  2226.  
  2227.  
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  
  2233.  
  2234.  
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240.  
  2241.  
  2242.  
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251.  
  2252.  
  2253.  
  2254.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  2255.  
  2256.  
  2257.  
  2258.  
  2259.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 36
  2260.      BUILTIN COMMANDS: EMULATED CP/M BUILTIN'S
  2261.  
  2262.  
  2263.       
  2264.      Builtin:
  2265.      ________  d: 
  2266.                d:
  2267.  
  2268.           Changes the default disk drive to the drive whose letter name is
  2269.      represented by the "d" character. The command prompt will change to
  2270.  
  2271.           Z80 d>
  2272.  
  2273.      to reflect the new default. Drive d's current PCDOS directory will
  2274.      then be the first directory searched for Z80 command (.COM) files,
  2275.      unless explicitly overridden by a drive prefix or pathname. Data files
  2276.      that are created will default to that drive and its current directory.
  2277.      Data files that are read will be searched for only in that drive and
  2278.      directory, unless explicitly overridden by the Z80 program. 
  2279.       
  2280.      Example (from an actual session): 
  2281.  
  2282.           Z80 A>stat b:*.* 
  2283.                 stat b:*.*
  2284.       
  2285.       
  2286.                 Volume in drive B has no label 
  2287.                 Directory of  B:\ 
  2288.       
  2289.                WORDSTAR     <DIR>     11-02-85   4:19a 
  2290.                     1 File(s)     89088 bytes free 
  2291.       
  2292.           Z80 A>dir b:\wordstar\ws*.* 
  2293.                 dir b:\wordstar\ws*.*
  2294.       
  2295.       
  2296.                 Volume in drive B has no label 
  2297.                 Directory of  B:\wordstar 
  2298.       
  2299.                WSMSGS   OVR   27904  11-06-85   6:27p 
  2300.                WSOVLY1  OVR   34048  11-06-85   6:30p 
  2301.                WSU      COM   15872  11-06-85   6:32p 
  2302.                WS       COM   15872  11-06-85   6:37p 
  2303.                     4 File(s)     89088 bytes free 
  2304.       
  2305.           Z80 A>b: 
  2306.                 b:
  2307.       
  2308.           Z80 B>dir 
  2309.                 dir
  2310.       
  2311.       
  2312.                 Volume in drive B has no label 
  2313.                 Directory of  B:\ 
  2314.       
  2315.                WORDSTAR     <DIR>     11-02-85   4:19a 
  2316.                     1 File(s)     89088 bytes free 
  2317.  
  2318.  
  2319.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  2320.  
  2321.  
  2322.  
  2323.  
  2324.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 37
  2325.      BUILTIN COMMANDS: EMULATED CP/M BUILTIN'S
  2326.  
  2327.  
  2328.       
  2329.           Z80 B>stat a:\*.exe 
  2330.                 stat a:\*.exe
  2331.       
  2332.       
  2333.                 Volume in drive A has no label 
  2334.                 Directory of  A:\ 
  2335.       
  2336.                Z80MU    EXE   94976  11-18-85   3:31p 
  2337.                     1 File(s)    142336 bytes free 
  2338.       
  2339.  
  2340.  
  2341.  
  2342.  
  2343.  
  2344.  
  2345.  
  2346.  
  2347.  
  2348.  
  2349.  
  2350.  
  2351.  
  2352.  
  2353.  
  2354.  
  2355.  
  2356.  
  2357.  
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.  
  2366.  
  2367.  
  2368.  
  2369.  
  2370.  
  2371.  
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377.  
  2378.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  2379.  
  2380.  
  2381.  
  2382.  
  2383.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 38
  2384.      BUILTIN COMMANDS: EMULATED CP/M BUILTIN'S
  2385.  
  2386.  
  2387.       
  2388.      Builtin:  del <pattern> 
  2389.                del <pattern> 
  2390.      ________
  2391.                era <pattern> 
  2392.                era <pattern> 
  2393.                delete <pattern> 
  2394.                delete <pattern> 
  2395.                erase <pattern> 
  2396.                erase <pattern>
  2397.  
  2398.      These are identical commands. All cause the invocation of the PCDOS
  2399.      "DEL" command to delete files that match <pattern>. 
  2400.  
  2401.      See the PCDOS manual for details of <pattern>. 
  2402.  
  2403.      We have created several synonyms for the same command in order to make
  2404.      life easier for CP/M folks who are used to saying "ERA", and PCDOS
  2405.      folks who are used to saying "DEL" or whatever. 
  2406.  
  2407.      These commands cause PCDOS to reload COMMAND.COM, so see "The PCDOS
  2408.      Environment" section for further detail on that subject. 
  2409.  
  2410.      Example:
  2411.       
  2412.           Z80 A>erase b:*.asm 
  2413.                 erase b:*.asm
  2414.           Z80 A>del *.* 
  2415.                 del *.*
  2416.                Are you sure? y 
  2417.                              y
  2418.           Z80 A>delete c:\backup\foo.* 
  2419.                 delete c:\backup\foo.*
  2420.           Z80 A>era foo.asm
  2421.                 era foo.asm
  2422.  
  2423.  
  2424.  
  2425.  
  2426.  
  2427.  
  2428.  
  2429.  
  2430.  
  2431.  
  2432.  
  2433.  
  2434.  
  2435.  
  2436.  
  2437.  
  2438.  
  2439.  
  2440.  
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  2447.  
  2448.  
  2449.  
  2450.  
  2451.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 39
  2452.      BUILTIN COMMANDS: EMULATED CP/M BUILTIN'S
  2453.  
  2454.  
  2455.       
  2456.      Builtin:  dir <pattern> 
  2457.                dir <pattern> 
  2458.      ________
  2459.                stat <pattern> 
  2460.                stat <pattern>
  2461.       
  2462.      Shows a directory of files matching <pattern>. This invokes the PCDOS
  2463.      "DIR" command, so remember about COMMAND.COM (see "The PCDOS Environ-
  2464.      ment" section). 
  2465.  
  2466.      <pattern> is passed directly to PCDOS. So see the PCDOS manual if you
  2467.      want to know what's legal.
  2468.       
  2469.      The CP/M STAT command (STAT.COM) cannot be emulated, because the
  2470.      first thing that Digital Research's STAT.COM does is invoke a hardware-
  2471.      specific CP/M function that means nothing on the IBM PC, and is there-
  2472.      fore illegal within the Emulator. But the most common function of
  2473.      STAT.COM - displaying filenames and file sizes with "STAT *.*" or
  2474.      whatever - can be done with PCDOS's "DIR" command. So STAT and DIR have
  2475.      been made to do the same thing. If you're used to typing "STAT *.*" in
  2476.      CP/M, then you'll be able to do the same thing under the Emulator. 
  2477.  
  2478.      Example (from an actual session):
  2479.  
  2480.           Z80 A>stat b:*.* 
  2481.                 stat b:*.*
  2482.       
  2483.       
  2484.                 Volume in drive B has no label 
  2485.                 Directory of  B:\ 
  2486.       
  2487.                WORDSTAR     <DIR>     11-02-85   4:19a 
  2488.                     1 File(s)     89088 bytes free 
  2489.       
  2490.           Z80 A>dir b:\wordstar\ws*.* 
  2491.                 dir b:\wordstar\ws*.*
  2492.       
  2493.       
  2494.                 Volume in drive B has no label 
  2495.                 Directory of  B:\wordstar 
  2496.       
  2497.                WSMSGS   OVR   27904  11-06-85   6:27p 
  2498.                WSOVLY1  OVR   34048  11-06-85   6:30p 
  2499.                WSU      COM   15872  11-06-85   6:32p 
  2500.                WS       COM   15872  11-06-85   6:37p 
  2501.                     4 File(s)     89088 bytes free 
  2502.       
  2503.           Z80 A>b: 
  2504.                 b:
  2505.       
  2506.           Z80 B>dir 
  2507.                 dir
  2508.       
  2509.       
  2510.  
  2511. COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  2512.  
  2513.  
  2514.  
  2515.  
  2516.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 40
  2517.      BUILTIN COMMANDS: EMULATED CP/M BUILTIN'S
  2518.  
  2519.  
  2520.                 Volume in drive B has no label 
  2521.                 Directory of  B:\ 
  2522.       
  2523.                WORDSTAR     <DIR>     11-02-85   4:19a 
  2524.                     1 File(s)     89088 bytes free 
  2525.       
  2526.           Z80 B>stat a:\*.exe 
  2527.                 stat a:\*.exe
  2528.       
  2529.       
  2530.                 Volume in drive A has no label 
  2531.                 Directory of  A:\ 
  2532.       
  2533.                Z80MU    EXE   94976  11-18-85   3:31p 
  2534.                     1 File(s)    142336 bytes free 
  2535.  
  2536.  
  2537.  
  2538.  
  2539.  
  2540.  
  2541.  
  2542.  
  2543.  
  2544.  
  2545.  
  2546.  
  2547.  
  2548.  
  2549.  
  2550.  
  2551.  
  2552.  
  2553.  
  2554.  
  2555.  
  2556.  
  2557.  
  2558.  
  2559.  
  2560.  
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  2571.  
  2572.  
  2573.  
  2574.  
  2575.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 41
  2576.      BUILTIN COMMANDS: EMULATED CP/M BUILTIN'S
  2577.  
  2578.  
  2579.  
  2580.      Builtin:  type <filename.typ> 
  2581.                type <filename.typ> 
  2582.      ________
  2583.                ty <filename.typ> 
  2584.                ty <filename.typ>
  2585.       
  2586.      This command is the equivalent of the CP/M "TYPE" command. The specified
  2587.      file is displayed on the standard output (normally the screen). 
  2588.       
  2589.      The display may be paused with either the CP/M convention of ^S/^Q or
  2590.      the PCDOS convention of CTRL-NUMLOCK. It may be aborted with ^C or
  2591.      CTRL-BREAK. 
  2592.  
  2593.      This command causes PCDOS to reload COMMAND.COM, so see "The PCDOS
  2594.      Environment" section for further detail on that subject. 
  2595.       
  2596.      Example: 
  2597.  
  2598.           Z80 A>ty b:foo.asm 
  2599.                 ty b:foo.asm
  2600.           Z80 A>type \source\backup\foo.doc 
  2601.                 type \source\backup\foo.doc
  2602.           Z80 A>ty ctest.err 
  2603.                 ty ctest.err
  2604.  
  2605.  
  2606.  
  2607.  
  2608.  
  2609.  
  2610.  
  2611.  
  2612.  
  2613.  
  2614.  
  2615.  
  2616.  
  2617.  
  2618.  
  2619.  
  2620.  
  2621.  
  2622.  
  2623.  
  2624.  
  2625.  
  2626.  
  2627.  
  2628.  
  2629.  
  2630.  
  2631.  
  2632.  
  2633.  
  2634.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  2635.  
  2636.  
  2637.  
  2638.  
  2639.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 42
  2640.      BUILTIN COMMANDS: SIMILAR TO CP/M'S
  2641.  
  2642.  
  2643.  
  2644.      Builtin:  rename <oldpath> <newpath> 
  2645.                rename <oldpath> <newpath> 
  2646.      ________
  2647.                ren <oldpath> <newpath> 
  2648.                ren <oldpath> <newpath>
  2649.       
  2650.      Renames the file specified by <oldpath> to the name given by <newpath>.
  2651.  
  2652.           NOTE: This is not the same syntax used by the CP/M equivalent,
  2653.                         not
  2654.           which is "REN <newname>=<oldname>". 
  2655.       
  2656.      This command causes PCDOS to reload COMMAND.COM, so see "The PCDOS
  2657.      Environment" section for further detail on that subject. 
  2658.       
  2659.      This command invokes the PCDOS "RENAME" command. See the PCDOS manual
  2660.      for details.
  2661.  
  2662.      Example: 
  2663.  
  2664.           Z80 A>rename dbase.exe dbase.xxx 
  2665.                 rename dbase.exe dbase.xxx
  2666.  
  2667.  
  2668.  
  2669.  
  2670.  
  2671.  
  2672.  
  2673.  
  2674.  
  2675.  
  2676.  
  2677.  
  2678.  
  2679.  
  2680.  
  2681.  
  2682.  
  2683.  
  2684.  
  2685.  
  2686.  
  2687.  
  2688.  
  2689.  
  2690.  
  2691.  
  2692.  
  2693.  
  2694.  
  2695.  
  2696.  
  2697.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  2698.  
  2699.  
  2700.  
  2701.  
  2702.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 43
  2703.      BUILTIN COMMANDS: SIMILAR TO CP/M'S
  2704.  
  2705.  
  2706.  
  2707.      Builtin:  save n <filename.typ> 
  2708.                save n <filename.typ> 
  2709.      ________
  2710.                sa n <filename.typ> 
  2711.                sa n <filename.typ>
  2712.       
  2713.      Saves n 256-byte pages of CP/M memory (starting at address 0100h) to the
  2714.      specified file. The data written to the file is a simple memory image.
  2715.      No translation is done, even if a .HEX extension is given in the
  2716.      filename. If you want to write a true Intel HEX file, use the write
  2717.                                                                    write
  2718.      Builtin. 
  2719.       
  2720.           NOTE: This is close to the CP/M equivalent, except that the
  2721.           default radix for n is HEX, not decimal as with CP/M. 
  2722.       
  2723.      Example (from an actual session):
  2724.  
  2725.           Z80 A>save 3 820init2.com 
  2726.                 save 3 820init2.com
  2727.       
  2728.                Writing 3 pages (768 bytes) to file '820INIT2.COM' 
  2729.       
  2730.           Z80 A>save 0 continue.com 
  2731.                 save 0 continue.com
  2732.       
  2733.                Writing 0 pages (0 bytes) to file 'CONTINUE.COM' 
  2734.  
  2735.  
  2736.  
  2737.  
  2738.  
  2739.  
  2740.  
  2741.  
  2742.  
  2743.  
  2744.  
  2745.  
  2746.  
  2747.  
  2748.  
  2749.  
  2750.  
  2751.  
  2752.  
  2753.  
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  2762.  
  2763.  
  2764.  
  2765.  
  2766.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 44
  2767.      BUILTIN COMMANDS: SIMILAR TO CP/M'S
  2768.  
  2769.  
  2770.  
  2771.      Builtin:  copy <from_pattern> <to_path> 
  2772.                copy <from_pattern> <to_path> 
  2773.      ________
  2774.                co <from_pattern> <to_path> 
  2775.                co <from_pattern> <to_path>
  2776.       
  2777.      Copies the file(s) specified by <from_pattern> to the file or directory
  2778.      specified by <to_path>. 
  2779.       
  2780.      This command invokes the PCDOS "COPY" command, so see the PCDOS manual
  2781.      for details as to what's legal. 
  2782.       
  2783.      It also causes PCDOS to reload COMMAND.COM, so see "The PCDOS Environ-
  2784.      ment" section for further detail on that subject. 
  2785.       
  2786.      This command is roughly equivalent to CP/M's "PIP <outfile>=<infile>".
  2787.      You have the additional power of PCDOS's directory and device name
  2788.      support, however. 
  2789.       
  2790.      Example:
  2791.  
  2792.           Z80 A>copy *.* B: 
  2793.                 copy *.* B:
  2794.           Z80 A>co b:*.asm 
  2795.                 co b:*.asm
  2796.           Z80 A>copy \bin\*.* c:\backup 
  2797.                 copy \bin\*.* c:\backup
  2798.           Z80 A>copy *.asm combined.bak 
  2799.                 copy *.asm combined.bak
  2800.           Z80 A>co *.asm *.bak 
  2801.                 co *.asm *.bak
  2802.           Z80 A>co foo.asm lpt1: 
  2803.                 co foo.asm lpt1:
  2804.           Z80 A>co con autoexec.bat
  2805.                 co con autoexec.bat
  2806.  
  2807.  
  2808.  
  2809.  
  2810.  
  2811.  
  2812.  
  2813.  
  2814.  
  2815.  
  2816.  
  2817.  
  2818.  
  2819.  
  2820.  
  2821.  
  2822.  
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828.  
  2829.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  2830.  
  2831.  
  2832.  
  2833.  
  2834.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 45
  2835.      BUILTIN COMMANDS: GENERAL
  2836.  
  2837.  
  2838.  
  2839.      Builtin:  help [command] 
  2840.                help [command]
  2841.      ________
  2842.                ? [command] 
  2843.                ? [command]
  2844.       
  2845.      Displays a brief description of the requested Builtin Command. 
  2846.       
  2847.      If no command name follows the "help" command, then a rather lengthy
  2848.                                      help
  2849.      explanation of all commands is displayed. If you press the SPACE bar,
  2850.      this long listing will be interrupted at the next logical break.
  2851.  
  2852.      The listing can be paused with ^S/^Q, or CTRL-NumLock. You can turn
  2853.      printer copying on before the listing starts (which is recommended) with
  2854.      ^P or CTRL-PrtSc.
  2855.       
  2856.      Example:
  2857.       
  2858.           Z80 A>help xreg 
  2859.                 help xreg
  2860.           Z80 A>? list 
  2861.                 ? list
  2862.           Z80 A>? 
  2863.                 ?
  2864.           Z80 A>help ?
  2865.                 help ?
  2866.           Z80 A>help b:
  2867.                 help b:
  2868.           Z80 A>help !
  2869.                 help !
  2870.  
  2871.  
  2872.  
  2873.  
  2874.  
  2875.  
  2876.  
  2877.  
  2878.  
  2879.  
  2880.  
  2881.  
  2882.  
  2883.  
  2884.  
  2885.  
  2886.  
  2887.  
  2888.  
  2889.  
  2890.  
  2891.  
  2892.  
  2893.  
  2894.  
  2895.  
  2896.  
  2897.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  2898.  
  2899.  
  2900.  
  2901.  
  2902.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 46
  2903.      BUILTIN COMMANDS: GENERAL
  2904.  
  2905.  
  2906.       
  2907.      Builtin:  illop [fault | nop] 
  2908.                illop [fault | nop] 
  2909.      ________
  2910.                i [fault | nop] 
  2911.                i [fault | nop]
  2912.       
  2913.      Specifies how the Emulator is to handle illegal Z80 opcodes. 
  2914.       
  2915.      If "illop fault" is entered, then an illegal Z80 opcode will cause a Z80
  2916.          illop fault
  2917.      fault, meaning that the Emulator will stop executing the Z80 program and
  2918.      will display an error message to the effect that an illegal opcode was
  2919.      encountered at such-and-such and address. 
  2920.  
  2921.      If "illop nop" is entered, then an illegal Z80 opcode will simply be
  2922.          illop nop
  2923.      ignored. This is closer to true Z80 operation. Execution will continue
  2924.      with the next Z80 instruction after the illegal opcode. 
  2925.       
  2926.      If only "illop" is entered, then the Emulator simply reports how it is
  2927.               illop
  2928.      currently handling illegal opcodes. 
  2929.  
  2930.      Example (from an actual session):
  2931.       
  2932.           Z80 A>i 
  2933.                 i
  2934.       
  2935.                Illegal opcodes will act as NOP's 
  2936.  
  2937.           Z80 A>illop fault 
  2938.                 illop fault
  2939.       
  2940.                Illegal opcodes will FAULT 
  2941.  
  2942.           Z80 A>illop nop 
  2943.                 illop nop
  2944.       
  2945.                Illegal opcodes will act as NOP's 
  2946.  
  2947.  
  2948.  
  2949.  
  2950.  
  2951.  
  2952.  
  2953.  
  2954.  
  2955.  
  2956.  
  2957.  
  2958.  
  2959.  
  2960.  
  2961.  
  2962.  
  2963.  
  2964.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  2965.  
  2966.  
  2967.  
  2968.  
  2969.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 47
  2970.      BUILTIN COMMANDS: GENERAL
  2971.  
  2972.  
  2973.  
  2974.      Builtin:  exit 
  2975.                exit 
  2976.      ________
  2977.                e 
  2978.                e
  2979.       
  2980.      Exits the Emulator, and returns to PCDOS. 
  2981.       
  2982.      Due to certain limitations within PCDOS, you should not remove any
  2983.      floppy disks that are being used until you have exited the Emulator via
  2984.      this command, unless you know that the Z80 programs which you have run
  2985.                               know
  2986.      have truly closed any files that have been written to. 
  2987.  
  2988.      We have used the Emulator extensively, and have frequently changed
  2989.      floppies while within the Emulator. We have never experienced corrupted
  2990.      floppy data. But then, we use only "safe" CP/M software like ASM.COM,
  2991.      M80.COM, L80.COM, and so on. Such programs are very good about closing
  2992.      files when they exit. 
  2993.       
  2994.      This warning is included not because it has ever happened to us, but
  2995.      because we wrote the code, and we know about certain "windows" within
  2996.      which a faulting CP/M program could conceivably confuse PCDOS into
  2997.      writing one floppy's data to another floppy, destroying the second
  2998.      floppy's file data and perhaps even its FAT (File Allocation Table). 
  2999.       
  3000.      Example: 
  3001.           Z80 A>exit 
  3002.                 exit
  3003.           A> 
  3004.  
  3005.  
  3006.  
  3007.  
  3008.  
  3009.  
  3010.  
  3011.  
  3012.  
  3013.  
  3014.  
  3015.  
  3016.  
  3017.  
  3018.  
  3019.  
  3020.  
  3021.  
  3022.  
  3023.  
  3024.  
  3025.  
  3026.  
  3027.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  3028.  
  3029.  
  3030.  
  3031.  
  3032.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 48
  3033.      BUILTIN COMMANDS: GENERAL
  3034.  
  3035.  
  3036.  
  3037.      Builtin:  speed? 
  3038.                speed? 
  3039.      ________
  3040.                howfast? 
  3041.                howfast?
  3042.       
  3043.      Calculates the effective speed of the imaginary Z80 that exists within
  3044.      the Emulator. 
  3045.  
  3046.      A sample Z80 program is loaded into the CP/M segment. It is run, and its
  3047.      execution is timed. This program takes up to half a minute to run on a
  3048.      simple IBM PC with an 8088, and correspondingly less time on faster
  3049.      machines (i.e. - a PC with a NEC V20 chip, an IBM PC/AT, etc). 
  3050.       
  3051.      The effective clock speed is displayed at the end of the test. 
  3052.       
  3053.      The reported speed should be taken with a grain of salt. What it means
  3054.      is that if you had a real Z80 running the exact instruction mix found in
  3055.      the test program, then that real Z80 would have to run at the reported
  3056.      clock speed in order to perform as fast (or slow) as the Emulator's
  3057.      imaginary Z80. 
  3058.  
  3059.      For example, assume that the reported effective clock is 250,000 Hz.
  3060.      This means that the imaginary Z80 in the Emulator is running the test
  3061.      program at one fourth the speed of a 1 MegaHertz Z80 (as found on a
  3062.      Microsoft SoftCard in an Apple, for example), one eighth the speed of a
  3063.      2 MegaHertz Z80, etc. 
  3064.       
  3065.      Does this mean that your CP/M programs run under the Emulator will run
  3066.      at one fourth the speed of an Apple with a SoftCard? Not necessarily.
  3067.      The reported speed is for CPU-bound (no I/O) operation, of the exact mix
  3068.      of instructions found in the test program. Real CP/M programs tend to
  3069.      have a mix of CPU and I/O operations. I/O operations to disk are handled
  3070.      as fast as the IBM PC can do them. They aren't emulated, they are done.
  3071.                                                                        done
  3072.      And CP/M programs whose CPU-bound operations involve a lot of register-
  3073.      to-register operations will be emulated faster than those requiring a
  3074.      lot of memory accesses. 
  3075.       
  3076.      It's a complicated relationship. Our experience has been that an
  3077.      assembly (using ASM.COM) runs about 1/5th the speed under the Emulator
  3078.      on a stock, floppy-based IBM PC than it does on an Apple with a SoftCard
  3079.      and 1 MegaHertz Z80. The addition of a NEC V20 processor to the IBM PC
  3080.      improves performance. So does using a hard disk instead of floppies. And
  3081.      moving the Emulator to an IBM PC/AT brings emulated performance close to
  3082.      that of a 1 MegaHertz Z80. 
  3083.  
  3084.  
  3085.  
  3086.  
  3087.  
  3088.  
  3089.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  3090.  
  3091.  
  3092.  
  3093.  
  3094.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 49
  3095.      BUILTIN COMMANDS: GENERAL
  3096.  
  3097.  
  3098.           NOTE: This command causes a Cold Boot of the CP/M segment.
  3099.           This destroys any CP/M program that you may have had in
  3100.           memory. 
  3101.       
  3102.      Example (from an actual session):
  3103.       
  3104.           Z80 A>speed? 
  3105.                 speed?
  3106.       
  3107.                *** CP/M Segment COLDBOOTED *** 
  3108.       
  3109.                Beginning Z80 timing test. Please wait... 
  3110.       
  3111.                Effective Z80 clock speed is 248101 Hz 
  3112.       
  3113.                *** CP/M Segment COLDBOOTED *** 
  3114.  
  3115.  
  3116.  
  3117.  
  3118.  
  3119.  
  3120.  
  3121.  
  3122.  
  3123.  
  3124.  
  3125.  
  3126.  
  3127.  
  3128.  
  3129.  
  3130.  
  3131.  
  3132.  
  3133.  
  3134.  
  3135.  
  3136.  
  3137.  
  3138.  
  3139.  
  3140.  
  3141.  
  3142.  
  3143.  
  3144.  
  3145.  
  3146.  
  3147.  
  3148.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  3149.  
  3150.  
  3151.  
  3152.  
  3153.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 50
  3154.      BUILTIN COMMANDS: DEBUG SUPPORT
  3155.  
  3156.  
  3157.       
  3158.      Builtin:  btrace [ SOME | ALL ] 
  3159.                btrace [ SOME | ALL ] 
  3160.      ________
  3161.                bt [ SOME | ALL ] 
  3162.                bt [ SOME | ALL ]
  3163.       
  3164.      Displays the current BDOS Trace Table (if no arguments are present), or
  3165.      controls the BDOS functions that will be traced. 
  3166.  
  3167.      As a CP/M program is run, the various BDOS calls that it makes are
  3168.      traced. This command displays the trace table as it has been left by the
  3169.      last CP/M program run. 
  3170.       
  3171.      Items reported include: 
  3172.       
  3173.           1) The trace table sequence number. 
  3174.           2) The Program Counter of the CALL to the BDOS. 
  3175.           3) The contents of the Z80 DE register at the entry to the BDOS
  3176.                handler. 
  3177.           4) The DMA address in effect at the instant of this BDOS call. 
  3178.           5) The BDOS function # (as passed in the Z80 C-reg) and a text
  3179.                description of the function being performed.
  3180.       
  3181.      The BDOS Trace Table is cleared by a COLD BOOT, by the load of a new
  3182.      CP/M program, and at various other times when it seems logical to clear
  3183.      it out. 
  3184.  
  3185.      If an argument (either "SOME" or "ALL") is present, then the trace
  3186.                              SOME      ALL
  3187.      table is not displayed. Instead, the Emulator adjusts (according to the
  3188.      argument) the way that future traces will be made:
  3189.  
  3190.           If "SOME" is specified, then the Console Status, Console
  3191.               SOME
  3192.           Output, Direct Console I/O, and List Output BDOS functions
  3193.           will not be traced. This can help to keep the BDOS Trace Table
  3194.           from filling up with unimportant entries.
  3195.  
  3196.           If "ALL" is specified, then even these console character BDOS
  3197.               ALL
  3198.           functions will be traced.
  3199.  
  3200.  
  3201.  
  3202.  
  3203.  
  3204.  
  3205.  
  3206.  
  3207.  
  3208.  
  3209.  
  3210.  
  3211.  
  3212.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  3213.  
  3214.  
  3215.  
  3216.  
  3217.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 51
  3218.      BUILTIN COMMANDS: DEBUG SUPPORT
  3219.  
  3220.  
  3221.      Example (from an actual run of DUMP.COM): 
  3222.  
  3223.           Z80 A>btrace all 
  3224.                 btrace all
  3225.       
  3226.           Future BDOS traces will include console character functions
  3227.  
  3228.           Z80 A>a:dump dump.com
  3229.                 a:dump dump.com
  3230.  
  3231.           0000 21 00 00 39 22 15 02 31 57 02 CD C1 01 FE FF C2 
  3232.           0010 1B 01 11 F3 01 CD 9C 01 C3 51 01 3E 80 32 13 02 
  3233.           0020 21 00 00 E5 CD A2 01 E1 DA 51 01 47 7D E6 0F C2 
  3234.           ...
  3235.           ...  (Much of DUMP.COM output deleted for brevity)
  3236.           ...
  3237.           0150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  3238.           0160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  3239.           0170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  3240.       
  3241.           Z80 A>bt 
  3242.                 bt
  3243.       
  3244.           BDOS TRACE TABLE: 
  3245.           SEQ#  Z80PC  Z80DE Z80DMA FUNCTION 
  3246.           ----- -----  ----- ------ ---------------- 
  3247.             006 016BH  0030H  0080H 02H Console Output from E-reg = 0 
  3248.             007 016BH  0030H  0080H 02H Console Output from E-reg = 0 
  3249.             008 016BH  0020H  0080H 02H Console Output from E-reg = 
  3250.  
  3251.           ...
  3252.           ...  (Many entries deleted for brevity)
  3253.           ...
  3254.  
  3255.            049 016BH  0030H  0080H 02H Console Output from E-reg = 0 
  3256.            050 01D6H  005CH  0080H 14H Read File (Sequential), FCB at (DE)
  3257.            051 016BH  000DH  0080H 02H Console Output from E-reg = ^M
  3258.            052 016BH  000AH  0080H 02H Console Output from E-reg = ^J
  3259.            244 016BH  0020H  0080H 02H Console Output from E-reg = 
  3260.            245 016BH  0030H  0080H 02H Console Output from E-reg = 0 
  3261.            246 016BH  0030H  0080H 02H Console Output from E-reg = 0 
  3262.            247 016BH  0020H  0080H 02H Console Output from E-reg = 
  3263.            248 016BH  0030H  0080H 02H Console Output from E-reg = 0 
  3264.            249 016BH  0030H  0080H 02H Console Output from E-reg = 0 
  3265.            250 016BH  000DH  0080H 02H Console Output from E-reg = ^M
  3266.            251 016BH  000AH  0080H 02H Console Output from E-reg = ^J
  3267.            252 015EH  0070H  0080H 0BH Get Console Status to A-reg 
  3268.            253 016BH  0030H  0080H 02H Console Output from E-reg = 0 
  3269.            254 016BH  0031H  0080H 02H Console Output from E-reg = 1 
  3270.            255 016BH  0037H  0080H 02H Console Output from E-reg = 7 
  3271.            001 016BH  0030H  0080H 02H Console Output from E-reg = 0 
  3272.  
  3273.  
  3274.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  3275.  
  3276.  
  3277.  
  3278.  
  3279.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 52
  3280.      BUILTIN COMMANDS: DEBUG SUPPORT
  3281.  
  3282.  
  3283.            002 016BH  0020H  0080H 02H Console Output from E-reg = 
  3284.            003 016BH  0030H  0080H 02H Console Output from E-reg = 0 
  3285.            004 016BH  0030H  0080H 02H Console Output from E-reg = 0 
  3286.            005 016BH  0020H  0080H 02H Console Output from E-reg = 
  3287.           -- END OF BDOS TRACE TABLE -- 
  3288.  
  3289.  
  3290.  
  3291.  
  3292.  
  3293.  
  3294.  
  3295.  
  3296.  
  3297.  
  3298.  
  3299.  
  3300.  
  3301.  
  3302.  
  3303.  
  3304.  
  3305.  
  3306.  
  3307.  
  3308.  
  3309.  
  3310.  
  3311.  
  3312.  
  3313.  
  3314.  
  3315.  
  3316.  
  3317.  
  3318.  
  3319.  
  3320.  
  3321.  
  3322.  
  3323.  
  3324.  
  3325.  
  3326.  
  3327.  
  3328.  
  3329.  
  3330.  
  3331.  
  3332.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  3333.  
  3334.  
  3335.  
  3336.  
  3337.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 53
  3338.      BUILTIN COMMANDS: DEBUG SUPPORT
  3339.  
  3340.  
  3341.  
  3342.      Builtin:  break 
  3343.                break 
  3344.      ________
  3345.                break clear [n [n...]] 
  3346.                break clear [n [n...]] 
  3347.                break set n [n...] 
  3348.                break set n [n...] 
  3349.                b 
  3350.                b 
  3351.                b clear [n [n...]] 
  3352.                b clear [n [n...]] 
  3353.                b set n [n...] 
  3354.                b set n [n...]
  3355.       
  3356.      Manipulates the Breakpoint Table, which contains up to 50 Z80 addresses
  3357.      at which execution of the Z80 is to be halted, and control returned to
  3358.      the Emulator's command prompt. 
  3359.       
  3360.      Breakpoints are typically used in conjunction with the "read" and "go"
  3361.                                                              read       go
  3362.      commands, and various other debug commands. 
  3363.       
  3364.      The Breakpoint Table is cleared when a new CP/M program is loaded, when
  3365.      the CP/M Segment is Cold Booted, and at various other times when it
  3366.      seems logical to clear it. 
  3367.       
  3368.      If only "break" is entered, then the current Breakpoint Table addresses
  3369.               break
  3370.      are displayed. 
  3371.       
  3372.      If "break set" is entered followed by one or more Z80 addresses, then
  3373.          break set
  3374.      the addresses following the command are added to the Table. 
  3375.       
  3376.      If only "break clear" is entered, then all active breakpoint addresses
  3377.               break clear
  3378.      are removed. No execution breakpoints will occur. 
  3379.       
  3380.      If "break clear" is entered followed by one or more Z80 addresses, then
  3381.          break clear
  3382.      only the specified addresses are removed from the Breakpoint Table. 
  3383.       
  3384.           NOTE: When a breakpoint is encountered during execution of the
  3385.           Z80 code, that breakpoint's address is automatically cleared
  3386.           from the table.
  3387.  
  3388.  
  3389.  
  3390.  
  3391.  
  3392.  
  3393.  
  3394.  
  3395.  
  3396.  
  3397.  
  3398.  
  3399.  
  3400.  
  3401.  
  3402.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  3403.  
  3404.  
  3405.  
  3406.  
  3407.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 54
  3408.      BUILTIN COMMANDS: DEBUG SUPPORT
  3409.  
  3410.  
  3411.      Example:
  3412.  
  3413.           Z80 A>break clear 
  3414.                 break clear
  3415.       
  3416.                0 Breakpoints cleared 
  3417.  
  3418.           Z80 A>b set startup startup+3 14f 210 221 
  3419.                 b set startup startup+3 14f 210 221
  3420.       
  3421.                5 Breakpoints set - 5 now in table 
  3422.  
  3423.           Z80 A>b clear 221 
  3424.                 b clear 221
  3425.       
  3426.                1 Breakpoints cleared, 4 left 
  3427.  
  3428.           Z80 A>b 
  3429.                 b
  3430.       
  3431.                Current Breakpoints: 
  3432.                0100H  0103H  014FH  0210H 
  3433.                4 Breakpoints currently set 
  3434.  
  3435.           Z80 A>b clear 210 startup 
  3436.                 b clear 210 startup
  3437.       
  3438.                2 Breakpoints cleared, 2 left 
  3439.  
  3440.           Z80 A>b 
  3441.                 b
  3442.       
  3443.                Current Breakpoints: 
  3444.                0103H  014FH 
  3445.                2 Breakpoints currently set 
  3446.  
  3447.           Z80 A>b clear 
  3448.                 b clear
  3449.       
  3450.                2 Breakpoints cleared 
  3451.  
  3452.           Z80 A>b 
  3453.                 b
  3454.       
  3455.                Current Breakpoints: 
  3456.                0 Breakpoints currently set 
  3457.       
  3458.  
  3459.  
  3460.  
  3461.  
  3462.  
  3463.  
  3464.  
  3465.  
  3466.  
  3467.  
  3468. COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  3469.  
  3470.  
  3471.  
  3472.  
  3473.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 55
  3474.      BUILTIN COMMANDS: DEBUG SUPPORT
  3475.  
  3476.  
  3477.       
  3478.      Builtin:  dump [n1 [n2]] 
  3479.                dump [n1 [n2]] 
  3480.      ________
  3481.                d [n1 [n2]] 
  3482.                d [n1 [n2]]
  3483.       
  3484.      Dumps Z80 (CP/M) memory in HEX and ASCII.
  3485.       
  3486.      If n1 is given, then the first address dumped is n1. If no arguments are
  3487.      present, then the first address is the one following the last one
  3488.      done by a previous dump command. 
  3489.                         dump
  3490.  
  3491.      If n2 is given, then the dump continues through Z80 (CP/M) address n2.
  3492.      If n2 is not given, then n2 is assumed to be 255 bytes beyond the
  3493.      starting address. 
  3494.       
  3495.      A lengthy dump may be interrupted by pressing the SPACE bar. 
  3496.       
  3497.      Example (from an actual session):
  3498.       
  3499.           Z80 A>dump 100 
  3500.                 dump 100
  3501.       
  3502.      ADDR  00 01 02 03 04 05 06 07  08 09 0A 0B 0C 0D 0E 0F 01234567 89ABCDEF
  3503.      ----  -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- -- -------- --------
  3504.      0100: 21 00 00 39 22 15 02 31  57 02 CD C1 01 FE FF C2 !..9"..1 W.MA.~.B
  3505.      0110: 1B 01 11 F3 01 CD 9C 01  C3 51 01 3E 80 32 13 02 ...s.M.. CQ.>.2..
  3506.      0120: 21 00 00 E5 CD A2 01 E1  DA 51 01 47 7D E6 0F C2 !..eM".a ZQ.G}f.B
  3507.      0130: 44 01 CD 72 01 CD 59 01  0F DA 51 01 7C CD 8F 01 D.Mr.MY. .ZQ.|M..
  3508.      0140: 7D CD 8F 01 23 3E 20 CD  65 01 78 CD 8F 01 C3 23 }M..#> M e.xM..C#
  3509.      0150: 01 CD 72 01 2A 15 02 F9  C9 E5 D5 C5 0E 0B CD 05 .Mr.*..y IeUE..M.
  3510.      0160: 00 C1 D1 E1 C9 E5 D5 C5  0E 02 5F CD 05 00 C1 D1 .AQaIeUE .._M..AQ
  3511.      0170: E1 C9 3E 0D CD 65 01 3E  0A CD 65 01 C9 E6 0F FE aI>.Me.> .Me.If.~
  3512.      0180: 0A D2 89 01 C6 30 C3 8B  01 C6 37 CD 65 01 C9 F5 .R..F0C. .F7Me.Iu
  3513.      0190: 0F 0F 0F 0F CD 7D 01 F1  CD 7D 01 C9 0E 09 CD 05 ....M}.q M}.I..M.
  3514.      01A0: 00 C9 3A 13 02 FE 80 C2  B3 01 CD CE 01 B7 CA B3 .I:..~.B 3.MN.7J3
  3515.      01B0: 01 37 C9 5F 16 00 3C 32  13 02 21 80 00 19 7E B7 .7I_..<2 ..!...~7
  3516.      01C0: C9 AF 32 7C 00 11 5C 00  0E 0F CD 05 00 C9 E5 D5 I/2|..\. ..M..IeU
  3517.      01D0: C5 11 5C 00 0E 14 CD 05  00 C1 D1 E1 C9 46 49 4C E.\...M. .AQaIFIL
  3518.      01E0: 45 20 44 55 4D 50 20 56  45 52 53 49 4F 4E 20 31 E DUMP V ERSION 1
  3519.      01F0: 2E 34 24 0D 0A 4E 4F 20  49 4E 50 55 54 20 46 49 .4$..NO  INPUT FI
  3520.  
  3521.           Z80 A>d primary_fcb secondary_fcb+.15 
  3522.                 d primary_fcb secondary_fcb+.15
  3523.       
  3524.      ADDR  00 01 02 03 04 05 06 07  08 09 0A 0B 0C 0D 0E 0F 01234567 89ABCDEF
  3525.      ----  -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- -- -------- --------
  3526.      0050:                                      01 44 55 4D              .DUM
  3527.      0060: 50 20 20 20 20 43 4F 4D  00 00 80 00 80 01 00 00 P    COM ........
  3528.      0070: 6D 0B 1B BF 40 F3 00 00  00 F3 00 00             m..?@s.. .s.. 
  3529.  
  3530.  
  3531.  
  3532.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  3533.  
  3534.  
  3535.  
  3536.  
  3537.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 56
  3538.      BUILTIN COMMANDS: DEBUG SUPPORT
  3539.  
  3540.  
  3541.  
  3542.      Builtin:  go [n] 
  3543.                go [n] 
  3544.      ________
  3545.                g [n] 
  3546.                g [n]
  3547.       
  3548.       
  3549.      Begins execution of Z80 code at address n. If n is not specified, then
  3550.      the starting address defaults to the current Z80 Program Counter (PC).
  3551.       
  3552.      This is the usual way to run a program that has been read from disk. It
  3553.                                                           read
  3554.      is also used to continue execution when the Z80 has been stopped via a
  3555.      breakpoint, or by the user pressing the BREAK key. 
  3556.       
  3557.           NOTE: A Z80 command (.COM) file that is invoked by typing
  3558.           its name is automatically run. It does not require this
  3559.           command in order to be executed. 
  3560.       
  3561.      Example: 
  3562.           Z80 A>go 
  3563.                 go
  3564.           Z80 A>g 100 
  3565.                 g 100
  3566.           Z80 A>g -.768 
  3567.                 g -.768
  3568.           Z80 A>go fixit5-3 
  3569.                 go fixit5-3
  3570.  
  3571.  
  3572.  
  3573.  
  3574.  
  3575.  
  3576.  
  3577.  
  3578.  
  3579.  
  3580.  
  3581.  
  3582.  
  3583.  
  3584.  
  3585.  
  3586.  
  3587.  
  3588.  
  3589.  
  3590.  
  3591.  
  3592.  
  3593.  
  3594.  
  3595.  
  3596.  
  3597.  
  3598.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  3599.  
  3600.  
  3601.  
  3602.  
  3603.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 57
  3604.      BUILTIN COMMANDS: DEBUG SUPPORT
  3605.  
  3606.  
  3607.  
  3608.      Builtin:  find n "text"
  3609.                find n "text"
  3610.      ________
  3611.                f n "text" 
  3612.                f n "text"
  3613.       
  3614.       
  3615.      Searches the CP/M Segment for the binary pattern represented by string
  3616.      "text". The search begins at Z80 address n, which is a numeric value as
  3617.       text
  3618.      described at the start of this section. 
  3619.  
  3620.      The "text" string may (and usually does) include imbedded escape
  3621.           text
  3622.      sequences, as follows:
  3623.  
  3624.  
  3625.                \\             (single "\" char) 
  3626.                \0             (NUL byte) 
  3627.                \b or \B       (Backspace char) 
  3628.                \t or \T       (TAB char) 
  3629.                \n or \N       (LINEFEED char) 
  3630.                \r or \R       (CARRIAGE RETURN char) 
  3631.                \'             (single apostrophe ("'") char) 
  3632.                \"             (single double-quote char ) 
  3633.                \xFF or \XFF   (byte with HEX value of FF) 
  3634.       
  3635.  
  3636.      The CP/M Segment address of each match is displayed as a four-digit HEX
  3637.      value. The search ends with CP/M Segment address 0FFFFh.
  3638.  
  3639.      Example (from an actual session): 
  3640.  
  3641.           Z80 A>patch 8000 "Joan Riff" 
  3642.                 patch 8000 "Joan Riff"
  3643.       
  3644.           Z80 A>find 100 "Joan" 
  3645.                 find 100 "Joan"
  3646.                8000H 
  3647.  
  3648.           Z80 A>f .256 "\xcd\x05\x00" 
  3649.                 f .256 "\xcd\x05\x00"
  3650.                015EH 016BH 019EH 01CAH 01D6H 
  3651.  
  3652.  
  3653.  
  3654.  
  3655.  
  3656.  
  3657.  
  3658.  
  3659.  
  3660.  
  3661.  
  3662.  
  3663.  
  3664.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  3665.  
  3666.  
  3667.  
  3668.  
  3669.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 58
  3670.      BUILTIN COMMANDS: DEBUG SUPPORT
  3671.  
  3672.  
  3673.       
  3674.      Builtin:  patch [n]
  3675.                patch [n]
  3676.      ________
  3677.                patch n "xxxx" 
  3678.                patch n "xxxx" 
  3679.                p [n]
  3680.                p [n]
  3681.                p n "xxxx" 
  3682.                p n "xxxx"
  3683.       
  3684.      Either enters an interactive patch dialog which allows you to change
  3685.      CP/M memory a byte at a time, or else applies string patch "xxxx" to the
  3686.                                                                  xxxx
  3687.      CP/M Segment and does not enter interactive patch mode. 
  3688.       
  3689.      If n (which is a numeric value as defined at the start of this section)
  3690.      is specified, then patching starts at address n. If n is not specified,
  3691.      then patching begins with next patch location (the one above the last
  3692.      location patched). Note that in the patch n "xxxx" format, numeric
  3693.                                          patch n "xxxx"
  3694.      value n is required. 
  3695.       
  3696.      The interactive patch dialog consists of: 
  3697.       
  3698.           1) a prompt which shows the next address to be patched and its
  3699.           current contents.
  3700.  
  3701.           2) user responses. 
  3702.       
  3703.      User responses to the interactive patch prompt are as follows: 
  3704.       
  3705.           ?<return>  A question mark (followed by RETURN) to request a short
  3706.           ?<return>
  3707.                help message showing available responses. 
  3708.       
  3709.           n<return> A standard numeric argument as described at the start
  3710.           n<return>
  3711.                of this section. This is the byte value to be patched into the
  3712.                specified CP/M address. 
  3713.       
  3714.                NOTE: This may also be a 16-bit value. If the high-order
  3715.                byte of the resultant n is non-zero, then this is taken
  3716.                to be a 16-bit value, and fills 2 bytes.
  3717.  
  3718.           "xxx" A string of ASCII text, delimited by double-quote characters.
  3719.           "xxx"
  3720.                The bytes of the string are patched into successive CP/M
  3721.                memory locations. The string may include ASCII escape se-
  3722.                quences as follows: 
  3723.       
  3724.                \\             (single "\" char) 
  3725.                \0             (NUL byte) 
  3726.                \b or \B       (Backspace char) 
  3727.                \t or \T       (TAB char) 
  3728.                \n or \N       (LINEFEED char) 
  3729.                \r or \R       (CARRIAGE RETURN char) 
  3730.                \'             (single apostrophe ("'") char) 
  3731.  
  3732.  
  3733.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  3734.  
  3735.  
  3736.  
  3737.  
  3738.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 59
  3739.      BUILTIN COMMANDS: DEBUG SUPPORT
  3740.  
  3741.  
  3742.                \"             (single double-quote char ) 
  3743.                \xFF or \XFF   (byte with HEX value of FF) 
  3744.       
  3745.       
  3746.           <space><return> to leave the addressed byte unchanged, and move to
  3747.           <space><return>
  3748.                next one. 
  3749.       
  3750.           <return> to exit the interactive patch mode. 
  3751.           <return>
  3752.       
  3753.           ;xxx A comment (everything following the semicolon is ignored).
  3754.           ;xxx
  3755.  
  3756.       
  3757.       
  3758.      Example (from an actual session):
  3759.  
  3760.           Z80 A>patch 400 
  3761.                 patch 400
  3762.       
  3763.       
  3764.           Enter '?' for help with PATCH entries 
  3765.       
  3766.       
  3767.           0400H (00H) = 'R 
  3768.                         'R
  3769.           0401H (00H) = 'I+20 
  3770.                         'I+20
  3771.           0402H (00H) = "ff\0" 
  3772.                         "ff\0"
  3773.           0405H (00H) = 
  3774.       
  3775.           Z80 A>d 400 40f 
  3776.                 d 400 40f
  3777.       
  3778.      ADDR  00 01 02 03 04 05 06 07  08 09 0A 0B 0C 0D 0E 0F 01234567 89ABCDEF
  3779.      ----  -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- -- -------- --------
  3780.      0400: 52 69 66 66 00 00 00 00  00 00 00 00 00 00 00 00 Riff.... ........
  3781.  
  3782.           Z80 A>p primary_fcb "JoanRiff   " 
  3783.                 p primary_fcb "JoanRiff   "
  3784.       
  3785.           Z80 A>d primary_fcb secondary_fcb+.15 
  3786.                 d primary_fcb secondary_fcb+.15
  3787.       
  3788.      ADDR  00 01 02 03 04 05 06 07  08 09 0A 0B 0C 0D 0E 0F 01234567 89ABCDEF
  3789.      ----  -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- -- -------- --------
  3790.      0050:                                      4A 6F 61 6E              Joan
  3791.      0060: 52 69 66 66 20 20 20 4D  00 00 80 00 80 01 00 00 Riff   M ........
  3792.      0070: 6D 0B 1B BF 40 F3 00 00  00 F3 00 00             m..?@s.. .s..  
  3793.  
  3794.  
  3795.  
  3796.  
  3797.  
  3798.  
  3799.  
  3800.  
  3801.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  3802.  
  3803.  
  3804.  
  3805.  
  3806.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 60
  3807.      BUILTIN COMMANDS: DEBUG SUPPORT
  3808.  
  3809.  
  3810.  
  3811.      Builtin:  xreg [rr n] 
  3812.                xreg [rr n] 
  3813.      ________
  3814.                x [rr n] 
  3815.                x [rr n]
  3816.       
  3817.      Sets Z80 register or flag rr to value n. 
  3818.       
  3819.      If no args are present, then the current Z80 register values and flags
  3820.      are displayed. 
  3821.       
  3822.      If args are present, then the register or flag represented by rr is set
  3823.      to the numeric value n (whose format is described at the beginning of
  3824.      this section). 
  3825.       
  3826.           NOTE: The Z80 has a primary and an alternate set of registers
  3827.           and flags. The alternate set is indicated by appending an
  3828.           apostrophe ("'") to the register or flag name. 
  3829.       
  3830.      The register or flag to be set (the rr argument) must be one of the
  3831.      following (in either upper or lowercase): 
  3832.       
  3833.           regs:     A    F    B    C    D    E    H    L 
  3834.                     A'   F'   B'   C'   D'   E'   H'   L' 
  3835.                     AF   BC   DE   HL 
  3836.                     AF'  BC'  DE'  HL' 
  3837.                     IX   IY   SP   PC 
  3838.                     IFF1 IFF2 IMF  I    R 
  3839.       
  3840.           flags:    SF   ZF   HF   P/V  NF   CF 
  3841.                     SF'  ZF'  HF'  P/V' NF'  CF' 
  3842.       
  3843.      Example (from an actual session):
  3844.  
  3845.           Z80 A>xreg pc 0 
  3846.                 xreg pc 0
  3847.       
  3848.           Z80 A>x 
  3849.                 x
  3850.       
  3851.           A F  B C  D E  H L  IX   IY   I  R  SP   PC   IFF1 IFF2 IMF
  3852.           0A01 000F 007F FEFC 0000 0000 00 00 FEFE 0000   0    0   0
  3853.           0000'0000'0000'0000'SF=0 ZF=0 HF=0 P/V=0 NF=0 CF=1 
  3854.           L0000:    C3 03 FF       JP   LFF03 
  3855.       
  3856.           Z80 A>xreg bc ffff 
  3857.                 xreg bc ffff
  3858.       
  3859.  
  3860.  
  3861.  
  3862.  
  3863.  
  3864.  
  3865. COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  3866.  
  3867.  
  3868.  
  3869.  
  3870.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 61
  3871.      BUILTIN COMMANDS: DEBUG SUPPORT
  3872.  
  3873.  
  3874.           Z80 A>x 
  3875.                 x
  3876.       
  3877.           A F  B C  D E  H L  IX   IY   I  R  SP   PC   IFF1 IFF2 IMF
  3878.           0A01 FFFF 007F FEFC 0000 0000 00 00 FEFE 0000   0    0   0
  3879.           0000'0000'0000'0000'SF=0 ZF=0 HF=0 P/V=0 NF=0 CF=1 
  3880.           L0000:    C3 03 FF       JP   LFF03
  3881.       
  3882.           Z80 A>x c' 'A 
  3883.                 x c' 'A
  3884.       
  3885.           Z80 A>xreg de .256 
  3886.                 xreg de .256
  3887.       
  3888.           Z80 A>xreg AF' 55 
  3889.                 xreg AF' 55
  3890.       
  3891.           Z80 A>xreg 
  3892.                 xreg
  3893.       
  3894.           A F  B C  D E  H L  IX   IY   I  R  SP   PC   IFF1 IFF2 IMF
  3895.           0A01 FFFF 0100 FEFC 0000 0000 00 00 FEFE 0000   0    0   0 
  3896.           0055'0041'0000'0000'SF=0 ZF=0 HF=0 P/V=0 NF=0 CF=1 
  3897.           L0000:    C3 03 FF       JP   LFF03 
  3898.       
  3899.  
  3900.  
  3901.  
  3902.  
  3903.  
  3904.  
  3905.  
  3906.  
  3907.  
  3908.  
  3909.  
  3910.  
  3911.  
  3912.  
  3913.  
  3914.  
  3915.  
  3916.  
  3917.  
  3918.  
  3919.  
  3920.  
  3921.  
  3922.  
  3923.  
  3924.  
  3925.  
  3926.  
  3927.  
  3928.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  3929.  
  3930.  
  3931.  
  3932.  
  3933.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 62
  3934.      BUILTIN COMMANDS: DEBUG SUPPORT
  3935.  
  3936.  
  3937.  
  3938.      Builtin:  trace [n] 
  3939.                trace [n] 
  3940.      ________
  3941.                t [n] 
  3942.                t [n]
  3943.       
  3944.      Traces a certain number (specified by the n argument) of Z80 instruction
  3945.      executions, displaying Z80 regs and flags after each instruction's
  3946.      execution. 
  3947.       
  3948.      Execution begins at the current Z80 Program Counter (PC). 
  3949.       
  3950.      If no argument is given, then n defaults to 1. 
  3951.       
  3952.      The n argument is a numeric value as described at the beginning of this
  3953.      section. 
  3954.  
  3955.           NOTE: The PC of each executed instruction is saved in a
  3956.           circular buffer for later interpretation by the "pc?" builtin
  3957.                                                            pc?
  3958.           command(q.v.).
  3959.  
  3960.      Example (from an actual trace of DDT.COM's opening lines): 
  3961.  
  3962.           Z80 A>read ddt.com 
  3963.                 read ddt.com
  3964.       
  3965.           *** Low = 0100H  Next = 1400H 
  3966.           *** Z80 DMA, PC and Stack automatically set for .COM file 
  3967.  
  3968.           Z80 A>t 4 
  3969.                 t 4
  3970.       
  3971.           A F  B C  D E  H L  IX   IY   I  R  SP   PC   IFF1 IFF2 IMF
  3972.           0A01 0FBC 0100 FEFC 0000 0000 00 00 FEFC 0103   0    0   0 
  3973.           0055'0041'0000'0000'SF=0 ZF=0 HF=0 P/V=0 NF=0 CF=1 
  3974.           L0103:    C3 3D 01       JP   L013D 
  3975.       
  3976.           A F  B C  D E  H L  IX   IY   I  R  SP   PC   IFF1 IFF2 IMF
  3977.           0A01 0FBC 0100 FEFC 0000 0000 00 00 FEFC 013D   0    0   0 
  3978.           0055'0041'0000'0000'SF=0 ZF=0 HF=0 P/V=0 NF=0 CF=1 
  3979.           L013D:    31 00 02       LD   SP,L0200 
  3980.       
  3981.           A F  B C  D E  H L  IX   IY   I  R  SP   PC   IFF1 IFF2 IMF
  3982.           0A01 0FBC 0100 FEFC 0000 0000 00 00 0200 0140   0    0   0 
  3983.           0055'0041'0000'0000'SF=0 ZF=0 HF=0 P/V=0 NF=0 CF=1 
  3984.           L0140:    C5             PUSH BC 
  3985.       
  3986.           A F  B C  D E  H L  IX   IY   I  R  SP   PC   IFF1 IFF2 IMF
  3987.           0A01 0FBC 0100 FEFC 0000 0000 00 00 01FE 0141   0    0   0 
  3988.           0055'0041'0000'0000'SF=0 ZF=0 HF=0 P/V=0 NF=0 CF=1 
  3989.           L0141:    C5             PUSH BC 
  3990.  
  3991.  
  3992.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  3993.  
  3994.  
  3995.  
  3996.  
  3997.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 63
  3998.      BUILTIN COMMANDS: DEBUG SUPPORT
  3999.  
  4000.  
  4001.       
  4002.      Builtin:  notrace [n] 
  4003.                notrace [n] 
  4004.      ________
  4005.                n [n] 
  4006.                n [n]
  4007.       
  4008.      Executes a certain number (specified by the n argument) of Z80 instruc-
  4009.      tions, beginning at the current Z80 Program Counter (PC). The Z80
  4010.      registers are not displayed after every instruction, but are displayed
  4011.                    not                                        are
  4012.      after the last instruction. 
  4013.  
  4014.      If no argument is given, then n defaults to 1. 
  4015.       
  4016.      The n argument is a numeric value as described at the beginning of this
  4017.      section. 
  4018.  
  4019.           NOTE: The PC of each executed instruction is saved in a
  4020.           circular buffer for later interpretation by the "pc?" builtin
  4021.                                                            pc?
  4022.           command(q.v.).
  4023.       
  4024.      Example: 
  4025.  
  4026.           Z80 A>n 3 
  4027.                 n 3
  4028.       
  4029.           A F  B C  D E  H L  IX   IY   I  R  SP   PC   IFF1 IFF2 IMF
  4030.           0A01 0F09 0130 FEFC 0000 0000 00 00 01FA FEFE   0    0   0 
  4031.           0055'0041'0000'0000'SF=0 ZF=0 HF=0 P/V=0 NF=0 CF=1 
  4032.           LFEFE:    76             HALT 
  4033.       
  4034.  
  4035.  
  4036.  
  4037.  
  4038.  
  4039.  
  4040.  
  4041.  
  4042.  
  4043.  
  4044.  
  4045.  
  4046.  
  4047.  
  4048.  
  4049.  
  4050.  
  4051.  
  4052.  
  4053.  
  4054.  
  4055.  
  4056.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  4057.  
  4058.  
  4059.  
  4060.  
  4061.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 64
  4062.      BUILTIN COMMANDS: DEBUG SUPPORT
  4063.  
  4064.  
  4065.       
  4066.      Builtin:  pctrace? [FIRST/LAST n [FULL/BRIEF] ] 
  4067.                pctrace? [FIRST/LAST n [FULL/BRIEF] ] 
  4068.      ________
  4069.                pc? [FIRST/LAST n [FULL/BRIEF] ] 
  4070.                pc? [FIRST/LAST n [FULL/BRIEF] ]
  4071.       
  4072.  
  4073.      Displays the Z80 PC's which were saved during the last "trace" or
  4074.                                                              trace
  4075.      "notrace" execution. This is very useful for finding out how the Z80
  4076.       notrace
  4077.      wound up at a particular address, or where it went from there.
  4078.  
  4079.      The display may proceed from the oldest PC toward the newest (FIRST n),
  4080.                                                                    FIRST n
  4081.      or in the reverse direction (LAST n).
  4082.                                   LAST n
  4083.  
  4084.      The display may include only the PC itself (BRIEF) or the complete
  4085.                                                  BRIEF
  4086.      disassembled instruction at each PC (FULL).
  4087.                                           FULL
  4088.  
  4089.      Note that a FULL display assumes that instructions haven't been modified
  4090.                  FULL
  4091.      since they executed. All that is saved in the circular PC queue is the
  4092.      PC itself. For a FULL display, the current contents of whatever is at
  4093.                       FULL
  4094.                                         _______
  4095.      that address is disassembled.
  4096.       
  4097.      The n argument is a numeric value as described at the beginning of this
  4098.      section. 
  4099.  
  4100.      The default is LAST 512 FULL.
  4101.                     LAST 512 FULL
  4102.  
  4103.      Example: 
  4104.  
  4105.           Z80 A>pc? 
  4106.                 pc?
  4107.           Z80 A>pctrace? first 20 full
  4108.                 pctrace? first 20 full
  4109.           Z80 A>pc? last 20 brief
  4110.                 pc? last 20 brief
  4111.                                  
  4112.  
  4113.  
  4114.  
  4115.  
  4116.  
  4117.  
  4118.  
  4119.  
  4120.  
  4121.  
  4122.  
  4123.  
  4124.  
  4125.  
  4126.  
  4127.  
  4128.  
  4129.  
  4130.  
  4131.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  4132.  
  4133.  
  4134.  
  4135.  
  4136.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 65
  4137.      BUILTIN COMMANDS: DEBUG SUPPORT
  4138.  
  4139.  
  4140.       
  4141.      Builtin:  move nlow nhigh ndest 
  4142.                move nlow nhigh ndest 
  4143.      ________
  4144.                m nlow nhigh ndest 
  4145.                m nlow nhigh ndest
  4146.       
  4147.      Moves CP/M memory from one location within the CP/M Segment to another
  4148.      location within the CP/M Segment. 
  4149.       
  4150.      The block of memory to be moved is defined by nlow through nhigh.
  4151.  
  4152.      The new location for the block is defined by ndest. 
  4153.       
  4154.      All three arguments are numeric values as described at the start of this
  4155.      section. 
  4156.       
  4157.           NOTE: The move is done either left-to-right or right-to-left,
  4158.           as needed. So no smearing is possible. 
  4159.       
  4160.      Example (from an actual session): 
  4161.  
  4162.           Z80 A>p primary_fcb "JoanRiff   " 
  4163.                 p primary_fcb "JoanRiff   "
  4164.       
  4165.           Z80 A>d primary_fcb secondary_fcb+.15 
  4166.                 d primary_fcb secondary_fcb+.15
  4167.       
  4168.      ADDR  00 01 02 03 04 05 06 07  08 09 0A 0B 0C 0D 0E 0F 01234567 89ABCDEF
  4169.      ----  -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- -- -------- --------
  4170.      0050:                                      4A 6F 61 6E              Joan
  4171.      0060: 52 69 66 66 20 20 20 4D  00 00 80 00 80 01 00 00 Riff   M ........
  4172.      0070: 6D 0B 1B BF 40 F3 00 00  00 F3 00 00             m..?@s.. .s.. 
  4173.  
  4174.           Z80 A>move primary_fcb secondary_fcb secondary_fcb 
  4175.                 move primary_fcb secondary_fcb secondary_fcb
  4176.       
  4177.           Z80 A>d primary_fcb secondary_fcb+.15 
  4178.                 d primary_fcb secondary_fcb+.15
  4179.       
  4180.      ADDR  00 01 02 03 04 05 06 07  08 09 0A 0B 0C 0D 0E 0F 01234567 89ABCDEF
  4181.      ----  -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- -- -------- --------
  4182.      0050:                                      4A 6F 61 6E              Joan
  4183.      0060: 52 69 66 66 20 20 20 4D  00 00 80 00 4A 6F 61 6E Riff   M ....Joan
  4184.      0070: 52 69 66 66 20 20 20 4D  00 00 80 00             Riff   M .... 
  4185.  
  4186.  
  4187.  
  4188.  
  4189.  
  4190.  
  4191.  
  4192.  
  4193.  
  4194.  
  4195.  
  4196.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  4197.  
  4198.  
  4199.  
  4200.  
  4201.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 66
  4202.      BUILTIN COMMANDS: DEBUG SUPPORT
  4203.  
  4204.  
  4205.       
  4206.      Builtin:  math <expression>
  4207.                math <expression>
  4208.      ________
  4209.                ma <expression>
  4210.                ma <expression>
  4211.       
  4212.      Prints 16-bit evaluated result of expression, which is composed of
  4213.      numeric values (as described at the start of this section) connected
  4214.      with '+' or '-' operators. 
  4215.       
  4216.      The evaluated result is printed in HEX and decimal, as both positive
  4217.      and negative numbers.
  4218.  
  4219.      Example (from an actual session): 
  4220.  
  4221.           Z80 A>math 0-7ff 
  4222.                 math 0-7ff
  4223.       
  4224.                HEX: F801H  -07FFH     Dec: 63489  -02047 
  4225.  
  4226.           Z80 A>ma secondary_fcb-primary_fcb 
  4227.                 ma secondary_fcb-primary_fcb
  4228.       
  4229.                HEX: 0010H  -FFF0H     Dec: 00016  -65520 
  4230.  
  4231.           Z80 A>ma 'A-40+'a 
  4232.                 ma 'A-40+'a
  4233.       
  4234.                HEX: 0062H  -FF9EH     Dec: 00098  -65438 
  4235.  
  4236.  
  4237.  
  4238.  
  4239.  
  4240.  
  4241.  
  4242.  
  4243.  
  4244.  
  4245.  
  4246.  
  4247.  
  4248.  
  4249.  
  4250.  
  4251.  
  4252.  
  4253.  
  4254.  
  4255.  
  4256.  
  4257.  
  4258.  
  4259.  
  4260.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  4261.  
  4262.  
  4263.  
  4264.  
  4265.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 67
  4266.      BUILTIN COMMANDS: CP/M ENVIRONMENT CONTROL
  4267.  
  4268.  
  4269.  
  4270.      Builtin:  args <tail> 
  4271.                args <tail> 
  4272.      ________
  4273.                ar <tail> 
  4274.                ar <tail>
  4275.       
  4276.      Formats default FCB's at 5Ch and 6Ch as well as default DMA at 80h per
  4277.      command tail, exactly as if <tail> had followed a Z80 command (.COM)
  4278.      filename. 
  4279.       
  4280.      This command is most useful for "filling in" a command tail for Z80 code
  4281.      that has been "read" into CP/M memory and which will look for command-
  4282.                     read
  4283.      line arguments. 
  4284.       
  4285.      For instance, you may want to debug Digital Research's DDT.COM program,
  4286.      while telling DDT to load file FOO.COM. You would first load DDT via
  4287.       
  4288.           read 100 ddt.com 
  4289.           read 100 ddt.com
  4290.       
  4291.      You would then fill in DDT's command-line arguments with 
  4292.       
  4293.           args foo.com 
  4294.           args foo.com
  4295.       
  4296.      When executed, DDT would then see "FOO.COM" in both the first FCB at 5Ch
  4297.      and as a raw command tail at 80h. 
  4298.       
  4299.      Example (from an actual session): 
  4300.  
  4301.           Z80 A>args testfile001 file0002 
  4302.                 args testfile001 file0002
  4303.       
  4304.           Z80 A>d primary_fcb secondary_fcb+.15 
  4305.                 d primary_fcb secondary_fcb+.15
  4306.       
  4307.      ADDR  00 01 02 03 04 05 06 07  08 09 0A 0B 0C 0D 0E 0F 01234567 89ABCDEF
  4308.      ----  -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- -- -------- --------
  4309.      0050:                                      00 54 45 53              .TES
  4310.      0060: 54 46 49 4C 45 30 30 31  00 00 00 00 00 46 49 4C TFILE001 .....FIL
  4311.      0070: 45 30 30 30 32 20 20 20  00 00 00 00             E0002    ....
  4312.  
  4313.           Z80 A>d 80 9f 
  4314.                 d 80 9f
  4315.       
  4316.      ADDR  00 01 02 03 04 05 06 07  08 09 0A 0B 0C 0D 0E 0F 01234567 89ABCDEF
  4317.      ----  -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- -- -------- --------
  4318.      0080: 15 20 54 45 53 54 46 49  4C 45 30 30 31 20 46 49 . TESTFI LE001 FI
  4319.      0090: 4C 45 30 30 30 32 0D 00  00 00 00 00 00 00 00 00 LE0002.. ........
  4320.  
  4321.           Z80 A>args foo.c -n -b -v 
  4322.                 args foo.c -n -b -v
  4323.       
  4324.  
  4325.  
  4326.  
  4327.  
  4328. COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  4329.  
  4330.  
  4331.  
  4332.  
  4333.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 68
  4334.      BUILTIN COMMANDS: CP/M ENVIRONMENT CONTROL
  4335.  
  4336.  
  4337.           Z80 A>d primary_fcb secondary_fcb+.15 
  4338.                 d primary_fcb secondary_fcb+.15
  4339.       
  4340.      ADDR  00 01 02 03 04 05 06 07  08 09 0A 0B 0C 0D 0E 0F 01234567 89ABCDEF
  4341.      ----  -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- -- -------- --------
  4342.      0050:                                      00 46 4F 4F              .FOO
  4343.      0060: 20 20 20 20 20 43 20 20  00 00 00 00 00 2D 4E 20      C   .....-N 
  4344.      0070: 20 20 20 20 20 20 20 20  00 00 00 00                      .... 
  4345.  
  4346.           Z80 A>d 80 9f 
  4347.                 d 80 9f
  4348.       
  4349.      ADDR  00 01 02 03 04 05 06 07  08 09 0A 0B 0C 0D 0E 0F 01234567 89ABCDEF
  4350.      ----  -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- -- -------- --------
  4351.      0080: 0F 20 46 4F 4F 2E 43 20  2D 4E 20 2D 42 20 2D 56 . FOO.C  -N -B -V
  4352.      0090: 0D 45 30 30 30 32 0D 00  00 00 00 00 00 00 00 00 .E0002.. ........
  4353.  
  4354.  
  4355.  
  4356.  
  4357.  
  4358.  
  4359.  
  4360.  
  4361.  
  4362.  
  4363.  
  4364.  
  4365.  
  4366.  
  4367.  
  4368.  
  4369.  
  4370.  
  4371.  
  4372.  
  4373.  
  4374.  
  4375.  
  4376.  
  4377.  
  4378.  
  4379.  
  4380.  
  4381.  
  4382.  
  4383.  
  4384.  
  4385.  
  4386.  
  4387.  
  4388.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  4389.  
  4390.  
  4391.  
  4392.  
  4393.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 69
  4394.      BUILTIN COMMANDS: CP/M ENVIRONMENT CONTROL
  4395.  
  4396.  
  4397.  
  4398.      Builtin:  coldboot! 
  4399.                coldboot! 
  4400.      ________
  4401.                cold! 
  4402.                cold!
  4403.       
  4404.      Cold Boots CP/M memory by zeroing the 64K CP/M Segment, installing the
  4405.      BIOS and BDOS hooks, formatting the first page of memory just as CP/M
  4406.      would, etc. 
  4407.       
  4408.      When you first start up the Emulator, the CP/M Segment has already been
  4409.      Cold Booted. 
  4410.       
  4411.      You may use this command to clean things up when you suspect that Z80
  4412.      software may have corrupted the BIOS or BDOS hooks, garbaged page zero,
  4413.      or whatever. 
  4414.       
  4415.      If a Z80 program exits with an Emulator message to the effect that the
  4416.      program requests termination via Cold Boot, then you should use this
  4417.      command to do it. The Z80 program probably had a good reason for asking
  4418.      for a Cold Boot.
  4419.       
  4420.      Example: 
  4421.  
  4422.           Z80 A>coldboot! 
  4423.                 coldboot!
  4424.       
  4425.                *** CP/M Segment COLDBOOTED *** 
  4426.  
  4427.  
  4428.  
  4429.  
  4430.  
  4431.  
  4432.  
  4433.  
  4434.  
  4435.  
  4436.  
  4437.  
  4438.  
  4439.  
  4440.  
  4441.  
  4442.  
  4443.  
  4444.  
  4445.  
  4446.  
  4447.  
  4448.  
  4449.  
  4450.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  4451.  
  4452.  
  4453.  
  4454.  
  4455.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 70
  4456.      BUILTIN COMMANDS: CP/M ENVIRONMENT CONTROL
  4457.  
  4458.  
  4459.  
  4460.      Builtin:  terminal [ ON | OFF ] 
  4461.                terminal [ ON | OFF ] 
  4462.      ________
  4463.                term [ ON | OFF ] 
  4464.                term [ ON | OFF ]
  4465.  
  4466.      Enables or disables the builtin VT52 "emulated terminal".
  4467.  
  4468.      If ON is specified, then the emulated CP/M BIOS routines that deal with
  4469.         ON
  4470.      the console will perform terminal emulation as described previously.
  4471.      Such I/O goes straight to the IBM PC screen (via the IBM PC ROM BIOS
  4472.      routines), and is therefore never seen by PCDOS.
  4473.  
  4474.      If OFF is specified, then the emulated CP/M BIOS routines that deal
  4475.         OFF
  4476.      with the console will not emulate anything. They will simply act
  4477.                            not
  4478.      as if the equivalent CP/M BDOS function had been called. This means that
  4479.      CP/M BIOS terminal I/O will go to PCDOS for handling. This makes it
  4480.      available for PCDOS I/O redirection. It also allows a PCDOS emulator
  4481.      (like ANSI.SYS) to become the CP/M terminal emulator.
  4482.  
  4483.      If no argument is specified, then the current state of emulation is
  4484.      simply reported.
  4485.       
  4486.      Example: 
  4487.  
  4488.           Z80 A>term 
  4489.                 term
  4490.       
  4491.           Terminal Emulation is OFF (CP/M BIOS console goes to PCDOS)
  4492.  
  4493.           Z80 A>terminal on 
  4494.                 terminal on
  4495.       
  4496.           Terminal Emulation is ON (via CP/M BIOS) 
  4497.  
  4498.           Z80 A>terminal off 
  4499.                 terminal off
  4500.       
  4501.           Terminal Emulation is OFF (CP/M BIOS console goes to PCDOS)
  4502.  
  4503.  
  4504.  
  4505.  
  4506.  
  4507.  
  4508.  
  4509.  
  4510.  
  4511.  
  4512.  
  4513.  
  4514.  
  4515.  
  4516.  
  4517.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  4518.  
  4519.  
  4520.  
  4521.  
  4522.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 71
  4523.      BUILTIN COMMANDS: CP/M ENVIRONMENT CONTROL
  4524.  
  4525.  
  4526.       
  4527.      Builtin:  read [n] <filename.typ> 
  4528.                read [n] <filename.typ> 
  4529.      ________
  4530.                r [n] <filename.typ> 
  4531.                r [n] <filename.typ>
  4532.       
  4533.      Reads data from specified file into the CP/M Segment, at address n.
  4534.       
  4535.      If n is absent, then it defaults to 0100. 
  4536.       
  4537.      This is the primary method used to load Z80 software for debugging. It
  4538.      is normally used to read Z80 command (.COM) files into memory, but this
  4539.      command will also read raw data files with no problem. 
  4540.       
  4541.      If <filename.typ> has a filetype of .HEX, then the file is assumed to be
  4542.      in standard Intel HEX format, and is loaded into memory at addresses
  4543.      specified by the HEX records. In such a case, the n argument may have no
  4544.      meaning.
  4545.       
  4546.      The n argument is a numeric value of the sort described at the beginning
  4547.      of this section. 
  4548.  
  4549.           NOTE: If a read of a file causes data to be read below 0100h
  4550.                      read
  4551.           or above FD00h, then the CP/M environment will be clobbered.
  4552.           If you're developing non-CP/M Z80 code, then who cares. If
  4553.           you're reading in a file that expects to call CP/M, however,
  4554.           then running the thing with a clobbered CP/M environment just
  4555.           might scramble the brains of the imaginary Z80.
  4556.       
  4557.      This command is used by us at CCS to load test versions of our Z80
  4558.      software, which we leave in .HEX format when we run L80. 
  4559.       
  4560.      Example: 
  4561.  
  4562.           Z80 A>read 100 820init.com 
  4563.                 read 100 820init.com
  4564.       
  4565.                *** Low = 0100H  Next = 0380H 
  4566.                *** Z80 DMA, PC and Stack automatically set for .COM file 
  4567.  
  4568.           Z80 A>write 100 360 820init.hex 
  4569.                 write 100 360 820init.hex
  4570.       
  4571.                Writing HEX records for 0100H thru 0360H (609 bytes) to file
  4572.                '820INIT.HEX' 
  4573.  
  4574.           Z80 A>read 820init.hex 
  4575.                 read 820init.hex
  4576.       
  4577.                *** .HEX file Starting Address = 0100H 
  4578.                *** Low = 0100H  Next = 0360H 
  4579.  
  4580.  
  4581.  
  4582.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  4583.  
  4584.  
  4585.  
  4586.  
  4587.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 72
  4588.      BUILTIN COMMANDS: CP/M ENVIRONMENT CONTROL
  4589.  
  4590.  
  4591.       
  4592.      Builtin:  write nlow nhigh <filename.typ> 
  4593.                write nlow nhigh <filename.typ> 
  4594.      ________
  4595.                w nlow nhigh <filename.typ> 
  4596.                w nlow nhigh <filename.typ>
  4597.       
  4598.      Write a block of CP/M memory to a disk file. 
  4599.       
  4600.      The bounds of the block to be written are specified by nlow and nhigh,
  4601.      which are numeric values as described at the start of this section.
  4602.       
  4603.      The specified block of memory is written from the CP/M Segment to the
  4604.      specified file. It is written as a pure memory image, unless a .HEX
  4605.      extension is supplied.
  4606.       
  4607.      Specifying a filename of type .HEX will cause an Intel HEX file to be
  4608.                                         will
  4609.      written. The final record of the generated HEX file is the special
  4610.      HEX record which specifies the starting execution address of the
  4611.      program. This address is assumed to be nlow.
  4612.  
  4613.      Example: 
  4614.  
  4615.           Z80 A>read 100 820init.com 
  4616.                 read 100 820init.com
  4617.       
  4618.                *** Low = 0100H  Next = 0380H 
  4619.                *** Z80 DMA, PC and Stack automatically set for .COM file 
  4620.  
  4621.           Z80 A>write 100 360 820init.hex 
  4622.                 write 100 360 820init.hex
  4623.       
  4624.                Writing HEX records for 0100H thru 0360H (609 bytes) to file
  4625.                '820INIT.HEX' 
  4626.  
  4627.           Z80 A>read 820init.hex 
  4628.                 read 820init.hex
  4629.       
  4630.                *** .HEX file Starting Address = 0100H 
  4631.                *** Low = 0100H  Next = 0360H 
  4632.  
  4633.  
  4634.  
  4635.  
  4636.  
  4637.  
  4638.  
  4639.  
  4640.  
  4641.  
  4642.  
  4643.  
  4644.  
  4645.  
  4646.  
  4647.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  4648.  
  4649.  
  4650.  
  4651.  
  4652.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 73
  4653.      BUILTIN COMMANDS: CP/M ENVIRONMENT CONTROL
  4654.  
  4655.  
  4656.       
  4657.      Builtin:  submit <filename.typ> 
  4658.                submit <filename.typ> 
  4659.      ________
  4660.                sub <filename.typ> 
  4661.                sub <filename.typ>
  4662.       
  4663.      Switches input (for Emulator commands only) to the specified file.
  4664.  
  4665.      This is roughly equivalent to the CP/M SUBMIT.COM program, except that
  4666.      it is built into the Emulator. 
  4667.       
  4668.      Z80 application input via BDOS and BIOS does not get switched. Only
  4669.      Emulator input is switched. Submit files cannot be nested.
  4670.                                  Submit
  4671.       
  4672.      Input reverts to the standard input (as defined by PCDOS) when EOF is
  4673.      detected on the specified file. 
  4674.  
  4675.           NOTE: If a keypress is detected during submit file processing
  4676.                                                  submit
  4677.           but outside of Z80 operation (i.e. - when the Emulator is
  4678.           expecting a command), then the submit file is aborted. This
  4679.                                          submit
  4680.           is how you cancel a submit file - just press SPACE while it
  4681.           is running.
  4682.       
  4683.      Example: 
  4684.           Z80 A>submit script 
  4685.                 submit script
  4686.           Z80 A>sub c:\cpm\autoexec.z80
  4687.                 sub c:\cpm\autoexec.z80
  4688.  
  4689.  
  4690.  
  4691.  
  4692.  
  4693.  
  4694.  
  4695.  
  4696.  
  4697.  
  4698.  
  4699.  
  4700.  
  4701.  
  4702.  
  4703.  
  4704.  
  4705.  
  4706.  
  4707.  
  4708.  
  4709.  
  4710.  
  4711.  
  4712.  
  4713.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  4714.  
  4715.  
  4716.  
  4717.  
  4718.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 74
  4719.      BUILTIN COMMANDS: RESOURCE FACILITY COMMANDS
  4720.  
  4721.  
  4722.       
  4723.      Builtin:  list [n1 [n2]] [>outfile | >>outfile] 
  4724.                list [n1 [n2]] [>outfile | >>outfile] 
  4725.      ________
  4726.                list prologue n1 n2 [>outfile | >>outfile] 
  4727.                list prologue n1 n2 [>outfile | >>outfile] 
  4728.                list include [A][O][F] 
  4729.                list include [A][O][F] 
  4730.                l [n1 [n2]] [>outfile | >>outfile] 
  4731.                l [n1 [n2]] [>outfile | >>outfile] 
  4732.                l prologue n1 n2 [>outfile | >>outfile] 
  4733.                l prologue n1 n2 [>outfile | >>outfile] 
  4734.                l include [A][O][F] 
  4735.                l include [A][O][F] 
  4736.       
  4737.      This is a multi-purpose disassembly command, which does one of three
  4738.      things (depending upon the arguments that are present):
  4739.       
  4740.           Lists disassembled Z80 object code (first form). 
  4741.       
  4742.           Generates an assembler prologue for the given range of Z80
  4743.           object code (second form). 
  4744.       
  4745.           Specifies fields to be included in disassembly lines (third
  4746.           form). 
  4747.       
  4748.  
  4749.  
  4750.      Format:  list [n1 [n2]] [>outfile | >>outfile] 
  4751.               list [n1 [n2]] [>outfile | >>outfile] 
  4752.               l [n1 [n2]] [>outfile | >>outfile] 
  4753.               l [n1 [n2]] [>outfile | >>outfile] 
  4754.       
  4755.      This form causes the disassembly of Z80 object code from CP/M address n1
  4756.      through CP/M address n2 (both of which are numeric values as defined at
  4757.      the start of this section). If n2 is absent, then n2 is assumed to be
  4758.      n1+22. If n1 is absent, then it defaults to the next address to be
  4759.      disassembled (as left by last list command). 
  4760.                                    list
  4761.       
  4762.      The generated disassembly is sent to (">outfile") or appended to
  4763.                                             >outfile
  4764.      (">>outfile") the specified output file. If an output file is not
  4765.        >>outfile
  4766.      specified (no ">" character present), then the generated disassembly
  4767.      goes to the standard output as defined by PCDOS (normally the screen). 
  4768.  
  4769.           NOTE: Disassembly speed decreases as the size of the control
  4770.           table increases. It may also be slowed by PCDOS being so
  4771.           lethargic with screen output. When disassembling the Radio
  4772.           Shack Model 100's memory (which required a control table of
  4773.           about 42K), for instance, we were only getting about 2 lines
  4774.           of disassembled code per second. 
  4775.  
  4776.      Generated source code is suitable for input to M80.COM in .Z80 mode.
  4777.      Note, however, that any RST instructions use as their argument the
  4778.      final address being jumped to, not the RST number (as is customary).
  4779.      Also, there is no END statement supplied.
  4780.  
  4781.  
  4782.  
  4783.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  4784.  
  4785.  
  4786.  
  4787.  
  4788.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 75
  4789.      BUILTIN COMMANDS: RESOURCE FACILITY COMMANDS
  4790.  
  4791.  
  4792.       
  4793.      Format:  list prologue n1 n2 [>outfile | >>outfile] 
  4794.               list prologue n1 n2 [>outfile | >>outfile] 
  4795.               l prologue n1 n2 [>outfile | >>outfile] 
  4796.               l prologue n1 n2 [>outfile | >>outfile] 
  4797.       
  4798.      This form generates assembler source code suitable for inclusion at the
  4799.      front of a Z80 source file. The generated source code is the prologue
  4800.      for a given block of Z80 object code, defined by CP/M addresses n1 and
  4801.      n2. Both n1 and n2 are numeric values as defined at the start of this
  4802.      section. 
  4803.       
  4804.      The generated prologue contains equates for the various ASCII control
  4805.      characters. Additionally, it contains equated labels for any CP/M
  4806.      addresses that are referenced by the specified block of Z80 code (from
  4807.      n1 to n2), but not contained within it. 
  4808.       
  4809.      Such a prologue is generally needed at the front of any sizeable Z80
  4810.      disassembly. 
  4811.       
  4812.      The generated prologue is sent to (">outfile") or appended to (">>out-
  4813.                                          >outfile                    >>out-
  4814.      file") the specified output file. If an output file is not specified,
  4815.      file
  4816.      (no ">" character present), then the generated prologue goes to the
  4817.      standard output as defined by PCDOS (normally the screen). 
  4818.  
  4819.  
  4820.       
  4821.      Format:  list include [A][O][F] 
  4822.               list include [A][O][F] 
  4823.               l include [A][O][F] 
  4824.               l include [A][O][F] 
  4825.       
  4826.      Specifies the fields to be included in disassembled Z80 instructions.
  4827.       
  4828.      If the "A" arg is present, then CP/M addresses will be included at the
  4829.              A                            addresses
  4830.      left of disassembled instructions. 
  4831.       
  4832.      If the "O" argument is present, then raw opcodes will be included after
  4833.              O                                opcodes
  4834.      the address (if present) but before the Z80 mnemonic. 
  4835.       
  4836.      If the "F" argument is present, then the disassembled Z80 instruction
  4837.              F
  4838.      will include a comment explaining the instruction's possible effect(s)
  4839.      on the Z80 flags. 
  4840.                 flags
  4841.       
  4842.      Arguments after "include" may be whole words. Only the first character
  4843.                       include
  4844.      is checked. 
  4845.       
  4846.      If no arguments appear after "include", then the disassembled Z80
  4847.                                    include
  4848.      instruction will consist only of the mnemonic field. 
  4849.  
  4850.  
  4851.  
  4852.  
  4853.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  4854.  
  4855.  
  4856.  
  4857.  
  4858.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 76
  4859.      BUILTIN COMMANDS: RESOURCE FACILITY COMMANDS
  4860.  
  4861.  
  4862.       
  4863.      Example: 
  4864.           Z80 A>list include addresses 
  4865.                 list include addresses
  4866.           Z80 A>list include 
  4867.                 list include
  4868.           Z80 A>l prologue 100 7ff 
  4869.                 l prologue 100 7ff
  4870.           Z80 A>list prologue 0 ffff >model100.rom 
  4871.                 list prologue 0 ffff >model100.rom
  4872.           Z80 A>list 0 ffff >>model100.rom
  4873.                 list 0 ffff >>model100.rom
  4874.           Z80 A>list
  4875.                 list
  4876.  
  4877.  
  4878.           NOTE: The next section contains a sample Emulator session
  4879.           which generates source code from object code. Refer to it for
  4880.           more detail about this and related Resource commands.
  4881.  
  4882.  
  4883.  
  4884.  
  4885.  
  4886.  
  4887.  
  4888.  
  4889.  
  4890.  
  4891.  
  4892.  
  4893.  
  4894.  
  4895.  
  4896.  
  4897.  
  4898.  
  4899.  
  4900.  
  4901.  
  4902.  
  4903.  
  4904.  
  4905.  
  4906.  
  4907.  
  4908.  
  4909.  
  4910.  
  4911.  
  4912.  
  4913.  
  4914.  
  4915.  
  4916.  
  4917.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  4918.  
  4919.  
  4920.  
  4921.  
  4922.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 77
  4923.      BUILTIN COMMANDS: RESOURCE FACILITY COMMANDS
  4924.  
  4925.  
  4926.  
  4927.      Builtin:  control list [n] 
  4928.                control list [n] 
  4929.      ________
  4930.                control clear 
  4931.                control clear 
  4932.                control read <filepath> 
  4933.                control read <filepath> 
  4934.                control write <filepath> 
  4935.                control write <filepath> 
  4936.                control n     i | b | w | t | s | c 
  4937.                control n     i | b | w | t | s | c 
  4938.                c list [n] 
  4939.                c list [n] 
  4940.                c clear 
  4941.                c clear 
  4942.                c read <filepath> 
  4943.                c read <filepath> 
  4944.                c write <filepath> 
  4945.                c write <filepath> 
  4946.                c n     i | b | w | t | s | c 
  4947.                c n     i | b | w | t | s | c 
  4948.       
  4949.      This is a multi-purpose command which manipulates the disassembly
  4950.      control table. 
  4951.       
  4952.      The disassembly control table holds CP/M addresses and any or all of the
  4953.      following which are associated with each address: 
  4954.       
  4955.           The data type of the Z80 object code at this address. This is
  4956.                called a "control break". 
  4957.       
  4958.           A symbolic label to be associated with the address. 
  4959.       
  4960.           A comment to be associated with the address. 
  4961.       
  4962.       
  4963.      This control table is used by the disassembler (the list command), and
  4964.                                                          list
  4965.      tells it how to format the source code while disassembling. 
  4966.       
  4967.      The various data type control breaks that may be associated with a CP/M
  4968.      address are as follows: 
  4969.       
  4970.           Instructions (executable Z80 code, disassembled as mnemonics)
  4971.       
  4972.           Bytes (disassembled as DB pseudo-ops) 
  4973.       
  4974.           Words (disassembled as DW pseudo-ops, multiple entries per
  4975.                line) 
  4976.       
  4977.           Table of Words (disassembled as DW pseudo-ops, one per line)
  4978.       
  4979.           Storage (disassembled as DS with argument large enough to
  4980.                bring it up to next control entry) 
  4981.       
  4982.       
  4983.      This is how the disassembler knows which parts of your Z80 object code
  4984.      are instructions, which are data, and which are irrelevant buffers etc. 
  4985.  
  4986.  
  4987.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  4988.  
  4989.  
  4990.  
  4991.  
  4992.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 78
  4993.      BUILTIN COMMANDS: RESOURCE FACILITY COMMANDS
  4994.  
  4995.  
  4996.      The specific formats are described below.
  4997.  
  4998.  
  4999.      Format:  control list [n] 
  5000.               control list [n]
  5001.               c list [n] 
  5002.               c list [n]
  5003.       
  5004.      This format of the command causes the Emulator to display all control
  5005.      table information that is currently known to it. If numeric value n (see
  5006.      definition of legal numeric values at start of this section) is present,
  5007.      then only control information associated with CP/M addresses greater
  5008.      than or equal to n are listed. 
  5009.       
  5010.      The list includes any control breaks, labels, and comments associated
  5011.      with the various CP/M addresses. 
  5012.       
  5013.  
  5014.  
  5015.      Format:  control clear 
  5016.               control clear
  5017.               c clear 
  5018.               c clear
  5019.       
  5020.      This format of the command clears out the control table, so that nothing
  5021.      is known about the Z80 object code. No CP/M addresses, control breaks,
  5022.      labels or comments are defined after this command is given. 
  5023.       
  5024.       
  5025.  
  5026.      Format:  control read <filepath> 
  5027.               control read <filepath>
  5028.               c read <filepath> 
  5029.               c read <filepath>
  5030.       
  5031.      This format of the command causes the Emulator to read a control table
  5032.      from the specified filename. The file must have been created by a
  5033.                                            must
  5034.      "control write <filepath>" command. 
  5035.       control write <filepath>
  5036.       
  5037.      A currently-defined control table is cleared before the new one is read
  5038.      from disk. It is not possible to merge control tables using this
  5039.      command. 
  5040.       
  5041.       
  5042.  
  5043.  
  5044.  
  5045.  
  5046.  
  5047.  
  5048.  
  5049.  
  5050.  
  5051.  
  5052.  
  5053.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  5054.  
  5055.  
  5056.  
  5057.  
  5058.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 79
  5059.      BUILTIN COMMANDS: RESOURCE FACILITY COMMANDS
  5060.  
  5061.  
  5062.      Format:  control write <filepath> 
  5063.               control write <filepath>
  5064.               c write <filepath> 
  5065.               c write <filepath>
  5066.       
  5067.      This command writes the current control table to the specified file, for
  5068.      later input via the "control read <filepath>" command. All known data is
  5069.                           control read <filepath>
  5070.      written - CP/M addresses, control breaks, labels and comments. 
  5071.       
  5072.       
  5073.  
  5074.      Format:  control n     i | b | w | t | s | c 
  5075.               control n     i | b | w | t | s | c
  5076.               c n     i | b | w | t | s | c 
  5077.               c n     i | b | w | t | s | c
  5078.       
  5079.      This format of the command is the real workhorse of control table
  5080.      maintenance. It associates a Z80 data type with CP/M address n, which is
  5081.      a numeric value as defined at the start of this section. 
  5082.       
  5083.      The argument following CP/M address n is a directive to the disassembler
  5084.      (the list command), and may be any one of the following (note that only
  5085.           list                          one
  5086.      the first character is required): 
  5087.       
  5088.           Instructions: switch to Z80 mnemonics when you get to this
  5089.           I
  5090.                address. 
  5091.       
  5092.           Bytes: switch to DB pseudo-ops when you get to this address.
  5093.           B
  5094.       
  5095.           Words: switch to DW pseudo-ops (multiple per line) when you
  5096.           W
  5097.                get to this address. 
  5098.       
  5099.           Table of words: switch to DW pseudo-ops (one per line) when
  5100.           T
  5101.                you get to this address. This is useful for jump tables,
  5102.                etc, where you want the source code to be neatly ar-
  5103.                ranged. 
  5104.       
  5105.           Storage: do a single DS (define storage) pseudo-op when you
  5106.           S
  5107.                get to this address, and make the size field big enough
  5108.                to take you up to the next control break address (or the
  5109.                end of the disassembly, whichever is lower). 
  5110.  
  5111.       
  5112.      You may also specify a special argument, which is handled immediately
  5113.      and never gets to the disassembler: 
  5114.       
  5115.           Clear: Clear this address's control break data type. This does
  5116.           C
  5117.                not remove an associated label or comment. It just undoes
  5118.                not
  5119.                any control break (of one of the above types) associated
  5120.                with this CP/M address. 
  5121.       
  5122.       
  5123.  
  5124. COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  5125.  
  5126.  
  5127.  
  5128.  
  5129.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 80
  5130.      BUILTIN COMMANDS: RESOURCE FACILITY COMMANDS
  5131.  
  5132.  
  5133.  
  5134.      Example: 
  5135.           Z80 A>control list 
  5136.                 control list
  5137.           Z80 A>c clear 
  5138.                 c clear
  5139.           Z80 A>c read b:\model100\model100.ctl 
  5140.                 c read b:\model100\model100.ctl
  5141.           Z80 A>control write foo.ctl 
  5142.                 control write foo.ctl
  5143.           Z80 A>c read xyz 
  5144.                 c read xyz
  5145.           Z80 A>control 100 Instructions 
  5146.                 control 100 Instructions
  5147.           Z80 A>c 103 b 
  5148.                 c 103 b
  5149.           Z80 A>c table_start+1 S 
  5150.                 c table_start+1 S
  5151.           Z80 A>CONTROL bios_address W 
  5152.                 CONTROL bios_address W
  5153.           Z80 A>c FF00 Table 
  5154.                 c FF00 Table
  5155.           Z80 A>c 103 clear
  5156.                 c 103 clear
  5157.  
  5158.  
  5159.  
  5160.  
  5161.           NOTE: The next section contains a sample Emulator session
  5162.           which generates source code from object code. Refer to it for
  5163.           more detail about this and related Resource commands.
  5164.       
  5165.  
  5166.  
  5167.  
  5168.  
  5169.  
  5170.  
  5171.  
  5172.  
  5173.  
  5174.  
  5175.  
  5176.  
  5177.  
  5178.  
  5179.  
  5180.  
  5181.  
  5182.  
  5183.  
  5184.  
  5185.  
  5186.  
  5187.  
  5188.  
  5189.  
  5190.  
  5191.  
  5192.  
  5193. COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  5194.  
  5195.  
  5196.  
  5197.  
  5198.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 81
  5199.      BUILTIN COMMANDS: RESOURCE FACILITY COMMANDS
  5200.  
  5201.  
  5202.       
  5203.      Builtin:  label n [label_name] 
  5204.                label n [label_name] 
  5205.      ________
  5206.                label autogen n1 n2 
  5207.                label autogen n1 n2 
  5208.                = n [label_name] 
  5209.                = n [label_name] 
  5210.                = autogen n1 n2 
  5211.                = autogen n1 n2 
  5212.       
  5213.      This command controls the assignment of symbolic label names to various
  5214.      CP/M addresses. Symbolic labels may be used as numeric values in many
  5215.      Emulator commands. They are also used by the disassembler when creating
  5216.      source code from Z80 object code. 
  5217.  
  5218.  
  5219.       
  5220.       
  5221.      Format:  label n [label_name] 
  5222.               label n [label_name]
  5223.               = n [label_name] 
  5224.               = n [label_name]
  5225.       
  5226.      This format associates label_name with CP/M address n, which is a
  5227.      numeric value as described at the start of this section. 
  5228.       
  5229.      Label names may be up to 32 characters in length. They must contain only
  5230.      alphanumeric characters and the underscore character "_". 
  5231.       
  5232.      If label_name is absent in this command, then any existing label name
  5233.      associated with the specified CP/M address is simply deleted. 
  5234.       
  5235.       
  5236.       
  5237.       
  5238.      Format:  label autogen n1 n2 
  5239.               label autogen n1 n2
  5240.               = autogen n1 n2 
  5241.               = autogen n1 n2
  5242.       
  5243.      This format causes the Emulator to automatically generate labels (of
  5244.      format AUTOxxxx) for all unlabeled CP/M addresses that are referenced by
  5245.      the block of Z80 code that starts at n1 and ends at n2 (both of which
  5246.      are numeric values as defined at the start of this section). 
  5247.       
  5248.      Labels that are generated are automatically entered into the current
  5249.      control table. Existing labels will not be altered. 
  5250.       
  5251.      This is a quick way to create labels. It can be useful for rapid
  5252.      generation of readable source code from Z80 object code. You should,
  5253.      however, define any recognizable labels before using this command. You
  5254.      should also make sure that you have pretty accurately defined all
  5255.      control breaks that apply to the specified block of Z80 code. There's
  5256.      nothing worse than getting a block of data confused with instructions,
  5257.      and having this command generate a few hundred bogus labels by misinter-
  5258.      preting the Z80 code. 
  5259.  
  5260.  
  5261.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  5262.  
  5263.  
  5264.  
  5265.  
  5266.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 82
  5267.      BUILTIN COMMANDS: RESOURCE FACILITY COMMANDS
  5268.  
  5269.  
  5270.       
  5271.      So this is generally the last thing that you do before deciding that
  5272.      you have finished disassembling a complete Z80 program. 
  5273.       
  5274.  
  5275.  
  5276.           NOTE: 16-bit literals will be ignored. There's no way - short
  5277.           of human inspection - to tell if the 16-bit value is meant to
  5278.           be a Z80 address or just a binary value (like a loop counter).
  5279.           In previous versions of the Emulator, there were too many
  5280.           bogus labels being autogen'd from 16-bit literals. Now it is
  5281.                              autogen
  5282.           up to you to decide whether a particular 16-bit literal
  5283.           should have a label associated with it. Specifically, the
  5284.           following instructions' 16-bit literals are ignored:
  5285.  
  5286.                     LD   IX,nn
  5287.                     LD   IY,nn
  5288.                     LD   BC,nn
  5289.                     LD   DE,nn
  5290.                     LD   HL,nn
  5291.                     LD   SP,nn
  5292.  
  5293.  
  5294.      Example: 
  5295.           Z80 A>= 100 program_entry 
  5296.                 = 100 program_entry
  5297.           Z80 A>label 7ff program_end 
  5298.                 label 7ff program_end
  5299.           Z80 A>= 0 warm_boot_jump 
  5300.                 = 0 warm_boot_jump
  5301.           Z80 A>= 5C FCB1 
  5302.                 = 5C FCB1
  5303.           Z80 A>= 5 BDOS 
  5304.                 = 5 BDOS
  5305.           Z80 A>label autogen 100 7ff
  5306.                 label autogen 100 7ff
  5307.  
  5308.  
  5309.  
  5310.  
  5311.           NOTE: The next section contains a sample Emulator session
  5312.           which generates source code from object code. Refer to it for
  5313.           more detail about this and related Resource commands.
  5314.  
  5315.  
  5316.  
  5317.  
  5318.  
  5319.  
  5320.  
  5321.  
  5322.  
  5323.  
  5324.  
  5325.  
  5326.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  5327.  
  5328.  
  5329.  
  5330.  
  5331.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 83
  5332.      BUILTIN COMMANDS: RESOURCE FACILITY COMMANDS
  5333.  
  5334.  
  5335.  
  5336.      Builtin:  comment n ["text"] 
  5337.                comment n ["text"] 
  5338.      ________
  5339.                ; n ["text"] 
  5340.                ; n ["text"] 
  5341.       
  5342.      Associates source-code comment "text" with CP/M address n, which is a
  5343.                                      text
  5344.      numeric value as defined at the start of this section. "text" may be up
  5345.                                                              text
  5346.      to 254 characters long. 
  5347.       
  5348.      If "text" is absent, then any existing comment associated with address n
  5349.          text
  5350.      is simply deleted. 
  5351.       
  5352.      Note that "text" must be enclosed in double quotes. It may include
  5353.                 text
  5354.      escape sequences as follows: 
  5355.       
  5356.           \\             Single "\" char 
  5357.           \0             NUL byte 
  5358.           \b or \B       Backspace char 
  5359.           \t or \T       Tab char 
  5360.           \n or \N       Linefeed char 
  5361.           \r or \R       Return char 
  5362.           \'             Single quote char 
  5363.           \"             Double quote char 
  5364.           \xFF or \XFF   Byte with HEX value FF 
  5365.       
  5366.      These escape codes made be used to make the comment more readable.
  5367.  
  5368.       
  5369.      When a comment is detected by the disassembler, it will be printed in
  5370.      one of two places: 
  5371.       
  5372.           As a line comment, after the mnemonic. Such a comment replaces
  5373.                the flags comment field (if present). If "text" starts
  5374.                                                          text
  5375.                with other than a "\n" escape, then the comment is
  5376.                printed in this manner. 
  5377.       
  5378.           As a multi-line comment, on lines before the instruction. If
  5379.                "text" starts with a "\n" escape, then the comment will
  5380.                 text
  5381.                be printed in this manner. Blank comment lines (starting
  5382.                with ";") are automatically provided before and after the
  5383.                comment, and ";" characters are inserted after every "\n"
  5384.                or "\r" found in the "text" string. 
  5385.                                      text
  5386.       
  5387.       
  5388.      If you want to create a nice-looking multi-line comment, then imbed "\n"
  5389.      escapes as line delimiters, and "\t" escapes to line things up on
  5390.      succeeding lines. 
  5391.       
  5392.  
  5393.  
  5394. COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  5395.  
  5396.  
  5397.  
  5398.  
  5399.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 84
  5400.      BUILTIN COMMANDS: RESOURCE FACILITY COMMANDS
  5401.  
  5402.  
  5403.      If your comment is intended to be a single-line comment appended to the
  5404.      disassembled instruction's mnemonic, then avoid imbedded "\n" and "\r"
  5405.      escapes. 
  5406.  
  5407.       
  5408.      Example: 
  5409.           Z80 A>comment 100 "\nStart of main program" 
  5410.                 comment 100 "\nStart of main program"
  5411.           Z80 A>; 0 "Jump to BIOS Warm, Start" 
  5412.                 ; 0 "Jump to BIOS Warm, Start"
  5413.           Z80 A>; 100 
  5414.                 ; 100
  5415.           Z80 A>comment ff00 "\nBIOS Jump Table\n\n\t3 bytes per JMP"
  5416.                 comment ff00 "\nBIOS Jump Table\n\n\t3 bytes per JMP"
  5417.  
  5418.  
  5419.  
  5420.  
  5421.  
  5422.           NOTE: The next section contains a sample Emulator session
  5423.           which generates source code from object code. Refer to it for
  5424.           more detail about this and related Resource commands.
  5425.  
  5426.  
  5427.  
  5428.  
  5429.  
  5430.  
  5431.  
  5432.  
  5433.  
  5434.  
  5435.  
  5436.  
  5437.  
  5438.  
  5439.  
  5440.  
  5441.  
  5442.  
  5443.  
  5444.  
  5445.  
  5446.  
  5447.  
  5448.  
  5449.  
  5450.  
  5451.  
  5452.  
  5453.  
  5454.  
  5455.  
  5456.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  5457.  
  5458.  
  5459.  
  5460.  
  5461.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 85
  5462.      USING THE RESOURCE BUILTIN COMMANDS
  5463.  
  5464.  
  5465.       
  5466.  
  5467.  
  5468.  
  5469.  
  5470.  
  5471.  
  5472.  
  5473.  
  5474.  
  5475.                       USING THE RESOURCE BUILTIN COMMANDS 
  5476.                       USING THE RESOURCE BUILTIN COMMANDS
  5477.  
  5478.  
  5479.      This section presents an example of re-sourcing a piece of Z80 object
  5480.      code. It demonstrates the use of the various Emulator builtin commands
  5481.      that deal with regenerating source code from object code.
  5482.  
  5483.      We were recently presented with a piece of software which (wouldn't you
  5484.      know it) existed only in object form on a Xerox 820 CP/M system. The
  5485.      owner of this little utility really wanted to move it to a 16-bit
  5486.      Hyperion system, cause the utility sets up a Z80 SIO and that's what the
  5487.      Hyperion has - an SIO.
  5488.  
  5489.      So he was wondering - could we regenerate the source code for this
  5490.      little utility?
  5491.  
  5492.  
  5493.  
  5494.           NOTE: The first step is to read the thing into Z80 memory
  5495.           with the Emulator, and clear any previous resource control
  5496.           breaks.
  5497.       
  5498.      Z80 C>read 100 820init.com 
  5499.            read 100 820init.com
  5500.       
  5501.      *** Low = 0100H  Next = 0380H 
  5502.      *** Z80 DMA, PC and Stack automatically set for .COM file 
  5503.      Z80 C>control clear 
  5504.            control clear
  5505.       
  5506.      Z80 C>list include addresses opcodes 
  5507.            list include addresses opcodes
  5508.  
  5509.  
  5510.  
  5511.  
  5512.  
  5513.  
  5514.  
  5515.  
  5516.  
  5517.  
  5518.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  5519.  
  5520.  
  5521.  
  5522.  
  5523.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 86
  5524.      USING THE RESOURCE BUILTIN COMMANDS
  5525.  
  5526.  
  5527.           NOTE: The next thing to do is take a quick look at the
  5528.           program, and get a general feel for what it does.
  5529.       
  5530.      Z80 C>list 
  5531.            list
  5532.       
  5533.      L0100:     11 45 02              LD     DE,L0245 
  5534.      L0103:     CD 40 02              CALL   L0240 
  5535.      L0106:     11 C8 02              LD     DE,L02C8 
  5536.      L0109:     CD 40 02              CALL   L0240 
  5537.      L010C:     CD 35 02              CALL   L0235 
  5538.      L010F:     FE 0D                 CP     CR 
  5539.      L0111:     C2 16 01              JP     NZ,L0116 
  5540.      L0114:     3E 36                 LD     A,'6' 
  5541.      L0116:     D6 30                 SUB    '0' 
  5542.  
  5543.  
  5544.  
  5545.           NOTE: This isn't real promising. Let's dump the thing and
  5546.           look for obvious ASCII strings.
  5547.  
  5548.      Z80 C>d 100 37f 
  5549.            d 100 37f
  5550.       
  5551.      ADDR  00 01 02 03 04 05 06 07  08 09 0A 0B 0C 0D 0E 0F 01234567 89ABCDEF
  5552.      ----  -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- -- -------- --------
  5553.      0100: 11 45 02 CD 40 02 11 C8  02 CD 40 02 CD 35 02 FE .E.M@..H .M@.M5.~
  5554.      0110: 0D C2 16 01 3E 36 D6 30  FE 00 DA 06 01 FE 0A D2 .B..>6V0 ~.Z..~.R
  5555.      0120: 06 01 32 58 03 11 EF 02  CD 40 02 CD 35 02 FE 0D ..2X..o. M@.M5.~.
  5556.      0130: C2 35 01 3E 4E FE 45 CA  47 01 FE 4F CA 47 01 FE B5.>N~EJ G.~OJG.~
  5557.      0140: 4E CA 47 01 C3 25 01 32  5A 03 11 16 03 CD 40 02 NJG.C%.2 Z....M@.
  5558.      0150: CD 35 02 FE 0D C2 5A 01  3E 38 D6 30 FE 07 CA 69 M5.~.BZ. >8V0~.Ji
  5559.      0160: 01 FE 08 CA 69 01 C3 4A  01 32 59 03 3A 58 03 FE .~.Ji.CJ .2Y.:X.~
  5560.      0170: 00 C2 79 01 3E 0F C3 B7  01 FE 01 C2 83 01 3E 0E .By.>.C7 .~.B..>.
  5561.      0180: C3 B7 01 FE 02 C2 8D 01  3E 0C C3 B7 01 FE 03 C2 C7.~.B.. >.C7.~.B
  5562.      0190: 97 01 3E 0A C3 B7 01 FE  04 C2 A1 01 3E 07 C3 B7 ..>.C7.~ .B!.>.C7
  5563.      01A0: 01 FE 05 C2 AB 01 3E 06  C3 B7 01 FE 06 C2 B5 01 .~.B+.>. C7.~.B5.
  5564.      01B0: 3E 05 C3 B7 01 3E 02 32  58 03 3A 5A 03 FE 45 C2 >.C7.>.2 X.:Z.~EB
  5565.      01C0: C7 01 3E 03 C3 D3 01 FE  4F C2 D1 01 3E 01 C3 D3 G.>.CS.~ OBQ.>.CS
  5566.      01D0: 01 3E 00 32 5A 03 3A 59  03 FE 07 CA EB 01 3E 60 .>.2Z.:Y .~.Jk.>`
  5567.      01E0: 32 5B 03 3E C0 32 5C 03  C3 F5 01 3E 20 32 5B 03 2[.>@2\.  Cu.>2[.
  5568.      01F0: 3E 40 32 5C 03 F3 3E 18  D3 06 D3 06 3E 01 D3 06 >@2\.s>. S.S.>.S.
  5569.      0200: AF D3 06 3E 04 D3 06 3A  5A 03 C6 44 D3 06 3E 03 /S.>.S.: Z.FDS.>.
  5570.      0210: D3 06 3A 5C 03 C6 01 D3  06 3E 05 D3 06 3A 5B 03 S.:\.F.S .>.S.:[.
  5571.      0220: C6 8A D3 06 3E 47 D3 00  3A 58 03 D3 00 FB 11 3D F.S.>GS. :X.S.{.=
  5572.      0230: 03 CD 40 02 C9 0E 01 CD  05 00 FE 60 D8 D6 20 C9 .M@.I..M  ..~`XVI
  5573.      0240: 0E 09 C3 05 00 1A 49 4E  49 54 20 31 2E 30 20 66 ..C...IN  IT 1.0f
  5574.      0250: 6F 72 20 58 65 72 6F 78  20 38 32 30 0D 0A 0A 0A or Xerox  820....
  5575.      0260: 0D 0A 42 61 75 64 20 52  61 74 65 73 3A 0D 0A 31 ..Baud R ates:..1
  5576.      0270: 39 32 30 30 20 3D 20 30  0D 0A 39 36 30 30 20 20 9200 = 0 ..9600 
  5577.  
  5578.  
  5579.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  5580.  
  5581.  
  5582.  
  5583.  
  5584.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 87
  5585.      USING THE RESOURCE BUILTIN COMMANDS
  5586.  
  5587.  
  5588.      0280: 3D 20 31 0D 0A 34 38 30  30 20 20 3D 20 32 0D 0A = 1..480 0  = 2..
  5589.      0290: 32 34 30 30 20 20 3D 20  33 0D 0A 31 32 30 30 20 2400  =  3..1200
  5590.      02A0: 20 3D 20 34 0D 0A 20 36  30 30 20 20 3D 20 35 0D  = 4.. 6 00  = 5.
  5591.      02B0: 0A 20 33 30 30 20 20 3D  20 36 0D 0A 20 31 31 30 . 300  =  6.. 110
  5592.      02C0: 20 20 3D 20 37 0D 0A 24  0D 0A 53 65 6C 65 63 74   = 7..$ ..Select
  5593.      02D0: 20 62 61 75 64 20 72 61  74 65 20 20 20 20 20 20  baud ra te     
  5594.      02E0: 20 20 20 20 20 28 31 2D  39 29 3A 20 36 08 24 0D      (1- 9): 6.$.
  5595.      02F0: 0A 53 65 6C 65 63 74 20  70 61 72 69 74 79 20 20 .Select  parity 
  5596.      0300: 28 4F 64 64 2C 20 45 76  65 6E 2C 20 4E 6F 6E 65 (Odd, Ev en, None
  5597.      0310: 29 3A 20 4E 08 24 0D 0A  53 65 6C 65 63 74 20 77 ): N.$.. Select w
  5598.      0320: 6F 72 64 20 6C 65 6E 67  74 68 20 20 20 20 20 20 ord leng th     
  5599.      0330: 28 37 20 6F 72 20 38 29  3A 20 38 08 24 0D 0A 43 (7 or 8) : 8.$..C
  5600.      0340: 6F 6D 6D 75 6E 69 63 61  74 69 6F 6E 73 20 70 6F ommunica tions po
  5601.      0350: 72 74 20 73 65 74 2E 24  00 00 00 00 00 00 00 00 rt set.$ ........
  5602.      0360: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00 ........ ........
  5603.      0370: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00 ........ ........
  5604.  
  5605.  
  5606.  
  5607.  
  5608.  
  5609.           NOTE: Well, there are some strings that are terminated with
  5610.           dollar signs. This is a heavy hint that these strings are to
  5611.           be displayed by BDOS function 9. Let's start our control
  5612.           table by filling in what we know so far...
  5613.  
  5614.  
  5615.      Z80 C>c 100 instructions
  5616.            c 100 instructions      (0100h, of course, starts code)
  5617.       
  5618.      Z80 C>= 100 startup
  5619.            = 100 startup           (Give it a sensible name) 
  5620.       
  5621.      Z80 C>c 245 b 
  5622.            c 245 b                 (Start bytes at first ASCII string)
  5623.       
  5624.      Z80 C>= 245 init_msg
  5625.            = 245 init_msg          (Give them sensible names) 
  5626.       
  5627.      Z80 C>= 2c8 baud_prompt 
  5628.            = 2c8 baud_prompt
  5629.       
  5630.      Z80 C>= 2ef parity_prompt 
  5631.            = 2ef parity_prompt
  5632.       
  5633.      Z80 C>= 316 databits_prompt 
  5634.            = 316 databits_prompt
  5635.       
  5636.      Z80 C>= 33d wrapup_msg 
  5637.            = 33d wrapup_msg
  5638.       
  5639.  
  5640.  
  5641.  
  5642.  
  5643.  
  5644.  
  5645.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  5646.  
  5647.  
  5648.  
  5649.  
  5650.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 88
  5651.      USING THE RESOURCE BUILTIN COMMANDS
  5652.  
  5653.  
  5654.  
  5655.           NOTE: Now let's look at the first code bytes again, and see
  5656.           if they make any more sense.
  5657.  
  5658.      Z80 C>l 100 
  5659.            l 100
  5660.       
  5661.       
  5662.                     STARTUP: 
  5663.      L0100:     11 45 02              LD     DE,INIT_MSG 
  5664.      L0103:     CD 40 02              CALL   L0240 
  5665.      L0106:     11 C8 02              LD     DE,BAUD_PROMPT 
  5666.      L0109:     CD 40 02              CALL   L0240 
  5667.      L010C:     CD 35 02              CALL   L0235 
  5668.      L010F:     FE 0D                 CP     CR 
  5669.      L0111:     C2 16 01              JP     NZ,L0116 
  5670.      L0114:     3E 36                 LD     A,'6' 
  5671.      L0116:     D6 30                 SUB    '0' 
  5672.  
  5673.  
  5674.  
  5675.  
  5676.           NOTE: So the routine at 0240h does something with a "$"-
  5677.           terminated string. Need we guess?
  5678.  
  5679.      Z80 C>l 240 
  5680.            l 240
  5681.       
  5682.      L0240:     0E 09                 LD     C,TAB 
  5683.      L0242:     C3 05 00              JP     L0005 
  5684.       
  5685.                     INIT_MSG: 
  5686.                          DB     SUB,"INIT 1.0 for Xero" 
  5687.      L0245:     1A 49 4E 49  
  5688.      L0249:     54 20 31 2E  
  5689.      L024D:     30 20 66 6F  
  5690.      L0251:     72 20 58 65  
  5691.      L0255:     72 6F             
  5692.  
  5693.  
  5694.           NOTE: First of all, note how the above disassembly changed
  5695.           from instructions to data, just as we told it to. Note also
  5696.           that this routine at 0240h is simple enough to document...
  5697.  
  5698.      Z80 C>= 5 bdos 
  5699.            = 5 bdos
  5700.       
  5701.      Z80 C>; 240 "\nPrint $-terminated string at (DE)" 
  5702.            ; 240 "\nPrint $-terminated string at (DE)"
  5703.       
  5704.      Z80 C>c 240 i 
  5705.            c 240 i
  5706.       
  5707.  
  5708. COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  5709.  
  5710.  
  5711.  
  5712.  
  5713.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 89
  5714.      USING THE RESOURCE BUILTIN COMMANDS
  5715.  
  5716.  
  5717.      Z80 C>= 240 print_string 
  5718.            = 240 print_string
  5719.       
  5720.      Z80 C>l 240 
  5721.            l 240
  5722.       
  5723.       
  5724.                     PRINT_STRING: 
  5725.       
  5726.                     ;  
  5727.                     ; Print $-terminated string at (DE) 
  5728.                     ;  
  5729.      L0240:     0E 09                 LD     C,TAB 
  5730.      L0242:     C3 05 00              JP     BDOS 
  5731.       
  5732.                     INIT_MSG: 
  5733.                          DB     SUB,"INIT 1.0 for Xero" 
  5734.      L0245:     1A 49 4E 49  
  5735.      L0249:     54 20 31 2E  
  5736.      L024D:     30 20 66 6F  
  5737.      L0251:     72 20 58 65  
  5738.      L0255:     72 6F             
  5739.  
  5740.  
  5741.  
  5742.  
  5743.           NOTE: OK, one routine down. Referring back to our disassembly
  5744.           of the startup code, let's see what else we can figure out.
  5745.  
  5746.      Z80 C>= 106 get_baud_rate 
  5747.            = 106 get_baud_rate
  5748.       
  5749.      Z80 C>l startup 
  5750.            l startup
  5751.       
  5752.       
  5753.                     STARTUP: 
  5754.      L0100:     11 45 02              LD     DE,INIT_MSG 
  5755.      L0103:     CD 40 02              CALL   PRINT_STRING 
  5756.       
  5757.                     GET_BAUD_RATE: 
  5758.      L0106:     11 C8 02              LD     DE,BAUD_PROMPT 
  5759.      L0109:     CD 40 02              CALL   PRINT_STRING 
  5760.      L010C:     CD 35 02              CALL   L0235 
  5761.      L010F:     FE 0D                 CP     CR 
  5762.      L0111:     C2 16 01              JP     NZ,L0116 
  5763.      L0114:     3E 36                 LD     A,'6' 
  5764.      L0116:     D6 30                 SUB    '0' 
  5765.  
  5766.  
  5767.  
  5768.  
  5769.  
  5770.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  5771.  
  5772.  
  5773.  
  5774.  
  5775.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 90
  5776.      USING THE RESOURCE BUILTIN COMMANDS
  5777.  
  5778.  
  5779.           NOTE: We have another routine to decipher - at 0235h.
  5780.  
  5781.      Z80 C>l 235 
  5782.            l 235
  5783.       
  5784.      L0235:     0E 01                 LD     C,SOH 
  5785.      L0237:     CD 05 00              CALL   BDOS 
  5786.      L023A:     FE 60                 CP     '`' 
  5787.      L023C:     D8                    RET    C 
  5788.      L023D:     D6 20                 SUB    ' ' 
  5789.      L023F:     C9                    RET 
  5790.       
  5791.                     PRINT_STRING: 
  5792.       
  5793.                     ;  
  5794.                     ; Print $-terminated string at (DE) 
  5795.                     ;  
  5796.      L0240:     0E 09                 LD     C,TAB 
  5797.      L0242:     C3 05 00              JP     BDOS 
  5798.       
  5799.                     INIT_MSG: 
  5800.                          DB     SUB,"INIT 1" 
  5801.      L0245:     1A 49 4E 49  
  5802.      L0249:     54 20 31          
  5803.  
  5804.  
  5805.  
  5806.  
  5807.           NOTE: Notice how the disassembly continued way past the end
  5808.           of our routine. That's because we didn't give an ending
  5809.           address. At any rate, the routine at 0235h appears to call
  5810.           BDOS to get a keypress, then force it to uppercase. It
  5811.           contains a slight bug, but our job right now is to re-source
  5812.           it, not fix it.
  5813.  
  5814.      Z80 C>= 235 get_bdos_keypress 
  5815.            = 235 get_bdos_keypress
  5816.       
  5817.      Z80 C>c 235 i 
  5818.            c 235 i
  5819.       
  5820.      Z80 C>; 235 "\nReturn next keypress as Uppercase char in A-reg" 
  5821.            ; 235 "\nReturn next keypress as Uppercase char in A-reg"
  5822.       
  5823.      Z80 C>; 237 "Use BDOS to get next keypress" 
  5824.            ; 237 "Use BDOS to get next keypress"
  5825.       
  5826.      Z80 C>; 23a "Is it lowercase char?" 
  5827.            ; 23a "Is it lowercase char?"
  5828.       
  5829.      Z80 C>; 23c "No, return it as-is" 
  5830.            ; 23c "No, return it as-is"
  5831.       
  5832.      Z80 C>; 23d "Yes, convert to uppercase" 
  5833.            ; 23d "Yes, convert to uppercase"
  5834.       
  5835.  
  5836. COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  5837.  
  5838.  
  5839.  
  5840.  
  5841.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 91
  5842.      USING THE RESOURCE BUILTIN COMMANDS
  5843.  
  5844.  
  5845.      Z80 C>l 235 
  5846.            l 235
  5847.       
  5848.       
  5849.                     GET_BDOS_KEYPRESS: 
  5850.       
  5851.                     ;  
  5852.                     ; Return next keypress as Uppercase char in A-reg
  5853.                     ;  
  5854.      L0235:    0E 01                LD    C,SOH 
  5855.      L0237:    CD 05 00             CALL  BDOS    ;Use BDOS to get next
  5856.                                                             keypress
  5857.      L023A:    FE 60                CP    '`'     ;Is it lowercase char?
  5858.      L023C:    D8                   RET   C       ;No, return it as-is
  5859.      L023D:    D6 20                SUB   ' '     ;Yes, convert to uppercase
  5860.      L023F:    C9                   RET 
  5861.       
  5862.                     PRINT_STRING: 
  5863.       
  5864.                     ;  
  5865.                     ; Print $-terminated string at (DE) 
  5866.                     ;  
  5867.      L0240:     0E 09                 LD     C,TAB 
  5868.      L0242:     C3 05 00              JP     BDOS 
  5869.       
  5870.                     INIT_MSG: 
  5871.                          DB     SUB,"INIT 1" 
  5872.      L0245:     1A 49 4E 49  
  5873.      L0249:     54 20 31          
  5874.  
  5875.  
  5876.  
  5877.  
  5878.  
  5879.           NOTE: OK, our little routines are understood and documented.
  5880.           Back to the main code, and add comments that clarify things.
  5881.  
  5882.      Z80 C>; 100 "Give intro screen" 
  5883.            ; 100 "Give intro screen"
  5884.       
  5885.      Z80 C>; 106 "Ask for baudrate value" 
  5886.            ; 106 "Ask for baudrate value"
  5887.       
  5888.      Z80 C>; 10f "RETURN only?" 
  5889.            ; 10f "RETURN only?"
  5890.       
  5891.      Z80 C>; 111 "No, look at keypress" 
  5892.            ; 111 "No, look at keypress"
  5893.       
  5894.      Z80 C>; 114 "Yes, use default value" 
  5895.            ; 114 "Yes, use default value"
  5896.       
  5897.      Z80 C>= 116 edit_baud_rate 
  5898.            = 116 edit_baud_rate
  5899.       
  5900.  
  5901. COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  5902.  
  5903.  
  5904.  
  5905.  
  5906.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 92
  5907.      USING THE RESOURCE BUILTIN COMMANDS
  5908.  
  5909.  
  5910.      Z80 C>l get_baud_rate 12b 
  5911.            l get_baud_rate 12b
  5912.       
  5913.       
  5914.                     GET_BAUD_RATE: 
  5915.      L0106:   11 C8 02           LD     DE,BAUD_PROMPT ;Ask for baudrate
  5916.                                                                  value 
  5917.      L0109:   CD 40 02           CALL   PRINT_STRING 
  5918.      L010C:   CD 35 02           CALL   GET_BDOS_KEYPRESS 
  5919.      L010F:   FE 0D              CP     CR          ;RETURN only? 
  5920.      L0111:   C2 16 01           JP     NZ,EDIT_BAUD_RATE ;No, look at
  5921.                                                                  keypress 
  5922.      L0114:   3E 36              LD     A,'6'       ;Yes, use default
  5923.                                                                  value 
  5924.       
  5925.                     EDIT_BAUD_RATE: 
  5926.      L0116:   D6 30              SUB    '0' 
  5927.      L0118:   FE 00              CP     NUL 
  5928.      L011A:   DA 06 01           JP     C,GET_BAUD_RATE 
  5929.      L011D:   FE 0A              CP     LF 
  5930.      L011F:   D2 06 01           JP     NC,GET_BAUD_RATE 
  5931.      L0122:   32 58 03           LD     (L0358),A 
  5932.      L0125:   11 EF 02           LD     DE,PARITY_PROMPT 
  5933.      L0128:   CD 40 02           CALL   PRINT_STRING 
  5934.      L012B:   CD 35 02           CALL   GET_BDOS_KEYPRESS 
  5935.  
  5936.  
  5937.  
  5938.  
  5939.           NOTE: And so on, and so on, and so on....
  5940.  
  5941.  
  5942.  
  5943.      We'll not present all of the output here. Although the session actually
  5944.      lasted less than half an hour, the output is huge. Instead, let us skip
  5945.      ahead to the point where we've finished defining our control table.
  5946.  
  5947.  
  5948.  
  5949.  
  5950.           NOTE: At this point - having done all of this work to con-
  5951.           struct documentation of the object code - we should save the
  5952.                                                               ________
  5953.           control table to disk!
  5954.           ______________________
  5955.  
  5956.      Z80 C>control write 820init.ctl
  5957.            control write 820init.ctl
  5958.  
  5959.  
  5960.  
  5961.  
  5962.  
  5963.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  5964.  
  5965.  
  5966.  
  5967.  
  5968.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 93
  5969.      USING THE RESOURCE BUILTIN COMMANDS
  5970.  
  5971.  
  5972.           NOTE: Having done that, we must prepare things for the actual
  5973.           generation of the .ASM file. Specifically, we should exclude
  5974.           addresses, opcodes, and flags from disassembly source lines.
  5975.       
  5976.      Z80 C>list include 
  5977.            list include
  5978.  
  5979.  
  5980.  
  5981.           NOTE: Now we can disassemble the object code to disk as source
  5982.           code. First we write the prologue, and then the program
  5983.           itself:
  5984.       
  5985.      Z80 C>list prologue 100 360 >820init.asm 
  5986.            list prologue 100 360 >820init.asm
  5987.       
  5988.      Z80 C>list 100 360 >>820init.asm 
  5989.            list 100 360 >>820init.asm
  5990.  
  5991.  
  5992.           NOTE: Having done that, let's test things by running the .ASM
  5993.           file through M80.COM...
  5994.       
  5995.      Z80 C>m80 820init.rel,820init.prn=820init.asm 
  5996.            m80 820init.rel,820init.prn=820init.asm
  5997.      %No END statement 
  5998.      %No END statement 
  5999.       
  6000.      No Fatal error(s) 
  6001.       
  6002.  
  6003.  
  6004.  
  6005.  
  6006.      That's it. We're done. The assembler version of 820INIT.COM has been
  6007.      written and verified.
  6008.  
  6009.      For your enjoyment, we have included with Z80MU the various 820INIT
  6010.      files that were used or created by the above session. Feel free to
  6011.      examine all of these files, especially 820INIT.ASM and 820INIT.PRN. They
  6012.      give you a good idea of the quality of source code that can be recreated
  6013.      from a given object program.
  6014.  
  6015.  
  6016.  
  6017.  
  6018.  
  6019.  
  6020.  
  6021.  
  6022.  
  6023.  
  6024.  
  6025.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  6026.  
  6027.  
  6028.  
  6029.  
  6030.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 94
  6031.      Appendix A: Layout of CP/M Segment
  6032.  
  6033.  
  6034.       
  6035.      Appendix A: Layout of Simulated CP/M Segment (as set by Cold Boot) 
  6036.      __________________________________________________________________
  6037.       
  6038.      0000:     JMP  0FF03H         ;to our fake BIOS 
  6039.      0003:     DB   ?              ;IOBYTE 
  6040.      0004:     DB   ?              ;Login Byte (drive, User Number) 
  6041.      0005:     JMP  0FEFEH         ;to our fake BDOS 
  6042.      005C:     DB   ?              ;Default FCB 
  6043.      0080:     DB   ?              ;Default DMA and Command Tail 
  6044.      0100:     DB   ?              ;start of TPA 
  6045.      FEFD:     DB   ?              ;last byte of TPA 
  6046.      FEFE:     HALT                ;our BDOS hook 
  6047.      FEFF:     RET                 ;return from BDOS 
  6048.      FF00:     JMP  0FF80H         ;BIOS COLD BOOT vector 
  6049.      FF03:     JMP  0FF82H         ;BIOS WARM BOOT vector 
  6050.      FF06:     JMP  0FF84H         ;BIOS console status 
  6051.      FF09:     JMP  0FF86H         ;BIOS console input 
  6052.      FF0C:     JMP  0FF88H         ;BIOS console output 
  6053.      FF0F:     JMP  0FF8AH         ;BIOS list output 
  6054.      FF12:     JMP  0FF8CH         ;BIOS punch output 
  6055.      FF15:     JMP  0FF8EH         ;BIOS reader input 
  6056.      FF18:     JMP  0FF90H         ;BIOS home disk 
  6057.      FF1B:     JMP  0FF92H         ;BIOS select disk 
  6058.      FF1E:     JMP  0FF94H         ;BIOS set track 
  6059.      FF21:     JMP  0FF96H         ;BIOS set sector 
  6060.      FF24:     JMP  0FF98H         ;BIOS set DMA address 
  6061.      FF27:     JMP  0FF9AH         ;BIOS read sector 
  6062.      FF2A:     JMP  0FF9CH         ;BIOS write sector 
  6063.      FF2D:     JMP  0FF9EH         ;BIOS list status 
  6064.      FF30:     JMP  0FFA0H         ;BIOS (unimplemented) 
  6065.      FF33:     JMP  0FFA2H         ;BIOS (unimplemented) 
  6066.      FF36:     JMP  0FFA4H         ;BIOS (unimplemented) 
  6067.      FF39:     JMP  0FFA6H         ;BIOS (unimplemented) 
  6068.      FF3C:     JMP  0FFA8H         ;BIOS (unimplemented) 
  6069.      FF3F:     JMP  0FFAAH         ;BIOS (unimplemented) 
  6070.      FF42:     JMP  0FFACH         ;BIOS (unimplemented) 
  6071.      FF45:     JMP  0FFAEH         ;BIOS (unimplemented) 
  6072.      FF48:     JMP  0FFB0H         ;BIOS (unimplemented) 
  6073.      FF4B:     JMP  0FFB2H         ;BIOS (unimplemented) 
  6074.      FF4E:     JMP  0FFB4H         ;BIOS (unimplemented) 
  6075.      FF51:     JMP  0FFB6H         ;BIOS (unimplemented) 
  6076.      FF54:     JMP  0FFB8H         ;BIOS (unimplemented) 
  6077.      FF57:     JMP  0FFBAH         ;BIOS (unimplemented) 
  6078.      FF5A:     JMP  0FFBCH         ;BIOS (unimplemented) 
  6079.      FF5D:     JMP  0FFBEH         ;BIOS (unimplemented) 
  6080.      FF60:     JMP  0FFC0H         ;BIOS (unimplemented) 
  6081.      FF63:     JMP  0FFC2H         ;BIOS (unimplemented) 
  6082.      FF66:     JMP  0FFC4H         ;BIOS (unimplemented) 
  6083.  
  6084.  
  6085.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  6086.  
  6087.  
  6088.  
  6089.  
  6090.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 95
  6091.      Appendix A: Layout of CP/M Segment
  6092.  
  6093.  
  6094.      FF69:     JMP  0FFC6H         ;BIOS (unimplemented) 
  6095.      FF6C:     JMP  0FFC8H         ;BIOS (unimplemented) 
  6096.      FF6F:     JMP  0FFCAH         ;BIOS (unimplemented) 
  6097.      FF72:     JMP  0FFCCH         ;BIOS (unimplemented) 
  6098.      FF75:     JMP  0FFCEH         ;BIOS (unimplemented) 
  6099.      FF78:     JMP  0FFD0H         ;BIOS (unimplemented) 
  6100.      FF7B:     JMP  0FFD2H         ;BIOS (unimplemented) 
  6101.       
  6102.      FF80:     HALT                ;BIOS COLD BOOT hook 
  6103.      FF81:     RET 
  6104.      FF82:     HALT                ;BIOS WARM BOOT hook 
  6105.      FF83:     RET 
  6106.      FF84:     HALT                ;BIOS console status 
  6107.      FF85:     RET 
  6108.      FF86:     HALT                ;BIOS console input 
  6109.      FF87:     RET 
  6110.      FF88:     HALT                ;BIOS console output 
  6111.      FF89:     RET 
  6112.      FF8A:     HALT                ;BIOS list output 
  6113.      FF8B:     RET 
  6114.      FF8C:     HALT                ;BIOS punch output 
  6115.      FF8D:     RET 
  6116.      FF8E:     HALT                ;BIOS reader input 
  6117.      FF8F:     RET 
  6118.      FF90:     HALT                ;BIOS home disk 
  6119.      FF91:     RET 
  6120.      FF92:     HALT                ;BIOS select disk 
  6121.      FF93:     RET 
  6122.      FF94:     HALT                ;BIOS set track 
  6123.      FF95:     RET 
  6124.      FF96:     HALT                ;BIOS set sector 
  6125.      FF97:     RET 
  6126.      FF98:     HALT                ;BIOS set DMA address 
  6127.      FF99:     RET 
  6128.      FF9A:     HALT                ;BIOS read sector 
  6129.      FF9B:     RET 
  6130.      FF9C:     HALT                ;BIOS write sector 
  6131.      FF9D:     RET 
  6132.      FF9E:     HALT                ;BIOS list status 
  6133.      FF9F:     RET 
  6134.      FFA0:     HALT                ;BIOS (unimplemented) 
  6135.      FFA1:     RET 
  6136.      FFA2:     HALT                ;BIOS (unimplemented) 
  6137.      FFA3:     RET 
  6138.      FFA4:     HALT                ;BIOS (unimplemented) 
  6139.      FFA5:     RET 
  6140.      FFA6:     HALT                ;BIOS (unimplemented) 
  6141.      FFA7:     RET 
  6142.  
  6143.  
  6144.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  6145.  
  6146.  
  6147.  
  6148.  
  6149.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 96
  6150.      Appendix A: Layout of CP/M Segment
  6151.  
  6152.  
  6153.      FFA8:     HALT                ;BIOS (unimplemented) 
  6154.      FFA9:     RET 
  6155.      FFAA:     HALT                ;BIOS (unimplemented) 
  6156.      FFAB:     RET 
  6157.      FFAC:     HALT                ;BIOS (unimplemented) 
  6158.      FFAD:     RET 
  6159.      FFAE:     HALT                ;BIOS (unimplemented) 
  6160.      FFAF:     RET 
  6161.      FFB0:     HALT                ;BIOS (unimplemented) 
  6162.      FFB1:     RET 
  6163.      FFB2:     HALT                ;BIOS (unimplemented) 
  6164.      FFB3:     RET 
  6165.      FFB4:     HALT                ;BIOS (unimplemented) 
  6166.      FFB5:     RET 
  6167.      FFB6:     HALT                ;BIOS (unimplemented) 
  6168.      FFB7:     RET 
  6169.      FFB8:     HALT                ;BIOS (unimplemented) 
  6170.      FFB9:     RET 
  6171.      FFBA:     HALT                ;BIOS (unimplemented) 
  6172.      FFBB:     RET 
  6173.      FFBC:     HALT                ;BIOS (unimplemented) 
  6174.      FFBD:     RET 
  6175.      FFBE:     HALT                ;BIOS (unimplemented) 
  6176.      FFBF:     RET 
  6177.      FFC0:     HALT                ;BIOS (unimplemented) 
  6178.      FFC1:     RET 
  6179.      FFC2:     HALT                ;BIOS (unimplemented) 
  6180.      FFC3:     RET 
  6181.      FFC4:     HALT                ;BIOS (unimplemented) 
  6182.      FFC5:     RET 
  6183.      FFC6:     HALT                ;BIOS (unimplemented) 
  6184.      FFC7:     RET 
  6185.      FFC8:     HALT                ;BIOS (unimplemented) 
  6186.      FFC9:     RET 
  6187.      FFCA:     HALT                ;BIOS (unimplemented) 
  6188.      FFCB:     RET 
  6189.      FFCC:     HALT                ;BIOS (unimplemented) 
  6190.      FFCD:     RET 
  6191.      FFCE:     HALT                ;BIOS (unimplemented) 
  6192.      FFCF:     RET 
  6193.      FFD0:     HALT                ;BIOS (unimplemented) 
  6194.      FFD1:     RET 
  6195.      FFD2:     HALT                ;BIOS (unimplemented) 
  6196.      FFD3:     RET 
  6197.      FFD4:                         ;rest reserved for scratch use
  6198.  
  6199.  
  6200.  
  6201.  
  6202.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  6203.  
  6204.  
  6205.  
  6206.  
  6207.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 97
  6208.      Appendix B: Bugs and Future Plans
  6209.  
  6210.  
  6211.  
  6212.       
  6213.                         Appendix B: Bugs and Future Plans
  6214.                         _________________________________
  6215.  
  6216.       
  6217.      This section describes known bugs and otherwise strange Emulator
  6218.      activity. Please help us to improve the product by sending us your own
  6219.      bug reports, with as much detail as possible (including programs
  6220.      which demonstrate the bug). 
  6221.       
  6222.      These bugs will be fixed as time allows and user interest demands.
  6223.  
  6224.       
  6225.           Issue: The disassembly (list) command can become quite pokey.
  6226.                                   list
  6227.           ______
  6228.                As the control table grows, disassembly speed decreases.
  6229.                When disassembling the Model 100's ROM, for instance, the
  6230.                poor disassembler is faced with a control table that is
  6231.                something bigger than 42K in size. It may have to
  6232.                search most of the table for each memory reference. This
  6233.                yields a disassembly speed of a line or two a second.
  6234.                Boo! The control table search routines should be changed
  6235.                from a sequential to an indexed method.
  6236.  
  6237.           Author's Response: Agreed. Will rewrite these for next
  6238.           __________________
  6239.                release. 
  6240.       
  6241.  
  6242.           Issue: Some commands (notably those that accept a range of
  6243.           ______
  6244.                CP/M addresses) get confused if they are asked to wrap
  6245.                around the high end of the 64K CP/M segment.
  6246.  
  6247.           Author's Response: Have applied fixes for most glaring
  6248.           __________________
  6249.                problems. Would appreciate specifics (i.e. - what
  6250.                commands fail and how) to help track down the rest. 
  6251.       
  6252.  
  6253.           Issue: Internal I/O redirection (effected by the Emulator, not
  6254.           ______
  6255.                PCDOS) should be available for any Emulator command, not
  6256.                just the list command. 
  6257.                         list
  6258.       
  6259.           Author's Response: Agreed. Will look into it.
  6260.           __________________
  6261.  
  6262.  
  6263.  
  6264.  
  6265.  
  6266.  
  6267.  
  6268.  
  6269.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  6270.  
  6271.  
  6272.  
  6273.  
  6274.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 98
  6275.      Appendix B: Bugs and Future Plans
  6276.  
  6277.  
  6278.  
  6279.           Issue: The patch command ought to allow multiple entries per
  6280.                      patch
  6281.           ______
  6282.                line, and ought to accept arguments on the patch command
  6283.                                                           patch
  6284.                line without dropping into interactive patch mode. 
  6285.       
  6286.           Author's Response: Have provided left-handed solution by
  6287.           __________________
  6288.                allowing a patch string on same line as patch command.
  6289.                                                        patch
  6290.                True fix (with multiple byte values as independent args
  6291.                on command line) will take a while to implement.
  6292.  
  6293.  
  6294.           Issue: The Emulator lacks a mini assembler. It needs one. 
  6295.           ______
  6296.       
  6297.           Author's Response: Agreed. We just don't have the memory left
  6298.           __________________
  6299.                in the 64K Lattice code segment to do it right. Maybe
  6300.                after some major rework...
  6301.  
  6302.  
  6303.           Issue: The Emulator's main program ought to be rewritten in
  6304.           ______
  6305.                Microsoft C version 3.0. This will speed it up consider-
  6306.                ably, and will make it a lot smaller. 
  6307.       
  6308.           Author's Response: Agreed. The major effort is in reworking
  6309.           __________________
  6310.                the assembler subroutines. There are a lot of places
  6311.                                                       lot
  6312.                where Lattice's calling convention and register usage is
  6313.                assumed.
  6314.  
  6315.  
  6316.           Issue: It would be nice to somehow state to the Emulator that
  6317.           ______
  6318.                what is in CP/M memory is actually an 8080 or 8085
  6319.                program. This would allow the 8085's RIM and SIM instruc-
  6320.                tions, for example, to be properly disassembled (instead
  6321.                of being misinterpreted as Z80 relative jumps). 
  6322.       
  6323.           Author's Response: Agreed. The biggest obstacle to doing this
  6324.           __________________
  6325.                is the same old bugaboo - no memory left in 64K code
  6326.                segment. Will put this off until we free up a couple of
  6327.                K in the code segment.
  6328.  
  6329.  
  6330.  
  6331.  
  6332.  
  6333.  
  6334.  
  6335.  
  6336.  
  6337.  
  6338.  
  6339.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  6340.  
  6341.  
  6342.  
  6343.  
  6344.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 99
  6345.      Appendix B: Bugs and Future Plans
  6346.  
  6347.  
  6348.  
  6349.  
  6350.           Issue: The loading of Z80 .COM files to be executed - in fact,
  6351.           ______
  6352.                any file load that is done directly or indirectly by the
  6353.                "read" command - is just too slow.
  6354.                 read
  6355.  
  6356.           Author's Response: Agreed! This should be redone to bypass
  6357.           __________________
  6358.                Lattice C's slow I/O routines. This problem may go away
  6359.                if and when the Emulator is rewritten in Microsoft 'C'
  6360.                version 3.0.
  6361.       
  6362.  
  6363.           Issue: The disassembler can get confused when a multi-byte
  6364.           ______
  6365.                opcode crosses a control break. In general, it reverts
  6366.                to DB pseudo ops up to the control break when this
  6367.                happens. Also, it's not too smart when disassembling
  6368.                code with addresses up around the 64K segment boundary.
  6369.       
  6370.           Author's Response: I have tried to locate and eliminate
  6371.           __________________
  6372.                peephole problems. The nature of the problem, however,
  6373.                goes to the very core of the disassembler as designed.
  6374.                This is not quickly (or cheaply) fixable.
  6375.  
  6376.  
  6377.           Issue: There are too many CP/M applications which abort
  6378.           ______
  6379.                because they use BDOS functions 27/1Bh and 31/1Fh. These
  6380.                BDOS functions should be supported, even if they mean
  6381.                little on a PCDOS system.
  6382.  
  6383.           Author's Response: Agreed. The only reason that they haven't
  6384.           __________________
  6385.                been emulated is that I have yet to find a sensible
  6386.                writeup of just exactly what the various data formats
  6387.                are. DRI's writeup stinks. If someone can provide a
  6388.                clear explanation of just what they truly mean, then
  6389.                I'll emulate them.
  6390.  
  6391.  
  6392.           Issue: There are more than 600 distinct instructions in the
  6393.           ______
  6394.                Z80. Have they all been validated as to the accuracy of
  6395.                the emulation?
  6396.  
  6397.           Author's Response: So far, all we've done is run Z80 stuff and
  6398.           __________________
  6399.                try to guess that it has run fine. All opcodes have been
  6400.                desk-checked. Not all opcodes have been tested. Most, in
  6401.                fact, have not even been executed. Would somebody please
  6402.                                                                  please
  6403.                create a definitive test program? The diagnostics that
  6404.                we've tried (like Supersoft's) have proven to be inac-
  6405.                curate.
  6406.  
  6407.  
  6408.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  6409.  
  6410.  
  6411.  
  6412.  
  6413.      "Z80MU" Z80 and CP/M 2.2 Emulator User's Guide            Page 100
  6414.      Appendix B: Bugs and Future Plans
  6415.  
  6416.  
  6417.  
  6418.  
  6419.           Issue: There should be an option to allow pagination of
  6420.           ______
  6421.                disassembled object code.
  6422.  
  6423.           Author's Response: Agreed. Will look into another list include
  6424.                                                             list include
  6425.           __________________
  6426.                option to specify pagination.
  6427.  
  6428.  
  6429.           Issue: Expressions are currently limited to "+" and "-"
  6430.           ______
  6431.                operators. They should allow "*" and "/" also, and maybe
  6432.                even AND, OR, XOR, shifts, etc.
  6433.  
  6434.           Author's Response: I disagree. The amount of work involved
  6435.           __________________
  6436.                isn't justified by the benefit.
  6437.  
  6438.  
  6439.           Issue: The Z80 IN and OUT instructions should have access to
  6440.           ______
  6441.                real 8088 I/O ports on the IBM PC.
  6442.  
  6443.           Author's Response: Over my dead body.
  6444.           __________________
  6445.  
  6446.  
  6447.  
  6448.  
  6449.  
  6450.  
  6451.  
  6452.  
  6453.  
  6454.  
  6455.  
  6456.  
  6457.  
  6458.  
  6459.  
  6460.  
  6461.  
  6462.  
  6463.  
  6464.  
  6465.  
  6466.  
  6467.  
  6468.  
  6469.  
  6470.  
  6471.  
  6472.  
  6473.      COMPUTERWISE CONSULTING SERVICES, P.O. BOX 813, MCLEAN, VA 22101
  6474.  
  6475.  
  6476.