pub trait GenericInstructionHandler<Instruction, Memory, CustomError>{
// Required method
fn fetch_instruction(
&mut self,
_regs: &mut Registers<Instruction::Reg>,
memory: &mut Memory,
pc: &mut u64,
) -> Result<FetchInstructionResult<Instruction>, ExecuteError<Instruction, CustomError>>;
}Expand description
Custom handlers for instructions ecall and ebreak
Required Methods§
Sourcefn fetch_instruction(
&mut self,
_regs: &mut Registers<Instruction::Reg>,
memory: &mut Memory,
pc: &mut u64,
) -> Result<FetchInstructionResult<Instruction>, ExecuteError<Instruction, CustomError>>
fn fetch_instruction( &mut self, _regs: &mut Registers<Instruction::Reg>, memory: &mut Memory, pc: &mut u64, ) -> Result<FetchInstructionResult<Instruction>, ExecuteError<Instruction, CustomError>>
Fetch a single instruction at a specified address and advance the program counter