fix(interpreter): typo selected wrong byte
This commit is contained in:
@@ -265,7 +265,8 @@ impl Computer {
|
||||
match lhs {
|
||||
ImmediateOperand::Word(lhsw) => match rhs {
|
||||
ImmediateOperand::Byte(_) => {
|
||||
let [low, _] = lhsw.to_be_bytes();
|
||||
let [low, _] = lhsw.to_le_bytes();
|
||||
log::debug!("lhs was word, so cmp'ing only {low:#04x} - {rhs:#04x}");
|
||||
return ImmediateOperand::Byte(low) - rhs;
|
||||
}
|
||||
_ => {}
|
||||
|
||||
@@ -59,6 +59,6 @@ impl Memory {
|
||||
.ok_or(InterpreterError::MemoryOutOfBound(addr))?
|
||||
.to_owned();
|
||||
log::debug!("Read raw byte {b1:#04x} and {b2:#04x}, starting at addr {addr:#04x}");
|
||||
Ok(Word::from_be_bytes([b2, b1]))
|
||||
Ok(Word::from_le_bytes([b1, b2]))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user