add pretty-printer for assembled instructions

This commit is contained in:
2020-10-05 00:32:08 +02:00
parent 986f3be6a2
commit 34e339b1ca
11 changed files with 247 additions and 12 deletions
+3 -2
View File
@@ -14,6 +14,7 @@ use crsn::runtime::run_thread::{RunThread, ThreadToken};
use crsn_arith::ArithOps;
use crsn_screen::ScreenOps;
use crsn_stacks::StackOps;
use crsn::module::OpTrait;
mod read_file;
mod serde_duration_millis;
@@ -130,13 +131,13 @@ fn main() -> anyhow::Result<()> {
if config.asm_only {
for (n, op) in parsed.ops.iter().enumerate() {
println!("{:04} : {:?}", n, op);
println!("{:04} : {}", n, op.to_sexp());
}
return Ok(());
} else {
trace!("--- Compiled program ---");
for (n, op) in parsed.ops.iter().enumerate() {
trace!("{:04} : {:?}", n, op);
trace!("{:04} : {}", n, op.to_sexp());
}
trace!("------------------------");
}