Skip to main content

ProgramCounter

Trait ProgramCounter 

Source
pub trait ProgramCounter<Address, Memory, CustomError> {
    // 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<I, Memory, CustomError> ProgramCounter<<<I as Instruction>::Reg as Register>::Type, Memory, CustomError> for BasicInstructionFetcher<I, CustomError>
where I: Instruction, Memory: VirtualMemory,