is there a command for reading a particular bit in a variable in memory??
laser-vector
Posts: 118
Hi all, this may be a simple question but:
lets say i have a variable named Status
Status is a long that equals %00000001_00000000_00000000_00001111
how would i do a bitwise lookup on bit 24 to see if its a 1 or 0??
thanks
lets say i have a variable named Status
Status is a long that equals %00000001_00000000_00000000_00001111
how would i do a bitwise lookup on bit 24 to see if its a 1 or 0??
thanks
Comments
How about Bitwise decode '|<' if you are working in Spin?
Status and |< 24
If you say outb:=status, then you can do:
if outb[24] then...
if (variable & constant(1 << bit_position))
.....
-Phil