chore(interpreter): improve debug output
This commit is contained in:
@@ -26,6 +26,7 @@ impl Memory {
|
||||
return Err(InterpreterError::MemoryOutOfBound(addr));
|
||||
} else {
|
||||
self.raw[addr as usize] = b;
|
||||
log::debug!("Wrote raw byte {b:#04x} at addr {addr:#04x}");
|
||||
}
|
||||
}
|
||||
ImmediateOperand::Word(w) => {
|
||||
@@ -35,6 +36,9 @@ impl Memory {
|
||||
let [low, high] = w.to_le_bytes();
|
||||
self.raw[addr as usize] = low;
|
||||
self.raw[(addr + 1) as usize] = high;
|
||||
log::debug!(
|
||||
"Wrote raw byte {low:#04x} and {high:#04x}, starting at addr {addr:#04x}"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -54,6 +58,7 @@ impl Memory {
|
||||
.get((addr + 1) as usize)
|
||||
.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]))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user