Enum Instruction

Source
pub enum Instruction {
Show 60 variants UNDEF, IGNORE, BREAK, ENTER(FrameSize), LEAVE(FrameSize), CALL, PUSH, POP, CONST(Literal), LOCAL(FrameOffset), JUMP, EQ(Address), NE(Address), LTI(Address), LEI(Address), GTI(Address), GEI(Address), LTU(Address), LEU(Address), GTU(Address), GEU(Address), EQF(Address), NEF(Address), LTF(Address), LEF(Address), GTF(Address), GEF(Address), LOAD1, LOAD2, LOAD4, STORE1, STORE2, STORE4, ARG(ArgOffset), BLOCK_COPY(BlockSize), SEX8, SEX16, NEGI, ADD, SUB, DIVI, DIVU, MODI, MODU, MULI, MULU, BAND, BOR, BXOR, BCOM, LSH, RSHI, RSHU, NEGF, ADDF, SUBF, DIVF, MULF, CVIF, CVFI,
}
Expand description

A QVM instruction.

Variants§

§

UNDEF

Undefined instruction.

Used for padding the code segment. Should not occur at runtime.

§

IGNORE

No-operation (NOP).

§

BREAK

Software breakpoint.

§

ENTER(FrameSize)

Enter a procedure, adjusting stack.

§

LEAVE(FrameSize)

Leave a procedure, adjusting stack.

§

CALL

Call a procedure.

§

PUSH

Push stack.

§

POP

Pop stack.

§

CONST(Literal)

Push constant onto stack.

§

LOCAL(FrameOffset)

Get address of frame local variable or argument.

§

JUMP

Jump to top of stack.

§

EQ(Address)

Check (signed integer) equality, jump to Address if true.

§

NE(Address)

Check (signed integer) inequality, jump to Address if true.

§

LTI(Address)

Check (signed integer) less-than, jump to Address if true.

§

LEI(Address)

Check (signed integer) less-than or equal-to, jump to Address if true.

§

GTI(Address)

Check (signed integer) greater-than, jump to Address if true.

§

GEI(Address)

Check (signed integer) greater-than or equal-to, jump to Address if true.

§

LTU(Address)

Check (unsigned integer) less-than, jump to Address if true.

§

LEU(Address)

Check (unsigned integer) less-than or equal-to, jump to Address if true.

§

GTU(Address)

Check (unsigned integer) greater-than, jump to Address if true.

§

GEU(Address)

Check (unsigned integer) greater-than or equal-to, jump to Address if true.

§

EQF(Address)

Check (float) equality, jump to Address if true.

§

NEF(Address)

Check (float) inequality, jump to Address if true.

§

LTF(Address)

Check (float) less-than, jump to Address if true.

§

LEF(Address)

Check (float) less-than or equal-to, jump to Address if true.

§

GTF(Address)

Check (float) greater-than, jump to Address if true.

§

GEF(Address)

Check (float) greater-than or equal-to, jump to Address if true.

§

LOAD1

Load 1-octet value.

§

LOAD2

Load 2-octet value.

§

LOAD4

Load 4-octet value.

§

STORE1

Store 1-octet value.

§

STORE2

Store 2-octet value.

§

STORE4

Store 4-octet value.

§

ARG(ArgOffset)

Store value into marshalling space.

§

BLOCK_COPY(BlockSize)

Copy a block of memory.

§

SEX8

Sign-extend 8-bit.

§

SEX16

Sign-extend 16-bit.

§

NEGI

Negate (signed integer).

§

ADD

Add.

§

SUB

Subtract.

§

DIVI

Divide (signed integer).

§

DIVU

Divide (unsigned integer).

§

MODI

Modulo (signed integer).

§

MODU

Modulo (unsigned integer).

§

MULI

Multiply (signed integer).

§

MULU

Multiply (unsigned integer).

§

BAND

Bitwise AND.

§

BOR

Bitwise OR.

§

BXOR

Bitwise XOR.

§

BCOM

Bitwise complement.

§

LSH

Bitwise left-shift.

§

RSHI

Algebraic (signed) right-shift.

§

RSHU

Bitwise (unsigned) right-shift.

§

NEGF

Negate (float).

§

ADDF

Add (float).

§

SUBF

Subtract (float).

§

DIVF

Divide (float).

§

MULF

Multiply (float).

§

CVIF

Convert signed integer to float.

§

CVFI

Convert float to signed integer.

Trait Implementations§

Source§

impl Clone for Instruction

Source§

fn clone(&self) -> Instruction

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Instruction

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Instruction

Source§

fn eq(&self, other: &Instruction) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Instruction

Source§

impl StructuralPartialEq for Instruction

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.