;
                                   CRCZ.COM                                   

             Size (recs) CRC   Version    Author/Latest Issue      Disk
               5k (35)   9B5F  1.1        Gene Pizzetta 6/90       Z3COM8

  1- Syntax  2- CRC Validation  3- Errors  4- Config  5- Security  6 - Notes  


   CRCZ calculates the cyclic-redundancy checksum  (CRC) for a group of files,
displaying the  checksums on  the screen,  typing them to the printer,  and/or
writing them to a file.   In validation mode,  CRCZ reads  a checksum file and
matches the listed CRC values to files on the disk.  CRCZ is for ZCPR3 only.
:1
    Syntax   CRCZ {dir:}{afn.aft} {{/}options}

   If a drive/user or named directory is given, all operations are carried out
in that directory.  Otherwise, the current (default) directory is used.

   If an  ambiguous  filename is  given,  checksums  will  be  calculated  for
matching  files.   DateStamper !!!TIME&.DAT files  are always ignored,  as are
temporary files with a filetype of $$$.

   If no filename is given,  CRCZ switches to validation mode.   It  will look
for a checksum file and try to match the listed  filenames and CRC values with
files on the same drive.  DateStamper !!!TIME&.DAT files will never be found.
 Options - 1/3   

   Options must  be preceded by  a slash  ("/") if no directory or filename is
given.

     F -  Send output to the file CRCKFILE.CRC on the target
          drive.  This option is ignored in validation mode.

     L -  Echo output to the printer (CP/M LST device).

     P -  Toggle screen paging.  The number of lines on the CRT
          screen is obtained from the environment descriptor.
          Whether CRCZ defaults to paging is determined by a
          configuration byte (see Configuration, below).  Paging
          is always turned off during printer or disk file
          output, and when quiet mode is in effect.
 Options - 2/3 

     Q -  Toggle quiet mode, which suppresses screen output,
          except for error messages.  The default quiet mode
          state is determined by a configuration byte (see
          Configuration, below).  The configuration byte is
          ignored if the ZCPR3 Quiet flag is set.  This option
          toggles either condition.  It has no effect on printer
          or file output.

     S -  Toggle inclusion of system files.  Whether system files
          are ignored by default is determined by a configuration
          byte (see Configuration, below).  This option toggles
          to the non-default state.  It has no effect on the
          checksum file search in validation mode, when system
          files are always found.
 Options - 3/3 

   A brief usage message is displayed  by  using the "//" option.   The  usage
message always reflects the current effect of the toggle options.   In invalid
option generates an error.

   If screen paging is not in effect,  ^S can be used to pause the display.  A
^C will abort the program at any time;  an incomplete  output  file (F option)
will be erased.

   The cyclic-redundancy checksum used  by CRCZ is based on the CCITT standard
polynomial:
     x^16 + x^15 + x^13 + x^7 + x^4 + x^2 + x + 1
It is compatible with most such CP/M programs.
:2
 CRC Validation - 1/2 

   In validation mode, CRCZ searches for the files CRCKFILE.???, CRCKLIST.???,
CRC.???,  and -CATALOG.???,  in that  order,  reading the  first  such file it
finds.   It then compares the checksum values of the listed files to  matching
files on the same disk, if they exist.   In searching for a checksum file, the
filetype is not significant  (except that COM files are ignored), so the file-
type may be most anything (the disk number, for instance).

   Each filename in  the checksum file is listed to the screen, followed by "*
Match *" if the CRC values match.   If they do not match,  the old and new CRC
values are given.   Files not  found  are so labeled.   Upon completion,  CRCZ
reports the number of matching and non-matching checksums, the number of files
not found, and the number of lines failing the parse test.   Non-parsing lines
at the beginning of the checksum file,  such as occur in ZCRCK's CRC.CRC files
and in SIG/M's -CATALOG files, are not reported.
 CRC Validation - 2/2 

   For validation,  the line format of the  checksum file  is important.   The
lines produced by CRCZ (CRCKFILE.CRC) consist of a filename,  a tab, "CRC = ",
and the CRC value in hexadecimal:
     TEST    .DOC    CRC = 62 25
CRCZ skips the rest of the line after the CRC value,  so  a text editor can be 
used to add a brief file description, if one so desires.

   Each  type of checksum file  has  its  own  line format.   CRCKLIST  lines, 
created by CRC 6.4, consist of "--> FILE:  ",  a filename, two tabs, "CRC = ", 
and the CRC value:
     --> FILE:  TEST    .DOC         CRC = 62 25
CRC.CRC lines,  created by ZCRCK,  consist of the drive/user, a colon, a file-
name, five spaces, and the CRC value (the rest of the line is ignored):
     N0:TEST    .DOC     6225     31D2         1         2
SIG/M's -CATALOG file lines consist of a disk number, a period, a file number,
a tab, a filename, several spaces,  the filesize, "K",  three spaces,  and the
CRC value (a following comment is ignored):
     123.01  TEST    .DOC    1K   62 25
:3
 Errors   

   All errors are  also reported in  quiet  mode,  except individual files not
found in validation mode.   However, the ZCPR3 program error flag is set to 10
in such cases.   In addition,  if any file's checksum does not match, the high
bit of the error flag is set  (that is,  128 is  added  to it).   If  no  file 
matches the given file specification, the error flag is also set to 10.  It is
set to 2 if  an illegal directory is specified,  and to 4 if an invalid option 
is given. The program error flag is otherwise set to zero.  
:4
 Configuration   

   Three configuration bytes  are  available in the  first sector of CRCZ.COM.
Each is marked by a label in ASCII,  immediately followed by the corresponding
byte.

   At the label  "PAGING>",  a zero disables screen paging.   A non-zero value
causes CRCZ to pause  the display each time the screen fills.  As distributed,
paging is enabled (non-zero).

   At the label "QUIET>",  a zero defaults to verbose mode.   A non-zero value
causes CRCZ to  default to quiet  mode,  displaying  only error messages.   As
distributed, verbose mode is enabled (zero).

   At the label  "SYSFILES",  a zero excludes system files by default.  A non-
zero value causes system files to be included.   As distributed,  system files
are excluded (zero). 
:5
 Security 

   No patching is  needed for  remote  system use.   All option flags,  except 
paging, are set to zero if the wheel byte is off,  which means no file output, 
no  printer output,  no system files,  and verbose mode.   With the wheel byte 
off, no options at all are shown by the usage message,  even though the paging
option will still work.  As distributed, CRCZ pages output, which is what most
users would want.

   CRCZ checks byte 15 of the file control block for ZCPR3's invalid directory
flag.  If it is set, CRCZ aborts with an error message.  That restricts CRCZ's
operation to the environment's MAXDU.
:6
 CRCZ Notes - 1/2 

   a. I've never found a file checksum calculator I  was happy with.   CRC 6.4
      (October 30, 1984) came  closest,  but it  was not  a  ZCPR3 utility and
      lacks some important features (particularly,  recognition of DU specifi-
      cations).   Still,  it came  closer to what I  wanted than anything else
      because it could  automatically read back its CRCKLIST.CRC file and then
      compare it with the checksums of the files on the disk.   Unfortunately,
      I couldn't find the source code,  so  CRCZ is based on  a disassembly of
      CRC 6.4.

   b. Version 1.1 updates (06/17/90, Gene Pizzetta)
      - Fixed bug that caused system crash if  program  was aborted in valida-
        tion mode and F option had been given (erroneously) on command line.  
      - Now also sets program error flag to 10 if no files  are found matching 
        given file spec,  to 4 for an invalid option,  and to 2 for an invalid 
        directory.  
      - Added security for remote systems:  all but paging option are disabled
        (and paging option isn't  displayed in usage message),  always runs in 
        verbose mode and excludes system files,  uses ZCPR33 parser to exclude 
        illegal directories.
 CRCZ Notes - 2/2 

   c. Version 1.0 updates (05/14/90, Gene Pizzetta):
      - Recognizes DU and DIR specifications.  
      - Displays usage message with "//" option.  
      - Uses correct name from external FCB in usage message.  
      - Simplified output file format for CRCKFILE.CRC.  
      - When looking for  a checksum file,  finds  system  files,  but ignores
        files with filetype  COM.   Looks  for CRCKFILE.CRC  (created  by this 
        program),  CRCKLIST.CRC (CRC 6.4), CRC.CRC (ZCRCK), and -CATALOG files 
        output by SIG/M.  
      - When  calculating checksums,  always ignores  DateStamper !!!TIME&.DAT 
        files and temporary ($$$) files, and ignores system files by default.  
      - Use 'S' option to include system files.  
      - Use 'L' option for printer output.
      - Use 'P' option to toggle paged display.  
      - Use 'Q' option to toggle suppression of all screen output except 
        error messages.  
      - Uses number of screen lines from  Environment Descriptor.   In valida-
        tion mode, sets program error flag to 10 if no checksum file or a file
        listed in a checksum file is not found.  A checksum mismatch sets high
        bit (adds 128) of the error flag.