Enum alure::instr::ControlFlowOp [−][src]
pub enum ControlFlowOp {
Fail,
Succ,
Jmp(u16),
Jif(u16),
Routine(u16),
Call(LibSite),
Exec(LibSite),
Ret,
}Expand description
Control-flow instructions
Variants
Completes program execution writing false to st0 (indicating program failure). Does not
modify value of call stack registers.
Completes program execution writing true to st0 (indicating program success). Does not
modify value of call stack registers.
Jmp(u16)Unconditionally jumps to an offset. Increments cy0.
Jif(u16)Jumps to an offset if st0 == true, otherwise does nothing. Increments cy0.
Routine(u16)Jumps to other location in the current code with ability to return back (calls a
subroutine). Increments cy0 and pushes offset of the instruction which follows current
one to cs0.
Call(LibSite)Calls code from an external library identified by the hash of its code. Increments cy0
and cp0 and pushes offset of the instruction which follows current one to cs0.
Exec(LibSite)Passes execution to other library without an option to return. Does not increment cy0 and
cp0 counters and does not add anything to the call stack cs0.
Returns execution flow to the previous location from the top of cs0. Does not change the
value in cy0. Decrements cp0.
Trait Implementations
Returns number of bytes which instruction and its argument occupies
Returns range of instruction btecodes covered by a set of operations
Returns byte representing instruction code (without its arguments)
fn write_args<W>(&self, writer: &mut W) -> Result<(), EncodeError> where
W: Write,
EncodeError: From<<W as Write>::Error>, [src]
fn write_args<W>(&self, writer: &mut W) -> Result<(), EncodeError> where
W: Write,
EncodeError: From<<W as Write>::Error>, [src]Writes instruction arguments as bytecode, omitting instruction code byte
fn read<R>(reader: &mut R) -> Result<Self, DecodeError> where
R: Read,
DecodeError: From<<R as Read>::Error>, [src]
fn read<R>(reader: &mut R) -> Result<Self, DecodeError> where
R: Read,
DecodeError: From<<R as Read>::Error>, [src]Reads the instruction from bytecode
fn write<W>(&self, writer: &mut W) -> Result<(), EncodeError> where
W: Write,
EncodeError: From<<W as Write>::Error>, [src]
fn write<W>(&self, writer: &mut W) -> Result<(), EncodeError> where
W: Write,
EncodeError: From<<W as Write>::Error>, [src]Writes the instruction as bytecode
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for ControlFlowOpimpl Send for ControlFlowOpimpl Sync for ControlFlowOpimpl Unpin for ControlFlowOpimpl UnwindSafe for ControlFlowOpBlanket Implementations
Mutably borrows from an owned value. Read more