chore: mo stuff pls

This commit is contained in:
surtur 2020-10-31 14:33:35 +01:00
parent 1b21c9f773
commit 490ad2847c
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

@ -2,11 +2,24 @@
void do_bit_ops() {
unsigned char PTAD = 0x10;
printf("PTAD = %#010x\n", PTAD);
printf("PTAD = %#x\n* OR\n", PTAD);
PTAD |= 0x01;
printf("PTAD |= 0x01\t %#010x\n", PTAD);
printf("PTAD |= 0x01 --> %#010x (%#x)\n", PTAD, PTAD);
printf("----------\n* AND\n");
printf("PTAD = %#x\n", PTAD=0x1f);
PTAD &= 0xfe;
printf("PTAD &= 0xfe\t %#010x\n", PTAD);
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);
}