4,7 → 4,7 |
|
BitOps.pas |
Bit- Byte- and Nibbleoperations |
64 Bit Edition; Rev 21 March 2010 |
64 Bit Edition; Rev 05 July 2010 |
|
(C) 2010 ViaThinkSoft [www.viathinksoft.com] |
Developed by Daniel Marschall [www.daniel-marschall.de] |
77,6 → 77,10 |
function GetByteBit(AByte: Byte; ABitPos: T8BitPos): TBit; |
function SetByteBit(AByte: Byte; ABitPos: T8BitPos; ANewBit: TBit): Byte; |
|
// Getting and setting of a bit in a AnsiChar |
function GetAnsiCharBit(AChar: AnsiChar; ABitPos: T8BitPos): TBit; |
function SetAnsiCharBit(AChar: AnsiChar; ABitPos: T8BitPos; ANewBit: TBit): Byte; |
|
// Logical operations for the 8 bit arrays. |
function ByteBitArrayShr(ABitArray: TByteBitArray; |
AVal: Longword): TByteBitArray; |
529,6 → 533,16 |
end; |
end; |
|
function GetAnsiCharBit(AChar: AnsiChar; ABitPos: T8BitPos): TBit; |
begin |
result := GetByteBit(Ord(AChar), ABitPos); |
end; |
|
function SetAnsiCharBit(AChar: AnsiChar; ABitPos: T8BitPos; ANewBit: TBit): Byte; |
begin |
result := SetByteBit(Ord(AChar), ABitPos, ANewBit); |
end; |
|
function GetNibbleBit(ANibble: Nibble; ABitPos: T4BitPos): TBit; |
begin |
result := GetByteBit(ANibble, ABitPos); |