|
contur2
|
Concrete CPU implementation. More...
#include <cpu.h>


Public Member Functions | |
| Cpu (IMemory &memory) | |
| Constructs a CPU connected to the given memory. | |
| ~Cpu () override | |
| Cpu (const Cpu &)=delete | |
| Cpu & | operator= (const Cpu &)=delete |
| Cpu (Cpu &&) noexcept | |
| Cpu & | operator= (Cpu &&) noexcept |
| Interrupt | step (RegisterFile ®s) override |
| Performs a single fetch-decode-execute cycle. | |
| void | reset () noexcept override |
| Resets the CPU's internal state (flags, etc.). | |
| RegisterValue | flags () const noexcept |
| Returns the current comparison flags. | |
| Public Member Functions inherited from contur::ICPU | |
| virtual | ~ICPU ()=default |
Private Attributes | |
| std::unique_ptr< Impl > | impl_ |
Additional Inherited Members | |
| Protected Member Functions inherited from contur::ICPU | |
| ICPU ()=default | |
| ICPU (const ICPU &)=default | |
| ICPU & | operator= (const ICPU &)=default |
| ICPU (ICPU &&)=default | |
| ICPU & | operator= (ICPU &&)=default |
Concrete CPU implementation.
The CPU performs the fetch-decode-execute cycle:
Instruction encoding in Block:
|
explicit |
Constructs a CPU connected to the given memory.
| memory | Reference to the memory subsystem (must outlive the CPU). |
|
override |
|
delete |
|
noexcept |
|
nodiscardnoexcept |
Returns the current comparison flags.
Flags are set by the Compare instruction:
|
overridevirtualnoexcept |
Resets the CPU's internal state (flags, etc.).
Implements contur::ICPU.
|
nodiscardoverridevirtual |
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.
| regs | The register file for the currently running process. |
Implements contur::ICPU.