Files
8086-rs/src/main.rs

42 lines
866 B
Rust

use clap::{Parser, Subcommand};
mod aout;
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();
log::debug!("{:?}", &instructions);
}
_ => panic!("Command not yet implemented"),
}
}