瀏覽代碼

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.
Andreas Kling 5 年之前
父節點
當前提交
a83fe7f82d
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      DevTools/UserspaceEmulator/SoftCPU.cpp

+ 7 - 1
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::POPA(const X86::Instruction&) { TODO(); }
 void SoftCPU::POPAD(const X86::Instruction&) { TODO(); }
 void SoftCPU::POPAD(const X86::Instruction&) { TODO(); }
 void SoftCPU::POPF(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_DS(const X86::Instruction&) { TODO(); }
 void SoftCPU::POP_ES(const X86::Instruction&) { TODO(); }
 void SoftCPU::POP_ES(const X86::Instruction&) { TODO(); }
 void SoftCPU::POP_FS(const X86::Instruction&) { TODO(); }
 void SoftCPU::POP_FS(const X86::Instruction&) { TODO(); }