Hi Wagner.
Close but not quite right.
If the have a mask of decimal value 32 then you will only be comparing bit 5 (the sixth bit counting from bit 0)
If you want to compare all the the first 6 bits (bits 0-5) then the mask value must be equal to 63. ie bit 0, 1, 2, 3, 4 and 5 on.
(don't forget to count bit positions from right to left)
EG
Source: x0 0 0 1 0 1 0 1 0 1 1 0 1 0 1 0
Mask: xxx0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 xxxxxxThis mask is equal to 63
Compare: 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 xxxxxxThe compare is the result.
Notice the mask blocks the "on" bits at position 6, 8, 10 and 12 from being passed from the source to the compare.
Hope this is enlightening.
I couldnt make the bits line up with spaces. Had to put in xxs to get them nearly correct.
Regards Alan Case