diff --git a/lab04/lab04.cpp b/lab04/lab04.cpp index cc4e256..86de7aa 100644 --- a/lab04/lab04.cpp +++ b/lab04/lab04.cpp @@ -28,8 +28,20 @@ void test_nibbles() { cout << "Nibble extraction tests passed!\n"; } +void print_in_hex(uint8_t byte) { + cout << nibble_to_hex(high_nibble(byte)) + << nibble_to_hex(low_nibble(byte)); +} + +void test_print_in_hex() { + print_in_hex(0x0); cout << "\n"; + print_in_hex(0xab); cout << "\n"; + print_in_hex(0xff); cout << "\n"; +} + int main() { test_nibble_to_hex(); test_nibbles(); + test_print_in_hex(); return 0; }