BUGFIX: Decoder now decodes instructions without parameters

This commit is contained in:
2025-06-29 10:43:41 -04:00
parent e5c2319803
commit 0c475127f6
9 changed files with 101 additions and 38 deletions
+14 -3
View File
@@ -1,11 +1,22 @@
use core::instruction::Instruction;
use core::address_mode::AddressMode;
use core::operand::Operand;
use core::operation::Operation;
fn main() {
println!("Taxation is Theft");
// Instruction::from_bytes(vec![0b11100011]);
let instructions = vec![(
Instruction {
op: Operation::NOP,
mode: AddressMode::Implied,
operand: Operand::None,
}, &[0xea]
)];
// let instruction = Instruction::ADC(AddressMode::Immediate);
// println!("Instruction = {:?}", instruction.to_string());
for (op, bytes) in instructions {
assert_eq!(Instruction::decode(bytes), Some(op));
}
// let instruction = Instruction::decode(&[0xea]);
// println!("NOP Decoded -> {:?}", instruction);
}