Correct target address for 6501 conditional jumps

It was calculated wrong if the offset was negative.
This commit is contained in:
Martin Vilcans 2023-03-17 16:58:55 +01:00
parent 8c69479f8c
commit 2655a372b8
1 changed files with 1 additions and 1 deletions

View File

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