浏览代码

UserspaceEmulator: Implement PUSH_imm8

Curiously, the 8-bit immediate is sign-extended.
Andreas Kling 5 年之前
父节点
当前提交
cb2e36dde7
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      DevTools/UserspaceEmulator/SoftCPU.cpp

+ 6 - 1
DevTools/UserspaceEmulator/SoftCPU.cpp

@@ -933,7 +933,12 @@ void SoftCPU::PUSH_imm32(const X86::Instruction& insn)
     push32(insn.imm32());
     push32(insn.imm32());
 }
 }
 
 
-void SoftCPU::PUSH_imm8(const X86::Instruction&) { TODO(); }
+void SoftCPU::PUSH_imm8(const X86::Instruction& insn)
+{
+    ASSERT(!insn.has_operand_size_override_prefix());
+    push32((i32)insn.imm8());
+}
+
 void SoftCPU::PUSH_reg16(const X86::Instruction&) { TODO(); }
 void SoftCPU::PUSH_reg16(const X86::Instruction&) { TODO(); }
 
 
 void SoftCPU::PUSH_reg32(const X86::Instruction& insn)
 void SoftCPU::PUSH_reg32(const X86::Instruction& insn)