CountBits examines the longword passed in as a parameter and returns the number of bits that are turned on in the word, using an algorithm derived from a note in MIT's HAKMEM.
Arguments
mask
The data word to count the bits of.
Return Value
The number of bits that were turned on in the supplied value.