ProgramCounter

Trait ProgramCounter 

Source
pub trait ProgramCounter<Address, Memory, CustomError>
where Address: Display, CustomError: Display,
{ // Required methods fn get_pc(&self) -> Address; fn set_pc( &mut self, memory: &mut Memory, pc: Address, ) -> Result<ControlFlow<()>, ProgramCounterError<Address, CustomError>>; }
Expand description

Generic program counter

Required Methods§

Source

fn get_pc(&self) -> Address

Get the current value of the program counter

Source

fn set_pc( &mut self, memory: &mut Memory, pc: Address, ) -> Result<ControlFlow<()>, ProgramCounterError<Address, CustomError>>

Set the current value of the program counter

Implementors§

Source§

impl<Instruction, Memory, CustomError> ProgramCounter<<<Instruction as BaseInstruction>::Reg as Register>::Type, Memory, CustomError> for BasicInstructionFetcher<Instruction, CustomError>
where Instruction: BaseInstruction, Memory: VirtualMemory, CustomError: Display,