BUGFIX: Decoder now decodes instructions without parameters
This commit is contained in:
+14
-3
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user