|
contur2
|
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.
|
inlineconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
| Instruction contur::Block::code = Instruction::Nop |
Instruction opcode.
| std::int32_t contur::Block::operand = 0 |
| std::uint8_t contur::Block::reg = 0 |
| std::int32_t contur::Block::state = 0 |