Path: ns-mx!iowasp.physics.uiowa.edu!ceres.physics.uiowa.edu!zaphod.mps.ohio-state.edu!usc!jarthur!nntp-server.caltech.edu!toddpw From: toddpw@nntp-server.caltech.edu (Todd P. Whitesel) Newsgroups: comp.sys.apple2 Subject: Re: CRCs Message-ID: <1991Apr22.002327.5546@nntp-server.caltech.edu> Date: 22 Apr 91 00:23:27 GMT References: <8720@crash.cts.com> Organization: California Institute of Technology, Pasadena Lines: 28 Morgan, if you can live with 512 bytes of CRC tables then you can do block CRC's in something like 25 cycles per byte CRC'd... lda CRC xba sep #$30 crclp eor [data],y tax lda tblL,x xba eor tblH,x iny bne crclp rep #$30 xba sta CRC will do 256 bytes at a time, with a best case of 24 cycles/byte and a worst of 27. (Aligning the DP saves 1, aligning tblH and tblL guarantees 4 cycles each.) I know the table is generated by something simple like (sombody check me): tbl[byte] = updcrc(byte, 0); where updcrc(byte, oldcrc) does not use the table, and tbl is split into high and low byte arrays for the assembly fragment above. Todd Whitesel toddpw @ tybalt.caltech.edu