CRC for MSDOS & Concurrent PC-DOS, version 6.79 by Howard Vigorita, NYACC PC SIG upload comments, etc. to: (718) 539-3338 (BBS) This is a MSDOS generic program derived from the CP/M-86 version by Bill Bolton found on SIG/M Volume #210. MSDOS 2.0 or higher is required for operation. This is a disk file CRC checking and generating utility originally written for CP/M-80, CP/M-86, MP/M-86 and Concurrent PC-DOS, now available for MSDOS. CRC is a companion utility to CRCBUILD which creates -CATALOG files. This utility uses the -CATALOG file as an interactive look up table and displays *MATCH* on your screen next to each line whose embedded CRC agrees with disk contents. This CRC utility may be used to verify the integrity of PC-BLUE or SIG/M public domain distribution disks, all of which contain a standard format -CATALOG file. This utility will optionally create an output file in the default directory, listing the CRC's of all files checked in a single session. That output file may be used in place of the -CATALOG file to perform integrity checks. NEW FEATURES for CRC version 6.79: 1. File write option now specified with /F switch 2. /F= allows specifying CRCKLIST 3. /A switch allows CRC of all hidden & system files COMMANDS: CRC [switches] [:][] Examples: CRC Will attempt to find a CRCK lookup file (CRCKLIST.???, CRCKFILE.???, or -CATALOG.???) and try to match recorded CRC values found there with values calculated by processing each byte of the files on the disk. CRC MYFILE.ASM Display CRC of MYFILE.ASM CRC B:*.ASM Display CRCs of all .ASM files ON B: drive Hidden files, system files, directory files, volume labels as well as files with the '$$$' or 'CRC' extention are ignored by default. Path names as part of the file specification are supported. CRC \BIN\*.* Check all files in the \BIN subdirectory CRC \BIN If \BIN is a directory, look for a CRCK file (CRCKLIST.???, CRCKFILE.???, or -CATALOG.???) in the current directory and try to match recorded CRC values against files in the \BIN directory. Note that the CRCK file, whether matched against or written to (as a result of the F option), will always be on the default drive's current directory. If is a directory, CRCK file matching is presumed. If represents regular file(s), they are processed and their CRCs are displayed. The F option is ignored when is a directory. A number of optional switches are also available. Switches are preceeded by a slash (/) and must be entered ahead of any file spec. The following examples process all files using various CRC polynomials: CRC /X *.* XMODEX CCITT CRC /C *.* CRC16 CRC CRC /P *.* supress 128-byte block padding CRC /P/C *.* CRC16 w/padding supressed (same as in ARC) CRC /A *.* All files includes hidden & system CRC /F *.* Write output to CRCKLIST.CRC CRC /F=my.crc *.* Write output to MY.CRC CRC /F=my.crc Match files against MY.CRC ALGORITHM NOTES The default cyclic-redundancy-checksum (CRC) used in this program is based on the following CCITT standard polynominal: X^16 + X^15 + X^13 + X^7 + X^4 + X^2 + X + 1 The CRC algorithm based on this polynomial is that published by Fred Gutman in EDN magazine, June 1979, at page 84. It is a pseudo CRC that imparts on a simple checksum the characteristics of a traditional CRC. A CRC is a 16 bit number which is derived by forming a hash based on each byte contained in a file. It differs from a simple arithmetic checksum in that bit shifting is applied giving the CRC byte order sensitivity. This EDN algorithm achieves much greater accuracy than a simple checksum with virtually no performance penalty. The implementation employed here uses XOR masking and word shifting techniques to achieve a high speed calculation with 1 memory access per data element. Special attention in this implementation has been given to insure that it generates CRC's which are not only compatable with SIG/M -CATALOG files, but which are also communication chanel insensitive. Generated CRC's will remain unchanged when files are moved from MSDOS or UNIX through communication's chanels which pad file resolution to 128 byte block boundaries. It is thus useful for checking the accuracy of such file transfers. This version also incorporates switches to disable block padding and/or enable highly optimized table lookup options for generating true XMODEM or CRC16 bisychronous CRCs. The table lookup algorithm achieves a speed that approaches that of the EDN technique by processing 8 bytes per loop. SPECIAL MSDOS NOTE This CRC version fixes a bug in some MSDOS versions whereby partial sectors of files were not being processed. Such versions generate "00 00" CRC values for files less than 128 bytes in length and incorrect values for files not an exact multiple of 128 bytes long. Use this version of CRC with CRCBUILD version 1.1 or greater which also fixes this bug. CREDITS The 8 bit version of the program was originally conceived by Keith Petersen, W8SDZ, to whom all glory and honour. Due to the initial scarcity of source code in the MSDOS public domain, the MSDOS version of this program has been derived from the CP/M-86 version by Bill Bolton, Software Tools BBS, Australia. Many thanks to Bill Bolton and the many other CP/M-86 programmers who continue enable the rest of us to learn from their examples in the best spirt of the public domain. The high performance table lookup code was provided by John Souvestre, New Orleans, Louisiana.