1
0
mirror of https://github.com/mre/mos6502.git synced 2025-02-17 17:30:43 +00:00

Show impl for machine

This commit is contained in:
Alex Weisberger 2014-10-01 18:07:57 -04:00
parent be65550525
commit f2a47f4b00
2 changed files with 9 additions and 0 deletions

View File

@ -39,5 +39,7 @@ fn main() {
}
println!("Ran program, output of Accum is {}", machine.registers.accumulator);
println!("Machine dump: {}", machine);
}

View File

@ -27,6 +27,7 @@
use address::Address;
use address::AddressDiff;
use std::fmt;
use instruction::Instruction;
use instruction::ADC;
use memory::Memory;
@ -100,6 +101,12 @@ impl Machine {
}
}
impl fmt::Show for Machine {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "I am a machine")
}
}
#[test]
fn add_with_carry_test() {