monistode-emulator 0.1.5

An emulator for the monistode set of ISA's
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::executable::executable::Executable;

pub trait Processor<Byte, Pc, IOPort, IOItem> {
    fn next(&mut self) -> Byte;
    fn at_pc_plus(&self, offset: u16) -> Byte;
    fn pc(&self) -> Pc;
    fn run_command<T, U>(&mut self, output: T, input: U) -> ProcessorContinue
    where
        T: Fn(IOPort, IOItem),
        U: Fn(IOPort) -> IOItem;
    fn load_executable(&mut self, executable: &Executable);
}

pub enum ProcessorContinue {
    KeepRunning,
    Halt,
}