L1InstructionStepper

class L1InstructionStepper(val interpreter: Interpreter)

This class is used to simulate the effect of level one nybblecodes during execution of the L2_INTERPRET_LEVEL_ONE instruction, on behalf of an Interpreter.

Author

Mark van Gulik

Parameters

interpreter

The Interpreter on whose behalf to step through level one nybblecode instructions.

Constructors

Link copied to clipboard
fun L1InstructionStepper(interpreter: Interpreter)

Construct a new L1InstructionStepper.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun pc(): Int

Get the current program counter.

Link copied to clipboard
fun pointerAt(index: Int): AvailObject

Read from the specified object register.

Link copied to clipboard
fun pointerAtPut(index: Int, value: A_BasicObject)

Write to the specified object register.

Link copied to clipboard
fun run(): StackReifier?

Run the current code until it reaches the end. Individual instructions, such as calls, may be subject to reification, which should cause a suitable A_Continuation to be reified. In addition, inter-nybblecode interrupts may also trigger reification, but they'll handle their own reification prior to returning here with a suitable StackReifier (to update and return again from here).

Link copied to clipboard
fun wipeRegisters()

Wipe out the existing register set for safety.

Properties

Link copied to clipboard

The current position in the nybblecodes.

Link copied to clipboard
val interpreter: Interpreter

The Interpreter on whose behalf to step level one nybblecodes.

Link copied to clipboard
var pointers: Array<AvailObject>

The registers that hold Avail objects.

Link copied to clipboard
var stackp: Int = 0

The current stack position as would be seen in a continuation.