pub enum Instruction {
}
Expand description
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§
Source§impl Clone for Instruction
impl Clone for Instruction
Source§fn clone(&self) -> Instruction
fn clone(&self) -> Instruction
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Instruction
impl Debug for Instruction
Source§impl Deserialize for Instruction
impl Deserialize for Instruction
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Instruction, <__D as Deserializer>::Error>where
__D: Deserializer,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Instruction, <__D as Deserializer>::Error>where
__D: Deserializer,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for Instruction
impl PartialEq for Instruction
Source§impl Serialize for Instruction
impl Serialize for Instruction
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for Instruction
impl StructuralPartialEq for Instruction
Auto Trait Implementations§
impl Freeze for Instruction
impl RefUnwindSafe for Instruction
impl Send for Instruction
impl Sync for Instruction
impl Unpin for Instruction
impl UnwindSafe for Instruction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more