home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR13 / 22DSK140.ZIP / 22DISK.DOC < prev    next >
Text File  |  1993-10-12  |  66KB  |  1,787 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.       Sydex
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.                                       22DISK
  28.  
  29.  
  30.                     A CP/M-to-DOS Diskette Interchange Utility
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.                                               Sydex
  55.                                               P.O. Box 5700
  56.                                               Eugene, OR  97405
  57.                                               Voice:  (503) 683-6033
  58.                                               FAX:    (503) 683-1622
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.                                       22DISK
  72.  
  73.                     A CP/M-to-DOS Diskette Interchange Utility
  74.  
  75.                            Version 1.40, September, 1993
  76.  
  77.                          Copyright 1988-1993, Sydex, Inc.
  78.  
  79.                                     Sydex, Inc.
  80.                                    P.O. Box 5700
  81.                                  Eugene, OR  97405
  82.                                Voice:  (503)  683-6033
  83.                                FAX:    (503)  683-1622
  84.  
  85.                                All Rights Reserved
  86.  
  87.  
  88.                                       NOTICE
  89.  
  90.       THIS IS NOT FREE  SOFTWARE!   If you  paid  a "public domain"   vendor
  91.       for  this  program,   you paid for the service of copying the program,
  92.       and not for the program itself.   Rest assured that nothing ever  gets
  93.       to the originators of this product from such a sale.  You may evaluate
  94.       this product, but if you make use of it, you must register your copy.
  95.  
  96.       We  offer  several inducements to you for registering.   First of all,
  97.       you receive the most up-to-date copy of the program that  we  have  --
  98.       and  we  do  update the product on a regular basis.   You also receive
  99.       support for 22DISK -- which can be  quite  valuable  at  times.   And
  100.       finally,  we  have  a  few  utilities  not  included in the evaluation
  101.       package.   Make no mistake,  however - this is a fully functional ver-
  102.       sion of 22DISK and not "crippled" in any way.
  103.  
  104.  
  105.                              REGISTRATION INFORMATION
  106.  
  107.       The  non-commercial  single-user registration fee for 22DISK is $25.00
  108.       US.  The commercial and multisystem site fee for 22DISK is $100.00.
  109.  
  110.       Send a check or company P.O. for the appropriate amount to:
  111.  
  112.                                       Sydex
  113.                                    P.O. Box 5700
  114.                                  Eugene, OR  97405
  115.  
  116.       Please indicate what product you are ordering and if you  have  a  re-
  117.       quirement for 3.5" media.   We normally ship 5.25" 360K diskettes, but
  118.       will furnish 3.5"  720K  media  upon  request.   Customers outside  of
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.       the United States and Canada should include an extra $5.00 for airmail.
  128.       U.S. and Canadian customers should include $2.50 for shipping.
  129.  
  130.  
  131.       If you are a registered user of this product  and  desire  an  update,
  132.       please  send  $5.00  for handling  and we will ship you an up-to-date
  133.       copy.  Please add $10.00 for printed documentation to cover duplication
  134.       and shipping costs.
  135.  
  136.  
  137.                                DISTRIBUTION NOTICE
  138.  
  139.       This is "user-supported" software.   You are hereby granted a  license
  140.       by Sydex to distribute this evaluation copy of 22DISK and its documen-
  141.       tation, subject to the following conditions:
  142.  
  143.       1.   22DISK  may  be  distributed  freely without charge in evaluation
  144.            form only.
  145.  
  146.       2.   22DISK may not be sold,  licensed,  or a fee charged for its use.
  147.            If a fee is charged in connection with 22DISK,  it must cover the
  148.            cost of copying or dissemination only.   Such  charges  must  be
  149.            clearly  identified  as such by the originating party.   Under no
  150.            circumstances may the purchaser be given the impression  that  he
  151.            is buying 22DISK itself.
  152.  
  153.       3.   22DISK  must  be  presented  as  a complete unit,  including this
  154.            documentation.   Neither 22DISK  nor  its  documentation  may  be
  155.            amended or altered in any way.
  156.  
  157.       4.   By  granting  you  the right to distribute the evaluation form of
  158.            22DISK, you do not become the owner of 22DISK in any form.
  159.  
  160.       Any other use,  distribution or representation of 22DISK is  expressly
  161.            forbidden without the written consent of Sydex.
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.       _______________________________________________________________
  172.       CP/M, CP/M-80 and CP/M 2.2 are trademarks of Digital Research.  MS-DOS
  173.       is a trademark of Microsoft.   IBM PC,  PC-XT and PC-AT are trademarks
  174.       of International Business Machines.  V20, V30, uPD70108,  uPD70116 are
  175.       trademarks  of  NEC  Electronics.   CompatiCard  is  the trademark of
  176.       MicroSolutions, Inc.  Some products of Lear-Siegler,  Kaypro,  Osborne
  177.       and Televideo are also trademarked.
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.                               Table of Contents
  188.  
  189.  
  190.         22DISK, Briefly..............................................1
  191.  
  192.         Installing 22DISK............................................2
  193.  
  194.         Getting Started..............................................2
  195.  
  196.         Selecting A Disk Format......................................4
  197.  
  198.         22DISK CP/M File Naming Conventions..........................5
  199.  
  200.         22DISK Command Syntax Conventions............................6
  201.  
  202.         A Quick Reference Guide to 22DISK Commands...................7
  203.  
  204.         CTOD -- Convert A CP/M Diskette To DOS.......................9
  205.  
  206.         DTOC -- Convert DOS Files TO CP/M Files.....................10
  207.  
  208.         CTYPE -- Display A CP/M File................................10
  209.  
  210.         CDIR -- Display A CP/M Directory............................11
  211.  
  212.         CERA -- Erase CP/M Files....................................12
  213.  
  214.         CFMT -- Format A CP/M Diskette..............................13
  215.  
  216.         Building Custom Diskette Definitions........................14
  217.  
  218.         Some Hints on Developing a Definition.......................19
  219.  
  220.         Indexing A Large Definition File with GENINDEX..............21
  221.  
  222.         Diskette Densities and Recording Modes......................21
  223.  
  224.         Modifying A PC-XT "Clone" Controller For Single-Density Re..23
  225.  
  226.         In Closing..................................................25
  227.  
  228.         Other Sydex Products........................................26
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.       22DISK, Briefly
  238.  
  239.       22DISK  is  a  product  which enables one to convert files on diskette
  240.       from various CP/M formats to MS-DOS,  and vice versa.   It is  a  com-
  241.       panion product to 22NICE,  a Z-80/8080 CP/M 2.2 emulator.   The opera-
  242.       tion of one part is not dependent on the other--if  you  want  to  use
  243.       22DISK  to  convert data from other disk formats to DOS or vice-versa,
  244.       you need not install the 22NICE CP/M emulator.  Similarly,  if you al-
  245.       ready  have CP/M programs available as DOS files,  you may not want to
  246.       use the 22DISK disk conversion utilities.
  247.  
  248.       Our packaging for 22NICE and 22DISK  offers  the  22DISK  program  set
  249.       separately  for those who may be using a different emulator or have no
  250.       need of a CP/M emulator.   The 22NICE emulation package,  however,  is
  251.       bundled with 22DISK because of the need to transport CP/M files to the
  252.       PC before emulation can be performed.
  253.  
  254.       The 22DISK disk conversion package offers the following features:
  255.  
  256.            *    "Roll  your  own"  disk  formats  -  we  provide support for
  257.                 several common CP/M 2.2 diskette formats,  but if you have a
  258.                 format  that  isn't  in our list,  you can simply define the
  259.                 characteristics in an  ASCII  parameter  file.   Registered
  260.                 users get an even larger file of diskette types.
  261.  
  262.            *    Support   for  single-  double-  and  quad-density  formats,
  263.                 hardware permitting.
  264.  
  265.            *    Support of the the following operations:
  266.  
  267.                      CP/M-to-DOS
  268.                      DOS-to-CP/M
  269.                      Directory display
  270.                      Display CP/M files
  271.                      Erase CP/M files
  272.                      Format CP/M diskette
  273.  
  274.            *    Full user number support.
  275.  
  276.            *    Support of MicroSolutions' CompatiCard.
  277.  
  278.       22DISK currently will not handle "hard sectored" diskettes,  nor  will
  279.       it work with diskettes written on an Apple ][ or Commodore 64 or 128.
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.                                       Page 1
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.       Installing 22DISK
  298.  
  299.       22DISK will not run without first being installed.   To do this, enter
  300.       the following command at the DOS prompt:
  301.  
  302.            A:22DINST            and press the ENTER key.
  303.  
  304.       We're assuming that the file 22DINST.EXE is located on the diskette in
  305.       drive A:; if you are installing 22DISK from some other drive or direc-
  306.       tory, substitute it for the A: in this command.
  307.  
  308.       Generally, the installation process is self-explanatory.  A few of the
  309.       more important points to note are:
  310.  
  311.            1.   22DISK will support up to 8 diskette drives--4 per  control-
  312.                 ler card. Support for two controller cards is provided.
  313.  
  314.            2.   If  you're using 22DISK on an XT-class computer with a high-
  315.                 density controller,  you'll need to specify that  your  com-
  316.                 puter  is an AT-type computer.   This is necessary to ensure
  317.                 that your controller is correctly programmed by 22DISK.
  318.  
  319.            3.   22DINST installs all files in the same directory.   However,
  320.                 the  file  CPMDISKS.DEF  and  the files with an extension of
  321.                 "LBL" may be placed in any directory specified  by  the  DOS
  322.                 PATH environment variable.  For information on PATH, consult
  323.                 the DOS reference manual.
  324.  
  325.            4.   The files comprising 22DISK can be installed or re-installed
  326.                 "in place".   That is, the source drive and directory may be
  327.                 the same as the destination.
  328.  
  329.       You'll need about 512K of base memory to install 22DISK.  If you don't
  330.       have that much available,  you can still install 22DISK by creating an
  331.       installation   diskette   having   all  of  the  22DISK  files  except
  332.       CPMDISKS.DEF and all of the files having a extension of "LBL".   These
  333.       files  can be copied over to your destination drive or directory after
  334.       you've run 22DINST.
  335.  
  336.  
  337.       Getting Started
  338.  
  339.       The following sections deal with various specific features of  22DISK.
  340.       If  the  diskette format desired is one of those included in the stan-
  341.       dard definition file, entering the command
  342.  
  343.            CMENU
  344.  
  345.       will cause a menu-driven interface to 22DISK to be executed.   The ap-
  346.       propriate function may then be selected from the menu.  CMENU displays
  347.       the following choices:
  348.  
  349.  
  350.                                       Page 2
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.                 +------------------------------------------------+
  360.                 |                                                |
  361.                 |       22DISK Version 1.30 (12-Mar-89)          |
  362.                 |                                                |
  363.                 |  Please select one of the following:           |
  364.                 |                                                |
  365.                 |       0.  Exit to DOS                          |
  366.                 |       1.  Set CP/M diskette type               |
  367.                 |       2.  Set CP/M diskette drive              |
  368.                 |       3.  Copy CP/M file(s) to DOS             |
  369.                 |       4.  Copy DOS file(s) to CP/M             |
  370.                 |       5.  Format a CP/M diskette               |
  371.                 |       6.  Display a CP/M directory             |
  372.                 |       7.  Display (type) CP/M file(s)          |
  373.                 |       8.  Erase CP/M file(s)                   |
  374.                 |                                                |
  375.                 +------------------------------------------------+
  376.                 No diskette type selected yet.
  377.  
  378.  
  379.  
  380.                 Please enter function number (0...8):
  381.  
  382.  
  383.  
  384.       When CMENU is used for the first time,  choice 1 should be selected to
  385.       determine what CP/M diskette format will be used.   Until a format  is
  386.       selected,  no  CP/M diskette operations can be performed;  attempts to
  387.       perform any operation before selecting a type will  produce  an  error
  388.       message.
  389.  
  390.       When choice 1 is selected,  a list of CP/M diskette types,  in display
  391.       "pages" of 23 types will be displayed.  The cursor keys may be used to
  392.       select a format type.  When the desired type is located,  pressing the
  393.       ENTER  keys will select that format.   A screen of general information
  394.       about systems requirements will be displayed,  after which the opening
  395.       menu is again shown.
  396.  
  397.       After  the  diskette  type is selected,  CMENU will "remember" it from
  398.       session to session.   The next step is to select choice 2  to  specify
  399.       what diskette drive will be used to access CP/M diskettes.
  400.  
  401.       The  desired function may then be selected from the menu.   Each func-
  402.       tion may then request additional input for items such as CP/M diskette
  403.       type and names of source and destination files.
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.                                       Page 3
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.       CMENU prompts for parameters and formats them into a command line  for
  418.       one of 22DISK's utility programs.  If a menu interface is not desired,
  419.       each program may also be invoked as a normal DOS command.  The follow-
  420.       ing  sections deal with each specific function in terms of the program
  421.       that performs that function.
  422.  
  423.  
  424.       Selecting A Disk Format
  425.  
  426.       All of the 22DISK utilities make use of a common interface to  specify
  427.       the format of CP/M diskette to be used. Over 200 different formats are
  428.       provided with 22DISK and "custom" definitions may also be written.
  429.  
  430.       Each  different  CP/M  format is given a unique one- to four-character
  431.       tag.  For example, the Osborne 1, single-sided,  double-density format
  432.       is  given  a  tag  of "OSB2",  while the single-sided,  double-density
  433.       Kaypro 2is assigned a tag of "KAY1".  So, to specify a format, its tag
  434.       is used.
  435.  
  436.       The format tag may be indicated to the  22DISK  utilities  in  any  of
  437.       three ways:
  438.  
  439.            (1)  The tag may be specified interactively.  This is the default
  440.                 situation if the tag has not been indicated by either of the
  441.                 other  two  ways.   The following prompting message is dis-
  442.                 played -
  443.  
  444.                 Enter 1-4 character disk format type, ? for list -
  445.  
  446.                 If a question mark is entered, followed by the ENTER key,  a
  447.                 list  of  diskette  formats and their tags is displayed,  23
  448.                 lines at a time.  The cursor keys (up, down,  PgUp and PgDn)
  449.                 may  be  used  to select a type.   Pressing ENTER causes the
  450.                 current type to be used.
  451.  
  452.            (2)  The tag may be specified directly on the DOS  command  line.
  453.                 In this case,  the tag is the first field of the 22DISK com-
  454.                 mand and is preceded with a slash (/) character.   For  ex-
  455.                 ample,
  456.  
  457.                      CFMT /KAY1 A:
  458.  
  459.                 would  result in the diskette in drive A: being formatted as
  460.                 a Kaypro 2 single-sided, double-density diskette.
  461.  
  462.            (3)  The DOS environment variable "CPMDISK" may be set to the tag
  463.                 corresponding to the desired format.  So,
  464.  
  465.                      SET CPMDISK=OSB2
  466.  
  467.  
  468.  
  469.  
  470.                                       Page 4
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.                 would result in all 22DISK  operations  being  performed  in
  478.                 terms of Osborne 1 double-density format,  unless overridden
  479.                 by an explicit DOS command line  specification  as  in  (2),
  480.                 above.
  481.  
  482.       The  file  named  CPMDISKS.DEF  contains  definitions for all diskette
  483.       types and must be present somewhere in the DOS  command  search  path.
  484.       That  is,  one  of the directories indicated by the DOS PATH statement
  485.       must contain the CPMDISKS.DEF file.
  486.  
  487.       In addition to the predefined formats given in  CPMDISKS.DEF  as  sup-
  488.       plied  with 22DISK,  custom definitions may also be prepared using any
  489.       ASCII text editor.   For details,  consult the section titled Building
  490.       Custom Diskette Definitions.
  491.  
  492.  
  493.       22DISK CP/M File Naming Conventions
  494.  
  495.       All  of  the  22DISK utilities use the same convention for naming CP/M
  496.       files,  which corresponds roughly to that used by CP/M.   However,  to
  497.       supply a means of indicating CP/M user numbers and to afford an alter-
  498.       nate way to refer to diskette drives, the convention has been extended
  499.       somewhat.
  500.  
  501.       A  CP/M  file  designator  as used by 22DISK consists of the following
  502.       items:
  503.  
  504.            *    A disk drive specifier.  This is a letter referring to those
  505.                 drives configured by the 22DINST program.
  506.  
  507.            *    An optional user number between 0 and 31.  If omitted,  user
  508.                 number 0 is assumed.   A wildcard,  or asterisk (*),  may be
  509.                 specified to signify all user numbers.
  510.  
  511.            *    A colon (:).
  512.  
  513.            *    The file name consisting of up to 8 letters, numbers or spe-
  514.                 cial characters.   Upper- and lower-case  letters  are  con-
  515.                 sidered to be equivalent.  A special character may be any of
  516.                 the following -
  517.  
  518.                      ! @ # $ % ^ & ( ) - _ = + { } [ ] ' " , /
  519.  
  520.            *    The   characters "?" and "*" serve as "wildcard" specifiers;
  521.                 "?" matches any single character.  "*" matches any remaining
  522.                 characters in the file name.
  523.  
  524.            *    A period (.),  which may be omitted if no file extension  is
  525.                 present (see next item).
  526.  
  527.  
  528.  
  529.  
  530.                                       Page 5
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.            *    The  file extension which consists of up to 3 letters,  num-
  538.                 bers or special characters.   Its  rules  of  formation  are
  539.                 identical to those associated with the file name,  including
  540.                 use of wildcard characters.
  541.  
  542.       Here are some examples of CP/M file names accepted by the 22DISK  con-
  543.       version utilities:
  544.  
  545.                 A:*.COM                     All  files  with  an extension of
  546.                                            "COM" from drive A:,  user number
  547.                                            0.
  548.  
  549.                 D*:*.*                      All files from any user number on
  550.                                            diskette drive D.
  551.  
  552.                 B2:X*.DAT                   All  files having an extension of
  553.                                            "DAT" under user number  2,  from
  554.                                            drive B:,  starting with the let-
  555.                                            ter "X".
  556.  
  557.       In all of the 22DISK utilities, a drive designator followed by a colon
  558.       without any filename or extension assumes all  files  on  that  drive.
  559.       Thus,
  560.  
  561.                 B:                   is identical in meaning to
  562.                 B:*.*
  563.  
  564.       Sometimes,  as  with the CFMT utility,  a drive designator is required
  565.       without a file name.  In these cases, no user number, file name or ex-
  566.       tension is used, but physical unit designations are still allowed.
  567.  
  568.  
  569.       22DISK Command Syntax Conventions
  570.  
  571.       In order to discuss command syntax in 22DISK,  a number of conventions
  572.       have been adopted in this document:
  573.  
  574.            (1)  All commands are assumed to be followed by depression of the
  575.                 ENTER  key.   Sometimes this key is referred to as RETURN or
  576.                 CARRIAGE RETURN.
  577.  
  578.            (2)  All upper-case (capital)  letters  are  entered  exactly  as
  579.                 shown in the command description.  For instance,
  580.  
  581.                      CFMT
  582.  
  583.                 is entered as depressions of the "C", "F", "M" and "T" keys.
  584.                 Actual  case  of the entered characters is irrelevant;  that
  585.                 is, either upper- or lower-case letters may be entered.
  586.  
  587.  
  588.  
  589.  
  590.                                       Page 6
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.            (3)  Any underlined item enclosed in italics refers to a name  of
  598.                 a  particular  type  of  item  and  is  not  to  be  entered
  599.                 literally.  For example:
  600.  
  601.                      CP/M file
  602.  
  603.                 refers to a general CP/M file designator as described in the
  604.                 preceding section, and NOT the characters ""CP/M file"".
  605.  
  606.            (4)  Any item enclosed in parentheses ("(" and ")") refers to  an
  607.                 item  which  may be omitted from the command line.   For ex-
  608.                 ample:
  609.  
  610.                      (disk type)
  611.  
  612.                 refers to a disk type item which may be left out  completely
  613.                 from the command statement.
  614.  
  615.            (5)  Any  blank  character may be replaced by more than one blank
  616.                 character or a tab character.
  617.  
  618.       These conventions will be used throughout  this  document  with  addi-
  619.       tional explanations where required.
  620.  
  621.  
  622.       A Quick Reference Guide to 22DISK Commands
  623.  
  624.       The  following  is  a  short description of the command syntax of each
  625.       conversion program:
  626.  
  627.            CONVERT CP/M FILES TO DOS
  628.  
  629.                 CTOD  (/disk type)  CP/M file name  DOS disk unit
  630.  
  631.            Example:
  632.  
  633.                 CTOD  /KAY1  A:*.DAT  C:
  634.  
  635.            CONVERT DOS FILES TO CP/M
  636.  
  637.                 DTOC  (/disk type)  DOS file name  CP/M disk unit
  638.  
  639.            Example:
  640.  
  641.                 DTOC  C:*.BAS  A:
  642.  
  643.            DISPLAY A CP/M DISKETTE DIRECTORY
  644.  
  645.                 CDIR  (/disk type)  CP/M file name
  646.  
  647.  
  648.  
  649.  
  650.                                       Page 7
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.            Example:
  658.  
  659.                 CDIR A:*.OVR
  660.  
  661.            ERASE A CP/M DISKETTE FILE
  662.  
  663.                 CERA  (/disk type)  CP/M file name
  664.  
  665.            Example:
  666.  
  667.                 CERA  /IBM1  WS?.COM
  668.  
  669.            DISPLAY (TYPE) A CP/M DISKETTE FILE
  670.  
  671.                 CTYPE  (/disk type)  CP/M file name
  672.  
  673.            Example:
  674.  
  675.                 CTYPE  2:*.DOC
  676.  
  677.            FORMAT A CP/M DISKETTE
  678.  
  679.                 CFMT  (/disk type)  CP/M disk unit
  680.  
  681.            Example:
  682.  
  683.                 CFMT  /OSB1  B:
  684.  
  685.            GENERATE AN INDEXED DEFINITION FILE
  686.  
  687.                 GENINDEX  source file  destination file
  688.  
  689.            Example:
  690.  
  691.                 GENINDEX  CPMDISKS.NOI  CPMDISKS.DEF
  692.  
  693.            STRIP AN INDEX FROM A DEFINITION FILE
  694.  
  695.                 STRIPIDX  source file  destination file
  696.  
  697.            Example:
  698.  
  699.                 STRIPIDX  CPMDISKS.DEF  CPMDISKS.NOI
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.                                       Page 8
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.       CTOD -- Convert A CP/M Diskette To DOS
  718.  
  719.       The program CTOD is used to read a CP/M diskette and copy files to any
  720.       selected DOS directory.
  721.  
  722.       The general syntax of the CTOD command is -
  723.  
  724.            CTOD  (/disk type)  CP/M file  (DOS path)
  725.  
  726.       Disk type is the optional diskette tag as  discussed  earlier.   CP/M
  727.       file  refers  to  the CP/M file designator for the diskette drive con-
  728.       taining the CP/M diskette and the file(s) to be copied.   The wildcard
  729.       characters * and ? are allowed to specify a number of CP/M files.
  730.  
  731.       DOS  path  refers  to  the name of a DOS disk drive or subdirectory to
  732.       which the CP/M files will be copied by CTOD.  If this term is omitted,
  733.       the current DOS default drive and path are used.
  734.  
  735.       Some transformations of CP/M file names are made by CTOD when  copying
  736.       to  DOS.   CP/M file naming conventions allow just about any character
  737.       in a file name;  DOS naming conventions  are  much  more  restrictive.
  738.       Characters which are not accepted by DOS are translated by CTOD to the
  739.       character #, a legal DOS file name character.
  740.  
  741.       In  addition,  the file extension COM is changed to CPM by CTOD.   DOS
  742.       considers any file with the extension COM to be executable;  if execu-
  743.       tion  of  a  CP/M  file is attempted by DOS,  the result could be dis-
  744.       astrous.
  745.  
  746.       The 22NICE CP/M emulator also performs the same name  translation  in-
  747.       ternally  for  CP/M programs,  so programs will operate correctly with
  748.       the transformed file extensions.
  749.  
  750.       Here are a few examples of CTOD commands:
  751.  
  752.                 CTOD  A:*.*
  753.  
  754.            Copy all files from user 0, on drive A: to the current directory.
  755.            Use whatever format that was defined by the  CPMDISK  environment
  756.            variable, or prompt for one if CPMDISK is not defined.
  757.  
  758.                 CTOD  /A1  B*:*.COM  C:\CPMFILES
  759.  
  760.            Copy  all  files  with  an extension of COM from all users,  from
  761.            drive B: to the directory named C:\CPMFILES.   Use  the  8"  SSSD
  762.            format.   These files, when copied, will be given an extension of
  763.            CPM.
  764.  
  765.                 CTOD
  766.  
  767.            Produces no action, but gives a synopsis of the CTOD command syn-
  768.            tax.
  769.  
  770.                                       Page 9
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.       DTOC -- Convert DOS Files TO CP/M Files
  780.  
  781.       The program DTOC is the complement of CTOD;  that is,  it  writes  DOS
  782.       files to a CP/M diskette.  The general syntax of the DTOC command is:
  783.  
  784.            DTOC  (/disk type)  DOS file name  CP/M drive and user
  785.  
  786.       The  optional  term disk type is the name of a CP/M diskette type,  as
  787.       discussed above.   DOS file name refers to the name of a DOS  file  or
  788.       group  of  files  and  may  include drive and subdirectory specifiers.
  789.       CP/M drive and user specifies the diskette drive to  receive  the  DOS
  790.       files and the user number under which they are to be created.
  791.  
  792.       In  addition to copying DOS files to CP/M diskettes,  DTOC carries out
  793.       the CPM to COM name translation described in the CTOD command.   That
  794.       is,  all  DOS  files  with  an extension of CPM will be created as COM
  795.       files on the CP/M target diskette.
  796.  
  797.       Some examples of DTOC commands are:
  798.  
  799.                 DTOC  C:*.*  A:
  800.  
  801.            Copy all files from DOS drive C: to CP/M  diskette  A:,  user  0.
  802.            Use  whatever  format that was defined by the CPMDISK environment
  803.            variable, or prompt for one if CPMDISK is undefined.
  804.  
  805.                 DTOC  /A1  \UTILS\*.ASM  B3:
  806.  
  807.            Copy all files from the DOS default  drive  in  the  subdirectory
  808.            named  UTILS  with an extension of ASM to user 3 on CP/M diskette
  809.            drive B:.  Use the 8" SSSD format.
  810.  
  811.                 DTOC
  812.  
  813.            Produces no action, but gives a synopsis of the DTOC command syn-
  814.            tax.
  815.  
  816.  
  817.       CTYPE -- Display A CP/M File
  818.  
  819.       The program CTYPE copies a CP/M diskette file or files to DOS standard
  820.       output.  Before each file is copied,  its name is also copied to stan-
  821.       dard  output.   CTYPE  is  the  analogue  of  the  DOS  and CP/M TYPE
  822.       utilities.
  823.  
  824.       The general syntax of the CTYPE command is:
  825.  
  826.            CTYPE  (/disk type)  CP/M file
  827.  
  828.  
  829.  
  830.                                      Page 10
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.       Disk type is the optional diskette  tag  code  as  discussed  earlier.
  838.       CP/M  file  refers  to the CP/M file designator for the diskette drive
  839.       containing the CP/M diskette and the file(s) to  be  displayed.   The
  840.       wildcard characters * and ?  are allowed in order that a group of CP/M
  841.       files may be specified.
  842.  
  843.       An operation similar to CTYPE can be obtained  with  CTOD,  where  the
  844.       destination  DOS  drive  is given as CON.   Some examples of the CTYPE
  845.       command are:
  846.  
  847.                 CTYPE  A:*.*
  848.  
  849.            Copy all files from user 0, on drive A: to standard output.
  850.  
  851.                 CTYPE  /A1  B*:*.DOC
  852.  
  853.            Copy all files with an extension of DOC from  all  user  numbers,
  854.            from drive B: to standard output.  The source diskette is assumed
  855.            to be in 8" SSSD format.
  856.  
  857.                 CTYPE
  858.  
  859.            Produces  no  action,  but  gives a synopsis of the CTYPE command
  860.            syntax.
  861.  
  862.  
  863.       CDIR -- Display A CP/M Directory
  864.  
  865.       The program CDIR displays a list of CP/M diskette files  in  much  the
  866.       same way that the CP/M command DIR does.  However, the user number for
  867.       each  file  is also displayed,  along with the available CP/M diskette
  868.       space remaining.
  869.  
  870.       The general syntax of the CDIR command is:
  871.  
  872.            CDIR  (/disk type)  CP/M file
  873.  
  874.       Disk type is the optional two character diskette  type  code  as  dis-
  875.       cussed earlier.   CP/M file refers to the CP/M file designator for the
  876.       diskette drive containing the CP/M diskette and the file(s) to be dis-
  877.       played.  The wildcard characters "*" and "?" are allowed in order that
  878.       a group of CP/M files may be specified.   Some examples  of  the  CDIR
  879.       command are:
  880.  
  881.                 CDIR  A:*.*
  882.  
  883.            Displays  a directory of all files from all user areas,  on drive
  884.            A.
  885.  
  886.                 CDIR  /A1  B*:*.DOC
  887.  
  888.  
  889.  
  890.                                      Page 11
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.            Displays a directory of all files with an extension of  DOC  from
  898.            all user numbers, on drive B:.  The source diskette is assumed to
  899.            be in 8" SSSD format.
  900.  
  901.                 CDIR
  902.  
  903.            Produces no action, but gives a synopsis of the CDIR command syn-
  904.            tax.
  905.  
  906.  
  907.       CERA -- Erase CP/M Files
  908.  
  909.       The program CERA erases a list of CP/M diskette files in much the same
  910.       way  that  the  CP/M  command  ERA does.   In addition,  the available
  911.       remaining CP/M diskette space is reported.
  912.  
  913.       The general syntax of the CERA command is:
  914.  
  915.            CERA  (/disk type)  CP/M file
  916.  
  917.       disk type is the optional diskette tag as  discussed  earlier.   CP/M
  918.       file  refers  to  the CP/M file designator for the diskette drive con-
  919.       taining the CP/M diskette and  the  file(s)  to  be  displayed.   The
  920.       wildcard  characters  "*" and "?" are allowed in order that a group of
  921.       CP/M files may be specified.
  922.  
  923.       Each file specified is erased by writing the hexadecimal character  E5
  924.       as  the first byte (user number) of the CP/M diskette directory entry.
  925.       The rest of the affected directory entry is left alone.   Examples  of
  926.       the CERA command are:
  927.  
  928.                 CERA  A:*.*
  929.  
  930.            Erase all files belonging to user 0, on drive A:.
  931.  
  932.                 CERA  /A1  B*:*.DOC
  933.  
  934.            Erase  all  files with an extension of DOC from all user numbers,
  935.            on drive B:.   The source diskette is assumed to be  in  8"  SSSD
  936.            format.
  937.  
  938.                 CERA
  939.  
  940.            Produces no action, but gives a synopsis of the CERA command syn-
  941.            tax.
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.                                      Page 12
  951.  
  952.  
  953.  
  954.  
  955.  
  956.  
  957.       CFMT -- Format A CP/M Diskette
  958.  
  959.       The  CFMT  utility  formats  blank  CP/M diskettes.   CFMT corresponds
  960.       directly to the CP/M FORMAT or NEWDISK command.
  961.  
  962.       The general syntax of the CFMT command is:
  963.  
  964.            CFMT  (/disk type)  CP/M unit name
  965.  
  966.       Disk type is the optional diskette tag as  discussed  earlier.   CP/M
  967.       unit  name  refers to the designator for the diskette drive containing
  968.       the diskette to be formatted.
  969.  
  970.       Before a diskette is formatted by CFMT, a prompt is issued to the con-
  971.       sole in order to confirm that a diskette is to be reformatted.  If the
  972.       letter "G" followed by the ENTER key is typed,  a blank format pattern
  973.       is created on the designated diskette.
  974.  
  975.       Examples of the CFMT command are:
  976.  
  977.                 CFMT  /MOR1  A:
  978.  
  979.            Format  the  diskette  in drive A: with a format pattern suitable
  980.            for a Morrow MD1 computer system.
  981.  
  982.                 CFMT  F:
  983.  
  984.            Format the diskette in diskette unit F:  with  a  format  pattern
  985.            corresponding to whatever is specified by the CPMDISK environment
  986.            variable.  If CPMDISK is not defined, CFMT will prompt for a dis-
  987.            kette type.
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.  
  999.  
  1000.  
  1001.  
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010.                                      Page 13
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.       Building Custom Diskette Definitions
  1018.  
  1019.       As  mentioned earlier,  the file CPMDISKS.DEF contains definitions for
  1020.       various common CP/M diskette types.   This sections describes how  you
  1021.       can add your own definitions to this file for diskette formats not al-
  1022.       ready  present.   This  section  requires some knowledge of CP/M disk
  1023.       structure; it is not intended for the casual user.
  1024.  
  1025.       The following is a typical diskette format definition:
  1026.  
  1027.            BEGIN
  1028.              SUP3  Superbrain QD -- DSDD 48 tpi 5.25"
  1029.            DENSITY
  1030.              MFM,LOW
  1031.            COMPLEMENT
  1032.            CYLINDERS
  1033.              35
  1034.            SIDES
  1035.              2
  1036.            SECTORS
  1037.              10,512
  1038.            SIDE1 0
  1039.              1,3,5,7,9,2,4,6,8,10
  1040.            SIDE2 1
  1041.              1,3,5,7,9,2,4,6,8,10
  1042.            ORDER
  1043.              CYLINDERS
  1044.            BSH 4 BLM 15  EXM 1  DSM 169  DRM 63
  1045.            AL0 080H  AL1 00H  OFS 2
  1046.            END
  1047.  
  1048.  
  1049.       Diskette definitions are keyword-oriented.   That is,  there are a few
  1050.       words  which  have  special meaning to the routines with interpret the
  1051.       diskette definitions.   Each keyword identifies  the  data  which  im-
  1052.       mediately follows it.
  1053.  
  1054.       The following rules of construction apply to a diskette definition:
  1055.  
  1056.            (1)  Definitions are not sensitive to alphabetic case;  terms and
  1057.                 keywords may be in upper- or  lower-case  characters,  or  a
  1058.                 mixture of both.
  1059.  
  1060.            (2)  Spaces,   tabs and line boundaries are treated as separators
  1061.                 between terms.  In some cases, a comma is required as an ad-
  1062.                 ditional separator.
  1063.  
  1064.            (3)  A term must be completely contained on a single line; other-
  1065.                 wise,  line boundaries are generally ignored.   The only ex-
  1066.                 ceptions to this are the NOTE keyword, which causes the rest
  1067.  
  1068.  
  1069.  
  1070.                                      Page 14
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.                 of  the  current line to be ignored,  and the BEGIN keyword,
  1078.                 which uses the rest of the line following the diskette  type
  1079.                 code or "tag" as a descriptive comment.
  1080.  
  1081.            (4)  Numbers may be expressed in decimal,  hexadecimal or binary.
  1082.                 Decimal quantities are the default and are made up of digits
  1083.                 between 0 and 9 inclusive.   Hexadecimal quantities may also
  1084.                 include the letters A through F,  but must begin with a num-
  1085.                 ber.   Hexadecimal quantities are denoted by  a  final  "H".
  1086.                 Binary quantities are made up of the numbers 0 and 1 and are
  1087.                 denoted  by a final "B".   These are the same conventions as
  1088.                 those used in CP/M assembler coding.
  1089.  
  1090.            (5)  All-blank or empty lines are ignored and may be used  freely
  1091.                 to enhance readability.
  1092.  
  1093.       BEGIN  signals  the  start of a definition.   The first term following
  1094.       this keyword is a one- to four-character diskette tag  code  by  which
  1095.       this  definition  may  be accessed.   The first character of this type
  1096.       code must be alphabetic;  the second character may be numeric  or  al-
  1097.       phabetic.   The  remainder of the the line following the type code is
  1098.       saved as commentary describing the diskette type.
  1099.  
  1100.       DENSITY takes two terms,  separated by a comma.   The  first  term  is
  1101.       either  MFM  for  a  double-density diskette or FM for single density.
  1102.       Your disk controller must be capable of supporting FM operation if the
  1103.       FM density option is given.   The second term is used to  program  the
  1104.       diskette  clock  rate on AT-class machines.   LOW signifies that a 250
  1105.       Kbps data rate should be used; HIGH signifies that a 500 Kbps (HD den-
  1106.       sity) data rate is to be used.   When the PC-AT  1.2M  5.25"  diskette
  1107.       drive is being used,  a data rate of LOW is taken to mean 300 Kbps in-
  1108.       stead of 250 Kbps.
  1109.  
  1110.       CYLINDERS specifies the number of cylinders contained in the  diskette
  1111.       format.   If  this  number  is less than 50,  quad-density (80 track)
  1112.       drives will be double stepped to go from cylinder to cylinder.
  1113.  
  1114.       SKEW specifies the physical interleaving of sectors.   This specifica-
  1115.       tion is optional; if omitted a 1-to-1 physical interleave is assumed.
  1116.  
  1117.       SIDES specifies the number of tracks or surfaces per cylinder.   SIDES
  1118.       may be either 1 or 2 for single- or double-sided media, respectively.
  1119.  
  1120.       SECTORS specifies both the number of sectors per track (cylinder  sur-
  1121.       face)  and the size of a sector.   The sector count and the size terms
  1122.       must be separated by a comma.  SECTORS must precede SIDE1 and SIDE2 in
  1123.       a definition.
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.  
  1130.                                      Page 15
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.       COMPLEMENT is used to denote certain  formats  which  record  data  in
  1138.       complemented or NOT-ed form.  The primary offender in this area is the
  1139.       Superbrain  line.   COMPLEMENT  instructs  22DISK  to complement data
  1140.       before writing and after reading a CP/M diskette.   If  COMPLEMENT  is
  1141.       not used within a definition, normal true format recording is assumed.
  1142.  
  1143.       ORDER  instructs 22DISK as to the ordering of tracks on a double-sided
  1144.       diskette.   Most  formats  record first one side,  and then the other
  1145.       before moving to a new cylinder.   However,  some  diskette  formats,
  1146.       notably CP/M-86 on the IBM PC, record all of the tracks on one side of
  1147.       a diskette, then record the tracks on the other side in descending or-
  1148.       der.  To specify that the cylinder is incremented before the side, use
  1149.       CYLINDERS after the ORDER keyword.  To specify that the side is incre-
  1150.       mented before the cylinder number,  use SIDES after the ORDER keyword.
  1151.       The default when ORDER is not specified is SIDES;  that is,  first one
  1152.       side is recorded,  then the other before the cylinder number is incre-
  1153.       mented.  ORDER has no effect on single-sided media.
  1154.  
  1155.       SIDE1, which must follow the SECTORS specification, specifies the sec-
  1156.       tor ordering on the  first  cylinder  surface.   CP/M  2.2  allows  a
  1157.       software  interleave  of  sectors on a diskette;  the terms given here
  1158.       reflect that interleave.   The first term after the SIDE1  keyword  is
  1159.       the  logical  side  ID  found  in  each ID address mark for that disk.
  1160.       Usually,  this number is 0 for the first side of a diskette and 1  for
  1161.       the second side.   Certain computers,  however,  deviate from this, as
  1162.       shown by the Kaypro example above,  where the second side also  has  a
  1163.       side ID of 0.   After the side ID, there follows a list of sector num-
  1164.       bers in their CP/M ordering.   Each number specifies the next  logical
  1165.       sector to be addressed.  Sector numbers in this list must be separated
  1166.       by  commas;  the  number   given must correspond to that stated in the
  1167.       SECTORS specification.
  1168.  
  1169.       SIDE2 is specified only if the diskette has two surfaces per cylinder.
  1170.       The terms following SIDE2 are the same as those for SIDE1, except that
  1171.       they define the sector addressing and ordering for the second  surface
  1172.       of the diskette.
  1173.  
  1174.       LABEL  is specified for diskette formatting only.   The term following
  1175.       the word LABEL is used as a file name with an implied suffix of  .LBL.
  1176.       When a diskette is formatted, the contents of this file are written to
  1177.       the diskette,  starting with the first sector.   If the data length of
  1178.       the file does not work out to be an integral multiple of the  diskette
  1179.       sector length,  the last sector is filled to its end with the value of
  1180.       the last byte read from the file.   The LABEL feature may also be used
  1181.       to enable one to create CP/M "system" diskettes.
  1182.  
  1183.       The  remainder  of  the  keywords in the definition are taken from the
  1184.       CP/M Disk Parameter Block for this diskette type.  The CP/M System Al-
  1185.       teration Guide presents details on the meaning of each field.  A brief
  1186.       description of each is presented here:
  1187.  
  1188.  
  1189.  
  1190.                                      Page 16
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.            BSH refers to the block shift or the number of left shifts needed
  1198.                 to translate an allocation block number to a relative sector
  1199.                 address.
  1200.  
  1201.            BLM refers to the block mask or a bit mask of ones  corresponding
  1202.                 to the number of bits specified by BSH.  For example, if BSH
  1203.                 is 3, BLM is 7 (3 bits).
  1204.  
  1205.            EXM  refers  to  the  extent  mask  or a bit mask of ones used in
  1206.                 delimiting extents, or groups of 128 128-byte records.
  1207.  
  1208.            DSM refers to the total number of sectors present on a  diskette.
  1209.                 This  quantity,  like all of the CP/M system variables,  as-
  1210.                 sumes a 128-byte sector.
  1211.  
  1212.            DRM refers to the total number of directory entries available  on
  1213.                 a diskette.  DRM is also related to the AL0 and AL1 fields.
  1214.  
  1215.            AL0 and AL1 form a bit mask,  beginning with the most significant
  1216.                 bit in byte AL0 and ending with the least significant bit in
  1217.                 AL1.   These two bytes map the first 16 allocation blocks of
  1218.                 the  disk.   A 1 bit in a position indicates that an alloca-
  1219.                 tion block is reserved,  usually for the directory (see DRM,
  1220.                 above).
  1221.  
  1222.            OFS  indicates the number of tracks that are used for storing the
  1223.                 CP/M system and BIOS at the beginning of a diskette.
  1224.  
  1225.            SOFS  indicates the number of sectors that are  used  for  storing
  1226.                 the  CP/M  system  and  BIOS at the beginning of a diskette.
  1227.                 SOFS is used when the number of sectors used by the CP/M  is
  1228.                 not  an  integral  number of tracks,  such as for the Coleco
  1229.                 Adam.
  1230.  
  1231.  
  1232.       Every diskette definition must end with the END keyword, which follows
  1233.       the OFS specification.
  1234.  
  1235.       If the following Microsoft BASIC program is run on the  host  CP/M  (8
  1236.       bit)  system,  the values of the relevant DPB fields are displayed for
  1237.       the currently logged-in drive:
  1238.  
  1239.  
  1240.            100 REM PROGRAM TO DISPLAY A DEFAULT DPB
  1241.            110 REM
  1242.            120 REM FOR CP/M 2.2 ONLY
  1243.            130 REM
  1244.            140 DEF FNP(X) = PEEK(X) + 256*PEEK(X+1)
  1245.            150 IF PEEK(0) <> 195 THEN PRINT "Requires CP/M" : STOP
  1246.            160 PRINT "DPB VALUES FOR THE CURRENT DISK -- " : PRINT
  1247.            170 REM
  1248.            180 REM STUFF S$ WITH THE FOLLOWING PROGRAM -
  1249.  
  1250.                                      Page 17
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.            190 REM
  1258.            200 REM PUSH H            ; Save address of FAC-3
  1259.            210 REM LHLD 1            ; Get BIOS Cold boot entry
  1260.            220 REM MVI L,27          ; Change to SELDISK vector
  1261.            230 REM LDA 4        ; Get current disk
  1262.            240 REM MOV C,A
  1263.            250 REM MVI A,PCHL   ; for indirect call
  1264.            260 REM STA 38H           ; set in RST 7 vector
  1265.            270 REM RST 7        ; call SELDISK
  1266.            280 REM POP D        ; FAC-3
  1267.            290 REM XCHG
  1268.            300 REM MOV M,E           ; Store pointer to DPH
  1269.            310 REM INX H
  1270.            320 REM MOV M,D
  1271.            330 REM RET          ; exit...
  1272.            340 REM
  1273.            350 S$ = ""
  1274.            360 READ SD : IF SD < 0 THEN 380  ' Read the USR code
  1275.            370 S$ = S$ + CHR$(SD) : GOTO 360
  1276.            380 SX = VARPTR(S$) +1
  1277.            390 SR = FNP(SX)
  1278.            400 DEF USR = SR               ' User program set up
  1279.            410 DPH = USR(0)               ' Get DPH Pointer
  1280.            420 IF DPH = 0 THEN PRINT "Select error" : STOP
  1281.            430 SPT = FNP( FNP( DPH +10)) ' Get Sectors/Track
  1282.            440 PRINT "Sectors per Track";TAB(30);SPT
  1283.            450 IF FNP(DPH) = 0 THEN 510  ' if no interleave
  1284.            460 PRINT " Sectors interleaved as follows:"
  1285.            470 FOR I = 1 TO SPT
  1286.            480  PRINT TAB(10); PEEK( FNP(DPH) + I-1)
  1287.            490 NEXT I
  1288.            500 PRINT : GOTO 520
  1289.            510 PRINT " Sectors are not interleaved"
  1290.            520 DPB = FNP(DPH+10)
  1291.            530 PRINT "Block Shift (BSH)";TAB(30);PEEK(DPB+2)
  1292.            540 PRINT "Block Mask (BLM)";TAB(30);PEEK(DPB+3)
  1293.            550 PRINT "Extent Mask (EXM)";TAB(30);PEEK(DPB+4)
  1294.            560 PRINT "Total Sectors (DSM)";TAB(30);FNP(DPB+5)
  1295.            570 PRINT "Directory Entries (DRM)";TAB(30);FNP(DPB+7)
  1296.            580 PRINT "Allocation 0 (AL0)";TAB(31);HEX$(PEEK(DPB+9));"H"
  1297.            590 PRINT "Allocation 1 (AL1)";TAB(31);HEX$(PEEK(DPB+10));"H"
  1298.            600 PRINT "Cylinder Offset (OFS)";TAB(30);PEEK(DPB+13)
  1299.            610 PRINT
  1300.            620 STOP
  1301.            630 DATA  229,42,1,0,46,27,58,4,0,79,62,233,50,56,0
  1302.            640 DATA  255,209,235,115,35,114,201,-1
  1303.            650 END
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.                                      Page 18
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.       Some Hints on Developing a Definition
  1318.  
  1319.       Quite frequently,  the only information available  when  developing  a
  1320.       definition for 22DISK is a diskette with a few files and nothing more.
  1321.       Here's a guide on what to do if you'd like to try working up a defini-
  1322.       tion yourself:
  1323.  
  1324.            1.   Get  a copy of Sydex's ANADISK.   This utility will fur-
  1325.                 nish far more information than will any other program.
  1326.  
  1327.            2.   Run ANADISK on the diskette in SECTOR EDIT mode.   Note
  1328.                 that  the interleave (or SKEW) is given,  as well as the
  1329.                 number,  size and addresses of sectors.   You then  have
  1330.                 the figures for DENSITY,  CYLINDERS,  SIDES,  SKEW SIDE1
  1331.                 and SIDE2.
  1332.  
  1333.            3.   Locate the  directory  on  the  diskette.   Almost  in-
  1334.                 variably, it starts on the first sector of a track.  The
  1335.                 number of tracks up the point where the directory begins
  1336.                 will give the figure for OFS.   The directory stands out
  1337.                 because it shows file names every  32  bytes,  or  every
  1338.                 other line on the ANADISK display.
  1339.  
  1340.            4.   Examine the first directory entry.   The second 16 bytes
  1341.                 (the second line of the entry) gives a list  of  alloca-
  1342.                 tion unit numbers belonging to the file.   The first one
  1343.                 of these will tell how many allocation units  have  been
  1344.                 reserved to hold the directory.   Thus, if the first al-
  1345.                 location byte is 04, four allocation units have been al-
  1346.                 located to the directory.   Another  thing  to  note  is
  1347.                 whether  the  allocation  unit number appears to be an 8
  1348.                 bit or 16 bit quantity.   For example,  if an entry  has
  1349.                 the following form:
  1350.  
  1351.       00 50 49 50 20 20 20 20 20 43 4F 4D 00 00 00 10  .PIP     COM....
  1352.       04 00 05 00 06 00 00 00 00 00 00 00 00 00 00 00  ................
  1353.  
  1354.                 the  allocation unit designators are 4,  5 and 6 and are 16-
  1355.                 bit quantities.  On the other hand, the following item:
  1356.  
  1357.       00 50 49 50 20 20 20 20 20 43 4F 4D 00 00 00 10  .PIP     COM....
  1358.       04 05 06 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  1359.  
  1360.                 shows the same allocation units,  but as  8-bit  quantities.
  1361.                 If 16-bit quantities are involved,  more than 255 allocation
  1362.                 units are defined for the diskette,  if an  8-bit  quantity,
  1363.                 less than 256 units.   This serves as a check for later com-
  1364.                 putations.  In any case,  the first allocation number of the
  1365.                 first  directory entry gives the number of bits to be set in
  1366.                 AL0 and AL1.  Thus, for an allocation number of 04:
  1367.  
  1368.                      AL0 11110000B  Al1 0
  1369.  
  1370.                                      Page 19
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.            5.   Starting with the first directory sector, advance the sector
  1378.                 (and track,  if necessary) until you find the data belonging
  1379.                 to the first file.   Unused directory entries are almost al-
  1380.                 ways filled out with a pattern of E5's.   The number of sec-
  1381.                 tors  dedicated  to the directory will give an indication of
  1382.                 both the number of directory entries and the allocation unit
  1383.                 size.   Suppose that a our hypothetical  diskette  shows  16
  1384.                 sectors  of 512 bytes allocated to the directory.   Since a
  1385.                 directory entry is 32 bytes long,  the number  of  directory
  1386.                 entries possible for this format is:
  1387.  
  1388.                      16 entries/sector X 16 sectors = 256 entries total
  1389.  
  1390.                 Thus,  DRM is one less than this or 255.  Since we know that
  1391.                 these 16 sectors  represent  4  allocation  units  or  8,192
  1392.                 bytes, the allocation unit size is:
  1393.  
  1394.                      8,192 / 4  = 2,048 bytes
  1395.  
  1396.                 Given  this,  we  can use the following table to compute the
  1397.                 values for BSH and BLM:
  1398.  
  1399.                      +------------+---------+----------+
  1400.                      | Unit Size  |   BSH   |   BLM    |
  1401.                      +------------+---------+----------+
  1402.                      |    1,024   |    3    |    7     |        +----------+
  1403.                      |    2,048   |    4    |   15     |  ------+ This one |
  1404.                      |    4,096   |    5    |   31     |        +----------+
  1405.                      |    8,192   |    6    |   63     |
  1406.                      |   16,384   |    7    |  127     |
  1407.                      +------------+---------+----------+
  1408.  
  1409.            7.   We still need a value for EXM and DSM.   DSM is  simply  the
  1410.                 total number of allocation units on the diskette, not count-
  1411.                 ing the system OFS area.  Let's assume that our diskette has
  1412.                 an  offset of 2 tracks and is single-sided with 40 cylinders
  1413.                 with 8 sectors per track.  The value of DSM is then:
  1414.  
  1415.            ((40 cylinders X 1 side) - 2 tracks) X 8 sectors X 512  bytes)  =
  1416.                 155,648 bytes / 2,048 = 76 Allocation units, total
  1417.  
  1418.                 To get EXM, we then use the following table:
  1419.  
  1420.                      +------------+-----------+-----------+
  1421.                      | Unit Size  | DSM < 256 | DSM > 255 |
  1422.                      +------------+-----------+-----------+
  1423.                      |    1,024   |      0    |   na      |
  1424.                      |    2,048   |      1    |    0      |
  1425.                      |    4,096   |      3    |    1      |
  1426.                      |    8,192   |      7    |    3      |
  1427.                      |   16,384   |     15    |    7      |
  1428.                      +------------+-----------+-----------+
  1429.  
  1430.                                      Page 20
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.            8.   That's  almost  the complete picture,  but for the SIDE1 and
  1439.                 SIDE2 sector ordering.   This is the hardest to determine of
  1440.                 any  of  the  parameters.   Find a readable text file on the
  1441.                 diskette and piece the text back together by  observing  how
  1442.                 words break across sector boundaries.   After a bit,  a pat-
  1443.                 tern in the ordering will become apparent, such as:
  1444.  
  1445.                      1, 3, 5, 7, 2, 4, 6, 8
  1446.  
  1447.            9.   The ORDER value can be determined on double-sided  diskettes
  1448.                 by  observing  whether  file  data  appears to move from one
  1449.                 track to the next on the same side (CYLINDERS),  or  appears
  1450.                 to  go  from  one  side to the other and then advance to the
  1451.                 next cylinder (SIDES).
  1452.  
  1453.            10.   COMPLEMENT is rare.  Generally,  if a diskette appears to be
  1454.                 formatted  with values of 1A instead of E5,  the data on the
  1455.                 diskette is complemented.
  1456.  
  1457.  
  1458.       Indexing A Large Definition File with GENINDEX
  1459.  
  1460.       CPMDISKS.DEF as supplied with 22DISK has been indexed so that the  en-
  1461.       tire  file  does  not  need  to be searched for the specified diskette
  1462.       definition.  CPMDISKS.DEF is also supplied in a  non-indexed  form  as
  1463.       CPMDISKS.NOI.
  1464.  
  1465.       To  generate an indexed definition file,  the GENINDEX command is used
  1466.       as follows:
  1467.  
  1468.                 GENINDEX  source file  destination file
  1469.  
  1470.       where source file is the non-indexed input definition  file  and  des-
  1471.       tination  file  names  the file which will contain the indexed defini-
  1472.       tions.
  1473.  
  1474.       An editable form of CPMDISKS.DEF may  be  had  by  using  the  utility
  1475.       STRIPIDX to remove the index from a definition file:
  1476.  
  1477.                 STRIPIDX  source file destination file
  1478.  
  1479.  
  1480.       Diskette Densities and Recording Modes
  1481.  
  1482.       The  diskette  has undergone quite a number of changes in its develop-
  1483.       ment and 22DISK reflects some of these changes.   This  section  dis-
  1484.       cusses some of the terms used in connection with 22DISK definitions:
  1485.  
  1486.            1.   The physical size of the diskette.   By and large, most dis-
  1487.                 kettes come in one of three sizes: 8, 5.25 or 3.5".   The 8"
  1488.                 diskette is rare to find in use nowadays, but 22DISK is able
  1489.  
  1490.                                      Page 21
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.                 to  handle  this  format,  given  the  appropriate hardware.
  1498.                 5.25" diskettes are the reigning media choice now,  but  may
  1499.                 soon be displaced by the 3.5" "micro" diskettes.  There have
  1500.                 been other sizes,  such as 3.25", but these have not enjoyed
  1501.                 much popularity.
  1502.  
  1503.            2.   Recording performed on both surfaces of the diskette.   The
  1504.                 formats  using  only  one  surface  are called single-sided,
  1505.                 those  using  both  surfaces,  double-sided.   Double-sided
  1506.                 drives  were  rare until about 1978;  now they are the rule,
  1507.                 rather than the exception.
  1508.  
  1509.            3.   The track density.   An analogue to this would be to ask how
  1510.                 close  the  grooves  on  a phonograph record are.  On 8" and
  1511.                 5.25" drives,  a track packing density of 48 tracks per inch
  1512.                 is  most  commonly  used,  although some high-capacity 5.25"
  1513.                 drives double this for 96 tracks per inch (the PC  AT's  1.2
  1514.                 megabyte  drive is a 96 tpi drive).   There was an alternate
  1515.                 5.25" standard in use between 1977 and 1980,  100 tracks per
  1516.                 inch,  but  it  was  always in the minority of applications.
  1517.                 3.5" diskettes use a track density of 135.5 tracks per inch.
  1518.  
  1519.            4.   The spindle speed, or how fast the diskette spins inside its
  1520.                 jacket.   All 8"  diskettes  spin  at  360  revolutions  per
  1521.                 minute; almost all 3.5" diskettes spin at 300 rpm; the first
  1522.                 Sony drives spun at 600 rpm.  Most 5.25" drives also spin at
  1523.                 300 rpm,  with the exception of the PC AT 1.2 megabyte high-
  1524.                 capacity drive, which spins at 360 rpm.
  1525.  
  1526.            5.   The recording method used.   Early diskette  drives  used  a
  1527.                 method  called  FM,  for frequency modulation,  in which one
  1528.                 pulse per time period signified a zero bit  and  two  pulses
  1529.                 signified  a  one  bit.   This is the method referred to as
  1530.                 single density.  Later,  a recording method called MFM,  for
  1531.                 Modified FM came into popular use.  This scheme uses a some-
  1532.                 what  more complex encoding scheme dependent on the position
  1533.                 of a pulse within a bit time window and  the  value  of  the
  1534.                 last bit written.   What MFM does is get twice the data rate
  1535.                 for the same bit rate,  hence the term double density.   Al-
  1536.                 most all modern diskette drives use MFM recording.
  1537.  
  1538.            6.   The  bit  rate  at which data is read or written.   The data
  1539.                 rate for low-density 5.25" diskettes are recorded is 250,000
  1540.                 bits per second.   The PS/2 and PC AT  high-density  formats
  1541.                 make use of a data rate of 500,000 bits per second.  8" for-
  1542.                 mats generally make use of a 500,000  bit  per  second  data
  1543.                 rate.   The  PC  AT 1.2 megabyte high-capacity drive uses a
  1544.                 data rate of 300,000 bits per second  to  record  360K  dis-
  1545.                 kettes because of its higher spindle speed:
  1546.  
  1547.  
  1548.  
  1549.  
  1550.                                      Page 22
  1551.  
  1552.  
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558.                      360 rpm
  1559.                      ---------- X 250,000 bps = 300,000 bps
  1560.                      300 rpm
  1561.  
  1562.            7.    The  sector  demarcation method used.   All modern diskettes
  1563.                 use unique data patterns to show where a sector  begins  and
  1564.                 ends on a track.  On some older systems, however, additional
  1565.                 index  holes  were  used to mark sector boundaries--known as
  1566.                 "hard" sectoring.   22DISK does not  support  hard  sectored
  1567.                 formats.
  1568.  
  1569.  
  1570.       The  common  PC  XT  diskette controller is able to handle single- and
  1571.       double-sided,  double-density diskettes.   The common PC  AT  diskette
  1572.       controller  possesses a variable-rate bit clock generator for 250,000,
  1573.       300,000 and 500,000 bits per second to handle double density diskettes
  1574.       in both 8", 5.25" and 3.5" sizes, as well as high-density diskettes in
  1575.       the 5.25" and 3.5" profiles.
  1576.  
  1577.       If there is a need to handle single-density diskettes in a 5.25"  form
  1578.       factor,  a PC XT clone controller can easily be modified to do so,  at
  1579.       no loss of normal functioning.  The next section shows how.
  1580.  
  1581.  
  1582.       Modifying A PC-XT "Clone" Controller For Single-Density Reading
  1583.  
  1584.       Got a bunch of Xerox 820 diskettes that you'd love to be able to read?
  1585.       Sold your Osborne I at a swap meet and need your correspondence  files
  1586.       from 1981?  Too bad, your PC can't handle single-density diskettes...
  1587.  
  1588.       Or can it?
  1589.  
  1590.       Well, it can be done with a little patience, a few bits of wire, and a
  1591.       small  soldering  iron.    The result is a controller that remains PC-
  1592.       compatible as far as any DOS software can tell,  but has an  extra  FM
  1593.       mode in addition.
  1594.  
  1595.       Do  not  attempt  this modification unless you really know what you're
  1596.       doing and have worked with this kind of equipment before.   This is no
  1597.       place for a novice.
  1598.  
  1599.       First, you need to determine the type of controller you're using.  The
  1600.       original  IBM PC and PC/XT controllers are NOT readily adaptable,  but
  1601.       most inexpensive clones are.
  1602.  
  1603.       The important thing to locate on  the  controller  card  is  the  data
  1604.       separator chip; it's an 8-pin DIP.  It looks something like this:
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.                                      Page 23
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.                              +--U--+
  1619.                      Pin 1   |     | Pin 8
  1620.                      Pin 2   |     | Pin 7
  1621.                      Pin 3   |     | Pin 6
  1622.                      Pin 4   |     | Pin 5
  1623.                              +-----+
  1624.  
  1625.                            (Top View)
  1626.  
  1627.       This DIP (Dual Inline Package) will have pins 4,  5 and 6 grounded and
  1628.       pin 8 connected to the +5 supply trace.    Numbering  of  this  device
  1629.       varies  --  Western Digital (the prime source) has it as a WD 9216;  a
  1630.       NEC part number is UM 8326.   But it's all the same as  far  as  we're
  1631.       concerned.
  1632.  
  1633.       Identify  the  diskette  controller  chip on your board -- this is the
  1634.       large 40 pin DIP  labeled  uPD765A  (NEC),  Z765A  (Zilog),  or  8272A
  1635.       (Intel).   Note that pin 26 is a no-connection on your card -- this is
  1636.       the MFM/FM mode output pin.
  1637.  
  1638.       The last thing you need to find is an unused inverter section.    This
  1639.       is the most difficult part of this whole modification.  Most cards use
  1640.       a  SN7404 or 'S04 as an oscillator (look near the crystal).   Usually,
  1641.       not all sections are used.   Or look for a section of an 'LS00 gate or
  1642.       some  such  thing that can be wired as an inverter (Hint: tie both in-
  1643.       puts together).
  1644.  
  1645.       You need to lift pin 5  of  the  8-pin  data  separator  (above)  from
  1646.       ground.  Depending on how your card is laid out, this can be quick and
  1647.       simple (cut the ground trace) or very messy (unsolder the whole chip).
  1648.       Connect  a  wire  (wire-wrap wire is great) between this pin 5 and the
  1649.       output of the inverter which you located.   Connect a second wire  be-
  1650.       tween  pin 26 of the floppy disk controller (uPD 765) and the input of
  1651.       the inverter.
  1652.  
  1653.       That's it -- put the card back into your PC and  make  sure  it  still
  1654.       handles regular DOS diskettes okay.
  1655.  
  1656.       If  you've got an AT-style controller or a Western Digital 'Fox' dual-
  1657.       density XT controller,  you can even drive SD and DD 8" diskettes with
  1658.       this modification.
  1659.  
  1660.       Note  that  this  simple  modification will enable you to read single-
  1661.       density diskettes,  but not to write them.   If you're  really  adven-
  1662.       turous,  an  XT-style controller can be made to write diskettes if the
  1663.       write-precompensation circuitry is bypassed.   We do it  here  with  a
  1664.       section of a 74LS157 driven from the MFM pin of the '765.  A schematic
  1665.       of your controller is a must for this kind of work.
  1666.  
  1667.  
  1668.  
  1669.  
  1670.                                      Page 24
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.       In Closing
  1679.  
  1680.       Thank you for taking the time to consider Sydex.   We hope that 22DISK
  1681.       does its job well and that it meets your needs.   This product  repre-
  1682.       sents several months of work and research; if you have any suggestions
  1683.       on how it might be improved, please let us know.
  1684.  
  1685.  
  1686.  
  1687.  
  1688.  
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728.  
  1729.  
  1730.                                      Page 25
  1731.  
  1732.  
  1733.  
  1734.  
  1735.  
  1736.  
  1737.       Other Sydex Products
  1738.  
  1739.                                     SHAREWARE
  1740.  
  1741.            CON>FORMAT  --  Concurrent "background" diskette formatter.  Fea-
  1742.            tures "pop-up" operation and "hot key" activation.  You've got to
  1743.            see it to believe.   Supports all  current  DOS  formats.  $15.00
  1744.            ($50.00 site) registration fee.
  1745.  
  1746.            22DISK  --  Transfer  files,  format,  examine and erase files on
  1747.            "foreign" CP/M diskettes on your PC.  Includes tips on supporting
  1748.            8" and 5.25" single-density diskettes.   Contains definitions for
  1749.            over  200  different formats.   $25.00 ($100.00 site) registration
  1750.            fee.
  1751.  
  1752.            22NICE -- A  CP/M  2.2  emulation  package.    Supports  the  NEC
  1753.            V-series  chips  or  performs  emulation by software for both the
  1754.            8080 and Z80 processors.   Includes terminal emulation  and  dis-
  1755.            kette handling for common CP/M systems.  Includes 22DISK.  $40.00
  1756.            ($150.00 site) registration fee.
  1757.  
  1758.            ANADISK  --  The  compleat  diskette  utility.    Nothing like it
  1759.            anywhere else; scan, edit, repair and copy just about any kind of
  1760.            diskette.  $25.00 ($150.00 site)  registration fee.
  1761.  
  1762.            COPYQM -- Mass diskette duplicator.  Format, copy and verify mul-
  1763.            tiple  diskettes from a single master.   Implements "no keyboard"
  1764.            interaction mode and drive "round robin" servicing.  Supports all
  1765.            standard DOS formats.  $25.00 ($75.00 site) registration fee.
  1766.  
  1767.            FORMATQM -- Mass diskette formatter - format a box  of  diskettes
  1768.            at  a single sitting.   Implements "no keyboard" interaction mode
  1769.            and drive "round robin" servicing.   Supports  all  standard  DOS
  1770.            formats.  $10.00 ($40.00 site) registration fee.
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.                                      Page 26
  1787.