fix(interpreter): wrong le byte order on pop

This commit is contained in:
2025-06-17 10:54:42 +09:00
parent 1f5e175c68
commit 7e7e648fa8
3 changed files with 17 additions and 4 deletions

View File

@@ -257,5 +257,18 @@ impl fmt::Display for Computer {
#[cfg(test)]
mod tests {
// use super::*;
use super::*;
#[test]
fn test_push() {
let mut c = Computer::new();
let val = ImmediateOperand::Word(0x1234);
c.push_stack(val).unwrap();
let target = PopTarget::Register(crate::register::Register::AX);
c.pop_stack(target).unwrap();
assert_eq!(val, c.regs.read(crate::register::Register::AX))
}
}