From a9902fc8174878626f3bf53aaab0c1775e8e2baf Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 11 May 2022 16:31:27 -0400 Subject: [PATCH] Fix ABCD when the result has an invalid lower digit. --- InstructionSets/M68k/Implementation/PerformImplementation.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InstructionSets/M68k/Implementation/PerformImplementation.hpp b/InstructionSets/M68k/Implementation/PerformImplementation.hpp index 2e3c34fdb..6d43257fc 100644 --- a/InstructionSets/M68k/Implementation/PerformImplementation.hpp +++ b/InstructionSets/M68k/Implementation/PerformImplementation.hpp @@ -43,7 +43,7 @@ template < int result = (destination & 0xf) + (source & 0xf) + (status.extend_flag_ ? 1 : 0); if(result > 0x09) result += 0x06; result += (destination & 0xf0) + (source & 0xf0); - if(result > 0x99) result += 0x60; + if(result > 0x9f) result += 0x60; // Set all flags essentially as if this were normal addition. status.zero_result_ |= result & 0xff;