From 7ae29015de865f045ce3551cb4561779e3e53354 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Mon, 3 Jun 2019 11:16:06 -0400 Subject: [PATCH] tools/emul: add hex representation to debug output My mind isn't so good at decimal -> hex translations. It helps to have this... --- tools/emul/shell/shell.c | 2 +- tools/emul/zasm/zasm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/emul/shell/shell.c b/tools/emul/shell/shell.c index eb252a0..c8b1a4b 100644 --- a/tools/emul/shell/shell.c +++ b/tools/emul/shell/shell.c @@ -103,7 +103,7 @@ static void io_write(int unused, uint16_t addr, uint8_t val) } else if (addr == FS_SEEKE_PORT) { fsdev_ptr = (fsdev_ptr & 0x00ffff) | (val << 16); } else { - fprintf(stderr, "Out of bounds I/O write: %d / %d\n", addr, val); + fprintf(stderr, "Out of bounds I/O write: %d / %d (0x%x)\n", addr, val, val); } } diff --git a/tools/emul/zasm/zasm.c b/tools/emul/zasm/zasm.c index b858c99..bf6add6 100644 --- a/tools/emul/zasm/zasm.c +++ b/tools/emul/zasm/zasm.c @@ -140,7 +140,7 @@ static void io_write(int unused, uint16_t addr, uint8_t val) } else if (addr == STDERR_PORT) { fputc(val, stderr); } else { - fprintf(stderr, "Out of bounds I/O write: %d / %d\n", addr, val); + fprintf(stderr, "Out of bounds I/O write: %d / %d (0x%x)\n", addr, val, val); } }