contur2
Loading...
Searching...
No Matches

Abstract CPU interface. More...

#include <i_cpu.h>

Inheritance diagram for contur::ICPU:

Public Member Functions

virtual ~ICPU ()=default
virtual Interrupt step (RegisterFile &regs)=0
 Performs a single fetch-decode-execute cycle.
virtual void reset () noexcept=0
 Resets the CPU's internal state (flags, etc.).

Protected Member Functions

 ICPU ()=default
 ICPU (const ICPU &)=default
ICPUoperator= (const ICPU &)=default
 ICPU (ICPU &&)=default
ICPUoperator= (ICPU &&)=default

Detailed Description

Abstract CPU interface.

The CPU reads instructions from memory (referenced internally), decodes them, and executes using the provided RegisterFile. Each call to step() performs one fetch-decode-execute cycle.

Definition at line 20 of file i_cpu.h.

Constructor & Destructor Documentation

◆ ~ICPU()

virtual contur::ICPU::~ICPU ( )
virtualdefault

◆ ICPU() [1/3]

contur::ICPU::ICPU ( )
protecteddefault

◆ ICPU() [2/3]

contur::ICPU::ICPU ( const ICPU & )
protecteddefault

◆ ICPU() [3/3]

contur::ICPU::ICPU ( ICPU && )
protecteddefault

Member Function Documentation

◆ operator=() [1/2]

ICPU & contur::ICPU::operator= ( const ICPU & )
protecteddefault

◆ operator=() [2/2]

ICPU & contur::ICPU::operator= ( ICPU && )
protecteddefault

◆ reset()

virtual void contur::ICPU::reset ( )
pure virtualnoexcept

Resets the CPU's internal state (flags, etc.).

Implemented in contur::Cpu.

◆ step()

virtual Interrupt contur::ICPU::step ( RegisterFile & regs)
nodiscardpure virtual

Performs a single fetch-decode-execute cycle.

Reads the instruction at the address given by the Program Counter in regs, decodes it, executes it (updating regs and possibly memory), and advances the PC.

Parameters
regsThe register file for the currently running process.
Returns
An Interrupt code indicating the result:

Implemented in contur::Cpu.


The documentation for this class was generated from the following file: