diff --git a/src/main.rs b/src/main.rs index 0439a7e..f655269 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,6 +9,7 @@ fn main() { let instructions = fs::read_to_string(&args[1]) .expect("Instructions could not be read."); let mut i: i32 = 0; + let mut ii = 0; if Path::new("registers").exists() { let lreg = fs::read_to_string("registers") @@ -25,6 +26,7 @@ fn main() { let split: Vec<&str> = instructions.split("\n").collect(); loop { + ii = ii + 1; let s = split[i as usize]; if s.contains("inc") { let splitinstr: Vec<&str> = s.split("inc ").collect(); @@ -61,7 +63,8 @@ fn main() { a = a + 1; } } - println!("Program Step: {}", i); + println!("Instruction Pointer: {}", i); + println!("Program Step: {}", ii); process::exit(0x0100); } }