diff options
author | Andreas Kling <kling@serenityos.org> | 2020-07-18 00:16:51 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-18 00:25:02 +0200 |
commit | becbf36711351c32e96b3d80b8d6e7af8b0fd815 (patch) | |
tree | 828fa3a11af90e5eb5a2f3049f1ba95554c50792 | |
parent | 8959f9950a22a9868c83c2815a3133d0736ba164 (diff) | |
download | serenity-becbf36711351c32e96b3d80b8d6e7af8b0fd815.zip |
UserspaceEmulator: Fix XCHG_AX_reg16 overwriting entire EAX
This instruction should only write to the lower 16 bits (AX)
-rw-r--r-- | DevTools/UserspaceEmulator/SoftCPU.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/DevTools/UserspaceEmulator/SoftCPU.cpp b/DevTools/UserspaceEmulator/SoftCPU.cpp index b9a215dea1..73323d322d 100644 --- a/DevTools/UserspaceEmulator/SoftCPU.cpp +++ b/DevTools/UserspaceEmulator/SoftCPU.cpp @@ -2138,7 +2138,7 @@ void SoftCPU::XCHG_AX_reg16(const X86::Instruction& insn) { auto temp = gpr16(insn.reg16()); gpr16(insn.reg16()) = eax(); - set_eax(temp); + set_ax(temp); } void SoftCPU::XCHG_EAX_reg32(const X86::Instruction& insn) |