mos6502/cli/src/bin/decode.rs

23 lines
584 B
Rust

use core::instruction::Instruction;
use core::address_mode::AddressMode;
use core::operand::Operand;
use core::operation::Operation;
fn main() {
println!("Taxation is Theft");
let instructions = vec![(
Instruction {
op: Operation::NOP,
mode: AddressMode::Implied,
operand: Operand::None,
}, &[0xea]
)];
for (op, bytes) in instructions {
assert_eq!(Instruction::decode(bytes), Some(op));
}
// let instruction = Instruction::decode(&[0xea]);
// println!("NOP Decoded -> {:?}", instruction);
}