ft: initial work in interpreter

This commit is contained in:
2025-06-03 21:31:28 +09:00
parent 5ee80c9364
commit ac69d75273
8 changed files with 344 additions and 51 deletions

View File

@@ -1,10 +1,12 @@
use clap::{Parser, Subcommand};
use disasm::Disassembler;
use interpreter::interpreter::Interpreter;
mod aout;
mod disasm;
mod disasm_macros;
mod instructions;
mod interpreter;
mod operands;
mod register;
@@ -49,6 +51,16 @@ fn main() {
_ => {}
}
}
_ => panic!("Command not yet implemented"),
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();
}
_ => {}
}
}
}
}