contur2
Loading...
Searching...
No Matches
i_cpu.h
Go to the documentation of this file.
1
7
8#pragma once
9
12
13namespace contur {
14
20 class ICPU
21 {
22 public:
23 virtual ~ICPU() = default;
24
39 [[nodiscard]] virtual Interrupt step(RegisterFile &regs) = 0;
40
42 virtual void reset() noexcept = 0;
43
44 protected:
45 ICPU() = default;
46 ICPU(const ICPU &) = default;
47 ICPU &operator=(const ICPU &) = default;
48 ICPU(ICPU &&) = default;
49 ICPU &operator=(ICPU &&) = default;
50 };
51
52} // namespace contur
virtual void reset() noexcept=0
Resets the CPU's internal state (flags, etc.).
ICPU()=default
virtual ~ICPU()=default
virtual Interrupt step(RegisterFile &regs)=0
Performs a single fetch-decode-execute cycle.
The CPU's register bank — holds REGISTER_COUNT (16) registers.
Interrupt enum class — hardware and software interrupt codes.
Definition block.h:15
Interrupt
Interrupt codes used by the CPU and kernel.
Definition interrupt.h:17
Register enum class and RegisterFile — the CPU's register bank.