ft: initial disasm of example data
This only contains two instructions of which I know the correct output.
This commit is contained in:
41
src/main.rs
Normal file
41
src/main.rs
Normal 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"),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user