puthex.c
526 Bytes
#include "libfb.h"
/*---------------------------------------------------------------------
Display hex-data on the screen
---------------------------------------------------------------------*/
void
fbPutHex(u16 color, int curs_x, int curs_y, int num, char c) {
int i, k;
for (i = 0 ; i < c ; i ++) {
k = num % 16;
if (k > 9) {
fbPutChar(color, curs_x - i, curs_y, k + 'A' - 10);
} else {
fbPutChar(color, curs_x - i, curs_y, k + '0');
}
num = num >> 4;
}
}