ozboomer has asked for the wisdom of the Perl Monks concerning the following question:
I have a single 8-bit byte where each bit represents whether a directly-mapped item is 'included' or not. An example:
I would think it's something pretty simple but I haven't been able to nut it out or find anything like it in any of my books or any net searches.$actions = " ABCDEFG"; $item = 0x37; # ...or 00110111b $newitem = &SomeMagic($item); # ...giving " BC EFG"
Any suggestions?
Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Decoding Mapped Bitfields
by Zaxo (Archbishop) on Oct 09, 2005 at 12:01 UTC | |
by sauoq (Abbot) on Oct 09, 2005 at 12:37 UTC | |
|
Re: Decoding Mapped Bitfields
by sauoq (Abbot) on Oct 09, 2005 at 12:28 UTC | |
by ozboomer (Friar) on Oct 09, 2005 at 13:14 UTC | |
|
Re: Decoding Mapped Bitfields
by BerntB (Deacon) on Oct 09, 2005 at 11:18 UTC |