fix(interpreter): impl fetch and decode

I parsed all instructions before executing, but this is not how
intel works.
We need to decode the instructions, pointed to by IP, on the fly.
This commit is contained in:
2025-07-01 12:04:20 +09:00
parent f3fd655908
commit a5cffa4852
5 changed files with 511 additions and 539 deletions

View File

@@ -69,15 +69,8 @@ fn main() {
}
}
Command::Interpret => {
let mut disasm = Disassembler::new(&args);
let instructions = disasm.disassemble(args.dump);
match instructions {
Ok(instrs) => {
let mut interpreter = Interpreter::new(instrs, disasm.aout.data);
interpreter.interpret().unwrap();
}
_ => {}
}
let mut interpreter = Interpreter::new(&args);
interpreter.interpret().unwrap();
}
}
}