Instruction enum class — all opcodes for the bytecode interpreter.
Interrupt enum class — hardware and software interrupt codes.
Interrupt
Interrupt codes used by the CPU and kernel.
@ PageFault
Page not present in physical memory.
@ SystemCall
Software interrupt — syscall entry.
@ DeviceIO
Generic device I/O interrupt.
@ NetworkIO
Network I/O event.
@ Ok
No interrupt — normal execution.
@ DivByZero
Division by zero fault.
@ Timer
Timer tick interrupt (preemption).
@ Exit
Process requests termination.
Instruction
CPU instruction opcodes for the simulated architecture.
@ Pop
Pop top of stack into register.
@ 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.
@ Or
Bitwise OR: dst = dst | src.
@ Div
Divide: dst = dst / src (may raise DivByZero).
@ Mul
Multiply: dst = dst * src.
@ ReadMemory
Read value from memory address into register.
@ Xor
Bitwise XOR: dst = dst ^ src.
@ Compare
Compare two registers (sets flags).
@ Return
Return from subroutine (pop PC).
@ Push
Push register onto stack.
@ JumpEqual
Jump if equal (ZF set).
@ WriteMemory
Write register value to memory address.
@ And
Bitwise AND: dst = dst & src.
@ Call
Call subroutine (push PC, jump).
@ JumpGreater
Jump if greater.
@ ShiftLeft
Left shift: dst = dst << src.
@ Sub
Subtract: dst = dst - src.
@ Add
Add: dst = dst + src.
@ ShiftRight
Right shift: dst = dst >> src.
constexpr std::string_view interruptName(Interrupt intr) noexcept
Returns the human-readable name for an interrupt code.
constexpr bool isStackOp(Instruction instr) noexcept
Returns true if the instruction affects the stack (Push, Pop, Call, Return).
constexpr std::uint8_t INSTRUCTION_COUNT
Total number of defined instructions.
constexpr bool isLogic(Instruction instr) noexcept
Returns true if the instruction is a logic/bitwise operation (And, Or, Xor, Shift).
constexpr bool isJump(Instruction instr) noexcept
Returns true if the instruction is a conditional or unconditional jump.
constexpr bool isMemoryOp(Instruction instr) noexcept
Returns true if the instruction involves memory access (ReadMemory, WriteMemory).
constexpr bool isArithmetic(Instruction instr) noexcept
Returns true if the instruction is an arithmetic operation (Add, Sub, Mul, Div).
constexpr std::string_view instructionName(Instruction instr) noexcept
Returns the human-readable mnemonic for an instruction.
constexpr bool isHalt(Instruction instr) noexcept
Returns true if the instruction terminates execution flow (Halt, Interrupt with Exit).