Table of Contents

Class VmState

Namespace
Pl0.Vm
Assembly
Pl0.Vm.dll

Unveränderliche Momentaufnahme des VM-Zustands. / Immutable snapshot of VM state.

public sealed record VmState : IEquatable<VmState>
Inheritance
VmState
Implements
Inherited Members

Constructors

VmState(int, int, int, int[], Instruction?)

Erstellt die bisherige Zustandsform. / Creates the previous state shape.

public VmState(int P, int B, int T, int[] Stack, Instruction? CurrentInstruction)

Parameters

P int

Befehlszeiger. / Program counter.

B int

Basiszeiger. / Base pointer.

T int

Stackzeiger. / Stack pointer.

Stack int[]

Zu kopierender Stack. / Stack to copy.

CurrentInstruction Instruction?

Nächste Instruktion. / Next instruction.

VmState(int, int, int, int[], Instruction?, int)

Erstellt einen Zustand mit Zähler. / Creates a state with a counter.

public VmState(int P, int B, int T, int[] Stack, Instruction? CurrentInstruction, int ExecutedInstructions)

Parameters

P int

Befehlszeiger. / Program counter.

B int

Basiszeiger. / Base pointer.

T int

Stackzeiger. / Stack pointer.

Stack int[]

Zu kopierender Stack. / Stack to copy.

CurrentInstruction Instruction?

Nächste Instruktion. / Next instruction.

ExecutedInstructions int

Begonnene Instruktionen. / Started instructions.

Fields

stack

private readonly int[] stack

Field Value

int[]

Properties

B

Ruft B ab. / Gets B.

public int B { get; }

Property Value

int

BasePointer

Ruft den Basiszeiger unter beschreibendem Namen ab. / Gets the base pointer by its descriptive name.

public int BasePointer { get; }

Property Value

int

CurrentInstruction

Ruft die nächste Instruktion ab. / Gets the next instruction.

public Instruction? CurrentInstruction { get; }

Property Value

Instruction?

ExecutedInstructions

Ruft den Instruktionszähler ab. / Gets the instruction counter.

public int ExecutedInstructions { get; }

Property Value

int

P

Ruft P ab. / Gets P.

public int P { get; }

Property Value

int

ProgramCounter

Ruft den Befehlszeiger unter beschreibendem Namen ab. / Gets the program counter by its descriptive name.

public int ProgramCounter { get; }

Property Value

int

Stack

Ruft eine defensive Stackkopie ab. / Gets a defensive stack copy.

public int[] Stack { get; }

Property Value

int[]

StackTop

Ruft den Stackzeiger unter beschreibendem Namen ab. / Gets the stack top by its descriptive name.

public int StackTop { get; }

Property Value

int

T

Ruft T ab. / Gets T.

public int T { get; }

Property Value

int

Methods

Deconstruct(out int, out int, out int, out int[], out Instruction?)

Zerlegt die bisherige Zustandsform. / Deconstructs the previous state shape.

public void Deconstruct(out int P, out int B, out int T, out int[] Stack, out Instruction? CurrentInstruction)

Parameters

P int

Befehlszeiger. / Program counter.

B int

Basiszeiger. / Base pointer.

T int

Stackzeiger. / Stack pointer.

Stack int[]

Defensive Stackkopie. / Defensive stack copy.

CurrentInstruction Instruction?

Nächste Instruktion. / Next instruction.