1. Set a specific bit to 1:
Macro #define setbit(x,y) x|=(1<<y) – Sets the y-th bit to 1.
2. Set a specific bit to 0:
Macro #define clrbit(x,y) x&=~(1<<y) – Sets the y-th bit to 0.
3. Toggle a specific bit:
Macro #define reversebit(x,y) x^=(1<<y) – Toggles the y-th bit. Note: XOR results in 0 for the same bits and 1 for different bits.
4. Get the value of a specific bit:
Macro #define getbit(x,y) ((x) >> (y)&1) – Retrieves the value of the y-th bit.