BITS
Modern Pascal provides a few different ways for you to work with bits, no matter how large of scale. Over the years, we have found that some people understand working with bits, while others struggle. This unit simplifies the challenge for everyone.
Globals
None
Functions
bitsAsString(const bits_:Longword;Const bitLength:Byte):String
BitCount(B:Byte):Byte
BitCount(W:Word):Byte
BitCount(W:LongWord):Byte
BitCount(W:LargeWord):Byte
bitsPlus(const bitSeq1,bitSeq2:Longword;Const bitLength:Byte):Longword
bitsEqual(const bitSeq1,bitSeq2:Longword;Const bitLength:Byte):boolean
lo(WholeNumber):WholeNumber
GetBit(Value:QWord;Index:Byte):Boolean
hi(WholeNumber):WholeNumber
BitScanBackward(BB:Int64):Integer
BitScanForward(BB:Int64):Integer
Procedures
bitsReverse(var bits_:Longword;Const bitLength:Byte)
ClearBit(var Value:QWord;Index:Byte)
SetBit(var Value:QWord;Index:Byte;State:Boolean)