From cb77519af83c2502c5f115e4d74e902b4c457d07 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Fri, 20 May 2022 12:40:09 -0400 Subject: [PATCH] Make BSR operate like the other offsets: the flow controller gets whatever was in the opcode. --- .../M68k/Implementation/ExecutorImplementation.hpp | 2 +- .../M68k/Implementation/PerformImplementation.hpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/InstructionSets/M68k/Implementation/ExecutorImplementation.hpp b/InstructionSets/M68k/Implementation/ExecutorImplementation.hpp index 7a8f17b52..6e6e21b57 100644 --- a/InstructionSets/M68k/Implementation/ExecutorImplementation.hpp +++ b/InstructionSets/M68k/Implementation/ExecutorImplementation.hpp @@ -483,7 +483,7 @@ template void Executor::State::bsr(uint32_t offset) { sp.l -= 4; write(sp.l, program_counter.l); - program_counter.l = instruction_address + offset; + program_counter.l = instruction_address + offset + 2; } template diff --git a/InstructionSets/M68k/Implementation/PerformImplementation.hpp b/InstructionSets/M68k/Implementation/PerformImplementation.hpp index 7aeb264b1..dcdd98561 100644 --- a/InstructionSets/M68k/Implementation/PerformImplementation.hpp +++ b/InstructionSets/M68k/Implementation/PerformImplementation.hpp @@ -268,13 +268,13 @@ template < break; case Operation::BSRb: - flow_controller.bsr(int8_t(src.b) + 2); + flow_controller.bsr(int8_t(src.b)); break; case Operation::BSRw: - flow_controller.bsr(int16_t(src.w) + 2); + flow_controller.bsr(int16_t(src.w)); break; case Operation::BSRl: - flow_controller.bsr(src.l + 2); + flow_controller.bsr(src.l); break; case Operation::DBcc: {