fuel_asm

Enum Opcode

source
#[repr(u8)]
pub enum Opcode {
Show 111 variants ADD = 16, AND = 17, DIV = 18, EQ = 19, EXP = 20, GT = 21, LT = 22, MLOG = 23, MROO = 24, MOD = 25, MOVE = 26, MUL = 27, NOT = 28, OR = 29, SLL = 30, SRL = 31, SUB = 32, XOR = 33, MLDV = 34, RET = 36, RETD = 37, ALOC = 38, MCL = 39, MCP = 40, MEQ = 41, BHSH = 42, BHEI = 43, BURN = 44, CALL = 45, CCP = 46, CROO = 47, CSIZ = 48, CB = 49, LDC = 50, LOG = 51, LOGD = 52, MINT = 53, RVRT = 54, SCWQ = 55, SRW = 56, SRWQ = 57, SWW = 58, SWWQ = 59, TR = 60, TRO = 61, ECK1 = 62, ECR1 = 63, ED19 = 64, K256 = 65, S256 = 66, TIME = 67, NOOP = 71, FLAG = 72, BAL = 73, JMP = 74, JNE = 75, SMO = 76, ADDI = 80, ANDI = 81, DIVI = 82, EXPI = 83, MODI = 84, MULI = 85, ORI = 86, SLLI = 87, SRLI = 88, SUBI = 89, XORI = 90, JNEI = 91, LB = 92, LW = 93, SB = 94, SW = 95, MCPI = 96, GTF = 97, MCLI = 112, GM = 113, MOVI = 114, JNZI = 115, JMPF = 116, JMPB = 117, JNZF = 118, JNZB = 119, JNEF = 120, JNEB = 121, JI = 144, CFEI = 145, CFSI = 146, CFE = 147, CFS = 148, PSHL = 149, PSHH = 150, POPL = 151, POPH = 152, WDCM = 160, WQCM = 161, WDOP = 162, WQOP = 163, WDML = 164, WQML = 165, WDDV = 166, WQDV = 167, WDMD = 168, WQMD = 169, WDAM = 170, WQAM = 171, WDMM = 172, WQMM = 173, ECAL = 176, BSIZ = 186, BLDD = 187,
}
Expand description

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

Variants§

§

ADD = 16

Adds two registers.

§

AND = 17

Bitwise ANDs two registers.

§

DIV = 18

Divides two registers.

§

EQ = 19

Compares two registers for equality.

§

EXP = 20

Raises one register to the power of another.

§

GT = 21

Compares two registers for greater-than.

§

LT = 22

Compares two registers for less-than.

§

MLOG = 23

The integer logarithm of a register.

§

MROO = 24

The integer root of a register.

§

MOD = 25

Modulo remainder of two registers.

§

MOVE = 26

Copy from one register to another.

§

MUL = 27

Multiplies two registers.

§

NOT = 28

Bitwise NOT a register.

§

OR = 29

Bitwise ORs two registers.

§

SLL = 30

Left shifts a register by a register.

§

SRL = 31

Right shifts a register by a register.

§

SUB = 32

Subtracts two registers.

§

XOR = 33

Bitwise XORs two registers.

§

MLDV = 34

Fused multiply-divide with arbitrary precision intermediate step.

§

RET = 36

Return from context.

§

RETD = 37

Return from context with data.

§

ALOC = 38

Allocate a number of bytes from the heap.

§

MCL = 39

Clear a variable number of bytes in memory.

§

MCP = 40

Copy a variable number of bytes in memory.

§

MEQ = 41

Compare bytes in memory.

§

BHSH = 42

Get block header hash for height.

§

BHEI = 43

Get current block height.

§

BURN = 44

Burns amount coins of the asset ID created from sub_id for the current contract.

§

CALL = 45

Call a contract.

§

CCP = 46

Copy contract code for a contract.

§

CROO = 47

Get code root of a contract.

§

CSIZ = 48

Get code size of a contract.

§

CB = 49

Get current block proposer’s address.

§

LDC = 50

Load code as executable either from contract, blob, or memory.

§

LOG = 51

Log an event.

§

LOGD = 52

Log data.

§

MINT = 53

Mints amount coins of the asset ID created from sub_id for the current contract.

§

RVRT = 54

Halt execution, reverting state changes and returning a value.

§

SCWQ = 55

Clear a series of slots from contract storage.

§

SRW = 56

Load a word from contract storage.

§

SRWQ = 57

Load a series of 32 byte slots from contract storage.

§

SWW = 58

Store a word in contract storage.

§

SWWQ = 59

Store a series of 32 byte slots in contract storage.

§

TR = 60

Transfer coins to a contract unconditionally.

§

TRO = 61

Transfer coins to a variable output.

§

ECK1 = 62

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

§

ECR1 = 63

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

§

ED19 = 64

Verify ED25519 public key and signature match a message.

§

K256 = 65

The keccak-256 hash of a slice.

§

S256 = 66

The SHA-2-256 hash of a slice.

§

TIME = 67

Get timestamp of block at given height.

§

NOOP = 71

Performs no operation.

§

FLAG = 72

Set flag register to a register.

§

BAL = 73

Get the balance of contract of an asset ID.

§

JMP = 74

Dynamic jump.

§

JNE = 75

Conditional dynamic jump.

§

SMO = 76

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

§

ADDI = 80

Adds a register and an immediate value.

§

ANDI = 81

Bitwise ANDs a register and an immediate value.

§

DIVI = 82

Divides a register and an immediate value.

§

EXPI = 83

Raises one register to the power of an immediate value.

§

MODI = 84

Modulo remainder of a register and an immediate value.

§

MULI = 85

Multiplies a register and an immediate value.

§

ORI = 86

Bitwise ORs a register and an immediate value.

§

SLLI = 87

Left shifts a register by an immediate value.

§

SRLI = 88

Right shifts a register by an immediate value.

§

SUBI = 89

Subtracts a register and an immediate value.

§

XORI = 90

Bitwise XORs a register and an immediate value.

§

JNEI = 91

Conditional jump.

§

LB = 92

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

§

LW = 93

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

§

SB = 94

Write the least significant byte of a register to memory.

§

SW = 95

Write a register to memory.

§

MCPI = 96

Copy an immediate number of bytes in memory.

§

GTF = 97

Get transaction fields.

§

MCLI = 112

Clear an immediate number of bytes in memory.

§

GM = 113

Get metadata from memory.

§

MOVI = 114

Copy immediate value into a register

§

JNZI = 115

Conditional jump against zero.

§

JMPF = 116

Unconditional dynamic relative jump forwards, with a constant offset.

§

JMPB = 117

Unconditional dynamic relative jump backwards, with a constant offset.

§

JNZF = 118

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

§

JNZB = 119

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

§

JNEF = 120

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

§

JNEB = 121

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

§

JI = 144

Jump.

§

CFEI = 145

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

§

CFSI = 146

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

§

CFE = 147

Extend the current call frame’s stack

§

CFS = 148

Shrink the current call frame’s stack

§

PSHL = 149

Push a bitmask-selected set of registers in range 16..40 to the stack.

§

PSHH = 150

Push a bitmask-selected set of registers in range 40..64 to the stack.

§

POPL = 151

Pop a bitmask-selected set of registers in range 16..40 to the stack.

§

POPH = 152

Pop a bitmask-selected set of registers in range 40..64 to the stack.

§

WDCM = 160

Compare 128bit integers

§

WQCM = 161

Compare 256bit integers

§

WDOP = 162

Simple 128bit operations

§

WQOP = 163

Simple 256bit operations

§

WDML = 164

Multiply 128bit

§

WQML = 165

Multiply 256bit

§

WDDV = 166

Divide 128bit

§

WQDV = 167

Divide 256bit

§

WDMD = 168

Fused multiply-divide 128bit

§

WQMD = 169

Fused multiply-divide 256bit

§

WDAM = 170

AddMod 128bit

§

WQAM = 171

AddMod 256bit

§

WDMM = 172

MulMod 128bit

§

WQMM = 173

MulMod 256bit

§

ECAL = 176

Call external function

§

BSIZ = 186

Get blob size

§

BLDD = 187

Load blob as data

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 for Opcode

source§

fn eq(&self, other: &Opcode) -> 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 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

source§

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 StructuralPartialEq for Opcode

Auto Trait Implementations§

§

impl Freeze for Opcode

§

impl RefUnwindSafe for Opcode

§

impl Send for Opcode

§

impl Sync for Opcode

§

impl Unpin for Opcode

§

impl UnwindSafe for Opcode

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, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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.
source§

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