My Project
Loading...
Searching...
No Matches
az_puthex.c
Go to the documentation of this file.
1// kernel_lib_printf_functions
2/*
3 * Kernel Lib Printf Functions
4 *
5 * Maintainer: Park Jiwoo
6 *
7 * Copyright (C) 2024 Park-Jiwoo
8 *
9 */
10#include "kernel_pr_he.h"
11
12void az_puthex(unsigned int n)
13{
14 char c;
15 char *map;
16
17 map = "0123456789abcdef";
18 if (n)
19 {
20 c = (char)(n & 0xF);
21 n = (n >> 4);
22 az_puthex(n);
23 kernel_putchar(map[(int)c]);
24 }
25}
26
27/*
28 void az_puthex(uint64_t nb)
29{
30 char hex[16];
31 int tmp;
32 int i;
33
34 az_bzero(hex, 16);
35 i = 0;
36 while (nb)
37 {
38 tmp = nb % 16;
39 hex[i] = (tmp + (tmp >= 10 ? ('A' - 10) : '0'));
40 nb /= 16;
41 i++;
42 }
43 az_putstr("0x");
44 while (i >= 0)
45 {
46 az_putchar(hex[i]);
47 i--;
48 }
49}
50*/
void kernel_putchar(char c)
Definition az_putchar.c:13
void az_puthex(unsigned int n)
Definition az_puthex.c:12