public interface Instruction
Note that instructions must not have any mutable state! They always operate on the machine given to them, and the pipes connected to that machine. Their only state is their configuration.
| Modifier and Type | Method and Description |
|---|---|
default void |
onWriteCompleted(Machine machine,
Port port)
Finish a write operation started by the instruction, usually by
advancing the program counter.
|
default void |
reset()
Reset the state of the instruction if it has any.
|
void |
step(Machine machine)
Update the instruction, when it is done it must increment the machine's
program counter itself.
|
void step(Machine machine)
machine - the machine to run the instruction on.default void reset()
default void onWriteCompleted(Machine machine, Port port)
Instructions must always await or cancel a write operation they started.
machine - the machine the operation finished on.port - the port the operation finished on.