From abb19e6670bfc278b95b30a1b5b438ee1f983ee5 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 17 Oct 2022 22:57:21 -0400 Subject: [PATCH] Populate carry whenever count != 0, regardless of modulo. --- InstructionSets/M68k/Implementation/PerformImplementation.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/InstructionSets/M68k/Implementation/PerformImplementation.hpp b/InstructionSets/M68k/Implementation/PerformImplementation.hpp index 88d0af4e6..84e0ea7b5 100644 --- a/InstructionSets/M68k/Implementation/PerformImplementation.hpp +++ b/InstructionSets/M68k/Implementation/PerformImplementation.hpp @@ -392,11 +392,13 @@ template void rota ); const auto size = bit_size(); - const auto shift = shift_count(uint8_t(source), flow_controller) & (size - 1); + auto shift = shift_count(uint8_t(source), flow_controller); if(!shift) { status.carry_flag = 0; } else { + shift &= size - 1; + switch(operation) { case Operation::ROLb: case Operation::ROLw: case Operation::ROLl: destination = IntT(