#include void do_bit_ops() { unsigned char PTAD = 0x10; printf("PTAD = %#x\n* OR\n", PTAD); PTAD |= 0x01; printf("PTAD |= 0x01 --> %#010x (%#x)\n", PTAD, PTAD); printf("----------\n* AND\n"); printf("PTAD = %#x\n", PTAD=0x1f); PTAD &= 0xfe; printf("PTAD &= 0xfe --> %#010x (%#x)\n", PTAD, PTAD); printf("----------\n* NOT\n"); printf("PTAD = %#x\n", PTAD=0x10); PTAD = ~PTAD; printf("PTAD = ~PTAD --> %#010x (%#x)\n", PTAD, PTAD); printf("----------\n* XOR\n"); printf("PTAD = %#x\n", PTAD=0x10); PTAD ^= 0xfe; printf("PTAD ^= 0xfe --> %#010x (%#x)\n", PTAD, PTAD); } int main() { printf("*** bit-ops pls ***\n"); do_bit_ops(); return 0; }