#[repr(u8)]pub enum Opcode {
Show 109 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,
}
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 a contract’s code as executable.
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.
ECR1 = 63
The 64-byte Secp256r1 public key (x, y) recovered from 64-byte signature on 32-byte message.
ED19 = 64
Verify ED25519 public key and signature match a 32-byte 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