From 4adb975b69b1a42ff00c07e3986fd900e43ee91f Mon Sep 17 00:00:00 2001 From: Marco Thomas Date: Wed, 2 Jul 2025 20:41:34 +0900 Subject: [PATCH] fix(interpreter): actually xchg into AX --- src/instructions.rs | 2 +- src/interpreter/interpreter.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/instructions.rs b/src/instructions.rs index 1034894..0d194f7 100644 --- a/src/instructions.rs +++ b/src/instructions.rs @@ -454,7 +454,7 @@ impl fmt::Display for Mnemonic { Self::TEST_AXIv(word) => write!(f, "test {}, {word:#04x}", Register::AX), Self::XCHG(target, reg) => write!(f, "xchg {target}, {reg}"), - Self::XCHG_AX(reg) => write!(f, "xchg, {reg}, {}", Register::AX), + Self::XCHG_AX(reg) => write!(f, "xchg {reg}, {}", Register::AX), Self::MOV_FromReg(target, reg) => write!(f, "mov {target}, {reg}"), Self::MOV_ToReg(target, reg) => write!(f, "mov {reg}, {target}"), diff --git a/src/interpreter/interpreter.rs b/src/interpreter/interpreter.rs index f1e2bd3..6da95fc 100644 --- a/src/interpreter/interpreter.rs +++ b/src/interpreter/interpreter.rs @@ -518,7 +518,7 @@ impl Interpreter { self.computer .regs .write(reg, self.computer.regs.ax.read().into()); - self.computer.regs.write(reg, tmp); + self.computer.regs.ax.write(tmp.into()); } /*