From 1b21c9f773847817f97ae907d3646d3a574445b3 Mon Sep 17 00:00:00 2001 From: surtur Date: Sat, 31 Oct 2020 12:49:18 +0100 Subject: [PATCH] feat: add do_bit_ops() --- bit-ops.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bit-ops.c b/bit-ops.c index 90412d6..f21994d 100644 --- a/bit-ops.c +++ b/bit-ops.c @@ -1,6 +1,17 @@ #include +void do_bit_ops() { + unsigned char PTAD = 0x10; + printf("PTAD = %#010x\n", PTAD); + PTAD |= 0x01; + printf("PTAD |= 0x01\t %#010x\n", PTAD); + PTAD &= 0xfe; + printf("PTAD &= 0xfe\t %#010x\n", PTAD); +} + + int main() { printf("*** bit-ops pls ***\n"); + do_bit_ops(); return 0; }