ft: initial work in interpreter

This commit is contained in:
2025-06-03 21:31:28 +09:00
parent 5ee80c9364
commit ac69d75273
8 changed files with 344 additions and 51 deletions

View File

@@ -0,0 +1,28 @@
use core::fmt;
use crate::operands::Byte;
use super::{flags::Flags, register::Register};
#[derive(Debug, Clone)]
pub struct Computer {
pub regs: Register,
pub flags: Flags,
pub memory: [Byte; 65536],
}
impl Computer {
pub fn new() -> Self {
Self {
regs: Register::new(),
flags: Flags::new(),
memory: [0; 65536],
}
}
}
impl fmt::Display for Computer {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{} | {}", self.regs, self.flags)
}
}