CRC16 routine for 8-bit platforms

Some time ago I stumbled over some CRC implementations on the very intersting Acorn’s BBC site BeebWiki.
Among several variants for different CPUs and languages (assembler, BASIC) an implementation for the Motorola 6809 was still missing. So, I provide my 6809 version. Beside the assembler versions there is also a BBC BASIC version available … and it looks so easy and nice. This challenges me to get the question answered if this is also possible for my past days preferred language BASIC on a Commodore 64. CBM BASIC V2 is far from being comparable to BBC BASIC, but it should be feasible either.
To spoiler the result: Yes, I managed to get a it running, but to be honest, BASIC V2 has truly not the elegance BBC BASIC has. See my repository on Github.

The main issue is the cumbersome handling of integer values to take advantage of the built-in AND, OR and NOT operators for bitwise handling of 16 bit values. Instead of the expected range from 0 to 65535 the integer range is in signed representation ranging from -32768 to +32767. Converting it to binary or doing a simple “left shift” needs some special case handling for negative and positive values.
One might get a grasp on it following the following blog article …