If you want to do division of one number by another. You might want to consider the use of a binary shift operator. Each shift of a binary number either multiplies or divides the number by two (depending on shift direction).
However, are you sure you are not making your CRC algorithm more complicated than neccessary? it could introduce more errors than the CRC will detect!
One method may be to sum 16bit values together and throw away the carry bit. I sure others could come up with more simple techniques.
Hope I'm not missing a trick, and apologies in advance if I am trying to oversimplify and have not caught on to what you want to do.
But here goes (hopefully not with both feet!) ....
I seem to remember doing similar things with Assembler a number of years ago. I think the algorithm used the basic theory that division like the "inverse of multiplication", and multiplication is a sort of "repeated addition":-
Try repeatedly subtracting the checksum from the word, until one of the following occurs:
(a) The remainder equals the Checksum - in which case you will have found "Remainder Zero";
or
(b) The remainder is smaller than the Checksum - in which case you will have found "Remainder not zero".
Might sound like a lot of work to do, but I suppose the number of iterations depends on how large your word is compared with your checksum.
Also, not sure whether in this simple example "the signs take care of themselves" for negative numbers - haven't thought that one through!
Unfortunitly I have a tendency to make things more complecated than they need to be!
As you say the binary division is probably unneccesary. I had a go at using the binary shift operator (the bitwise >> and << operators) but I got relly confused about operating on integers types and dividing by any integer. I also attempted to use a higher level 'mod' construct, ('%' in C++ or 'mod' object pascal). I had similar problems.
I saw an extreamly complecated looking piece of code that didn't use divsion at all, but some kind of logical sequence. Many algorithms are suited to long frames and 64 bit or 32 bit codes, when I'm after something that will to for simple numbers
Thanks for your suggestions! I'll look at the 'repeated addition' method and see what I get