Add execution to VM via file, starting to iron out bugs
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
use crate::vm::{error::*, flags::Flags, inst::*, reg::*, vm::*};
|
||||
use std::io::stdin;
|
||||
|
||||
impl Vm {
|
||||
pub fn tick(&mut self) -> Result<()> {
|
||||
@@ -120,6 +121,12 @@ impl Vm {
|
||||
_ => panic!("unknown instruction opcode: 0x{:04x}", op),
|
||||
}
|
||||
|
||||
println!("op: {:04x} {}", op, inst_name(op).unwrap());
|
||||
println!("ip: {:05x}", self.ip());
|
||||
println!("next_ip: {:05x}", next_ip);
|
||||
let mut _line = String::new();
|
||||
stdin().read_line(&mut _line).unwrap();
|
||||
|
||||
self.set_reg(IP, next_ip);
|
||||
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user