chore: mo stuff pls
This commit is contained in:
parent
1b21c9f773
commit
490ad2847c
19
bit-ops.c
19
bit-ops.c
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user