From 2655a372b86696f364864412a709fe1889b7c164 Mon Sep 17 00:00:00 2001 From: Martin Vilcans Date: Fri, 17 Mar 2023 16:58:55 +0100 Subject: [PATCH] Correct target address for 6501 conditional jumps It was calculated wrong if the offset was negative. --- dcc6502.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dcc6502.c b/dcc6502.c index 613aa2b..c029f8c 100644 --- a/dcc6502.c +++ b/dcc6502.c @@ -616,7 +616,7 @@ static void disassemble(char *output, uint8_t *buffer, options_t *options, uint1 // Compute displacement from first byte after full instruction. word_operand = current_addr + 3; - if (byte_operand > 0x7Fu) { + if (byte_operand2 > 0x7Fu) { word_operand -= ((~byte_operand2 & 0x7Fu) + 1); } else { word_operand += byte_operand2 & 0x7Fu;