Accessing Bits

BlitzMax Forums/BlitzMax Programming/Accessing Bits

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

128 64 32 16 8 4 2 1
$FF = 1 1 1 1 1 1 1 1
$0F = 0 0 0 0 1 1 1 1
$01 = 0 0 0 0 0 0 0 1 - refreshing your memory?

test if bit zero is set..
if(mask & $01)do something..

test if bit 15 is set
if(mask & $80)do something

mask out most sig nibble
mask=mask & $0F