From 76b2a2789b37186955a10e8104f0dfaa1691c8e3 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 15 Jul 2020 17:16:37 +0200 Subject: [PATCH] UserspaceEmulator: Implement MUL_RM32 --- DevTools/UserspaceEmulator/SoftCPU.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/DevTools/UserspaceEmulator/SoftCPU.cpp b/DevTools/UserspaceEmulator/SoftCPU.cpp index 1deeeec984..f1bf36cf7c 100644 --- a/DevTools/UserspaceEmulator/SoftCPU.cpp +++ b/DevTools/UserspaceEmulator/SoftCPU.cpp @@ -1288,7 +1288,17 @@ void SoftCPU::MOV_reg8_imm8(const X86::Instruction& insn) void SoftCPU::MOV_seg_RM16(const X86::Instruction&) { TODO(); } void SoftCPU::MOV_seg_RM32(const X86::Instruction&) { TODO(); } void SoftCPU::MUL_RM16(const X86::Instruction&) { TODO(); } -void SoftCPU::MUL_RM32(const X86::Instruction&) { TODO(); } + +void SoftCPU::MUL_RM32(const X86::Instruction& insn) +{ + u64 result = (u64)eax() * (u64)insn.modrm().read32(*this, insn); + set_eax(result & 0xffffffff); + set_edx(result >> 32); + + set_cf(edx() != 0); + set_of(edx() != 0); +} + void SoftCPU::MUL_RM8(const X86::Instruction&) { TODO(); } void SoftCPU::NEG_RM16(const X86::Instruction& insn)