X-Git-Url: https://robinkrens.nl/gitweb/?p=cortex-from-scratch;a=blobdiff_plain;f=lib.c;h=69bb12df260bd744158fcd8b5f2c399bf86e8f3e;hp=62c56e833a1bff7a69f3298dc96bb392d4c2dfc1;hb=3f9ee85c250250580f0ceb38525ddb99ebc6d36e;hpb=22c1abee1ad44eb88784fd7ff38ca669f41b6c01 diff --git a/lib.c b/lib.c index 62c56e8..69bb12d 100644 --- a/lib.c +++ b/lib.c @@ -9,13 +9,12 @@ char hexbuf[8] = {'0', '0','0', '0','0', '0','0', '0'}; -void addrtohex(const uint32_t addr) { +void addrtohex(uint32_t addr) { char tmpbuf[6] = {'A', 'B', 'C', 'D', 'E', 'F'}; memset(&hexbuf, 0, sizeof(uint32_t) * 8); - uint32_t tmp = addr; for (int i = 0; i < 8 ; i++) { - tmp = addr; + uint32_t tmp = addr; tmp = tmp >> (i * 4); tmp = tmp & 0xF; if ((tmp >= 0) && tmp < 10) { @@ -27,20 +26,10 @@ void addrtohex(const uint32_t addr) { } uart_puts("ADDRESS: 0x"); - for (int i = 7; i >= 0; i--) { + for (int i = 7; i >= 0; i--) { uart_putc(hexbuf[i]); - } + } + //uart_puts(hexbuf); uart_putc('\n'); } - -void *malloc(size_t size) { - - - -} - -void free(void * ptr) { - - -}