From b1349038789c61b41321d6e4ea5d81bdee1eeb44 Mon Sep 17 00:00:00 2001 From: Guy Perfect Date: Wed, 30 Oct 2024 15:12:38 -0500 Subject: [PATCH] Fix first line of disassembly --- util/disassembler.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/disassembler.c b/util/disassembler.c index 3970211..80f1743 100644 --- a/util/disassembler.c +++ b/util/disassembler.c @@ -637,8 +637,8 @@ static VBU_DasmLine* dasmDisassemble(VB *sim, uint32_t address, } /* Begin decoding from at least 10 lines before first/reference */ - addr = (address & 0xFFFFFFFE) + - (int32_t) ((line < 0 ? -line : 0) - 10) * 4; + addr = (address & 0xFFFFFFFE) - + (int32_t) (line <= 0 ? 10 : line + 10) * 4; /* Locate the address of the line containing the reference address */ pc = vbGetProgramCounter(sim);