Enum aluvm::isa::ControlFlowOp

source ·
pub enum ControlFlowOp {
    Fail,
    Succ,
    Jmp(u16),
    Jif(u16),
    Routine(u16),
    Call(LibSite),
    Exec(LibSite),
    Ret,
}
Expand description

Control-flow instructions

Variants§

§

Fail

Completes program execution writing false to st0 (indicating program failure). Does not modify value of call stack registers.

§

Succ

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.

§

Ret

Returns execution flow to the previous location from the top of cs0. Does not change the value in cy0. Decrements cp0.

Trait Implementations§

If the instruction call or references any external library, returns the call site in that library.
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)
Writes instruction arguments as bytecode, omitting instruction code byte
Reads the instruction from bytecode
Writes the instruction as bytecode
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
ISA Extensions used by the provided instruction set. Read more
Returns computational complexity of the instruction
Executes given instruction taking all registers as input and output. Read more
ISA Extension IDs represented as a standard string (space-separated) Read more
ISA Extension IDs encoded in a standard way (space-separated) Read more
Checks whether provided ISA extension ID is supported by the current instruction set
This method returns an Ordering between self and other. Read more
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
Restrict a value to a certain interval. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
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
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.