From a83fe7f82d54cf899e3acf56eeca4aa720485998 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 13 Jul 2020 13:41:09 +0200 Subject: [PATCH] UserspaceEmulator: Add the POPFD instruction I'm not sure the mask I'm using here is completely correct, but it's not terribly important since we're a userspace-only emulator anyway. --- DevTools/UserspaceEmulator/SoftCPU.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/DevTools/UserspaceEmulator/SoftCPU.cpp b/DevTools/UserspaceEmulator/SoftCPU.cpp index 02cdb3f9c7..bd6f06d20e 100644 --- a/DevTools/UserspaceEmulator/SoftCPU.cpp +++ b/DevTools/UserspaceEmulator/SoftCPU.cpp @@ -1306,7 +1306,13 @@ void SoftCPU::PADDD_mm1_mm2m64(const X86::Instruction&) { TODO(); } void SoftCPU::POPA(const X86::Instruction&) { TODO(); } void SoftCPU::POPAD(const X86::Instruction&) { TODO(); } void SoftCPU::POPF(const X86::Instruction&) { TODO(); } -void SoftCPU::POPFD(const X86::Instruction&) { TODO(); } + +void SoftCPU::POPFD(const X86::Instruction&) +{ + m_eflags &= ~0x00fcffff; + m_eflags |= pop32() & 0x00fcffff; +} + void SoftCPU::POP_DS(const X86::Instruction&) { TODO(); } void SoftCPU::POP_ES(const X86::Instruction&) { TODO(); } void SoftCPU::POP_FS(const X86::Instruction&) { TODO(); }