32 [[nodiscard]]
inline Block movReg(std::uint8_t dst, std::uint8_t src)
noexcept
50 [[nodiscard]]
inline Block addReg(std::uint8_t dst, std::uint8_t src)
noexcept
68 [[nodiscard]]
inline Block subReg(std::uint8_t dst, std::uint8_t src)
noexcept
86 [[nodiscard]]
inline Block mulReg(std::uint8_t dst, std::uint8_t src)
noexcept
104 [[nodiscard]]
inline Block divReg(std::uint8_t dst, std::uint8_t src)
noexcept
Block — the fundamental unit of simulated memory.
Instruction enum class — all opcodes for the bytecode interpreter.
Interrupt enum class — hardware and software interrupt codes.
Block mulImm(std::uint8_t reg, RegisterValue value) noexcept
Multiplies a register by an immediate value (dst = dst * value).
Interrupt
Interrupt codes used by the CPU and kernel.
Block interrupt(Interrupt code) noexcept
Raises a software interrupt.
Block compareReg(std::uint8_t reg, std::uint8_t other) noexcept
Compares two registers and sets flags.
Block jumpGreater(RegisterValue target) noexcept
Jumps to target if the last compare was greater.
Block jumpNotEqual(RegisterValue target) noexcept
Jumps to target if the last compare was not equal.
Block writeMem(std::uint8_t reg, MemoryAddress addr) noexcept
Writes a register value to a physical memory address.
Block nop() noexcept
No-op — advances the program counter by one.
Block movReg(std::uint8_t dst, std::uint8_t src) noexcept
Copies the value of one register into another.
Block jumpEqual(RegisterValue target) noexcept
Jumps to target if the last compare was equal.
Block divImm(std::uint8_t reg, RegisterValue value) noexcept
Divides a register by an immediate value (dst = dst / value).
Block jumpLessEqual(RegisterValue target) noexcept
Jumps to target if the last compare was less or equal.
@ Mov
Move immediate/register → register.
@ Interrupt
Software interrupt (syscall, exit, etc.).
@ JumpGreaterEqual
Jump if greater or equal.
@ JumpNotEqual
Jump if not equal (ZF clear).
@ JumpLessEqual
Jump if less or equal.
@ Div
Divide: dst = dst / src (may raise DivByZero).
@ Mul
Multiply: dst = dst * src.
@ ReadMemory
Read value from memory address into register.
@ Compare
Compare two registers (sets flags).
@ JumpEqual
Jump if equal (ZF set).
@ WriteMemory
Write register value to memory address.
@ JumpGreater
Jump if greater.
@ Sub
Subtract: dst = dst - src.
@ Add
Add: dst = dst + src.
Block mulReg(std::uint8_t dst, std::uint8_t src) noexcept
Multiplies a register by the value of another register (dst = dst * src).
Block divReg(std::uint8_t dst, std::uint8_t src) noexcept
Divides a register by the value of another register (dst = dst / src).
Block jumpLess(RegisterValue target) noexcept
Jumps to target if the last compare was less.
Block addReg(std::uint8_t dst, std::uint8_t src) noexcept
Adds the value of one register to another (dst = dst + src).
Block compareImm(std::uint8_t reg, RegisterValue value) noexcept
Compares a register against an immediate value and sets flags.
Block subReg(std::uint8_t dst, std::uint8_t src) noexcept
Subtracts the value of one register from another (dst = dst - src).
Block halt() noexcept
Halts the process unconditionally.
std::uint32_t MemoryAddress
Represents a memory address (physical or virtual).
Block movImm(std::uint8_t reg, RegisterValue value) noexcept
Loads an immediate value into a register.
Block subImm(std::uint8_t reg, RegisterValue value) noexcept
Subtracts an immediate value from a register (dst = dst - value).
Block addImm(std::uint8_t reg, RegisterValue value) noexcept
Adds an immediate value to a register (dst = dst + value).
std::int32_t RegisterValue
Value stored in a CPU register.
Block jumpGreaterEqual(RegisterValue target) noexcept
Jumps to target if the last compare was greater or equal.
Block readMem(std::uint8_t reg, MemoryAddress addr) noexcept
Reads a value from a physical memory address into a register.
A single memory cell in the simulated architecture.
Common type aliases, sentinel constants, and forward declarations used throughout the Contur 2 kernel...