mirror of
https://github.com/mre/mos6502.git
synced 2024-11-24 11:31:00 +00:00
Print decoded instruction
This commit is contained in:
parent
23ddc109ee
commit
cb49e5e5a6
@ -21,6 +21,12 @@ fn main() {
|
||||
// run step-by-step
|
||||
let mut old_pc = cpu.registers.program_counter;
|
||||
while cpu.registers.program_counter != 0x3468 {
|
||||
// Use `fetch_next_and_decode` instead of
|
||||
// `single_step` to see the decoded instruction
|
||||
if let Some(decoded_instr) = cpu.fetch_next_and_decode() {
|
||||
println!("{decoded_instr:?}");
|
||||
cpu.execute_instruction(decoded_instr);
|
||||
}
|
||||
cpu.single_step();
|
||||
println!("{cpu:?}");
|
||||
|
||||
|
@ -105,7 +105,7 @@ pub enum Instruction {
|
||||
TYA, // Transfer Y to Accumulator..... | N. ...Z. A = Y
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
pub enum OpInput {
|
||||
UseImplied,
|
||||
UseImmediate(u8),
|
||||
|
Loading…
Reference in New Issue
Block a user