home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / enterprs / cpm / utils / a / 22nice12.arc / 22NICE.DOC next >
Encoding:
Text File  |  1988-08-07  |  47.6 KB  |  1,180 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.                        22NICE - A NEW INSYSTEM CP/M 2.2 EMULATOR
  14.  
  15.  
  16.  
  17.                                 Version 1.2, July, 1988
  18.  
  19.                               Copyright 1988, C. P. Guzis
  20.  
  21.                                          SYDEX
  22.                                  153 North Murphy Ave.
  23.                                  Sunnyvale, CA  94086
  24.                                     (408) 739-4866
  25.  
  26.                                   All Rights Reserved
  27.  
  28.  
  29.                                         NOTICE
  30.  
  31.                 THIS IS NOT FREE  SOFTWARE!   If you   paid    a  "public
  32.                 domain"    vendor  for  this program,   you paid for the
  33.                 service of copying the program,  and not for the program
  34.                 itself.    Rest  assured  that  nothing ever gets to the
  35.                 originators of this product from such a sale.   You  may
  36.                 evaluate  this product,  but if you make use of it,  you
  37.                 must register your copy.
  38.  
  39.                 We offer several inducements  to  you  for  registering.
  40.                 First  of  all,  you receive the most up-to-date copy of
  41.                 the program that we have - and we do update the  product
  42.                 on a regular basis.  You also receive support for  22NICE
  43.                 - which can be quite valuable at times.  And finally, we
  44.                 have  a  few  utilities  not  included in the evaluation
  45.                 package.   Make no mistake,  however - this is  a  fully
  46.                 functional  version  of  22NICE  and not "crippled" in any
  47.                 way.
  48.  
  49.  
  50.                                 REGISTRATION INFORMATION
  51.  
  52.                 The  non-commercial  single-user  registration  fee  for
  53.                 22NICE   is $30.00 US.  This registration also includes a
  54.                 copy of   22DISK ,  a  CP/M  diskette  conversion  utility
  55.                 package.    The  commercial and multisystem site fee for
  56.                 22NICE  is $75.00.
  57.  
  58.                 Send a check or company P.O.  for the appropriate amount
  59.                 to:
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.                                          SYDEX
  68.                                  153 North Murphy Ave.
  69.                                   Sunnyvale, CA 94086
  70.  
  71.                 Please indicate what product you are ordering and if you
  72.                 have  a  requirement  for 3.5" media.   We normally ship
  73.                 5.25" 360K diskettes,  but will furnish 3.5" 720K  media
  74.                 upon request.
  75.  
  76.  
  77.  
  78.                                   DISTRIBUTION NOTICE
  79.  
  80.                 This  is  "user-supported"  software.    You  are hereby
  81.                 granted a license by Sydex to distribute this evaluation
  82.                 copy of  22NICE  and its  documentation,  subject  to  the
  83.                 following conditions:
  84.  
  85.                 1.    22NICE   may be distributed freely without charge in
  86.                      evaluation form only.
  87.  
  88.                 2.    22NICE  may not be sold, licensed,  or a fee charged
  89.                      for  its  use.    If a fee is charged in connection
  90.                      with  22NICE ,  it must cover the cost of copying  or
  91.                      dissemination  only.   Such charges must be clearly
  92.                      identified as such by the originating party.  Under
  93.                      no circumstances may the purchaser be given the im-
  94.                      pression that he is buying  22NICE  itself.
  95.  
  96.                 3.    22NICE  must be presented as a  complete  unit,  in-
  97.                      cluding this documentation.  Neither  22NICE  nor its
  98.                      documentation may be amended or altered in any way.
  99.  
  100.                 4.    By granting you the right to distribute the evalua-
  101.                      tion form of  22NICE , you do not become the owner of
  102.                      22NICE  in any form.
  103.  
  104.                 Any other use,  distribution or representation of  22NICE
  105.                 is expressly forbidden without the  written  consent  of
  106.                 SYDEX.
  107.  
  108.  
  109.  
  110.                 CP/M,  CP/M-80  and  CP/M  2.2 are trademarks of Digital
  111.                 Research.  MS-DOS is a trademark of Microsoft.   IBM PC,
  112.                 PC-XT and PC-AT are trademarks of International Business
  113.                 Machines.   V20,  V30, uPD70108, uPD70116 are trademarks
  114.                 of NEC Electronics.    Some  products  of  Lear-Siegler,
  115.                 Kaypro, Osborne and Televideo are also trademarked.
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.                                    Table of Contents
  124.  
  125.  
  126.              22NICE IN BRIEF..............................................1
  127.  
  128.              COMMAND SYNTAX CONVENTIONS...................................1
  129.  
  130.              USING THE 22NICE CP/M EMULATOR...............................2
  131.  
  132.              HOW 22NICE WORKS.............................................3
  133.  
  134.              INSTALLING 22NICE............................................5
  135.  
  136.              THE GENCOM UTILITY - GENERATE A PRE-LOADER...................6
  137.  
  138.              LOCATING CP/M PROGRAM FILES..................................9
  139.  
  140.              A SAMPLE 22NICE INSTALLATION................................10
  141.  
  142.              USE OF CP/M SUBMIT AND XSUB.................................12
  143.  
  144.              USER NUMBER SUPPORT.........................................13
  145.  
  146.              SAVING MEMORY IMAGES - THE CSAVE COMMAND....................14
  147.  
  148.              MISCELLANEOUS TOPICS........................................14
  149.               Accessing I/O Ports........................................15
  150.               Accessing PC Memory........................................15
  151.               IOBYTE Support.............................................15
  152.               Physical Disk Addressing...................................16
  153.               Maximum Program Size.......................................16
  154.               Disk Drive Reassignment....................................16
  155.  
  156.              IN CLOSING..................................................16
  157.  
  158.              OTHER SYDEX PRODUCTS........................................17
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.            22NICE IN BRIEF
  169.  
  170.            22NICE   is a Z-80/8080 CP/M 2.2 emulator for use on PC-compatible
  171.            computers.   The  22NICE  CP/M Emulation package offers the follow-
  172.            ing features:
  173.  
  174.                 *     Emulate  8080/8085/Z-80  processors with or without NEC
  175.                      V-series chip installed.
  176.  
  177.                 *     Provides  terminal  emulation  for  most  common   CP/M
  178.                      machines  with  terminal  types  for  Osborne,  Kaypro,
  179.                      Heath/Zenith,   Morrow,   Actrix,   DEC   VT-100/VT-52,
  180.                      Televideo 925 and LSI ADM-3X.
  181.  
  182.                 *     Supports  CP/M user number to DOS subdirectory transla-
  183.                      tion.
  184.  
  185.                 *     Allows use of  DOS  "pipes"  and  utilities  with  CP/M
  186.                      programs.
  187.  
  188.                 *     Supports  a  complete set of BDOS and BIOS function in-
  189.                      terfaces, including direct disk read/write.
  190.  
  191.                 *     CP/M programs are fully integrated  into  the  DOS  en-
  192.                      vironment;  the user is unaware that a program is CP/M-
  193.                      or DOS-based.
  194.  
  195.            All this for a nominal registration fee!  You'd easily pay over a
  196.            hundred dollars for a commercial  package  with  far  fewer  cap-
  197.            abilities.   In addition,  we include the  22DISK  CP/M-to-DOS con-
  198.            version package with every  22NICE  registration.
  199.  
  200.  
  201.            COMMAND SYNTAX CONVENTIONS
  202.  
  203.            In order to discuss the general form of various  22NICE   commands,
  204.            a number of conventions have been adopted in this document:
  205.  
  206.                 (1)   All  commands  are assumed to be followed by depression
  207.                      of the ENTER key.  Sometimes this key is referred to as
  208.                      RETURN or CARRIAGE RETURN.
  209.  
  210.                 (2)   All upper-case (capital) letters are entered exactly as
  211.                      shown in the command description.  For instance,
  212.  
  213.                           CFMT
  214.  
  215.                      is entered as depressions of the "C", "F",  "M" and "T"
  216.                      keys.    Actual  case  of the entered characters is ir-
  217.                      relevant; that is,  either upper- or lower-case letters
  218.                      may be entered.
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.                 (3)   Any  item  enclosed in quotes (") refers to a name of a
  227.                      particular type of  item  and  is  not  to  be  entered
  228.                      literally.  For example:
  229.  
  230.                           "CP/M file"
  231.  
  232.                      refers  to  a  general CP/M file designator and NOT the
  233.                      characters "CP/M file".
  234.  
  235.                 (4)   Any item enclosed in parentheses ("(" and  ")")  refers
  236.                      to  an item which may be omitted from the command line.
  237.                      For example:
  238.  
  239.                           ("disk type")
  240.  
  241.                      refers to a disk type item which may be left  out  com-
  242.                      pletely from the command statement.
  243.  
  244.                 (5)   Any  blank  character  may be replaced by more than one
  245.                      blank character.
  246.  
  247.            These conventions will be used throughout this document with  ad-
  248.            ditional explanations where required.
  249.  
  250.  
  251.            USING THE 22NICE CP/M EMULATOR
  252.  
  253.            The  emulation  of  8080  and  Z-80 processors on the PC is not a
  254.            recent development.   Almost since  the  beginning,  co-processor
  255.            cards  have  been  available  for the PC and various efforts have
  256.            been made to include CP/M 2.2 support in the  general  scheme  of
  257.            things.  CP/M 2.2 on an MS-DOS machine is a tempting prospect -
  258.            after all, MS-DOS was based on CP/M 2.2 (and not CP/M-86).
  259.  
  260.            In  1985,  NEC introduced a pin-compatible 8088 work-alike called
  261.            the uPD70108 or V20.   The curious thing about this chip is  that
  262.            it's  really  two  processors  in one - an 8088 for PC-based ("16
  263.            bit") software,  and  an  8080  for  the  older  CP/M  ("8  bit")
  264.            software.    Switching  between  the  modes  is done with special
  265.            machine instructions.   What could be a more natural product than
  266.            a CP/M emulator running on the PC?
  267.  
  268.            It happened that a lot of people got this idea and offered a host
  269.            of  packages  differing  in  appearance and function to do essen-
  270.            tially the same thing  -  emulate  a  CP/M  environment.    Sydex
  271.            developed   22NICE ,  but decided against marketing it for or three
  272.            years,  primarily because of the number of similar  products  al-
  273.            ready being offered.
  274.  
  275.            The fuss has died down now.   Intel is still suing NEC on charges
  276.            of copyright infringement over the V20,  but by and  large,  CP/M
  277.            support is of no great interest.   The V20,  alas, would not emu-
  278.  
  279.                                         Page 1
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.            late a Z80,  and it does have a few unfixed "bugs" in its  emula-
  287.            tion mode.   Besides, PC-AT clones are really selling now and you
  288.            can't drop a V20 into one of those.
  289.  
  290.            So Sydex has dusted off its emulator,   22NICE  and put it  out  in
  291.            the  shareware  market.     22NICE  offers the following advantages
  292.            over its competition:
  293.  
  294.                 *     22NICE  will use a V20 if it's present and  do  software
  295.                      emulation  if  it's  not.   This means that you can run
  296.                      your old CP/M programs on your PC-AT.
  297.  
  298.                 *     22NICE  contains an  emulator  for  both  8080  and  Z80
  299.                      processors.    In  addition,   22NICE  has a "test" mode,
  300.                      which  will  allow  you  to  identify  the  appropriate
  301.                      processor that you need to emulate.   It will also tell
  302.                      you if your program will run afoul of one  of  the  V20
  303.                      bugs.
  304.  
  305.                 *     22NICE  supports a user number-subdirectory mapping that
  306.                      allows  your  CP/M  program  to  access DOS's directory
  307.                      structure.
  308.  
  309.                 *     22NICE  contains terminal emulation routines for  a  few
  310.                      common  terminal  types which will usually allow you to
  311.                      run a program without re-installing,
  312.  
  313.                 *     If terminal emulation isn't  important,   22NICE   allows
  314.                      your  program  to  use  DOS  console  input  and output
  315.                      facilities.  This means that you can use a CP/M program
  316.                      as part of a DOS "pipe".
  317.  
  318.                 *     And finally,   22NICE  fits CP/M into the DOS environment
  319.                      - CP/M programs use the DOS facilities and are not dis-
  320.                      tinguishable  from  other DOS programs.   This means no
  321.                      special CP/M-like command interpreter is needed.
  322.  
  323.            Together with the diskette data conversion programs,  support  of
  324.            CP/M 2.2 applications on a PC can really be painless.
  325.  
  326.  
  327.            HOW 22NICE WORKS
  328.  
  329.            There  are  several  ways  to implement a CP/M-like operating en-
  330.            vironment on a PC-class computer:
  331.  
  332.                 (1)   Emulate an 8080 or Z-80-based computer system  and  run
  333.                      CP/M 2.2 more or less "straight out of the box".   This
  334.                      approach leads to difficulties in  making  use  of  DOS
  335.                      data files and system functions.  It also requires that
  336.                      you "shift gears" mentally each time you make the tran-
  337.                      sition from CP/M to DOS and vice-versa.
  338.  
  339.                                         Page 2
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.                 (2)   Emulate the CP/M operating environment and provide 8080
  348.                      and  Z-80  emulation.   This might take care of some of
  349.                      the DOS data interchange problems,  but "crossing over"
  350.                      to  DOS  is  difficult  and  few  of  the  benefits and
  351.                      resource of DOS are available to CP/M users.
  352.  
  353.                 (3)   Support the CP/M I/O interface  and  provide  8080/Z-80
  354.                      emulation, but leave DOS in control as the host operat-
  355.                      ing system.   This involves the greatest effort and re-
  356.                      quires an intimate knowledge of CP/M 2.2 and MS-DOS in-
  357.                      ternals to really work  properly.    However,  all  DOS
  358.                      facilities  are  at  your disposal and "mixing" of CP/M
  359.                      and DOS applications happens naturally.   This  is  the
  360.                      approach taken in  22NICE .
  361.  
  362.            22NICE  puts the bulk of the emulation in a DOS installable device
  363.            driver package called  22RES.SYS .  22RES not only contains support
  364.            for CP/M functions, but also provides software emulators for both
  365.            the 8080 and the Z-80 instruction sets.
  366.  
  367.            CP/M  programs  are  loaded  by  having DOS first execute a "pre-
  368.            loader", which provides information to 22RES about the program to
  369.            be executed.   22RES then allocates the necessary  memory,  loads
  370.            the CP/M program code, and begins emulation.
  371.  
  372.            A  CP/M  executable  file  normally  has a file name extension of
  373.            "COM".  This creates problems, however, with existing DOS
  374.            programs having the same extension.   DOS does no checking on the
  375.            contents of "COM" files -- executing a CP/M file in DOS 8088 mode
  376.            could lead to disaster.
  377.  
  378.            22NICE   handles this by renaming all CP/M executable files with a
  379.            "CPM" file name extension.  CP/M programs, therefore, are not
  380.            directly executable by DOS.    The  "pre-loader"  for  each  CP/M
  381.            program carries the "COM" name extension and the name of the CP/M
  382.            program to which it is related.  The pre-loader is short -- about
  383.            600 bytes, but one is needed for each CP/M executable file.  This
  384.            can get to be a nuisance if you're not running with a fixed disk,
  385.            so  we've  also  provided a "bound" program form,  where the CP/M
  386.            program is combined with the pre-loader in a single program file.
  387.  
  388.            This "pre-loader" concept is very powerful - it allows  different
  389.            programs    to    execute    with different operating parameters.
  390.            MicroPro's WordStar,  for example,  best runs in a mode where the
  391.            numeric  keypad  is re-mapped to provide WordStar cursor movement
  392.            codes.  CP/M system utilities, however, best run with no terminal
  393.            emulation,  allowing console input and output to be redirected if
  394.            desired.   One program may require Z-80 software emulation, where
  395.            another might not.
  396.  
  397.  
  398.  
  399.                                         Page 3
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.            22NICE  has been in use within Sydex for some time - currently  we
  407.            have  it  running  in  AT's and XT's and on at least one CompuPro
  408.            8086 machine.
  409.  
  410.  
  411.            INSTALLING 22NICE
  412.  
  413.            The files associated with CP/M emulation are the following:
  414.  
  415.                 22RES.SYS       the resident support driver.
  416.                 CUSER.EXE       user number information utility.
  417.                 GENCOM.COM      generate a DOS *.COM file.
  418.                 CSAVE.COM       SAVE command a la CP/M SAVE
  419.  
  420.            To install  22NICE  on your system, you'll need to insert a line in
  421.            your  CONFIG.SYS  file on your boot drive.  The line should read as
  422.            follows:
  423.  
  424.                 DEVICE=22RES.SYS
  425.  
  426.            A statement to insert the required text into CONFIG.SYS is:
  427.  
  428.                 ECHO DEVICE=22RES.SYS >X
  429.                 COPY /A \CONFIG.SYS+X CONFIG.SYS
  430.                 DEL X
  431.  
  432.            You may also use any ASCII text editor, such as EDLIN,  to do the
  433.            same thing.
  434.  
  435.            Make  sure  that   22RES.SYS   gets placed in the root directory on
  436.            your boot disk so DOS can access it.   You can  also  put  it  in
  437.            another  directory  and  include  the path specification with the
  438.            file name on the DEVICE= line.  For example,
  439.  
  440.                 DEVICE=\CPM22\22RES.SYS
  441.  
  442.            22RES needs two hardware interrupt vector slots to function.   If
  443.            you  don't  specify which interrupt to use,  22RES starts looking
  444.            for an available one beginning with interrupt 128.   If you  need
  445.            to specify the interrupts to be used,  the  CONFIG.SYS  line should
  446.            look like this -
  447.  
  448.                 DEVICE=22RES.SYS <i1> <i2>
  449.  
  450.            where <i1> and <i2> are interrupt ordinals expressed  as  decimal
  451.            numbers.   If just <i1> is specified,  interrupt vectors <i1> and
  452.            the one immediately following (<i1>+1) will be used.
  453.  
  454.            At this point,  it is assumed that you've gotten your CP/M  files
  455.            over  to your PC somehow.   Remember that CP/M program files with
  456.            an extension of "COM" need to be renamed to have an extension  of
  457.  
  458.  
  459.                                         Page 4
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.            "CPM".    The   22DISK  conversion utilities do this automatically,
  467.            but if you've used some other means to obtain your files,  you'll
  468.            need to rename them manually.
  469.  
  470.  
  471.            THE GENCOM UTILITY - GENERATE A PRE-LOADER
  472.  
  473.            The  GENCOM  utility  is  used to create "COM" files which can be
  474.            loaded and executed by DOS.   These files interface to the  22RES
  475.            driver  and  serve as pre-loaders for execution of the associated
  476.            CP/M program ("CPM"-type) files.
  477.  
  478.            GENCOM produces a very short (about 600 bytes) DOS  program  file
  479.            which, when executed, performs the following actions:
  480.  
  481.                 (1)   Determines if 22RES has been installed.  If not, an er-
  482.                      ror message is issued and no further action is taken.
  483.  
  484.                 (2)   Passes  an  information packet concerning the operating
  485.                      environment for the CP/M file and the name of the  file
  486.                      to be executed in emulation mode.
  487.  
  488.                 (3)   Relinquishes  control  to 22RES for actual CP/M program
  489.                      loading and execution.
  490.  
  491.            Note that a "COM"-type file produced by GENCOM serves both as  an
  492.            interface  between  DOS and 22RES and also as a container for in-
  493.            formation concerning the CP/M program  environment  needed.    In
  494.            fact,  GENCOM  does  not even need to know that a particular CP/M
  495.            program file exists - the file location and subsequent  execution
  496.            is handled by 22RES.
  497.  
  498.            The syntax of the GENCOM command is as follows:
  499.  
  500.                 GENCOM "file" (DISPLAY="dtype") (KEYBOARD="ktype")
  501.                      (PROCESSOR="ptype") (BIND="filename")
  502.  
  503.                 "file"   is the name of the CP/M program file to be executed,
  504.                      and is specified without a file extension.  No DOS path
  505.                      names are allowed here,  just the name of the CP/M com-
  506.                      mand  for  which a 22RES interface file will be genera-
  507.                      ted.
  508.  
  509.                 DISPLAY="dtype"  is optional and specifies the type  of  con-
  510.                      sole display to be emulated.   Any of the following may
  511.                      be specified for "dtype":
  512.  
  513.                      NONE  - Use DOS for output.    No  special  handling  of
  514.                           characters is performed unless the ANSI.SYS device
  515.                           driver  has  been  specified in the DOS CONFIG.SYS
  516.                           file.  If the DISPLAY expression is omitted,  this
  517.  
  518.  
  519.                                         Page 5
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.                           is  the  default.    If  program  output  is to be
  527.                           "piped" to another program or file,  NONE must  be
  528.                           specified.
  529.  
  530.                      TVI920  - Emulate a Televideo 920/925 series terminal.
  531.  
  532.                      ADM   -  Emulate  a  Lear-Siegler ADM-3/ADM-31 type ter-
  533.                           minal.
  534.  
  535.                      OSBORNE  - Emulate the display on an Osborne  I/II/Nuevo
  536.                           computer.
  537.  
  538.                      KAYPRO  - Emulate the display on a Kaypro I/II computer.
  539.  
  540.                      ANSI  - Emulate an ANSI (DEC VT-100) display.
  541.  
  542.                      VT52  - Emulate a DEC VT-52 display.
  543.  
  544.                      H19   -  Emulate  a Heath/Zenith H19/Z19 or H89/Z89 dis-
  545.                           play.
  546.  
  547.                 DISPLAY may be abbreviated to DIS.
  548.  
  549.                 KEYMAP="ktype"  is optional and specifies  the  map  for  the
  550.                      console  keyboard.     Any  of  the  following  may  be
  551.                      specified for "ktype":
  552.  
  553.                      NONE  - Use DOS for  input.    No  special  handling  of
  554.                           keyboard  characters is performed.   If the KEYMAP
  555.                           expression is omitted,  this is the default.    If
  556.                           keyboard  input  is  to  be  "piped"  from another
  557.                           program or file, NONE must be specified.
  558.  
  559.                      TVI920  - Emulate a Televideo  920/925  series  terminal
  560.                           keyboard.
  561.  
  562.                      ADM  - Emulate a Lear-Siegler ADM-3/ADM-31 type terminal
  563.                           keyboard.
  564.  
  565.                      OSBORNE   - Emulate the display on an Osborne I/II/Nuevo
  566.                           computer keyboard.
  567.  
  568.                      WS  - causes the keypad keys to generate codes  suitable
  569.                           for MicroPro WordStar.
  570.  
  571.                      KAYPRO   -  Emulate  the  keyboard on a Kaypro I/II com-
  572.                           puter.
  573.  
  574.                      ANSI  - Emulate the keys on an ANSI  (DEC  VT-100)  ter-
  575.                           minal.
  576.  
  577.                      VT52  - Emulate the keyboard on a DEC VT-52 terminal.
  578.  
  579.                                         Page 6
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.                      H19    -   Emulate   the   Heath/Zenith  H19/Z19/H89/Z89
  588.                           keyboard.
  589.  
  590.                 KEYBOARD may be abbreviated as KEY.
  591.  
  592.                 PROCESSOR="ptype"  is optional and  specifies  the  processor
  593.                      emulation  type required for this program.   Any of the
  594.                      following may be specified for "ptype":
  595.  
  596.                      V20  - Indicates that  22RES  should  use  the  hardware
  597.                           emulation  capabilities  of  the  NEC  V20  or V30
  598.                           processor,  if one is installed in this  computer.
  599.                           If  no V20 or V30 processor can be found,  an 8080
  600.                           software emulator will be automatically used.  V20
  601.                           is the default  if  the  PROCESSOR  expression  is
  602.                           omitted.
  603.  
  604.                      E8080   -  specifies  that  22RES  should  use  an  8080
  605.                           software emulation,  even  if  a  V20  or  V30  is
  606.                           present.    E8080  is primarily used when the TEST
  607.                           mode indicates that there will be  problems  using
  608.                           the V20 or V30 hardware emulation facility.
  609.  
  610.                      Z80   -  specifies  that 22RES should use a Z80 software
  611.                           emulation.   Note that the NEC V20 and V30 do  not
  612.                           support  the  extended  instruction set of the Z80
  613.                           processor.
  614.  
  615.                      TEST  - specifies that 22RES should implement a Z80  in-
  616.                           struction  set  and  observe  the execution of the
  617.                           current program.  At the conclusion of program ex-
  618.                           ecution, 22RES will report on the following:
  619.  
  620.                           *     Use  of  Z-80-only  instruction  codes.    If
  621.                                present, PROCESSOR=Z80 should be used.
  622.  
  623.                           *     Use  of  I/O  instructions.    If  these  are
  624.                                present,  the program should be examined  and
  625.                                the  instructions  modified  or eliminated so
  626.                                as to be compatible with the PC hardware.
  627.  
  628.                           *     Presence  of  code  likely to activate one of
  629.                                the V20 "bugs".  If a message indicating this
  630.                                is present,  a software emulation mode should
  631.                                be selected.
  632.  
  633.                      Hardware-supported   emulation  (V20)  results  in  the
  634.                      fastest execution speed for a program.   8080  software
  635.                      emulation (E8080) is approximately 4 times slower, with
  636.                      Z80  software emulation (Z80) about 6 times slower than
  637.                      V20/V30  supported hardware emulation.   On PC-AT-class
  638.  
  639.                                         Page 7
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.                      machines,   the   software   emulation   modes  compare
  647.                      favorably with a PC-XT  class    machine  using  a  V20
  648.                      processor.  PROCESSOR may be abbreviated as PRO.
  649.  
  650.                 BIND="filename"   is  an  optional  parameter  to  produce  a
  651.                      "unitized" *.COM using the contents  of  "filename"  as
  652.                      the image of the CP/M object.   In this case,  a ".COM"
  653.                      file will be produced that includes the pre-loader  and
  654.                      the CP/M program file.  Observe that since the BIND op-
  655.                      tion  generates a file containing the CP/M object code,
  656.                      you must re-GENCOM this file each time the CP/M  object
  657.                      is changed.
  658.  
  659.  
  660.            Here are some examples of the GENCOM command:
  661.  
  662.                      GENCOM DDT
  663.  
  664.            Builds a file,  DDT.COM , containing the pre-loader only.  If a V20
  665.            is present,  its emulation capabilities will be used.  Otherwise,
  666.            8080 software emulation will be performed.   Standard  DOS  input
  667.            and output will be performed.
  668.  
  669.                      GENCOM WS KEY=WS DIS=ANSI
  670.  
  671.            Builds a file,   WS.COM , containing the pre-loader only.  If a V20
  672.            is present, its emulation facility will be used.   Otherwise 8080
  673.            software  emulation  will  be  performed.    A  special  WordStar
  674.            keyboard mapping will be used;  console  output  will  emulate  a
  675.            standard ANSI terminal.
  676.  
  677.                      GENCOM ZSID PRO=Z80 BIND=ZSID.CPM
  678.  
  679.            Builds  a  file,   ZSID.COM ,  containing  the  pre-loader  and the
  680.            program file  ZSID.CPM .   Z80 software emulation will be performed
  681.            and standard DOS input and output will be used.
  682.  
  683.                      GENCOM MYPROG PRO=TEST
  684.  
  685.            Builds a file,   MYPROG.COM ,  containing the pre-loader only.  Z80
  686.            software emulation will be performed and a note will be  made  if
  687.            any Z80-only instructions are used.  In addition, any code likely
  688.            to  run afoul of V20 bugs will be noted,  as well as usage of any
  689.            I/O instructions.
  690.  
  691.                      GENCOM
  692.  
  693.            Displays a summary of GENCOM command syntax.
  694.  
  695.  
  696.            LOCATING CP/M PROGRAM FILES
  697.  
  698.  
  699.                                         Page 8
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.            It has been mentioned that GENCOM generates a "pre-loader" for  a
  707.            CP/M  program  in order to interface to 22RES.   22RES,  however,
  708.            needs to know where to find the program file itself.   22RES  lo-
  709.            cates program files the following way:
  710.  
  711.                 (1)   If  the environment variable  CPMPATH  is defined,  22RES
  712.                      will search the drives and  directories  given  by  it.
  713.                      The syntax for describing a search path with  CPMPATH  is
  714.                      identical  to  that  used for  PATH ;  namely,  a list of
  715.                      directories or drive names, separated by semicolons.
  716.  
  717.                 (2)   In the absence of any other indication,  22RES searches
  718.                      for  a  program according to the  PATH  environment vari-
  719.                      able specification.   That is,  22RES will look  for  a
  720.                      program in the same places and in the same order as the
  721.                      DOS command processor.
  722.  
  723.                 (3)   If  neither a search of  PATH  nor  CPMPATH  results in the
  724.                      requested file being found,  the current  directory  is
  725.                      searched for the file.
  726.  
  727.            As an example, suppose all of our system's CP/M program files are
  728.            located  in the subdirectory  \USR\CPM22 .   We could indicate this
  729.            to 22RES by means of the following DOS statement:
  730.  
  731.                      SET CPMPATH=\USR\CPM22
  732.  
  733.            Observe that,  since DOS is responsible  for  loading  the  "COM"
  734.            pre-loader files,  only the PATH environment variable has any ef-
  735.            fect on the main DOS search path.   In other words,   CPMPATH  only
  736.            has relevance when "CPM" program files are involved.
  737.  
  738.  
  739.            A SAMPLE 22NICE INSTALLATION
  740.  
  741.            Suppose  you'd like to run some of the programs from your Osborne
  742.            I on your PC-XT clone.  You haven't installed a V20 chip in place
  743.            of the 8088 processor yet,  but you're considering it.   You  al-
  744.            ready  have  the   22NICE   files  downloaded  from your local BBS.
  745.            Let's look at what's needed to get your system going with  22NICE .
  746.  
  747.  
  748.                 1.    ADD THE 22RES LINE TO THE DOS CONFIG.SYS FILE .
  749.  
  750.                 Using your favorite text editor,  you add this line  to  the
  751.                 CONFIG.SYS  file in the root directory of the boot disk unit;
  752.                 in this case, the fixed disk:
  753.  
  754.                           DEVICE=22RES.SYS
  755.  
  756.                 You  also  make  sure  that  22RES.SYS  is located in the root
  757.                 directory.
  758.  
  759.                                         Page 9
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.                 2.    DETERMINE WHERE CP/M PROGRAM FILES WILL BE KEPT .
  768.  
  769.                 As mentioned earlier,  any CP/M ".COM" program files need to
  770.                 have  the  extension  part  of  their  file names changed to
  771.                 ".CPM".   Also note that 22RES will need to know where these
  772.                 files  are located.   On your fixed disk,  you've decided to
  773.                 keep them in a directory called  "CPM22" ,  so you need to add
  774.                 the following line to our  AUTOEXEC.BAT  file:
  775.  
  776.                      SET CPMPATH=C:\CPM22
  777.  
  778.                 to  inform 22RES where to find the CP/M program files.   You
  779.                 also make the appropriate directory with the  following  DOS
  780.                 command:
  781.  
  782.                      MKDIR C:\CPM22
  783.  
  784.                 3.   RE-BOOT THE COMPUTER .
  785.  
  786.                 You want to check out what you've done so far,  so you press
  787.                 the Ctrl,  Alt and Del keys on the keyboard to  reboot  DOS.
  788.                 If all goes well, you'll see a  22NICE  registration form come
  789.                 up (which we bypass by pressing the space bar) and a message
  790.                 that  22NICE  is installed.   If any errors show up during the
  791.                 system initialization process,  you should correct  them  at
  792.                 this point.
  793.  
  794.                 4.   COPY THE CP/M FILES TO DOS .
  795.  
  796.                 Suppose  that  you'd  like  to run two programs from our Os-
  797.                 borne:
  798.  
  799.                      PWP.COM ,  a proprietary word processing package.   This
  800.                      requires    Televideo    920-type    console    display
  801.                      capabilities.   You'd also like the keypad to  function
  802.                      in  WordStar mode.   You don't require the Z80 instruc-
  803.                      tion set, however.
  804.  
  805.                      MLP.COM , a mailing list program.  This requires no spe-
  806.                      cial console I/O, but does make use of the Z80 instruc-
  807.                      tion set.
  808.  
  809.                 You can copy PWP from your Osborne diskette in the  PC's  A:
  810.                 drive with the following  22DISK  CTOD command:
  811.  
  812.                      CTOD A:PWP.COM C:\CPM22
  813.  
  814.                 Or,  if you already have  PWP.COM  in the CPM22 directory, you
  815.                 need to rename it to have a "CPM" extension:
  816.  
  817.                      REN PWP.COM PWP.CPM
  818.  
  819.                                         Page 10
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.                 In the same manner, MLP can be copied from the same diskette
  828.                 with this command:
  829.  
  830.                      CTOD A:MLP.COM C:\CPM22
  831.  
  832.                 After the copying or renaming is  finished,  you  check  the
  833.                 CPM22  directory and find that two files,  PWP.CPM  and  MLP.CPM
  834.                 have been placed there by CTOD.
  835.  
  836.                 5.    RUN GENCOM FOR THE PROGRAM FILES .
  837.  
  838.                 You  need to generate two pre-loader files which contain in-
  839.                 formation for 22RES concerning our programs.  You use GENCOM
  840.                 to generate the files:
  841.  
  842.                      GENCOM PWP DIS=TVI920 KEY=WS
  843.                      GENCOM MLP PRO=Z80
  844.  
  845.                 After running GENCOM, you discover that two short (about 640
  846.                 bytes) files have been created:  PWP.COM  and  MLP.COM .   These
  847.                 are the files that DOS will execute when you call for PWP or
  848.                 MLP.
  849.  
  850.                 6.    COPY ANY NEEDED DATA FILES .
  851.  
  852.                 If you require any data files, you can use CTOD to copy them
  853.                 also.  For example, suppose a customer address file for your
  854.                 mailing list program is needed.  You copy it using CTOD:
  855.  
  856.                      CTOD A:CUSTLIST.DAT
  857.  
  858.                 7.    RUN THE PROGRAMS .
  859.  
  860.                 To run PWP, just type
  861.  
  862.                      PWP
  863.  
  864.                 the  same way you'd have entered it on your Osborne.   After
  865.                 this, PWP and MLP will behave as ordinary DOS programs.  You
  866.                 may re-specify the operating parameters of  PWP  by  running
  867.                 GENCOM again.
  868.  
  869.                 Remember  that the DOS file  PWP.COM  contains the name of the
  870.                 CP/M file  PWP.CPM .   If you rename  PWP.COM ,  it  will  still
  871.                 cause  PWP.CPM  to be executed.
  872.  
  873.  
  874.            USE OF CP/M SUBMIT AND XSUB
  875.  
  876.  
  877.  
  878.  
  879.                                         Page 11
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.            If  you  have "batch" files which operated with CP/M 2.2's SUBMIT
  887.            facility,  you'll need to alter them  to  use  DOS's  batch  file
  888.            capability.  Usually this will entail no more than the following:
  889.  
  890.                 1.    Change  the  file  name  extension from "SUB" to "BAT".
  891.                      This is done with the DOS RENAME command.
  892.  
  893.                 2.    Edit the file,  changing all parameter references  from
  894.                      $1, $2, etc.  to %1, %2 and so on.
  895.  
  896.                 3.    Instead  of using SUBMIT "filename" to invoke the file,
  897.                      just use "filename" as a command.
  898.  
  899.            A special problem arises when XSUB is used in a batch file.   DOS
  900.            has no direct analogue of the XSUB function,  but it may be simu-
  901.            lated by means of input file redirection.  Consider the following
  902.            sample batch file:
  903.  
  904.                      XSUB
  905.                      SAMPLE $1
  906.                      line 1 for SAMPLE
  907.                      line 2 for SAMPLE
  908.                      ^Z
  909.  
  910.            This file could be rearranged to yield  the  same  results  under
  911.            DOS:
  912.  
  913.                      echo line 1 for SAMPLE"x
  914.                      echo line 2 for SAMPLE""x
  915.                      SAMPLE %1"x
  916.                      DELETE X
  917.  
  918.            Of course this is only one possibility;  you may wish to make use
  919.            of the "pipe" facility of DOS, if the input to your program comes
  920.            from another program.
  921.  
  922.  
  923.            USER NUMBER SUPPORT
  924.  
  925.            You may specify that CP/M user numbers used by some  programs  be
  926.            converted  to DOS subdirectory references.   This is done by set-
  927.            ting an environment variable of the form  USERx  to  the  directory
  928.            name to be used for that user number.
  929.  
  930.            For example, suppose that all user number 13 references are to be
  931.            converted to reference the directory  C:\COMPANY3 .   The following
  932.            DOS command would accomplish this:
  933.  
  934.                      SET USER13=C:\COMPANY3
  935.  
  936.  
  937.  
  938.  
  939.                                         Page 12
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.            You can get a map of user number-directory correspondence by  ex-
  947.            ecuting the CUSERS command.   The following is sample output from
  948.            CUSERS:
  949.  
  950.                 CUSER Copyright 1988, Sydex.  All rights reserved.
  951.  
  952.                 User 1 = \CPMFILE1
  953.                 User 2 = A:\
  954.                 User 3 = \DATA\DB
  955.  
  956.                 Search path: C:\CPMFILES, then
  957.                              .;C:\SYS;C:\USR;C:\BIN
  958.  
  959.            Note that CUSER also displays the search path used by 22RES.
  960.  
  961.            A command corresponding to  the  USER  command  of  CP/M  is  not
  962.            provided  in  22NICE  - the DOS CHDIR command accomplishes the same
  963.            purpose.   If a USER command is required,  consider the following
  964.            DOS batch file:
  965.  
  966.                      REM  USER COMMAND
  967.                      IF %1==1 CHDIR %USER1%
  968.                      IF %1==2 CHDIR %USER2%
  969.                      IF %1==3 CHDIR %USER3%
  970.                      ...and so on...
  971.  
  972.            which works for DOS 3.1 and later.
  973.  
  974.            Observe  that User 0 is always the current directory.   A defini-
  975.            tion of the environment variable  USER0  will be ignored by  22NICE .
  976.  
  977.  
  978.            SAVING MEMORY IMAGES - THE CSAVE COMMAND
  979.  
  980.            DOS provides more-than-adequate substitutes for most  CP/M  resi-
  981.            dent  commands,  with  the exception of  SAVE .    22NICE  provides a
  982.            command, CSAVE, with the same syntax and operation as CP/M SAVE:
  983.  
  984.                      CSAVE "count" "filename"
  985.  
  986.            As in CP/M,  "count" is the number of 256-byte blocks to be writ-
  987.            ten to "filename".   Observe that CSAVE will also change the file
  988.            extension to "CPM" when one of "COM" is specified.
  989.  
  990.  
  991.            MISCELLANEOUS TOPICS
  992.  
  993.            This section deals with some of the more specialized features  of
  994.            22NICE  and reflects Sydex's own experience with using  22NICE .
  995.  
  996.  
  997.  
  998.  
  999.                                         Page 13
  1000.  
  1001.  
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.                 Accessing I/O Ports
  1009.  
  1010.                 22NICE   supports  access  to  8-bit I/O port numbers via the
  1011.                 8080 IN and OUT instructions.  Occasionally it may be neces-
  1012.                 sary to access a PC I/O port greater than 255.   This can be
  1013.                 done by means of the 8080 "RST 3" instructions.
  1014.  
  1015.                 To read a byte from an I/O port, code the following -
  1016.  
  1017.                           LXI   D,port number
  1018.                           RST   3
  1019.  
  1020.                 The  contents of the I/O port will be returned in the 8080's
  1021.                 A register.
  1022.  
  1023.                 To write a byte to an I/O port, code the following -
  1024.  
  1025.                           LXI   D,port number
  1026.                           RST   4
  1027.  
  1028.                 The contents of the 8080 A register will be written  to  the
  1029.                 specified port.
  1030.  
  1031.  
  1032.                 Accessing PC Memory
  1033.  
  1034.                 During  emulation,  a  program's memory access is limited to
  1035.                 the 64K addressing range of the  8080.    Should  it  become
  1036.                 necessary  to inspect the contents of a memory location out-
  1037.                 side of this range, the following "RST 5" call can be used:
  1038.  
  1039.                           LXI   D,segment
  1040.                           LXI   H,offset
  1041.                           RST   5
  1042.  
  1043.                 The contents of the memory location at the specified segment
  1044.                 and offset will be returned in the 8080 A register.
  1045.  
  1046.  
  1047.                 IOBYTE Support
  1048.  
  1049.                 The CP/M 2.2 IOBYTE mappings are supported by  22NICE  for the
  1050.                 console, printer, punch and reader as described in the "CP/M
  1051.                 2.2 System Alteration  Guide".    All  other  mappings  will
  1052.                 result  in a null device access;  i.e.,  data output will be
  1053.                 discarded,  input will result in an end-of-file,  and  input
  1054.                 status will always be "data unavailable".
  1055.  
  1056.  
  1057.  
  1058.  
  1059.                                         Page 14
  1060.  
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066.                 The  CP/M  punch  and reader devices are taken to be the DOS
  1067.                 auxiliary device.  Usually,  this is a serial communications
  1068.                 port, or in absence of a serial port, the null device.
  1069.  
  1070.  
  1071.                 Physical Disk Addressing
  1072.  
  1073.                 22NICE  contains an interface to disk read and write routines
  1074.                 present  in  DOS.   When a CP/M program requests a DPB (Disk
  1075.                 Parameter Block) from  22NICE  (BDOS function 31), one is sup-
  1076.                 plied which defines a 36-sector track  with  the  allocation
  1077.                 block  size  and  number  of tracks varying according to the
  1078.                 capacity of the disk being serviced.    Note  that  DOS  can
  1079.                 describe  drives much smaller (less than 1K) and much larger
  1080.                 (32,000 K) than CP/M;  22RES attempts to build a  DPB  which
  1081.                 best defines the disk in question.
  1082.  
  1083.                 Utilities  that  directly write to a disk without making use
  1084.                 of BDOS calls should be avoided,  as the DOS structure for a
  1085.                 disk is quite different from that assumed by CP/M.
  1086.  
  1087.                 22RES  attempts  to  emulate  the  disk  interface  of CP/M.
  1088.                 However,  because of  differences  in  implementation,  disk
  1089.                 sizes  reported  by STAT and similar programs should be con-
  1090.                 sidered to be approximations only.
  1091.  
  1092.  
  1093.                 Maximum Program Size
  1094.  
  1095.                 22RES has a very small BIOS area and only 6  bytes  of  BDOS
  1096.                 with  no CCP.   This means that a CP/M program has about 63K
  1097.                 of program memory available for  use  -  more  than  on  any
  1098.                 "native" CP/M system.
  1099.  
  1100.  
  1101.                 Disk Drive Reassignment
  1102.  
  1103.                 A  number  of  older  CP/M  2.2 programs have diskette drive
  1104.                 selections "hard-wired" into them.   This can be  an  incon-
  1105.                 venience,  particularly if you use a hard disk system.   Use
  1106.                 of the DOS ASSIGN command will allow you to re-map the drive
  1107.                 accesses made by CP/M programs.
  1108.  
  1109.  
  1110.            IN CLOSING
  1111.  
  1112.            Thank you for taking the time to consider Sydex.   We  hope  that
  1113.            22NICE   does  its  job  well and that it meets your needs.   This
  1114.            product represents several months of work and  research;  if  you
  1115.            have  any suggestions on how it might be improved,  please let us
  1116.            know.
  1117.  
  1118.  
  1119.                                         Page 15
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.            OTHER SYDEX PRODUCTS
  1127.  
  1128.                 SHAREWARE
  1129.  
  1130.                 ANADISK  - The compleat diskette utility.   Nothing  like  it
  1131.                 anywhere else;  scan,  edit,  repair and copy just about any
  1132.                 kind of diskette.  $15.00 Shareware registration fee.
  1133.  
  1134.                 TELEDISK  - Turn any diskette into a compressed data file and
  1135.                 vice-versa.  Allows you to send and receive entire diskettes
  1136.                 via modem.   Great for those bootable game diskettes and for
  1137.                 diskettes  with  subdirectories.    Works  with  most "copy-
  1138.                 protected" diskettes.  $15.00 Shareware registration fee.
  1139.  
  1140.                 COPYQM  - Cheap diskette duplicator.  Format, copy and verify
  1141.                 multiple diskettes from a single master.  Implements "smart"
  1142.                 drive status determination,  freeing  the  operator's  hands
  1143.                 from keyboard interaction.  Handles all standard DOS formats
  1144.                 including  3.5" 1.44M files.   $15.00 Shareware registration
  1145.                 fee.
  1146.  
  1147.                 FORMATQM  - Mass diskette formatter - format a  box  of  dis-
  1148.                 kettes at a single sitting.  Implements "smart" drive status
  1149.                 determination,  freeing  the  operator's hands from keyboard
  1150.                 interaction.   Format a 360K diskette in 41 seconds.    Sup-
  1151.                 ports all standard DOS formats.   $10.00 Shareware registra-
  1152.                 tion fee.
  1153.  
  1154.  
  1155.                 RETAIL SOFTWARE
  1156.  
  1157.                 SIM-CGA  4.2   -  Color  Graphics   Adapter   simulation   on
  1158.                 monochrome (Hercules-compatible) graphics-equipped machines.
  1159.                 Available  from better software retailers and distributed by
  1160.                 CSS, ABCO and American Software Distributors.
  1161.  
  1162.                 SIM-EMS  - Simulate Lotus/Intel/Microsoft Expanded Memory  on
  1163.                 PC-AT  class  machines.   Conforms to EMS 3.2 specification.
  1164.                 Distributed by CSS and ABCO.
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.                                         Page 16
  1180.