emu: Fake opcode ASSERT for testing
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
use std::fmt::Debug;
|
||||
|
||||
use emu::byteorder::{ByteOrder, LittleEndian};
|
||||
use emu::dos;
|
||||
use emu::i8088::i8088;
|
||||
@@ -5,6 +7,12 @@ use emu::operands::{Addr, Address, LValue, Reg, RValue};
|
||||
use emu::pc::Bus;
|
||||
use emu::util::segoff_to_addr;
|
||||
|
||||
pub fn assert<T: Debug + Eq>(loc: &impl RValue<T>, val: &impl RValue<T>) {
|
||||
assert_eq!(loc.read(), val.read(),
|
||||
"ASSERT instruction failed: {:#2X?} != {:#2X?}", loc.read(), val.read());
|
||||
println!("ASSERT pass: {:#2X?} == {:#2X?}", loc.read(), val.read());
|
||||
}
|
||||
|
||||
pub fn show(cpu: &mut i8088) {
|
||||
println!("{:#X?}", cpu);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user