From 2c7f83e006c3fee8d26e940eee801a4be9443e50 Mon Sep 17 00:00:00 2001 From: neoraider Date: Mon, 18 Apr 2005 15:18:02 +0000 Subject: Verzeichnisstruktur ver?ndert --- system/hex.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 system/hex.c (limited to 'system/hex.c') diff --git a/system/hex.c b/system/hex.c new file mode 100644 index 0000000..4374063 --- /dev/null +++ b/system/hex.c @@ -0,0 +1,31 @@ +/* hex.c - hexdecimal print functions */ + +#include + + +extern unsigned char console_std_attr; + +static char hex_values[16] = "0123456789ABCDEF"; + +void print_hex_byte(unsigned char hex) { + print_char(hex_values[(hex >> 4) & 0x0F]); + print_char(hex_values[hex & 0x0F]); +} + +void print_hex_word(unsigned short hex) { + print_char(hex_values[(hex >> 12) & 0x0F]); + print_char(hex_values[(hex >> 8) & 0x0F]); + print_char(hex_values[(hex >> 4) & 0x0F]); + print_char(hex_values[hex & 0x0F]); +} + +void print_hex_long(unsigned long hex) { + print_char(hex_values[(hex >> 28) & 0x0F]); + print_char(hex_values[(hex >> 24) & 0x0F]); + print_char(hex_values[(hex >> 20) & 0x0F]); + print_char(hex_values[(hex >> 16) & 0x0F]); + print_char(hex_values[(hex >> 12) & 0x0F]); + print_char(hex_values[(hex >> 8) & 0x0F]); + print_char(hex_values[(hex >> 4) & 0x0F]); + print_char(hex_values[hex & 0x0F]); +} -- cgit v1.2.3