From cb2e36dde739f6ebe46a166571d250d3e9be52dd Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 11 Jul 2020 22:34:38 +0200 Subject: [PATCH] UserspaceEmulator: Implement PUSH_imm8 Curiously, the 8-bit immediate is sign-extended. --- DevTools/UserspaceEmulator/SoftCPU.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/DevTools/UserspaceEmulator/SoftCPU.cpp b/DevTools/UserspaceEmulator/SoftCPU.cpp index fa0f10822f..36de12ed40 100644 --- a/DevTools/UserspaceEmulator/SoftCPU.cpp +++ b/DevTools/UserspaceEmulator/SoftCPU.cpp @@ -933,7 +933,12 @@ void SoftCPU::PUSH_imm32(const X86::Instruction& insn) 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_reg32(const X86::Instruction& insn)