mos6502/cli/src/bin/decode.rs

22 lines
483 B
Rust

use core::address_mode::AddressMode;
use core::instruction::Instruction;
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));
}
}