home *** CD-ROM | disk | FTP | other *** search
-
-
- 8080 ROUTINE GENERATES CRC CHARACTER
- by Fred Gutman
-
- California Microwave, Inc., Sunnyvale, CA
-
-
- Communications and magnetic-storage controllers often use
- cyclic redundancy checking (CRC) to enhance data-transmission
- accuracy; this method's popularity is due, in part, to its easy
- implementa- tion with shift registers and exclusive-OR gates (EDN,
- Sept 5, 1978, pgs 119-123).
-
- Many software methods can emulate this hardware mechanization.
- The more natural software method discussed here directly executes the
- division of a message by a generating polynomial. An example,
- programmed on the 8080, appears in the figure.
-
- CRC divides a message M(x) of any length by a generating
- polynomial P(x) to form a quotient Q(x) and a remainder R(x):
- M(x)/P(x)=Q(x)+R(x). R(x) is appended to the message and checked at
- the receiving end of the communication channel or upon read- back of
- magnetic-storage information.
-
- In these operations, addition and division are based on the
- exclusive-OR function without carry; only bit-by-bit differences are
- important, not their arithmetic sum. Thus, while this process
- resembles nonrestoring binary division, its mechanization is somewhat
- simpler. Note that you don't have to store the quotient - the
- remainder is the only useful part. This versatile method accepts
- different generating polynomials (table); you simply insert them into
- the routine in the figure. In each case, an R-bit remainder is left
- in location REM for transmission or checking. (R is the order of the
- generating polynomial.)
-
-
-
- TABLE
-
- POLYNOMIAL MASK HEX FORM
-
- CR16: x16+x15+x2+1 H=128 8005
- SDLC: x16+x12+x5+1 H=128 1021
- CCITT: x16+x15+x10+x6+x5+1 H=128 8461
- x16+x15+x13+x7+x4+x2+x+1 H=128 A097
- HDLC: x14+x2+x+1 H=128 4007
- x8+x7+x2+1 L=128 0185
- CR12: x12+x11+x3+x2+x+1 H=8 180F
- BCC: x8+1 L=128 0101
- CR16 REVERSE: x15+x14+x+1 H=128 4003
- CCIT REVERSE: x16+x11+x4+1 H=128 0811
- x8+x7+x5+x4+1 L=128 01B1
-
-
-
-
-
- --------------------------------------------------------------------
-
- NOTES FOR REPOSITORY USERS ON SIMTEL20
-
- CRCs provide a convenient way to verify that a file received
- from a repository is an exact duplicate of the file on the repository.
- A standard CRC polynomial has been selected, and several different
- programs have been created which analyze files and compute the value
- of this CRC polynomial when the data in the file is provided as data
- for the polynomial. The following list may prove to be useful:
-
-
- Program Name Implementation Comments
- ------------ -------------- --------
- NCRC TOPS-20 MICRO:<CPM.TOPS20>
- NCRC.MID (written in Midas)
- CRC UNIX PD:<UNIX.CPM>
- CRCK2.C (generic C)
- CRC CP/M MICRO:<CPM.DIRUTL>
- CRCKxx.ASM (8080 asm)
- xx=version number
- CRC ZCPR3 MICRO:<CPM.ZCPR3>
- CRC.MAC (8080 asm)
-
-
- Source code is provided for all of the routines listed above.
-
- The repositories on SIMTEL20 contain CRCLST files, generated
- by NCRC for TOPS-20, which contain the CRCs for the files contained in
- them. The <ADA> repository's CRCLST file is:
-
-
- PD:<ADA>ADA.CRCLST
-
-
- Previous versions of the CRCLST are often retained for
- historical purposes. Only the last N versions of ADA.CRCLST are
- retained, where N is indeterminant. By using the file reference
- specified above, the latest version is always retrieved.
-
-
- SAMPLE ADA.CRCLST
-
-
- Filename Type Bytes Sectors CRC
-
- Directory PD:<ADA.COMPONENTS>
- LIMPRIOR.ADA.2 ASCII 7374 58 = 3AH 364CH
- LIMPRIOR.PRO.2 ASCII 3461 28 = 1CH 813DH
- LIST.ADA.2 ASCII 17483 137 = 89H 4B17H
- LIST.PRO.2 ASCII 3397 27 = 1BH 7780H
- PRIOR.ADA.2 ASCII 6398 50 = 32H A562H
- PRIOR.PRO.2 ASCII 3582 28 = 1CH 5060H
- SAFEIO.ADA.2 ASCII 9730 77 = 4DH 7E5BH
- SAFEIO.PRO.2 ASCII 3661 29 = 1DH BB29H
-
- Directory PD:<ADA.GENERAL>
- 00READ.ME.2 ASCII 1578 13 = DH 84D1H
- ADAREPOS.TXT.2 ASCII 3681 29 = 1DH 9B3EH
- COPYRITE.DOC.1 ASCII 4434 35 = 23H 206EH
- COPYRITE.INF.1 ASCII 5777 46 = 2EH AEBCH
- COPYRITE.TXT.1 ASCII 11313 89 = 59H 9916H
- FTP.DOC.1 ASCII 17412 137 = 89H B0E3H
- LBR.DOC.2 ASCII 955 8 = 8H E967H
- MLIST.DOC.1 ASCII 807 7 = 7H 45FBH
- PROLOGUE.ADA.1 ASCII 2513 20 = 14H 3CB9H
- SAMPLE.PRO.1 ASCII 3461 28 = 1CH 813DH
- UUCP-BIT.DOC.1 ASCII 4649 37 = 25H CCBCH
-
-