1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-22 12:33:29 +00:00

Make BSR operate like the other offsets: the flow controller gets whatever was in the opcode.

This commit is contained in:
Thomas Harte 2022-05-20 12:40:09 -04:00
parent 45e9648b8c
commit cb77519af8
2 changed files with 4 additions and 4 deletions

View File

@ -483,7 +483,7 @@ template <Model model, typename BusHandler>
void Executor<model, BusHandler>::State::bsr(uint32_t offset) {
sp.l -= 4;
write<uint32_t>(sp.l, program_counter.l);
program_counter.l = instruction_address + offset;
program_counter.l = instruction_address + offset + 2;
}
template <Model model, typename BusHandler>

View File

@ -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: {