HyperDbg Debugger
Loading...
Searching...
No Matches
Bitwise.h File Reference

Header files for bit-level operations. More...

Go to the source code of this file.

Functions

int TestBit (int BitNumber, unsigned long *Addr)
 Check whether the bit is set or not.
 
void ClearBit (int BitNumber, unsigned long *Addr)
 unset the bit
 
void SetBit (int BitNumber, unsigned long *Addr)
 set the bit
 

Detailed Description

Header files for bit-level operations.

Author
Sina Karvandi (sina@.nosp@m.hype.nosp@m.rdbg..nosp@m.org)
Version
0.2
Date
2023-04-27

Function Documentation

◆ ClearBit()

void ClearBit ( int BitNumber,
unsigned long * addr )

unset the bit

Parameters
BitNumber
addr
35{
36 BITMAP_ENTRY(BitNumber, addr) &= ~(1UL << BITMAP_SHIFT(BitNumber));
37}
#define BITMAP_ENTRY(_nr, _bmap)
Definition Common.h:200
#define BITMAP_SHIFT(_nr)
Definition Common.h:201

◆ SetBit()

void SetBit ( int BitNumber,
unsigned long * addr )

set the bit

Parameters
BitNumber
addr
47{
48 BITMAP_ENTRY(BitNumber, addr) |= (1UL << BITMAP_SHIFT(BitNumber));
49}

◆ TestBit()

int TestBit ( int BitNumber,
unsigned long * addr )

Check whether the bit is set or not.

Parameters
BitNumber
addr
Returns
int
23{
24 return (BITMAP_ENTRY(BitNumber, addr) >> BITMAP_SHIFT(BitNumber)) & 1;
25}