>>511
unsigned char a; /* フラグ */
int x; /* ビット番号(0〜7) */

ビット検査
if( (a>>x) & 1 ) ビット勃ってる;

ビットたて
a |= 1<<x;

ビットおろし
a &= ~(1<<x);