/*!
* swap-bits.c
* Interchange bits of a byte in the following pattern:
* bit7 <-> bit0
* bit6 <-> bit1
* bit5 <-> bit2
* bit4 <-> bit3
*
* Vijay Zanvar Feb 03, 2006
*/
#include
#include
#define mask(byte, pos) ((byte) & ~(1<<(pos)))
#define get_bit(byte, pos) ((byte) & (1<<(pos)))
#define program_bit(byte, pos, low_high) \
byte = mask(byte, pos); \
if (low_high) \
byte = byte | (1<               ( geocities.com/vijoeyz/faq)                   ( geocities.com/vijoeyz)