![]() |
Contur 2
Educational OS kernel simulator
|
A single memory cell in the simulated architecture. More...
#include <block.h>
Public Member Functions | |
| constexpr | Block () noexcept=default |
| Default-constructs a Nop block. | |
| constexpr | Block (Instruction code, std::uint8_t reg, std::int32_t operand, std::int32_t state=0) noexcept |
| Constructs a block with all fields specified. | |
| constexpr bool | operator== (const Block &other) const noexcept |
| Equality comparison. | |
| constexpr bool | operator!= (const Block &other) const noexcept |
| Inequality comparison. | |
Public Attributes | |
| Instruction | code = Instruction::Nop |
| Instruction opcode. | |
| std::uint8_t | reg = 0 |
| Target/source register index. | |
| std::int32_t | operand = 0 |
| Immediate value or address. | |
| std::int32_t | state = 0 |
| Auxiliary state / flags. | |
A single memory cell in the simulated architecture.
Blocks serve dual purpose:
This is a lightweight value type (Flyweight pattern) — designed to be stored in large arrays efficiently.
|
constexprdefaultnoexcept |
Default-constructs a Nop block.
Referenced by Block(), operator!=(), and operator==().
|
inlineconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
| Instruction contur::Block::code = Instruction::Nop |
| std::int32_t contur::Block::operand = 0 |
Immediate value or address.
Definition at line 29 of file block.h.
Referenced by Block(), and operator==().
| std::uint8_t contur::Block::reg = 0 |
Target/source register index.
Definition at line 28 of file block.h.
Referenced by Block(), and operator==().
| std::int32_t contur::Block::state = 0 |
Auxiliary state / flags.
Definition at line 30 of file block.h.
Referenced by Block(), and operator==().