From 076855deb184cee21c75b691acc7a1d35fdc744a Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Thu, 5 Jan 2017 01:03:26 -0800 Subject: [PATCH] LR35902: Print address when disassembling --- src/lr35902/debugger/cli-debugger.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lr35902/debugger/cli-debugger.c b/src/lr35902/debugger/cli-debugger.c index 050ad5877..bfd3bcd48 100644 --- a/src/lr35902/debugger/cli-debugger.c +++ b/src/lr35902/debugger/cli-debugger.c @@ -57,6 +57,10 @@ static inline uint16_t _printLine(struct CLIDebugger* debugger, uint16_t address struct LR35902InstructionInfo info = {}; char disassembly[48]; char* disPtr = disassembly; + if (segment >= 0) { + be->printf(be, "%02X: ", segment); + } + be->printf(be, "%04X: ", address); uint8_t instruction; size_t bytesRemaining = 1; for (bytesRemaining = 1; bytesRemaining; --bytesRemaining) {