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);