chore: formatting
This commit is contained in:
parent
bf2bd62743
commit
ae788c9d22
11
src/main.rs
11
src/main.rs
@ -1,8 +1,11 @@
|
|||||||
|
// NOTE
|
||||||
|
// trying this out https://www.pathsensitive.com/2023/12/should-you-split-that-file.html
|
||||||
|
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
#![allow(unused_variables)]
|
#![allow(unused_variables)]
|
||||||
|
|
||||||
use std::{fs::File, io::BufReader};
|
|
||||||
use byteorder::{BigEndian, ReadBytesExt};
|
use byteorder::{BigEndian, ReadBytesExt};
|
||||||
|
use std::{fs::File, io::BufReader};
|
||||||
|
|
||||||
enum OpCodes {
|
enum OpCodes {
|
||||||
// branch
|
// branch
|
||||||
@ -19,7 +22,7 @@ enum OpCodes {
|
|||||||
AND,
|
AND,
|
||||||
// load register
|
// load register
|
||||||
LDR,
|
LDR,
|
||||||
// store registerj
|
// store register
|
||||||
STR,
|
STR,
|
||||||
// return from interrupt (unused)
|
// return from interrupt (unused)
|
||||||
RTI,
|
RTI,
|
||||||
@ -187,7 +190,9 @@ impl VM {
|
|||||||
// Therefore, it flips each pair of bytes.
|
// Therefore, it flips each pair of bytes.
|
||||||
// Meanwhile, `hed` uses big-endian.
|
// Meanwhile, `hed` uses big-endian.
|
||||||
// To make hexdump ignore words, pass the `-C` flag for a byte-by-byte output.
|
// To make hexdump ignore words, pass the `-C` flag for a byte-by-byte output.
|
||||||
let base_addr = f.read_u16::<BigEndian>().expect("Program file could not be read");
|
let base_addr = f
|
||||||
|
.read_u16::<BigEndian>()
|
||||||
|
.expect("Program file could not be read");
|
||||||
|
|
||||||
let mut addr = base_addr;
|
let mut addr = base_addr;
|
||||||
loop {
|
loop {
|
||||||
|
Loading…
Reference in New Issue
Block a user