Enum fuel_asm::Opcode

source ·
#[repr(u8)]
pub enum Opcode {
Show 87 variants ADD, AND, DIV, EQ, EXP, GT, LT, MLOG, MROO, MOD, MOVE, MUL, NOT, OR, SLL, SRL, SUB, XOR, RET, RETD, ALOC, MCL, MCP, MEQ, BHSH, BHEI, BURN, CALL, CCP, CROO, CSIZ, CB, LDC, LOG, LOGD, MINT, RVRT, SCWQ, SRW, SRWQ, SWW, SWWQ, TR, TRO, ECR, K256, S256, TIME, NOOP, FLAG, BAL, JMP, JNE, SMO, ADDI, ANDI, DIVI, EXPI, MODI, MULI, ORI, SLLI, SRLI, SUBI, XORI, JNEI, LB, LW, SB, SW, MCPI, GTF, MCLI, GM, MOVI, JNZI, JMPF, JMPB, JNZF, JNZB, JNEF, JNEB, JI, CFEI, CFSI, CFE, CFS,
}
Expand description

Solely the opcode portion of an instruction represented as a single byte.

Variants§

§

ADD

Adds two registers.

§

AND

Bitwise ANDs two registers.

§

DIV

Divides two registers.

§

EQ

Compares two registers for equality.

§

EXP

Raises one register to the power of another.

§

GT

Compares two registers for greater-than.

§

LT

Compares two registers for less-than.

§

MLOG

The integer logarithm of a register.

§

MROO

The integer root of a register.

§

MOD

Modulo remainder of two registers.

§

MOVE

Copy from one register to another.

§

MUL

Multiplies two registers.

§

NOT

Bitwise NOT a register.

§

OR

Bitwise ORs two registers.

§

SLL

Left shifts a register by a register.

§

SRL

Right shifts a register by a register.

§

SUB

Subtracts two registers.

§

XOR

Bitwise XORs two registers.

§

RET

Return from context.

§

RETD

Return from context with data.

§

ALOC

Allocate a number of bytes from the heap.

§

MCL

Clear a variable number of bytes in memory.

§

MCP

Copy a variable number of bytes in memory.

§

MEQ

Compare bytes in memory.

§

BHSH

Get block header hash for height.

§

BHEI

Get current block height.

§

BURN

Burn coins of the current contract’s asset ID.

§

CALL

Call a contract.

§

CCP

Copy contract code for a contract.

§

CROO

Get code root of a contract.

§

CSIZ

Get code size of a contract.

§

CB

Get current block proposer’s address.

§

LDC

Load a contract’s code as executable.

§

LOG

Log an event.

§

LOGD

Log data.

§

MINT

Mint coins of the current contract’s asset ID.

§

RVRT

Halt execution, reverting state changes and returning a value.

§

SCWQ

Clear a series of slots from contract storage.

§

SRW

Load a word from contract storage.

§

SRWQ

Load a series of 32 byte slots from contract storage.

§

SWW

Store a word in contract storage.

§

SWWQ

Store a series of 32 byte slots in contract storage.

§

TR

Transfer coins to a contract unconditionally.

§

TRO

Transfer coins to a variable output.

§

ECR

The 64-byte public key (x, y) recovered from 64-byte signature on 32-byte message.

§

K256

The keccak-256 hash of a slice.

§

S256

The SHA-2-256 hash of a slice.

§

TIME

Get timestamp of block at given height.

§

NOOP

Performs no operation.

§

FLAG

Set flag register to a register.

§

BAL

Get the balance of contract of an asset ID.

§

JMP

Dynamic jump.

§

JNE

Conditional dynamic jump.

§

SMO

Send a message to recipient address with call abi, coins, and output.

§

ADDI

Adds a register and an immediate value.

§

ANDI

Bitwise ANDs a register and an immediate value.

§

DIVI

Divides a register and an immediate value.

§

EXPI

Raises one register to the power of an immediate value.

§

MODI

Modulo remainder of a register and an immediate value.

§

MULI

Multiplies a register and an immediate value.

§

ORI

Bitwise ORs a register and an immediate value.

§

SLLI

Left shifts a register by an immediate value.

§

SRLI

Right shifts a register by an immediate value.

§

SUBI

Subtracts a register and an immediate value.

§

XORI

Bitwise XORs a register and an immediate value.

§

JNEI

Conditional jump.

§

LB

A byte is loaded from the specified address offset by an immediate value.

§

LW

A word is loaded from the specified address offset by an immediate value.

§

SB

Write the least significant byte of a register to memory.

§

SW

Write a register to memory.

§

MCPI

Copy an immediate number of bytes in memory.

§

GTF

Get transaction fields.

§

MCLI

Clear an immediate number of bytes in memory.

§

GM

Get metadata from memory.

§

MOVI

Copy immediate value into a register

§

JNZI

Conditional jump against zero.

§

JMPF

Unconditional dynamic relative jump forwards, with a constant offset.

§

JMPB

Unconditional dynamic relative jump backwards, with a constant offset.

§

JNZF

Dynamic relative jump forwards, conditional against zero, with a constant offset.

§

JNZB

Dynamic relative jump backwards, conditional against zero, with a constant offset.

§

JNEF

Dynamic relative jump forwards, conditional on comparsion, with a constant offset.

§

JNEB

Dynamic relative jump backwards, conditional on comparsion, with a constant offset.

§

JI

Jump.

§

CFEI

Extend the current call frame’s stack by an immediate value.

§

CFSI

Shrink the current call frame’s stack by an immediate value.

§

CFE

Extend the current call frame’s stack

§

CFS

Shrink the current call frame’s stack

Implementations§

Trait Implementations§

source§

impl Clone for Opcode

source§

fn clone(&self) -> Opcode

Returns a copy 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 Opcode

source§

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

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

impl<'de> Deserialize<'de> for Opcode

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<Opcode> for u8

source§

fn from(op: Opcode) -> Self

Converts to this type from the input type.
source§

impl Hash for Opcode

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq<Opcode> for Opcode

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Opcode

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl TryFrom<u8> for Opcode

§

type Error = InvalidOpcode

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

fn try_from(u: u8) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Copy for Opcode

source§

impl Eq for Opcode

source§

impl StructuralEq for Opcode

source§

impl StructuralPartialEq for Opcode

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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 Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,