Bit manipulation

BSET( NUMBER, bitpos )
BCLR( NUMBER, bitpos )
BCHG( NUMBER, bitpos )
BTST( NUMBER, bitpos )
BIT( BITPOS )


BSet  

Description: Set siggle bit in integer value

Syntax:

retvalue = BSet( number, bitpos ) 


Parameter description
:

Name Type
Description
number
integer
Value before changing a bit
bitpos
integer
Position of bit that should be set


Return value:
value (type integer) where bit at bitpos has been changed to 1


Code example
:

Set the bit at position 2 in value 1

 print BSet( 2, 1 )