What's the purpose of ANDing a bit mask with all bits set to a value?
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.