Files
8086-rs/src/main.rs
Marco Thomas 2af4578c8b ft: initial disasm of example data
This only contains two instructions of which I know
the correct output.
2025-05-07 15:48:44 +09:00

42 lines
831 B
Rust

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"),
}
}