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

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

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

Executes given instruction taking all registers as input and output. The method is provided with the current code position which may be used by the instruction for constructing call stack. Read more

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 ==. 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

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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.