home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / ZCPR / ZCPR1.ARK / ZCPR.DOC < prev    next >
Text File  |  1986-10-19  |  45KB  |  1,387 lines

  1.              ZCPR - A Z80 Replacement for the CP/M CCP
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.      Documentation on ZCPR - A Z80 Replacement for the CP/M CCP
  9.  
  10.  
  11.  
  12.  
  13.               ZCPR is a Group Project By the CCP-GROUP:
  14.             RLC - Richard Conn            FJW - Frank Wancho
  15.             KBP - Keith Peterson          RGF - Ron Fowler
  16.  
  17.  
  18.                       ZCPR Documentation By RLC
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.                           Table of Contents
  27.                           ----- -- --------
  28.  
  29.        Introduction                                       2
  30.  
  31.        Part A: Installation Instructions                  4
  32.             ZCPR Integration Example                      5
  33.             Setting the ZCPR Inline Options               8
  34.               REL, BASE, CPRLOC, RAS, SUBA, CLEVEL3       8
  35.             Customization Symbols                         8
  36.               NLINES, WIDE, PGDFLT                        8
  37.               PGDFLG, MAXUSR, SYSFLG, SOFLG, SUPRES,
  38.                 DEFUSR, SPRMPT, CPRMPT, NUMBASE,          9
  39.                 SECTFLG, FENCE                           10
  40.             Patching SUBMIT.COM                          10
  41.  
  42.        Part B: Usage Instructions and Explanation of
  43.                Commands                                  11
  44.             The ZCPR Command Hierarchy Search            11
  45.             The ZCPR-Resident Commands                   14
  46.               DIR, ERA                                   14
  47.               LIST, TYPE, SAVE                           15
  48.               REN, USER, DFU                             16
  49.               JUMP, GO, GET                              17
  50.             ZCPR Error Messages                          18
  51.  
  52.        Part C: ZCPR Command Levels and How to Use Them   19
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.                                                 Page 1
  62.  
  63.  
  64.  
  65.  
  66.  
  67.              ZCPR - A Z80 Replacement for the CP/M CCP
  68.  
  69.  
  70.  
  71.      Documentation on ZCPR - A Z80 Replacement for the CP/M CCP
  72.  
  73.  
  74.  
  75.  
  76.        ZCPR is a replacement for the CP/M Console Command Processor 
  77.   (CCP)  which  is  designed to run as part of  CP/M  on  Z80-based 
  78.   microcomputers.   In most cases it is upward-compatible with  the 
  79.   original CP/M Version 2.2 CCP.
  80.  
  81.        ZCPR,  however,  provides  many extensions to the CP/M  CCP.  
  82.   Included in these extensions are the following features:
  83.  
  84.             . The TYPE function can be made to page or not page its 
  85.   output at the user's discretion
  86.  
  87.             .  A LIST function is available which sends its  output 
  88.   to the CP/M LST: Device and does NOT page
  89.  
  90.             .  The  DIR command has been extended to allow the dis-
  91.   play of the system files or all files
  92.  
  93.             . The ERA command now prints out the names of the files 
  94.   it is erasing
  95.  
  96.             .  The  current user number may be included as part  of 
  97.   the command prompt;  if the user is under a number other than  0, 
  98.   the prompt is of the form 'du>' (like 'A2>' or 'B10>'),  and,  if 
  99.   the  user is under 0,  the prompt may be 'd>' or 'd0>' as per his 
  100.   choice
  101.  
  102.             .  The  SUBMIT facility has been changed in  two  basic 
  103.   ways:
  104.                  - the  prompt  changes to 'du$' or 'd$'  when  the 
  105.   SUBMIT command is printed
  106.                  - the $$$.SUB is executed from drive A: (note that 
  107.   the  original  SUBMIT  problem now exists,  but the  new  SUB.COM 
  108.   facility  corrects it);  the CCP-GROUP definition of an  Indirect 
  109.   Command  File  now  applies,  and this  definition  is  that  any 
  110.   sequence of commands which may be issued from the console is also 
  111.   a  valid  sequence  of commands for execution  from  an  Indirect 
  112.   Command File; hence, the sequence:
  113.  
  114.                       DIR
  115.                       B:
  116.                       DIR
  117.                       A:
  118.  
  119.   may  be  issued  from either the console or an  Indirect  Command 
  120.   File,  and the results of the execution of this sequence are  the 
  121.   same.   Basically,  this  says  that Indirect Command  Files  are 
  122.   upward-compatible  to the console input (but not necessarily that 
  123.   the  contents  of an Indirect Command File may be issued  at  the 
  124.   console without modification).
  125.  
  126.  
  127.                                                 Page 2
  128.  
  129.  
  130.  
  131.  
  132.  
  133.              ZCPR - A Z80 Replacement for the CP/M CCP
  134.  
  135.  
  136.  
  137.             .  A command-search hierarchy is now implemented  which 
  138.   is executed roughly as follows:
  139.                  - the  user's command is checked against the  CPR-
  140.   resident commands and executed immediately if a match is found
  141.                  - failing  that,  the  current user number on  the 
  142.   current disk is scanned for the COM file;  the COM file is loaded 
  143.   and executed if found
  144.                  - failing that, a default user number (initially 0 
  145.   but  can be reset with the DFU CPR-resident command) on the  cur-
  146.   rent disk is scanned for the COM file; the COM file is loaded and 
  147.   executed if found
  148.                  - finally,  failing that,  the default user number 
  149.   on disk A:  is scanned for the COM file;  the COM file is  loaded 
  150.   and executed if found or an error message (COMMAND?, when COMMAND 
  151.   was the user's command name) is printed
  152.  
  153.             .   The  numeric  argument for the SAVE command can  be 
  154.   specified  in hexadecimal so that the user may employ the  values 
  155.   presented by tools such as DDT exactly as they are given
  156.  
  157.             .  A  GET  command which loads a file  at  a  specified 
  158.   memory address and a JUMP command which "calls" the subroutine at 
  159.   a  specified memory address have been added;  a GO command  which 
  160.   "calls"  the  subroutine at 100H (subset of the JUMP  capability) 
  161.   has also been added
  162.  
  163.  
  164.        This  document provides the user of ZCPR with the  following 
  165.   information:
  166.  
  167.             Part A:  Installation Instructions
  168.             Part B:  Usage Instructions and Explanation of Commands
  169.             Part C:  ZCPR Command Levels and How to Use Them
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.                                                 Page 3
  194.  
  195.  
  196.  
  197.  
  198.  
  199.              ZCPR - A Z80 Replacement for the CP/M CCP
  200.  
  201.  
  202.  
  203.                                Part A
  204.                       Installation Instructions
  205.  
  206.        In  order to install ZCPR on a target microcomputer (must be 
  207.   currently running CP/M 2.2), the user must know two basic things:
  208.  
  209.             1)  Where his CCP is currently running in memory
  210.             2)  Where his CCP is located in the SYSGEN  image,  or, 
  211.   for systems which don't support SYSGEN (such as P&T CP/M 2.2  for 
  212.   the TRS-80 Model II), where his CCP is located on disk and how to 
  213.   place the new ZCPR on top of it
  214.  
  215.        The  first question is answered relatively easily.   A  pro-
  216.   gram,  known  as either BDOSLOC or BDLOC (for BDOS  Locator),  is 
  217.   provided  with ZCPR.   You should assemble this program for  your 
  218.   particular  computer (change the base ORG if you are running non-
  219.   ORG-0 CP/M) and execute it.   Upon execution, it will provide you 
  220.   with  the base address of (1) the BDOS and (2) the CCP  for  your 
  221.   particular system.   BDOSLOC has worked correctly for all systems 
  222.   tested so far,  but there is always a chance that it may NOT work 
  223.   for some non-tested system.   For the time being,  assume that it 
  224.   works correctly and record the starting base page address of your 
  225.   CCP.
  226.  
  227.        The  second question is not answered nearly so  easily.   If 
  228.   you  have  the ability to SYSGEN your system,  it is much  easier 
  229.   (commonly) than if you do not.   You must,  after assembling  the 
  230.   ZCPR  properly,  integrate it into the sysgen (or disk) image  of 
  231.   CP/M.   This  can  be  done by obtaining a SYSGEN image  of  your 
  232.   system, scanning it via a debugger such as DDT to find the offset 
  233.   for the CCP,  reading the new CPR in on top of the old  one,  and 
  234.   finally  running  SYSGEN again to place the resultant  system  on 
  235.   disk.   If  you  DO NOT have SYSGEN capability,  a  Disk  Utility 
  236.   program  is required to locate the CCP on disk and then write the 
  237.   new  ZCPR  on  top  of the old  one.   The  net  result  of  this 
  238.   integration  is  the placement of the new ZCPR onto disk  in  the 
  239.   proper  place so that it will be loaded with the rest of CP/M  on 
  240.   cold boot and executed properly.
  241.        To find the original CCP, you typically have to locate it by 
  242.   its appearance.   It is probably stored contiguously on disk, so, 
  243.   once it is found, a sequential overwrite is all that is required.  
  244.   Probability  is extremely high that it is stored contiguously  in 
  245.   the SYSGEN image.   The CCP starts with two (2) and ONLY TWO jump 
  246.   instructions  followed  by a buffer area (possibly containing  an 
  247.   initial  command and/or the Digital Research  copyright  notice).  
  248.   The  Digital  Research manuals show the CCP to reside at  address 
  249.   980H  in the SYSGEN image,  but this may vary  with  system.   To 
  250.   find  this image,  use DDT or some other such debugger,  load the 
  251.   SYSGEN image you can get via SYSGEN,  and examine memory starting 
  252.   at around 900H for the two (and ONLY two) jumps described  above.  
  253.   If  you find an area with more than two jumps (a group of  them), 
  254.   you  are probably looking at the BIOS and should go lower for the 
  255.   CCP.   The  CCP will probably start on an even page or  half-page 
  256.   address (like 900H, 980H, 1100H, etc).
  257.  
  258.  
  259.                                                 Page 4
  260.  
  261.  
  262.  
  263.  
  264.  
  265.              ZCPR - A Z80 Replacement for the CP/M CCP
  266.  
  267.  
  268.  
  269.        Now that the location of the CCP has been found, record this 
  270.   address for later.  You are now ready for the integration of ZCPR 
  271.   into your system.   To do this, perform the following steps using 
  272.   the  information  of the page address of the CCP  (obtained  from 
  273.   BDOSLOC  and  called  CPRLOC within ZCPR) and  the  SYSGEN  image 
  274.   address of the CCP (called IMAGE for reference in this document).
  275.  
  276.             1.  Edit  ZCPR  and set the CPRLOC equate to the  value 
  277.   obtained from above.  Also set any flags and values as you desire 
  278.   (see the section on ZCPR Customization below).   When  satisfied, 
  279.   end the edit session.
  280.  
  281.             2.   Assemble  ZCPR  with MAC  (or  equivalent).   This 
  282.   assembler  is  required  because of the MACROs  used.   Only  the 
  283.   resultant HEX file is required.
  284.  
  285.             3.   Assuming that you can use SYSGEN,  obtain a SYSGEN 
  286.   image of your current CP/M system and save it on disk.
  287.  
  288.             4.   Load  the  SYSGEN image into memory with  DDT  (or 
  289.   equivalent).  Once loaded, verify that the original CCP is at the 
  290.   IMAGE  address  found above and compute  the  integration  offset 
  291.   using the DDT H command:
  292.                  H<IMAGE adr>,<CPRLOC adr>
  293.   The  second number displayed gives you the OFFSET value  required 
  294.   for step 5.
  295.  
  296.             5.   Integrate  ZCPR into your SYSGEN image via DDT's I 
  297.   and ROFFSET commands.  Use IZCPR.HEX (or the name of your version 
  298.   of  ZCPR) to load the FCB and ROFFSET (where OFFSET was  computed 
  299.   in  step 4) to load the ZCPR.HEX file into memory at  the  proper 
  300.   location.   Check  to see that ZCPR is indeed properly loaded  by 
  301.   examining the SYSGEN IMAGE area.
  302.  
  303.             6.   Place the new system on disk by running SYSGEN and 
  304.   NOT loading the system from disk (use the memory image).
  305.  
  306.        For   further  clarification  of  the  above  process,   the 
  307.   following  is a sample terminal session which outlines the  steps 
  308.   taken.
  309.  
  310.                       ZCPR Integration Example
  311.  
  312.  
  313.   B>; Sample terminal session for integrating ZCPR
  314.   B>sysgen
  315.   SYSGEN VER 2.2
  316.   SOURCE DRIVE NAME (OR RETURN TO SKIP)b
  317.   SOURCE ON B, THEN TYPE RETURN  <-- I hit the RETURN key here
  318.   FUNCTION COMPLETE                                /
  319.   DESTINATION DRIVE NAME (OR RETURN TO REBOOT)  <-- and here
  320.   B>save 44 cpm56.com      <-- We now have a SYSGEN image of CP/M
  321.                                 to work with
  322.  
  323.  
  324.  
  325.                                                 Page 5
  326.  
  327.  
  328.  
  329.  
  330.  
  331.              ZCPR - A Z80 Replacement for the CP/M CCP
  332.  
  333.  
  334.   B>xdir
  335.   XDIR   Version 2.6  User Number:   0,  Double Density
  336.   File Attributes:  Non-System  
  337.  
  338.   Filename.Typ Size K   Filename.Typ Size K   Filename.Typ Size K
  339.   -------- --- ------   -------- --- ------   -------- --- ------
  340.   !TEXTWRK.-12      0   CPR     .DOC      8   EE687   .TXT      4
  341.   CPR     .AQM     34   TFS     .HLP      6   EE687PRE.TXT      4
  342.   CPR     .ASM     50   CONTENTS.T01      6   SW1     .TXT     10
  343.   CPR     .BAK      4   CONTENTS.T02      4   SW2     .TXT      2
  344.   CPM56   .COM     12   CONTENTS.T03      4
  345.   B:  30 Entries &   22 Files --    338K Bytes Remaining
  346.   File Data:         14 Files --    154K Bytes Displayed
  347.   B>bdosloc      <-- Now to locate the CCP's address
  348.   The Base Page Address of this system's BDOS is C5
  349.   The Base Page Address of this system's CCP is  BD <-- This is it
  350.   B>ddt cpm56.com     <-- Now to find the CCP in the SYSGEN image
  351.   DDT VERS 2.0
  352.   NEXT  PC
  353.   2D00 0100
  354.   -d900,90f      <-- Start looking around here
  355.   0900 31 80 E7 3E 06 3C 3C FE 1B CA 00 C2 DA 11 E7 D6 1..>.<<.........
  356.   -da00,a0f
  357.   0A00 31 00 01 01 01 0C C5 CD 0F E4 21 00 BE 11 00 04 1.........!.....
  358.   -db00,b0f
  359.   0B00 31 00 01 01 01 11 C5 CD 0F E4 21 00 C0 11 00 02 1.........!.....
  360.   -db80,b8f
  361.   0B80 31 00 01 01 09 01 CD A8 00 21 00 D2 11 00 C2 0E 1........!......
  362.           -- Detail Left Out --
  363.   -d1100         <-- I found it at 1100H; note the 2 JMP's
  364.   1100 C3 FF BD C3 FB BD 50 10 20 20 20 20 20 20 20 20 ......P.        
  365.   1110 20 20 20 20 20 20 20 20 00 00 00 00 00 00 00 00         ........
  366.   1120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  367.           -- Detail Left Out --
  368.   -^C            <-- Return to CP/M; I know that CPRLOC will be
  369.                       BD00H and the IMAGE offset is 1100H
  370.  
  371.   B>ed cpr.asm {edit ZCPR here and place CPRLOC=BD00H}#  
  372.           -- Detail Left Out --
  373.  
  374.   B>mac cpr $pz sz         <-- Now to assemble the CPR
  375.   CP/M MACRO ASSEM 2.0
  376.   C4F0                     <-- Note that CPR MUST end before BDOS
  377.                                 begins!
  378.   014H USE FACTOR
  379.   END OF ASSEMBLY
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.                                                 Page 6
  392.  
  393.  
  394.  
  395.  
  396.  
  397.              ZCPR - A Z80 Replacement for the CP/M CCP
  398.  
  399.  
  400.  
  401.  
  402.   B>ddt cpm56.com          <-- Now to integrate!
  403.   DDT VERS 2.0
  404.   NEXT  PC
  405.   2D00 0100
  406.   -h1100,bd00              <-- Compute offset for new CPR
  407.   CE00 5400                <-- Offset is 5400H
  408.   -icpr.hex                <-- Init FCB
  409.   -r5400                   <-- Read in new CPR with offset
  410.   NEXT  PC
  411.   2D00 0000
  412.   -^C                      <-- Done!
  413.   B>sysgen                 <-- Now to SYSGEN onto disk
  414.   SYSGEN VER 2.2
  415.   SOURCE DRIVE NAME (OR RETURN TO SKIP)   <-- Use memory image
  416.   DESTINATION DRIVE NAME (OR RETURN TO REBOOT)b     <-- onto B:
  417.   DESTINATION ON B, THEN TYPE RETURN
  418.   FUNCTION COMPLETE
  419.   DESTINATION DRIVE NAME (OR RETURN TO REBOOT) <-- Done for now
  420.  
  421.   B>
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.                                                 Page 7
  458.  
  459.  
  460.  
  461.  
  462.  
  463.              ZCPR - A Z80 Replacement for the CP/M CCP
  464.  
  465.  
  466.  
  467.                    Setting the ZCPR Inline Options
  468.  
  469.        The  following  are the four basic options available to  the 
  470.   user under ZCPR for customization of his package.
  471.  
  472.   Option Name    Function
  473.  
  474.      REL         Configures CPRLOC (CPRLOC equ 0) for integration
  475.                  via MOVCPM rather than the DDT/SYSGEN technique
  476.                  outlined above; set to TRUE for MOVCPM integra-
  477.                  tion or FALSE for DDT/SYSGEN integration
  478.  
  479.      BASE        Base address of your CP/M system; standard CP/M
  480.                  has a base of 0, but some CP/M systems (such as
  481.                  for the TRS-80 Model I and Heath/Zenith H89/Z89)
  482.                  start physical RAM memory at a higher address;
  483.                  equate BASE to the starting RAM memory address of
  484.                  your system
  485.  
  486.      CPRLOC      This is the starting address of ZCPR; set the
  487.                  second CPRLOC equate to the address you obtain
  488.                  from BDOSLOC
  489.  
  490.      RAS         This is an equate which masks out selected ZCPR
  491.                  command functions for security purposes on
  492.                  Remote Access Systems such as Bulletin Boards;
  493.                  the masked out functions currently include
  494.                  SAVE, ERA, REN, JUMP, GO, and GET; set RAS to TRUE
  495.                  to mask these out or FALSE to leave them in
  496.  
  497.      SUBA        This is an equate which determines the drive
  498.                  onto which ZCPR will look for an executing
  499.                  Indirect Command File.  If the basic philosophy
  500.                  of the Indirect Command File described above is
  501.                  to be maintained, this symbol should be set to
  502.                  TRUE (look on drive A: for the $$$.SUB file); if
  503.                  not, this symbol should be set to FALSE (look on
  504.                  the default drive from the $$$.SUB file).  To
  505.                  review, the basic philosophy of the Indirect
  506.                  Command File is that any sequence of commands
  507.                  which may be issued from the console (within
  508.                  reason, which means NOT to erase a $$$.SUB file)
  509.                  may also be issued from within an Indirect
  510.                  Command File, and the resultant execution should
  511.                  be identical (same functions performed).
  512.  
  513.      CLEVEL3     This equate enables or disables extended Command
  514.                  Level 3 Processing.  If set to TRUE, extended
  515.                  Command Level 3 Processing is enabled and the user
  516.                  command line is automatically capitalized, the
  517.                  terminating zero is placed at the end of the
  518.                  buffer, and the internal CIBPTR is set correctly
  519.                  (see later for more information).
  520.  
  521.  
  522.  
  523.                                                 Page 8
  524.  
  525.  
  526.  
  527.  
  528.  
  529.              ZCPR - A Z80 Replacement for the CP/M CCP
  530.  
  531.  
  532.  
  533.  
  534.                         Customization Symbols
  535.  
  536.        The following symbols are provided for further customization 
  537.   of ZCPR to a user's particular tastes and hardware facilities.
  538.  
  539.   Option Name    Function
  540.  
  541.      NLINES      Number of lines on the user's CRT for paging
  542.  
  543.      WIDE        This equate is used to select a narrow or wide
  544.                  display under the DIR command; if WIDE is equated
  545.                  to TRUE, each file name is separated by two
  546.                  spaces, a FENCE, and two more spaces; if WIDE is
  547.                  equated to FALSE, each file name is separated by
  548.                  one space, a FENCE, and one more space
  549.  
  550.      PGDFLT      This is the Paging Default flag for the TYPE
  551.                  command; if PGDFLT is set to TRUE, the TYPE
  552.                  command will page its output by default and
  553.                  the P option on the TYPE command (see below)
  554.                  will prohibit paging; if PGDFLT is set to FALSE,
  555.                  the TYPE command will NOT page its output by
  556.                  default and the P option will enable paging
  557.  
  558.      PGDFLG      This sets the option character in the command
  559.                  line for the TYPE command (the 'P' mentioned
  560.                  above); if the user wishes to change this option
  561.                  character, he need only change this equate
  562.  
  563.      MAXUSR      This is the largest user number recognized by
  564.                  the USER command; if the user wishes to protect
  565.                  the higher user areas, he may set this symbol
  566.                  to the highest area normally accessable; 15 is
  567.                  the largest permitted value for MAXUSR
  568.  
  569.      SYSFLG      This is the option character for the DIR command
  570.                  line which is used to specify that DIR search
  571.                  All Files (both $SYS and $DIR) for its display;
  572.                  the distributed default for this is 'A'
  573.  
  574.      SOFLG       This is the option character for the DIR command
  575.                  line which is used to specify that DIR search
  576.                  ONLY the $SYS files for its display; the distri-
  577.                  buted default for this is 'S'
  578.  
  579.      SUPRES      Set SUPRES to TRUE to suppress printing the user
  580.                  number when the user is under User Number 0 or
  581.                  set SUPRES to FALSE to ALWAYS display the User
  582.                  Number with the CPR prompt; with SUPRES set to
  583.                  TRUE, a user on B: in user 0 sees 'B>' as the
  584.                  prompt, but with SUPRES set to FALSE, a user on
  585.                  B: in user 0 sees 'B0>' as the prompt
  586.  
  587.  
  588.  
  589.                                                 Page 9
  590.  
  591.  
  592.  
  593.  
  594.  
  595.              ZCPR - A Z80 Replacement for the CP/M CCP
  596.  
  597.  
  598.  
  599.      DEFUSR      This is the CPR-default user number which is
  600.                  searched in the command hierarchy for the COM
  601.                  files (distributed as 0); the DFU changes this
  602.                  temporarily until a Warm Boot or Cold Boot is
  603.                  done, at which time the search reverts to this
  604.                  value
  605.  
  606.      SPRMPT      This is the CPR prompt character which indicates
  607.                  that a SUBMIT file is in execution; by default
  608.                  it is set to '$', so prompts like 'A$' appear
  609.                  during SUBMIT file execution
  610.  
  611.      CPRMPT      This is the CPR prompt character which indicates
  612.                  that the CPR is awaiting a user console command;
  613.                  by default it is set to '>', so prompts like
  614.                  'A>' appear during user input to the CPR
  615.  
  616.      NUMBASE     This is the escape character used by those
  617.                  commands which require a DECIMAL number as
  618.                  an argument; placing this character after
  619.                  the number argument switches the base to
  620.                  HEXADECIMAL; for example, 'SAVE 15 MYFILE' can be
  621.                  expressed as 'SAVE FH MYFILE' if NUMBASE is
  622.                  set to 'H' (the default)
  623.  
  624.      SECTFLG     This character constant is the suffix option for
  625.                  the SAVE command which specifies that sectors,
  626.                  as opposed to pages, are to be saved; the default
  627.                  value is 'S'
  628.  
  629.      FENCE       This is the character printed to separate entries
  630.                  in a directory listing; it's default value is '|'
  631.  
  632.  
  633.                          Patching SUBMIT.COM
  634.  
  635.        SUBMIT.COM  may be patched to run with ZCPR by the following 
  636.   procedure  (this  is  recommended  if  the  user  does  not  have 
  637.   SUB.COM).   This  patch simply makes it always place the  $$$.SUB 
  638.   file on Drive A:.  Illustrative terminal session follows:
  639.  
  640.   A>ddt b:submit.com
  641.   DDT VERS 2.0
  642.   NEXT  PC
  643.   0600 0100
  644.   -s5bb           <-- Patch is at 5BB Hex
  645.   05BB 00 1       <-- Change 0 (default drive) to 1 (drive A:)
  646.   05BC 24 .       <-- That's it!
  647.   -d5b0 5cf       <-- See change
  648.   05B0 00 00 00 00 00 00 30 30 31 20 24 01 24 24 24 20 ......001 $.$$$ 
  649.   05C0 20 20 20 20 53 55 42 00 00 00 1A 1A 1A 1A 1A 1A     SUB.........
  650.   -^C             <-- Done
  651.   A>save 5 newsubmt.com   <-- Save new SUBMIT.COM file
  652.  
  653.  
  654.  
  655.                                                 Page 10
  656.  
  657.  
  658.  
  659.  
  660.  
  661.              ZCPR - A Z80 Replacement for the CP/M CCP
  662.  
  663.  
  664.  
  665.                                Part B
  666.            Usage Instructions and Explanation of Commands
  667.  
  668.  
  669.        The  following instructions are written with the  assumption 
  670.   that  the  reader is quite familiar with how to use CP/M 2.2  and 
  671.   its CCP.   ZCPR is written as a logical extension of the CP/M 2.2 
  672.   CCP philosophy and should be addressed as such.
  673.  
  674.  
  675.  
  676.                   The ZCPR Command Hierarchy Search
  677.  
  678.        The first,  and most basic thing, to learn about ZCPR is the 
  679.   order in which is searches for a COM file for execution or a file 
  680.   specified  by the GET command.   Under the CP/M 2.2 CCP,  if  the 
  681.   specified  COM file command was not found on the current drive in 
  682.   the  current user area,  the CCP aborted with an  error  message.  
  683.   ZCPR,  however,  continues searching from this point a maximum of 
  684.   two  more  levels.   This command hierarchy search  was  outlined 
  685.   above and is described here in further detail.
  686.  
  687.             1.   If  the  command is of the form 'COMMAND' and  NOT 
  688.   'd:COMMAND',  the  CPR-resident  command list is searched  for  a 
  689.   match.   If  the  match is found,  the  CPR-resident  command  is 
  690.   immediately processed.   If the match is not found or the command 
  691.   is  of the form 'd:COMMAND',  the next step is taken.   Note that 
  692.   the  'd:COMMAND'  form is good for executing a command  COM  file 
  693.   which  has the same name as a CPR-resident command (such as  SAVE 
  694.   or DIR).
  695.  
  696.             2.   If  the command is of the form  'd:COMMAND',  disk 
  697.   drive  'd:'  is  temporarily logged in for  the  purpose  of  the 
  698.   command  search.   Otherwise,  the  currently logged-in drive  is 
  699.   used.
  700.  
  701.             3.  Now the file named COMMAND.COM is searched for.  If 
  702.   found,  it  is loaded into memory starting at 100H and  executed.  
  703.   If not, proceed to step 4.
  704.  
  705.             4.   Now  that  the first search  for  COMMAND.COM  has 
  706.   failed,  the  CPR checks to see if the user is under the  current 
  707.   Default User Number.   The Default User Number may be that set by 
  708.   the  DEFUSR equate in the CPR or that set by the user via the DFU 
  709.   command.   DEFUSR  is in effect if DFU has not been issued  since 
  710.   the last Warm or Cold Boot, and DFU is in effect if it was issued 
  711.   since the last Warm or Cold Boot.   If the user is NOT under  the 
  712.   current  Default User Number,  ZCPR temporarily logs him into  it 
  713.   and  searches  the directory.   If COMMAND.COM is  found,  it  is 
  714.   loaded as described above and executed.  If not, ZCPR proceeds to 
  715.   the next step.
  716.  
  717.  
  718.  
  719.  
  720.  
  721.                                                 Page 11
  722.  
  723.  
  724.  
  725.  
  726.  
  727.              ZCPR - A Z80 Replacement for the CP/M CCP
  728.  
  729.  
  730.  
  731.             5.   The user is now in the Default User Number, and at 
  732.   this  point,  ZCPR checks to see if the user is on disk drive A:.  
  733.   If not, it temporarily logs into A: and searches the default user 
  734.   number  of  A:  for  COMMAND.COM.   If found,  it  is  loaded  as 
  735.   described above and executed.   If not,  ZCPR prints the  command 
  736.   name  as  an  error message and returns to  command  input  mode, 
  737.   aborting the SUBMIT file if COMMAND came from it.
  738.  
  739.        In  all cases of the search above,  if COMMAND.COM is found, 
  740.   after  it  is loaded into memory,  ZCPR resets the  user  to  his 
  741.   original disk drive and user number.  Hence, the files referenced 
  742.   by the user by default are obtained from this environment.
  743.  
  744.        To  illustrate this command hierarchy search,  consider  the 
  745.   following examples:
  746.  
  747.   Example 1:  DEFUSR equ 0 {default user number is 0}
  748.  
  749.   B10>           <-- User is on Drive B:, User Number 10
  750.   B10>ASM TEST.BBZ    <-- User wishes to assemble TEST.ASM in
  751.                            Drive B:, User 10
  752.        <-- At this point, ZCPR looks on B:/10 for ASM.COM, fails,
  753.             looks on B:/0, fails, and finally looks on A:/0; it
  754.             finds ASM.COM here and goes back to B:/10 for the file
  755.  
  756.  
  757.   Example 2:  DEFUSR equ 0 and DFU issued
  758.  
  759.   B10>           <-- User is on Drive B:, User Number 10
  760.   B10>DFU 5      <-- User Selects User 5 as default
  761.   B10>ASM TEST.BBZ    <-- As above
  762.        <-- At this point, ZCPR looks on B:/10 for ASM.COM, fails,
  763.             look on B:/5, fails, and finally looks on A:/5; it
  764.             fails here also and prints ASM? as an error message
  765.  
  766.   Example 3:  DEFUSR equ 0
  767.  
  768.   B>             <-- User is on Drive B:, User Number 0
  769.   B>ASM TEST.BBZ      <-- As above
  770.        <-- At this point, ZCPR looks on B:/0 for ASM.COM, fails,
  771.             looks on A:/0, fails, and prints error message
  772.  
  773.   Example 4:  DEFUSR equ 0
  774.  
  775.   A10>           <-- User is on Drive A:, User Number 10
  776.   A10>ASM TEST.AAZ    <-- As above, but file on A:
  777.        <-- At this point, ZCPR looks on A:/10 for ASM.COM, fails,
  778.             looks on A:/0, fails, and prints error message
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.                                                 Page 12
  788.  
  789.  
  790.  
  791.  
  792.  
  793.              ZCPR - A Z80 Replacement for the CP/M CCP
  794.  
  795.  
  796.  
  797.   Another Example:
  798.  
  799.             For  example,  if the user is logged into Drive  B:  in 
  800.   User Area 10, the Default User Number is 0, and the following COM 
  801.   files are present as indicated --
  802.  
  803.                  WM.COM on Drive A: in User 0
  804.                  MBASIC.COM on Drive A: in User 0 and on
  805.                       Drive B: in User 0
  806.                  TEST.COM on Drive B: in User 10 and Drive B:
  807.                       in User 0
  808.  
  809.   then  the  following  happens when  the  following  commands  are 
  810.   issued from the console (or Indirect Command File):
  811.  
  812.   B10>WM TEST2.TXT
  813.    \   \    \__ File to be edited
  814.     \   \__ Invoke the WM.COM file (Word Master editor)
  815.      \__ User is on Drive B: in User Area 10
  816.  
  817.        Results:
  818.             ZCPR searches B:  User 10, B: User 0, and A: User 0 for 
  819.   WM.COM;  it finds WM.COM in A:  User 0,  loads it,  logs the user 
  820.   back into B: User 10, and executes it.
  821.  
  822.   B10>MBASIC
  823.    \    \__ Invoke the MBASIC.COM file (MBASIC Interpreter)
  824.     \__ User is on Drive B: in User Area 10
  825.  
  826.        Results:
  827.             ZCPR searches B:  User 10 and B: User 0 for MBASIC.COM; 
  828.   it finds MBASIC.COM in B: User 0, so it doesn't bother to look on 
  829.   A:  User 0.   MBASIC.COM is then loaded and executed as described 
  830.   in the previous example.
  831.  
  832.   B10>TEST
  833.     \   \__ Invoke the TEST.COM file (TEST program)
  834.      \__ User is on Drive B: in User Area 10
  835.  
  836.        Results:
  837.             ZCPR  searches  B:  User  10  for  TEST.COM;  it  finds 
  838.   TEST.COM in B:  User 0,  so it doesn't bother to look further (if 
  839.   it had,  it would have found TEST.COM in B: User 0).  TEST.COM is 
  840.   then loaded and executed as described above.
  841.  
  842.   B10>TEST2
  843.     \    \__ Invoke the TEST2.COM file (TEST2 program)
  844.      \__ User is on Drive B: in User Area 10
  845.  
  846.        Results:
  847.             ZCPR searches B:  User 10, B: User 0, and A: User 0 for 
  848.   TEST2.COM;  it  doesn't find it,  so it issues the error  message 
  849.   'TEST2?', which says it couldn't find TEST2.COM.
  850.  
  851.  
  852.  
  853.                                                 Page 13
  854.  
  855.  
  856.  
  857.  
  858.  
  859.              ZCPR - A Z80 Replacement for the CP/M CCP
  860.  
  861.  
  862.  
  863.  
  864.  
  865.                      The ZCPR-Resident Commands
  866.  
  867.        The  following  pages describe the  ZCPR-Resident  Commands.  
  868.   These  are commands located within ZCPR itself which are executed 
  869.   from within ZCPR.  The phrases <afn> and <ufn> refer to ambiguous 
  870.   file name and unambigous file name as per the CP/M convention.
  871.  
  872.   Command: DIR
  873.   Function:  To Display a listing of the names of the files on disk
  874.   Forms:
  875.        DIR <afn>           <-- Displays $DIR files
  876.        DIR <afn> S         <-- Displays $SYS files
  877.        DIR <afn> A         <-- Displays both $DIR and $SYS files
  878.   Customization Variables:
  879.        WIDE      SYSFLG    SOFLG     FENCE
  880.   Examples:
  881.        DIR *.ASM           <-- All $DIR .ASM files
  882.        DIR *.COM S         <-- All $SYS .COM files
  883.        DIR *.COM A         <-- All .COM files
  884.   Notes:
  885.        If  a  file is scanned for and no such name exists on  disk, 
  886.   the  'No  Files' message will appear.   However,  if  a  file  is 
  887.   scanned for and the name exists as a $SYS file and $DIR files are 
  888.   being  scanned for,  no file name is displayed but the 'No Files' 
  889.   message does NOT appear.  For example, if TEST.COM is a $SYS file 
  890.   and  'DIR  TEST.COM' is issued,  no  message  appears.   If  'DIR 
  891.   TEXT.COM' is issued and TEXT.COM does not exist on disk,  the 'No 
  892.   Files' message is displayed.
  893.  
  894.  
  895.   Command: ERA
  896.   Function:  To Erase the specified $R/W files from disk
  897.   Forms:
  898.        ERA <afn>           <-- Erase both $DIR and $SYS files
  899.   Customization Variables:
  900.        WIDE      FENCE
  901.   Examples:
  902.        ERA *.ASM           <-- Erase all .ASM files
  903.        ERA *.*             <-- Erase all files
  904.   Notes:
  905.        If a $R/O file is encountered,  a BDOS error message will be 
  906.   displayed  and the procedure is stopped.   The user is unsure  at 
  907.   this  time as to which files have been erased and which have  not 
  908.   and should check.  Sorry for this problem!  The ERASE command (to 
  909.   be  given  to SIG/M by RLC in the near future) is a  solution  to 
  910.   this problem.
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.                                                 Page 14
  920.  
  921.  
  922.  
  923.  
  924.  
  925.              ZCPR - A Z80 Replacement for the CP/M CCP
  926.  
  927.  
  928.  
  929.  
  930.   Command: LIST
  931.   Function:  To Print the specified file on the CP/M LST: device
  932.   Forms:
  933.        LIST <ufn>          <-- Print the file (no paging)
  934.   Customization Variables:
  935.        -None-
  936.   Examples:
  937.        LIST TEST.TXT       <-- Print TEST.TXT on LST:
  938.   Notes:
  939.        If  the file has a $SYS attribute,  it will be found as well 
  940.   as those with $DIR attributes.
  941.  
  942.  
  943.   Command: TYPE
  944.   Function:  To Print the specified file on the CP/M CON: device
  945.   Forms:
  946.        TYPE <ufn>          <-- Print the file with the paging deflt
  947.        TYPE <ufn> P        <-- Print the file with the paging deflt
  948.                                 negated
  949.   Customization Variables:
  950.        NLINES    PGDFLT    PGDFLG
  951.   Examples:
  952.        TYPE TEST.TXT
  953.        TYPE TEST.TXT P
  954.   Notes:
  955.        When  the  display pauses during paging,  type any  char  to 
  956.   continue or ^C to abort.  ^S also works.
  957.  
  958.  
  959.   Command: SAVE
  960.   Function:  To Copy the TPA starting at 100H to disk
  961.   Forms:
  962.        SAVE <Number of Pages> <ufn>  <-- <Number of Pages> in DEC
  963.        SAVE <Number of Pages>H <ufn> <-- <Number of Pages> in HEX
  964.        SAVE <Number of Sectors> <ufn> S  <-- Number of sectors
  965.        SAVE <Number of Sectors>H <ufn> S <-- Number of sectors
  966.   Customization Variables:
  967.        NUMBASE   RAS
  968.   Examples:
  969.        SAVE 15 MYFILE.TXT        <-- 15 pages saved
  970.        SAVE FH MYFILE.TXT        <-- 15 pages saved
  971.        SAVE 10H MYFILE.TXT S     <-- 16 sectors (8 pages) saved
  972.   Notes:
  973.        If the file name to be saved already exists,  then SAVE will 
  974.   exit with the message 'Delete File?'; if the user REALLY wants to 
  975.   save  under  this name,  he may then type Y or y and the  current 
  976.   file will be deleted and then recreated containing the  specified 
  977.   part of the TPA.
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.                                                 Page 15
  986.  
  987.  
  988.  
  989.  
  990.  
  991.              ZCPR - A Z80 Replacement for the CP/M CCP
  992.  
  993.  
  994.  
  995.  
  996.  
  997.   Command: REN
  998.   Function:  To Change the name of a disk file
  999.   Forms:
  1000.        REN <ufn new>=<ufn old>
  1001.   Customization Variables:
  1002.        RAS
  1003.   Examples:
  1004.        REN NEWFILE.TXT=OLDFILE.TXT
  1005.   Notes:
  1006.        If <ufn new> already exists, the message 'Delete File?' will 
  1007.   be  printed  and the user may respond with Y or y to  delete  the 
  1008.   current <ufn new> and then rename <ufn old> to <ufn new>.
  1009.  
  1010.   Command: USER
  1011.   Function:  To Change the current user number
  1012.   Forms:
  1013.        USER <User Number>       <-- <User Number> in DEC
  1014.        USER <User Number>H      <-- <User Number> in HEX
  1015.   Customization Variables:
  1016.        -None-
  1017.   Examples:
  1018.        USER 15        USER FH        USER 0
  1019.        USER      <-- Same as USER 0
  1020.   Notes:
  1021.        -None-
  1022.  
  1023.  
  1024.   Command: DFU
  1025.   Function:  To Temporarily Change the default user number for the
  1026.              command hierarchy search
  1027.   Forms:
  1028.        DFU <User Number>        <-- <User Number> in DEC
  1029.        DFU <User Number>H       <-- <User Number> in HEX
  1030.   Customization Variables:
  1031.        -None-
  1032.   Examples:
  1033.        DFU 15         DFU FH         DFU 0
  1034.        DFU       <-- Same as DFU 0
  1035.   Notes:
  1036.        See above for explanation.
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.                                                 Page 16
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.              ZCPR - A Z80 Replacement for the CP/M CCP
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.   Command: JUMP
  1064.   Function:  To "call" the subroutine at the specified page address
  1065.   Forms:
  1066.        JUMP <Address> <Cmd Parms> <-- <Address> in HEX
  1067.   Customization Variables:
  1068.        NUMBASE   RAS
  1069.   Examples:
  1070.        JUMP E000 or JUMP E000H  <-- Jump to E000H
  1071.        JUMP                     <-- Jump to 000H
  1072.        JUMP 0                   <-- Jump to 000H
  1073.   Notes:
  1074.        JUMP performs a subroutine "call", so the called routine may 
  1075.   return to the ZCPR by either a RET or a Warm Boot.
  1076.  
  1077.  
  1078.   Command: GO
  1079.   Function:  To "call" the subroutine starting at 100H
  1080.   Forms:
  1081.        GO <Cmd Parms>           <-- Execute reentrant at 100H
  1082.   Customization Variables:
  1083.        RAS
  1084.   Examples:
  1085.        GO *.ASM                 <-- Assuming XDIR is loaded,
  1086.                                      gives directory of *.ASM
  1087.   Notes:
  1088.        This  command is identical in function to JUMP  100H;  JUMP, 
  1089.   however, leaves the address as the first entry in CP/M BASE + 80H 
  1090.   (the input line buffer), while GO has no such address.
  1091.  
  1092.  
  1093.   Command: GET
  1094.   Function:  To load a file from disk into memory starting at the
  1095.              specified page
  1096.   Forms:
  1097.        GET <Address> <ufn>      <-- <Address> in HEX
  1098.   Customization Variables:
  1099.        NUMBASE   RAS
  1100.   Examples:
  1101.        GET 8000 TEST.80         <-- Load TEST.80 starting at 8000H
  1102.        GET 100 TEST.80 or GET 100H TEST.80 <-- Load TEST.80      
  1103.                                      starting at 100H
  1104.        GET 0 TEST.80            <-- Load TEST.80 starting at 000H
  1105.   Notes:
  1106.        GET  searches for the specified file according to  the  same 
  1107.   command  hierarchy  search employed by the ZCPR command  scanner.  
  1108.   Hence,  if the user is on B:/10 and the file is on A:/0 with  the 
  1109.   current  default user number at 0,  GET will search from B:/10 to 
  1110.   B:/0 to A:/0 in looking for the file.
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.                                                 Page 17
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.              ZCPR - A Z80 Replacement for the CP/M CCP
  1124.  
  1125.  
  1126.  
  1127.                          ZCPR Error Messages
  1128.  
  1129.        The  following  are the error messages issued  by  ZCPR  and 
  1130.   their meanings.
  1131.  
  1132.   Message   Meaning
  1133.  
  1134.   ?         Printed after a command or an argument means that such
  1135.               was invalid
  1136.  
  1137.   No File   From DIR, this means that DIR did not locate any files
  1138.             Also from ERA with the same meaning
  1139.  
  1140.   All?      Issued in response ERA *.*, asks the user is he really
  1141.               wants to erase all the files.  Unlike under the
  1142.               original CP/M 2.2 CCP, single character input is
  1143.               required (Y or y for yes and anything else for no)
  1144.               with NO <CR> to end the line
  1145.  
  1146.   Full      From SAVE, means that there is not enough space on
  1147.               disk
  1148.             From GET or command load by CPR, means that there
  1149.               is not enough space in memory
  1150.  
  1151.   Delete File?
  1152.             From REN or SAVE, means that the file specified already 
  1153.               exists on disk and the user may type Y or y to delete 
  1154.               it and proceed with the REN or SAVE function
  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.  
  1180.  
  1181.  
  1182.  
  1183.                                                 Page 18
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.              ZCPR - A Z80 Replacement for the CP/M CCP
  1190.  
  1191.  
  1192.  
  1193.  
  1194.                                Part C
  1195.                ZCPR Command Levels and How to Use Them
  1196.  
  1197.  
  1198.        ZCPR  Version 1.0 and beyond supports three distinct command 
  1199.   levels in its implementation.  Each level constitutes a different 
  1200.   way to issue a command for ZCPR to process.
  1201.  
  1202.        Command Levels 1 and 2 are common to all implementations  of 
  1203.   CP/M  and CP/ZM from CP/M Version 1.4.   Command Level 1 is  that 
  1204.   command level in which the command is issued by the user from his 
  1205.   console  terminal.   The  prompt  'd>' or 'du>'  appears  on  the 
  1206.   terminal,  and  the  user  is allowed to enter the  command  with 
  1207.   editing from the terminal.  Command Level 2 is that command level 
  1208.   in which the command is entered from an executing $$$.SUB file.
  1209.  
  1210.        In  both cases,  the command is stored in the internal  ZCPR 
  1211.   buffer called CIBUFF (Command Input BUFFer).   Under both Command 
  1212.   Levels  1  and 2,  the command is placed into  this  buffer,  the 
  1213.   characters of the command line are capitalized, a character count 
  1214.   which  indicates the number of characters in the command line  is 
  1215.   stored in CBUFF (the byte before CIBUFF),  an ending binary 0  is 
  1216.   placed  after  the last character in the command  line,  and  the 
  1217.   internal  pointer CIBPTR (Command Input Buffer PoinTeR) is set to 
  1218.   point to CIBUFF (the first character of the command line).
  1219.  
  1220.        Command  Level 3 is an extended concept to Command Levels  1 
  1221.   and  2  which is specifically supported by ZCPR Version  1.0  and 
  1222.   beyond.  This command level allows a transient program to place a 
  1223.   command  line into CIBUFF and the character count into CBUFF  and 
  1224.   have this command line executed by ZCPR.   Once control is trans-
  1225.   ferred to ZCPR to execute the command line, the transient program 
  1226.   which  placed  the command line loses control and the command  is 
  1227.   executed  exactly as though it had been typed by the user at  his 
  1228.   console terminal.
  1229.  
  1230.        In  order  for  a transient program to utilize  the  Command 
  1231.   Level 3 facility, this program MUST do the following:
  1232.  
  1233.             1.  Locate the ZCPR.  Since the ZCPR is ALWAYS 2K bytes 
  1234.   in  size and located directly under the BDOS,  the transient  can 
  1235.   locate  the  ZCPR  by examining the BDOS entry  page  address  at 
  1236.   location  7  and  subtracting 8 from this number (8  pages  =  2K 
  1237.   bytes).  The resulting number is the base page address of ZCPR.
  1238.  
  1239.             2.   Store the command line in CIBUFF and the character 
  1240.   count  in  CBUFF.   Knowing the base page address  of  ZCPR,  the 
  1241.   following information is useful in doing this:
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.                                                 Page 19
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.              ZCPR - A Z80 Replacement for the CP/M CCP
  1256.  
  1257.  
  1258.  
  1259.  
  1260.                  ORG  CPRLOC    ;Base Address of ZCPR
  1261.                  JMP  CPR       ;Enter ZCPR and Execute Default Cmd
  1262.                  JMP  CPR1      ;Enter ZCPR and Don't Execute
  1263.        MBUFF:    DB   BUFLEN    ;Size of CIBUFF in bytes
  1264.        CBUFF:    DS   1         ;Number of Bytes in Command Line
  1265.        CIBUFF:   DS   BUFLEN    ;Buffer for Command Line
  1266.                  DS   1         ;Buffer for Ending 0 (set by ZCPR)
  1267.        CIBPTR:   DS   2         ;Address of CIBUFF (set by ZCPR)
  1268.  
  1269.  
  1270.             3.   Obtain  the User/Disk Flag.   Location 4  contains 
  1271.   this number,  but the user may select a flag of his choice.  This 
  1272.   flag  is  one  byte  long,  and the high-order  nybble  (4  bits) 
  1273.   contains  the user number and the low-order nybble  contains  the 
  1274.   disk  number to process the command from.   The User/Disk Flag is 
  1275.   to be passed to ZCPR in the C Register.
  1276.  
  1277.             4.  When ready, transfer control to ZCPR to process the 
  1278.   command by JMPing to the base address of ZCPR.   The first JMP in 
  1279.   the JMP Table given above is at this address.  At this time, ZCPR 
  1280.   will  log in the user and disk in the User/Disk Flag and  process 
  1281.   the Command Level 3 Command Line.
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.                                                 Page 20
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.              ZCPR - A Z80 Replacement for the CP/M CCP
  1322.  
  1323.  
  1324.  
  1325.  
  1326.        The  following  is a sample program  which  illustrates  the 
  1327.   steps outlined above:
  1328.  
  1329.   ;
  1330.   ;  Demonstration of Command Level 3 Facility by RLC
  1331.   ;
  1332.   udflag  equ     4       ;Address of User/Disk Flag
  1333.   bdos    equ     5       ;Address of BDOS Entry Point
  1334.  
  1335.           org     100h
  1336.  
  1337.           lxi     d,prmpt ;Print User Prompt
  1338.           mvi     c,9     ;PRINT function
  1339.           call    bdos
  1340.  
  1341.           lhld    bdos+1  ;Get address of BDOS
  1342.           mov     a,h     ;High-Order Address in A
  1343.           sui     8       ;A=High-Order Address of CPR
  1344.           mov     h,a     ;HL=Address of CPR
  1345.           mvi     l,0
  1346.           shld    cpr     ;Save address in buffer
  1347.  
  1348.           lxi     d,6     ;Point to command line buffer
  1349.           dad     d       ;HL points to command line buffer
  1350.           xchg            ;DE points to command line buffer
  1351.           mvi     c,10    ;READLN into this buffer
  1352.           call    bdos
  1353.  
  1354.           lhld    cpr     ;Get Address of CPR
  1355.           lda     udflag  ;Get User/Disk Flag
  1356.           mov     c,a     ; ... in C
  1357.           pchl            ;Run Command Line
  1358.  
  1359.   cpr:    ds      2       ;CPR Address buffer
  1360.   prmpt:  db      'User Command? $'
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.        Enjoy using ZCPR!
  1368.                                 -- RLC
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.                                                 Page 21
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.