In this video You can see how use test and set a bits in WORD or other variable. If its to complicated then use UNION-s.
No download links available.