This commit is contained in:
2025-05-31 22:56:05 -04:00
parent ef3d605528
commit 21f6e492f6
30 changed files with 1145 additions and 1286 deletions
+1
View File
@@ -35,6 +35,7 @@ fn main() {
print!("0x{:02x}, ", result.unwrap());
}
}
fn read_file_to_bools(file_path: &str) -> io::Result<Vec<u8>> {
// Open the file
let file = File::open(file_path)?;
+2 -2
View File
@@ -18,7 +18,7 @@ pub struct Chip8AsmParser;
fn main() {
println!("Taxation is Theft");
let unparsed = fs::read_to_string("resources/test/gemma_disassembler_manual_document.asc")
let unparsed = fs::read_to_string("resources/test/asm/gemma_disassembler_manual_document.asm8")
.expect("Unable to read input");
let file = Chip8AsmParser::parse(Rule::file, &unparsed)
@@ -36,7 +36,7 @@ fn main() {
print!("record = {:?}\t", record.as_str());
let x = Chip8CpuInstructions::from_str(record.as_str());
println!("DECODED TO {:?} {:04x}", x, x.encode());
let (high, low) = InstructionUtil::split_bytes(x.encode());
let (low, high) = InstructionUtil::split_bytes(x.encode());
target_file
.write_all(&[high, low])
.expect("Unable to write to the file.");