المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Bits and Bitmask - how to write?



C# Programming
09-06-2009, 08:51 PM
Hi,

I am unfortunately not familiar with single bits and have now the problem that I have to write single bit values in an integer value.
The bit masks look like:

Value# Bit Mask
1 2-0 00000007H
2 5-3 00000038H
3 8-6 000001C0H
4 15-9 0000FE00H
5 22-16 007F0000H
6 29-23 3F800000H
Bit 30-32 are unused.

Does anyone know how can I set these six values - maybe as short example?

Many thanks! Daniel.