Enum mlem::Instruction
[−]
[src]
pub enum Instruction { NoOp, Zero(Address), Move(Address, Address), Output(Address), Input(Address), Add(Address, Address), Sub(Address, Address), Jump(Address), JumpIfZero(Address, Address), JumpNotZero(Address, Address), Push(Address), Pop(Address), Halt, Illegal, }
Possible instructions for the machine to execute. For each instruction, the first operand is a, second is b, et cetera
Variants
NoOp
Increment IP.
Zero(Address)
Set a equal to 0
Move(Address, Address)
Set b equal to a
Output(Address)
Push a onto the output
Input(Address)
Pop from the input into a
Add(Address, Address)
Add the unsigned a to b, storing the result in a
Sub(Address, Address)
Subtract the unsigned b from a, storing the result in a
Jump(Address)
Uncontitionally jump to the position given by a
JumpIfZero(Address, Address)
Jump to a if the value at b is 0
JumpNotZero(Address, Address)
Jump to a if the value at b is NOT zero
Push(Address)
Push a to the stack
Pop(Address)
Pop a value from the stack into the given address
Halt
Gracefully shut down the machine
Illegal
An illegal instruction. Executing this is a Fault.
Trait Implementations
impl PartialEq for Instruction
[src]
fn eq(&self, __arg_0: &Instruction) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Instruction) -> bool
This method tests for !=
.
impl Debug for Instruction
[src]
impl Copy for Instruction
[src]
impl Clone for Instruction
[src]
fn clone(&self) -> Instruction
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more