diff options
author | Andreas Kling <kling@serenityos.org> | 2020-07-11 22:15:47 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-11 23:57:14 +0200 |
commit | 12566b9df074ba01de20d550c01aff119f212bb8 (patch) | |
tree | b59dddc500c6e74cc4d81d9c23897b0a1119c3a8 | |
parent | 0af485dfffb6ae96b4440b3f9b01849ae6aabd95 (diff) | |
download | serenity-12566b9df074ba01de20d550c01aff119f212bb8.zip |
UserspaceEmulator: Implement the MOVZX instruction
-rw-r--r-- | DevTools/UserspaceEmulator/SoftCPU.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/DevTools/UserspaceEmulator/SoftCPU.cpp b/DevTools/UserspaceEmulator/SoftCPU.cpp index f7a7f9fe05..10be2bf097 100644 --- a/DevTools/UserspaceEmulator/SoftCPU.cpp +++ b/DevTools/UserspaceEmulator/SoftCPU.cpp @@ -746,9 +746,22 @@ void SoftCPU::MOVSW(const X86::Instruction&) { TODO(); } void SoftCPU::MOVSX_reg16_RM8(const X86::Instruction&) { TODO(); } void SoftCPU::MOVSX_reg32_RM16(const X86::Instruction&) { TODO(); } void SoftCPU::MOVSX_reg32_RM8(const X86::Instruction&) { TODO(); } -void SoftCPU::MOVZX_reg16_RM8(const X86::Instruction&) { TODO(); } -void SoftCPU::MOVZX_reg32_RM16(const X86::Instruction&) { TODO(); } -void SoftCPU::MOVZX_reg32_RM8(const X86::Instruction&) { TODO(); } + +void SoftCPU::MOVZX_reg16_RM8(const X86::Instruction& insn) +{ + gpr16(insn.reg16()) = insn.modrm().read8(*this, insn); +} + +void SoftCPU::MOVZX_reg32_RM16(const X86::Instruction& insn) +{ + gpr32(insn.reg32()) = insn.modrm().read16(*this, insn); +} + +void SoftCPU::MOVZX_reg32_RM8(const X86::Instruction& insn) +{ + gpr32(insn.reg32()) = insn.modrm().read8(*this, insn); +} + void SoftCPU::MOV_AL_moff8(const X86::Instruction&) { TODO(); } void SoftCPU::MOV_AX_moff16(const X86::Instruction&) { TODO(); } void SoftCPU::MOV_CR_reg32(const X86::Instruction&) { TODO(); } |