Show / Hide Table of Contents

Class Instruction

Abstract base class for all virtual machine instructions.

Inheritance
object
Instruction
AddInstruction
AndInstruction
CallInstruction
CmpInstruction
DivInstruction
DupInstruction
EqInstruction
GetIndexInstruction
HaltInstruction
InputInstruction
JmpInstruction
JnzInstruction
JzInstruction
LoadInstruction
ModInstruction
MulInstruction
NegInstruction
NeqInstruction
NewArrayInstruction
NotInstruction
OrInstruction
OverInstruction
PopInstruction
PrintInstruction
PushInstruction
PushStringInstruction
RetInstruction
SetIndexInstruction
StoreInstruction
SubInstruction
SwapInstruction
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
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

In this article
Back to top Generated by DocFX