The result is already cumulative. If you compare the results to the assembly version in your link, you'll see the last version I posted outputs the same values. crc_hi & crc_lo are only cleared at the start - so they are cumulative until cleared.
Yes, that's what I thought by looking at it, but I guess I was thrown by the fact that the results weren't as expected. However, some more experimentation shows that the results aren't as expected even when calculating the CRC for a single byte, so it would indeed appear that the algorithm in the assembly routine above and the one used by the PC-based program are not identical (although they both are supposed to be CCITT-16 reversed (0x8408)).
I have the C source code for the algorithm used in the PC program. I will try to compare this against the PIC assembly routine and see where the difference might be, although unfortunately I'm no expert in either.
Thanks again for your assistance. This forum is an incredible resource thanks to you and all of the people who contribute.
Bookmarks