From 321ee72fe72ac2a4e93090aacc6def4bb1dea645 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 11 Jul 2020 22:25:55 +0200 Subject: [PATCH] UserspaceEmulator: Implement JMP_imm16 and JMP_imm32 --- DevTools/UserspaceEmulator/SoftCPU.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/DevTools/UserspaceEmulator/SoftCPU.cpp b/DevTools/UserspaceEmulator/SoftCPU.cpp index 10be2bf097..ae993db5af 100644 --- a/DevTools/UserspaceEmulator/SoftCPU.cpp +++ b/DevTools/UserspaceEmulator/SoftCPU.cpp @@ -683,10 +683,19 @@ void SoftCPU::JMP_FAR_mem16(const X86::Instruction&) { TODO(); } void SoftCPU::JMP_FAR_mem32(const X86::Instruction&) { TODO(); } void SoftCPU::JMP_RM16(const X86::Instruction&) { TODO(); } void SoftCPU::JMP_RM32(const X86::Instruction&) { TODO(); } -void SoftCPU::JMP_imm16(const X86::Instruction&) { TODO(); } + +void SoftCPU::JMP_imm16(const X86::Instruction& insn) +{ + set_eip(eip() + (i16)insn.imm16()); +} + void SoftCPU::JMP_imm16_imm16(const X86::Instruction&) { TODO(); } void SoftCPU::JMP_imm16_imm32(const X86::Instruction&) { TODO(); } -void SoftCPU::JMP_imm32(const X86::Instruction&) { TODO(); } + +void SoftCPU::JMP_imm32(const X86::Instruction& insn) +{ + set_eip(eip() + (i32)insn.imm32()); +} void SoftCPU::JMP_short_imm8(const X86::Instruction& insn) {