Class Instruction
Abstract base class for all virtual machine instructions.
Inheritance
Instruction
Inherited Members
Namespace: VM.Core.Instructions
Assembly: VM.dll
Syntax
public abstract class Instruction
Constructors
Instruction(OpCode, string, int, string)
Abstract base class for all virtual machine instructions.
Declaration
protected Instruction(OpCode code, string mnemonic, int operandSize = 0, string stackEffect = "")
Parameters
Type | Name | Description |
---|---|---|
OpCode | code | |
string | mnemonic | |
int | operandSize | |
string | stackEffect |
Properties
Code
Gets the opcode for this instruction
Declaration
public OpCode Code { get; }
Property Value
Type | Description |
---|---|
OpCode |
Mnemonic
Gets the human-readable mnemonic
Declaration
public string Mnemonic { get; }
Property Value
Type | Description |
---|---|
string |
OperandSize
Gets the size of operands in bytes
Declaration
public int OperandSize { get; }
Property Value
Type | Description |
---|---|
int |
StackEffect
Gets the stack effect description
Declaration
public string StackEffect { get; }
Property Value
Type | Description |
---|---|
string |
Methods
Execute(ExContext, FrameStack)
Executes the instruction with the given context.
Declaration
public abstract void Execute(ExContext context, FrameStack frames)
Parameters
Type | Name | Description |
---|---|---|
ExContext | context | The execution context |
FrameStack | frames | The frame stack |