ft: initial disasm of example data

This only contains two instructions of which I know
the correct output.
This commit is contained in:
2025-05-07 15:48:44 +09:00
commit 2af4578c8b
8 changed files with 804 additions and 0 deletions

41
src/main.rs Normal file
View File

@@ -0,0 +1,41 @@
use clap::{Parser, Subcommand};
mod aout;
mod decode;
mod disasm;
mod instructions;
#[derive(Subcommand, Debug)]
enum Command {
/// Disassemble the binary into 8086 instructions
Disasm,
/// Interpret the binary as 8086 Minix
Interpret,
}
/// Simple prgram to diasm and interpret Minix binaries
#[derive(Parser, Debug)]
#[command(version, about, long_about = None)]
struct Args {
#[command(subcommand)]
command: Command,
/// Path of the binary
#[arg(short, long, global = true)]
path: Option<String>,
}
fn main() {
env_logger::init();
let args = Args::parse();
log::debug!("{:?}", args);
match args.command {
Command::Disasm => {
let _instructions = disasm::disasm(&args).unwrap();
}
_ => panic!("Command not yet implemented"),
}
}