diff --git a/InstructionSets/x86/Implementation/Arithmetic.hpp b/InstructionSets/x86/Implementation/Arithmetic.hpp index e36aba1c1..619dead80 100644 --- a/InstructionSets/x86/Implementation/Arithmetic.hpp +++ b/InstructionSets/x86/Implementation/Arithmetic.hpp @@ -132,6 +132,7 @@ void imul( modify_t destination_high, modify_t destination_low, read_t source, + read_t multiplicand, ContextT &context ) { /* @@ -160,8 +161,8 @@ void imul( FI; */ using sIntT = typename std::make_signed::type; - destination_high = IntT((sIntT(destination_low) * sIntT(source)) >> (8 * sizeof(IntT))); - destination_low = IntT(sIntT(destination_low) * sIntT(source)); + destination_high = IntT((sIntT(multiplicand) * sIntT(source)) >> (8 * sizeof(IntT))); + destination_low = IntT(sIntT(multiplicand) * sIntT(source)); const auto sign_extension = (destination_low & Numeric::top_bit()) ? IntT(~0) : 0; context.flags.template set_from(destination_high != sign_extension); diff --git a/InstructionSets/x86/Implementation/PerformImplementation.hpp b/InstructionSets/x86/Implementation/PerformImplementation.hpp index f70b60278..67288379f 100644 --- a/InstructionSets/x86/Implementation/PerformImplementation.hpp +++ b/InstructionSets/x86/Implementation/PerformImplementation.hpp @@ -241,7 +241,12 @@ template < return; case Operation::MUL: Primitive::mul(pair_high(), pair_low(), source_r(), context); return; - case Operation::IMUL_1: Primitive::imul(pair_high(), pair_low(), source_r(), context); return; + case Operation::IMUL_1: + Primitive::imul(pair_high(), pair_low(), source_r(), pair_low(), context); + return; + case Operation::IMUL_3: + Primitive::imul(pair_high(), pair_low(), source_r(), IntT(instruction.operand()), context); + return; case Operation::DIV: Primitive::div(pair_high(), pair_low(), source_r(), context); return; case Operation::IDIV: Primitive::idiv(pair_high(), pair_low(), source_r(), context); return; case Operation::IDIV_REP: @@ -570,7 +575,6 @@ template < // LSL // LTR // STR - // IMUL_3 // LOADALL } @@ -647,7 +651,8 @@ void perform( // This is reachable only if the data and address size combination in use isn't available // on the processor model nominated. - assert(false);} + assert(false); +} // // Public function; just indirects into a trampoline into a version of perform templated on data and address size. diff --git a/OSBindings/Mac/Clock SignalTests/8088Tests.mm b/OSBindings/Mac/Clock SignalTests/8088Tests.mm index 415971dbd..2e940fe60 100644 --- a/OSBindings/Mac/Clock SignalTests/8088Tests.mm +++ b/OSBindings/Mac/Clock SignalTests/8088Tests.mm @@ -258,6 +258,7 @@ NSArray *test_files(const char *const home) { // @"D4.json.gz", // AAM // @"F6.7.json.gz", // IDIV byte // @"F7.7.json.gz", // IDIV word + @"C8.json.gz", // ENTER ]]; NSSet *ignoreList = nil;