From 2432396eaa861643a0061f99227064900b377ea1 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 31 Oct 2023 22:04:26 -0400 Subject: [PATCH] Fix SETMOC. --- .../x86/Implementation/PerformImplementation.hpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/InstructionSets/x86/Implementation/PerformImplementation.hpp b/InstructionSets/x86/Implementation/PerformImplementation.hpp index 0fd1657ee..68844f1e6 100644 --- a/InstructionSets/x86/Implementation/PerformImplementation.hpp +++ b/InstructionSets/x86/Implementation/PerformImplementation.hpp @@ -1048,11 +1048,6 @@ void setmo(IntT &destination, Status &status) { status.set_from(destination); } -template -void setmoc(IntT &destination, uint8_t cl, Status &status) { - if(cl) setmo(destination, status); -} - template inline void rcl(IntT &destination, uint8_t count, Status &status) { /* @@ -1775,7 +1770,11 @@ template < return; case Operation::SETMOC: if constexpr (model == Model::i8086) { - Primitive::setmoc(destination_w(), registers.cl(), status); + // Test CL out here to avoid taking a reference to memory if + // no write is going to occur. + if(registers.cl()) { + Primitive::setmo(destination_w(), status); + } break; } else { // TODO.