add total count

This commit is contained in:
Dmitry Vagner 2022-11-14 16:41:02 -08:00
parent e0ee489d38
commit 69ce4f99fe

View File

@ -140,11 +140,14 @@ impl<'a> Interpreter<'a> {
self.run_opcode()?;
}
println!("Opcode count:");
let mut tot = 0;
for i in 0..0x100 {
if self.opcode_count[i] > 0 {
tot = tot + self.opcode_count[i];
println!("{}: {}", get_mnemonic(i as u8), self.opcode_count[i])
}
}
println!("TOTAL: {}", tot);
Ok(())
}