1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:37:35 +00:00

UserspaceEmulator: Implement the MOVSX instruction

This commit is contained in:
Andreas Kling 2020-07-12 15:33:29 +02:00
parent 8940916232
commit 04695957e2

View file

@ -1055,9 +1055,20 @@ void SoftCPU::MOVSW(const X86::Instruction& insn)
});
}
}
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::MOVSX_reg16_RM8(const X86::Instruction& insn)
{
gpr16(insn.reg16()) = sign_extended_to<u16>(insn.modrm().read8(*this, insn));
}
void SoftCPU::MOVSX_reg32_RM16(const X86::Instruction& insn)
{
gpr32(insn.reg32()) = sign_extended_to<u32>(insn.modrm().read16(*this, insn));
}
void SoftCPU::MOVSX_reg32_RM8(const X86::Instruction& insn)
{
gpr32(insn.reg32()) = sign_extended_to<u32>(insn.modrm().read8(*this, insn));
}
void SoftCPU::MOVZX_reg16_RM8(const X86::Instruction& insn)
{