A couple of years ago we've discussed CRC-16 here. Last week, I received an email from somebody who was searching for CRC-16 in the lost 8052.com codebase, and stumbled upon that piece of code on my webpage.

Turned out, he needed a different variant of CRC-16 (there are half a dozen of them or so), known also as "Kermit". The difference is in the direction of shift, or, alternatively, in bit-swapping all the input bytes, and then also the result. I concocted a variant of the original code, and, meantime improved the original one by a couple of cycles too (there are remnants of the original code at the end of the file, I was lazy to purge them - please ignore those, the comments and code flow should show the direction).