IZ80Processor contains a handful of properties that allow to check the current state of the simulated processor. These properties can be checked when the processor is stopped, or when handling the instruction execution events and the memory access events while the processor is running and executing instructions. The properties are:
-
TStatesElapsedSinceStart
: The number of T states elapsed since the execution started with theStart
method. This is the sum of the states consumed by the instructions themselves and the extra wait states introduced by memory and ports access (the amount of wait states required by memory and ports must be configured before starting execution, see the documentation about configuration). -
TStatesElapsedSinceReset
: Same asTStatesElapsedSinceStart
, but this one counts the T states elapsed since the processor was reset, either with theStart
method or with theReset
method. -
StopReason
: A member of the StopReason enumeration that indicates why the processor exited the execution loop. The value of this property changes every time that execution starts or stops. -
State
: A member of the ProcessorState enumeration that indicates whether the processor is stopped, paused or running. -
IsHalted
: A boolean value that becomes true when aHALT
instruction is executed and returns to false when a maskable interrupt is processed. -
InterruptMode
: The current interrupt mode as set by anIM n
instruction. -
StartOfStack
: The current start of stack address as set by a reset or by aLD SP
instruction. This value is relevant for the auto stop on empty stack functionality, see execution stop conditions.