public final class MachineState
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
short |
acc
Accumulator register.
|
short |
bak
Backup register.
|
java.lang.String[] |
code
Lines of original code this state was compiled from.
|
java.util.List<Instruction> |
instructions
List of instructions (the program) stored in the machine.
|
java.util.HashMap<java.lang.String,java.lang.Integer> |
labels
List of labels and associated addresses.
|
java.util.Optional<Port> |
last
The port last read from.
|
java.util.HashMap<java.lang.Integer,java.lang.Integer> |
lineNumbers
Instruction address to line number mapping.
|
int |
pc
Program counter, i.e.
|
| Constructor and Description |
|---|
MachineState() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Hard reset the machine state.
|
boolean |
finishCycle()
Finishes an execution cycle, ensuring values of the state are valid ones and
returning whether the internal state changed since the last call to this method.
|
void |
readFromNBT(net.minecraft.nbt.NBTTagCompound nbt) |
void |
reset()
Soft reset the machine state.
|
void |
writeToNBT(net.minecraft.nbt.NBTTagCompound nbt) |
public int pc
public short acc
public short bak
public java.util.Optional<Port> last
public java.lang.String[] code
public final java.util.List<Instruction> instructions
public final java.util.HashMap<java.lang.String,java.lang.Integer> labels
public final java.util.HashMap<java.lang.Integer,java.lang.Integer> lineNumbers
public boolean finishCycle()
public void reset()
public void clear()
public void readFromNBT(net.minecraft.nbt.NBTTagCompound nbt)
public void writeToNBT(net.minecraft.nbt.NBTTagCompound nbt)