#[repr(u8)]pub enum Opcode {
Show 108 variants
ADD,
AND,
DIV,
EQ,
EXP,
GT,
LT,
MLOG,
MROO,
MOD,
MOVE,
MUL,
NOT,
OR,
SLL,
SRL,
SUB,
XOR,
MLDV,
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,
ECK1,
ECR1,
ED19,
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,
PSHL,
PSHH,
POPL,
POPH,
WDCM,
WQCM,
WDOP,
WQOP,
WDML,
WQML,
WDDV,
WQDV,
WDMD,
WQMD,
WDAM,
WQAM,
WDMM,
WQMM,
}
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.
MLDV
Fused multiply-divide with arbitrary precision intermediate step.
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
Burns amount
coins of the asset ID created from sub_id
for the current contract.
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
Mints amount
coins of the asset ID created from sub_id
for the current contract.
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.
ECK1
The 64-byte public key (x, y) recovered from 64-byte signature on 32-byte message.
ECR1
The 64-byte Secp256r1 public key (x, y) recovered from 64-byte signature on 32-byte message.
ED19
Verify ED25519 public key and signature match a 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
PSHL
Push a bitmask-selected set of registers in range 16..40 to the stack.
PSHH
Push a bitmask-selected set of registers in range 40..64 to the stack.
POPL
Pop a bitmask-selected set of registers in range 16..40 to the stack.
POPH
Pop a bitmask-selected set of registers in range 40..64 to the stack.
WDCM
Compare 128bit integers
WQCM
Compare 256bit integers
WDOP
Simple 128bit operations
WQOP
Simple 256bit operations
WDML
Multiply 128bit
WQML
Multiply 256bit
WDDV
Divide 128bit
WQDV
Divide 256bit
WDMD
Fused multiply-divide 128bit
WQMD
Fused multiply-divide 256bit
WDAM
AddMod 128bit
WQAM
AddMod 256bit
WDMM
MulMod 128bit
WQMM
MulMod 256bit