Compare commits

..

4 Commits

Author SHA1 Message Date
b3d45f8abd reorganize files 2025-01-02 15:34:23 -06:00
c5079fd307 test commit 2025-01-02 11:07:15 -06:00
d87071ebe7 update readme 2025-01-02 11:06:06 -06:00
62ccb7644a add readme - testing mirroring 2025-01-02 04:00:04 +01:00
6 changed files with 22 additions and 19 deletions

1
README.md Normal file
View File

@ -0,0 +1 @@
# little computer 3 (lc3) vm written in rust

View File

@ -1,9 +1,11 @@
#![allow(dead_code)]
#![allow(unused_variables)]
mod vm;
use crate::vm::vm::*;
fn main() {
let lc3 = vm::VM::new();
let lc3 = VM::new();
// let mut lc3 = VM::new();
// let args: Vec<String> = env::args().collect();
// let path = args.get(1).expect("a file must be specified");

View File

@ -1,7 +1,7 @@
#![allow(dead_code)]
#![allow(unused_variables)]
use crate::vm::VM;
use crate::vm::vm::VM;
enum Opcode {
BR = 0,

View File

@ -1,3 +1,3 @@
pub mod virtmem;
pub mod isa;
pub mod mem;
pub mod vm;

View File

@ -1,21 +1,21 @@
#![allow(dead_code)]
#![allow(unused)]
use crate::virtmem::Memory;
use crate::vm::mem::*;
const PC_START: u16 = 0x300;
pub struct Registers {
pub r0: u16,
pub r1: u16,
pub r2: u16,
pub r3: u16,
pub r4: u16,
pub r5: u16,
pub r6: u16,
pub r7: u16,
pub pc: u16,
pub cond: u16,
struct Registers {
r0: u16,
r1: u16,
r2: u16,
r3: u16,
r4: u16,
r5: u16,
r6: u16,
r7: u16,
pc: u16,
cond: u16,
}
enum ConditionFlags {
@ -86,8 +86,8 @@ impl Registers {
pub struct VM {
pub memory: Memory,
pub registers: Registers,
memory: Memory,
registers: Registers,
}
impl VM {
@ -99,7 +99,7 @@ impl VM {
}
}
// pub fn execute(&mut self) {
// fn execute(&mut self) {
// while self.registers.pc < 0x3010 {
// let instruction = self.memory.get(self.registers.pc);
// match instruction >> 12 {