forked from Lea/invadeez
take file path as arg
This commit is contained in:
parent
b02e8e7672
commit
351ce267da
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1 +1,3 @@
|
||||||
/target
|
/target
|
||||||
|
|
||||||
|
test/
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
use std::fs;
|
use std::{env, fs};
|
||||||
use core::slice::Iter;
|
use core::slice::Iter;
|
||||||
|
|
||||||
const REGISTERS: [&str; 8] = [ "B", "C", "D", "E", "H", "L", "M", "A" ];
|
const REGISTERS: [&str; 8] = [ "B", "C", "D", "E", "H", "L", "M", "A" ];
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let file = fs::read("/home/lea/Downloads/invadeez/invadeez/rom/invaders.h").expect("where file");
|
let mut args = env::args();
|
||||||
|
let filename = args.nth(1).expect("Provide a path to a file to disassemble as an argument");
|
||||||
|
let file = fs::read(filename).expect("where file");
|
||||||
let mut data = file.iter();
|
let mut data = file.iter();
|
||||||
|
|
||||||
while let Some(byte) = data.next() {
|
while let Some(byte) = data.next() {
|
||||||
|
|
Loading…
Reference in a new issue