Enum mlem_asm::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 Copy for Instruction
[src]
impl Deserialize for Instruction
[src]
fn deserialize<__D>(
__deserializer: __D
) -> Result<Instruction, <__D as Deserializer>::Error> where
__D: Deserializer,
__deserializer: __D
) -> Result<Instruction, <__D as Deserializer>::Error> where
__D: Deserializer,
impl Serialize for Instruction
[src]
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
impl PartialEq<Instruction> 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]
fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter.