What's the purpose of ANDing a bit mask with all bits set to a value? I'm adapting an algorithm for calculating a CRC 16-bit CCITT (XModem) value from an ASCII input.  I've found some code here. I'm using the function the poster has in his question, but I've noticed at the bottom he does this:

calcrc = crc And &amp;HFFFF


What's the purpose of applying such a bit mask that is all 1s to a value?  Doesn't that just return the value again?
The reason is crc that it's calculating is defined to be a 16-bit value, the And &amp;HFFFF will truncate the most significant bit outside the 16-bit range if there is any overflow during the calculation.