Struct StackProcessor

Source
pub struct StackProcessor {
    pub text_memory: Memory<u6>,
    pub data_memory: Memory<u8>,
    pub registers: StackProcessorRegisters,
}

Fields§

§text_memory: Memory<u6>§data_memory: Memory<u8>§registers: StackProcessorRegisters

Implementations§

Source§

impl StackProcessor

Source

pub fn new() -> StackProcessor

Source

pub fn load_from_bytes(&mut self, bytes: &[u8])

Source

pub fn load_text_binary_file(&mut self, binary: &str)

Source

pub fn register_stack(&mut self) -> TwoByteStack<'_, Memory<u8>, u16, usize>

Source

pub fn memory_stack(&mut self) -> TwoByteStack<'_, Memory<u8>, u16, usize>

Source

pub fn two_byte_data_memory( &mut self, ) -> TwoByteMemory<'_, Memory<u8>, u16, usize>

Trait Implementations§

Source§

impl Processor<u6, u16, u16, u16> for StackProcessor

Source§

fn next(&mut self) -> u6

Source§

fn at_pc_plus(&self, offset: u16) -> u6

Source§

fn pc(&self) -> u16

Source§

fn run_command<T, U>(&mut self, output: T, input: U) -> ProcessorContinue
where T: Fn(u16, u16), U: Fn(u16) -> u16,

Source§

fn load_executable(&mut self, executable: &Executable) -> Result<(), String>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.