Humm... My Brain Hurts.. You crazy optimising people are giving me a headache trying to keep up :) If you are interested, a full discussion about how CRCs work is presented= at http://www.geocities.com/SiliconValley/Pines/8659/crc.htm This is what I based my original code on. I was trying to produce a _simple_ and relatively small CRC routine and I seem to have been out-done in a big way.. Oh well :) Maybe I should have a look at this again in the morning when I've drunk l= ess beer.. :P Might make more sense. Cheers, Ash. --- Ashley Roll Digital Nemesis Pty Ltd www.digitalnemesis.com Mobile: +61 (0)417 705 718 > -----Original Message----- > From: pic microcontroller discussion list > [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of K=FCbek Tony > Sent: Tuesday, 14 May 2002 8:54 PM > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: [PIC]: Small Table Driven CRC16 Routine > > > Hi Scott and Ashley, > nice initiative and somewhat challenging :) *gee* probably to > much free time > today. Anyway I concluded by reading the original post the > same result as > Scott > did, there were ways one could skip the table and make some > parts shorter. > However > one thing was still bugging me, the double 4 bits shifts, I > felt that these > should not be > needed. Wrapping my head around what exactely was happening ( > I never have > dealt with CRC > or feedback registers before ) made me realise something, > kind of an 'aha' > experience, > so without further ramblings here goes an *really breifly* > commented version > ( for challenge ). > It works with the test vector but don't take it for granted > that it's fully > operational :) > ( although I think so ). > > It does not save much in regards to Scotts version > (unrolled), but I guess > it is atleast > a few cycles shorther. > > Ofcource I'll post an more commented version if there is > anyone who actually > is interested, > > The snippet is really migrane inducing :) and not for the > faint hearted. > > I needed three temps, and used the 'available' in the > original snippet. > Executes in around 36 instr./byte, no additional stack or > tables are needed > (including call/return). > > But it wouldn't surprise me if Scott,Nikolai or Bob presents > an 10 cycle > version :) *hint* hint* > -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.