Module op

Source
Expand description

Definitions and implementations for each unique instruction type, one for each unique Opcode variant.

Structs§

ADD
Adds two registers.
ADDI
Adds a register and an immediate value.
ALOC
Allocate a number of bytes from the heap.
AND
Bitwise ANDs two registers.
ANDI
Bitwise ANDs a register and an immediate value.
BAL
Get the balance of contract of an asset ID.
BHEI
Get current block height.
BHSH
Get block header hash for height.
BLDD
Load blob as data
BSIZ
Get blob size
BURN
Burns amount coins of the asset ID created from sub_id for the current contract.
CALL
Call a contract.
CB
Get current block proposer’s address.
CCP
Copy contract code for a contract.
CFE
Extend the current call frame’s stack
CFEI
Extend the current call frame’s stack by an immediate value.
CFS
Shrink the current call frame’s stack
CFSI
Shrink the current call frame’s stack by an immediate value.
CROO
Get code root of a contract.
CSIZ
Get code size of a contract.
DIV
Divides two registers.
DIVI
Divides a register and an immediate value.
ECAL
Call external function
ECK1
The 64-byte public key (x, y) recovered from 64-byte signature on 32-byte message hash.
ECOP
Given some curve, performs an operation on points
ECR1
The 64-byte Secp256r1 public key (x, y) recovered from 64-byte signature on 32-byte message hash.
ED19
Verify ED25519 public key and signature match a message.
EPAR
Given some curve, performs a pairing on groups of points
EQ
Compares two registers for equality.
EXP
Raises one register to the power of another.
EXPI
Raises one register to the power of an immediate value.
FLAG
Set flag register to a register.
GM
Get metadata from memory.
GT
Compares two registers for greater-than.
GTF
Get transaction fields.
JI
Jump.
JMP
Dynamic jump.
JMPB
Unconditional dynamic relative jump backwards, with a constant offset.
JMPF
Unconditional dynamic relative jump forwards, with a constant offset.
JNE
Conditional dynamic jump.
JNEB
Dynamic relative jump backwards, conditional on comparsion, with a constant offset.
JNEF
Dynamic relative jump forwards, conditional on comparsion, with a constant offset.
JNEI
Conditional jump.
JNZB
Dynamic relative jump backwards, conditional against zero, with a constant offset.
JNZF
Dynamic relative jump forwards, conditional against zero, with a constant offset.
JNZI
Conditional jump against zero.
K256
The keccak-256 hash of a slice.
LB
A byte is loaded from the specified address offset by an immediate value.
LDC
Load code as executable either from contract, blob, or memory.
LOG
Log an event.
LOGD
Log data.
LT
Compares two registers for less-than.
LW
A word is loaded from the specified address offset by an immediate value.
MCL
Clear a variable number of bytes in memory.
MCLI
Clear an immediate number of bytes in memory.
MCP
Copy a variable number of bytes in memory.
MCPI
Copy an immediate number of bytes in memory.
MEQ
Compare bytes in memory.
MINT
Mints amount coins of the asset ID created from sub_id for the current contract.
MLDV
Fused multiply-divide with arbitrary precision intermediate step.
MLOG
The integer logarithm of a register.
MOD
Modulo remainder of two registers.
MODI
Modulo remainder of a register and an immediate value.
MOVE
Copy from one register to another.
MOVI
Copy immediate value into a register
MROO
The integer root of a register.
MUL
Multiplies two registers.
MULI
Multiplies a register and an immediate value.
NOOP
Performs no operation.
NOT
Bitwise NOT a register.
OR
Bitwise ORs two registers.
ORI
Bitwise ORs a register and an immediate value.
POPH
Pop 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.
PSHH
Push a bitmask-selected set of registers in range 40..64 to the stack.
PSHL
Push a bitmask-selected set of registers in range 16..40 to the stack.
RET
Return from context.
RETD
Return from context with data.
RVRT
Halt execution, reverting state changes and returning a value.
S256
The SHA-2-256 hash of a slice.
SB
Write the least significant byte of a register to memory.
SCWQ
Clear a series of slots from contract storage.
SLL
Left shifts a register by a register.
SLLI
Left shifts a register by an immediate value.
SMO
Send a message to recipient address with call abi, coins, and output.
SRL
Right shifts a register by a register.
SRLI
Right shifts a register by an immediate value.
SRW
Load a word from contract storage.
SRWQ
Load a series of 32 byte slots from contract storage.
SUB
Subtracts two registers.
SUBI
Subtracts a register and an immediate value.
SW
Write a register to memory.
SWW
Store a word in contract storage.
SWWQ
Store a series of 32 byte slots in contract storage.
TIME
Get timestamp of block at given height.
TR
Transfer coins to a contract unconditionally.
TRO
Transfer coins to a variable output.
WDAM
AddMod 128bit
WDCM
Compare 128bit integers
WDDV
Divide 128bit
WDMD
Fused multiply-divide 128bit
WDML
Multiply 128bit
WDMM
MulMod 128bit
WDOP
Simple 128bit operations
WQAM
AddMod 256bit
WQCM
Compare 256bit integers
WQDV
Divide 256bit
WQMD
Fused multiply-divide 256bit
WQML
Multiply 256bit
WQMM
MulMod 256bit
WQOP
Simple 256bit operations
XOR
Bitwise XORs two registers.
XORI
Bitwise XORs a register and an immediate value.

Functions§

add
Adds two registers.
addi
Adds a register and an immediate value.
aloc
Allocate a number of bytes from the heap.
and
Bitwise ANDs two registers.
andi
Bitwise ANDs a register and an immediate value.
bal
Get the balance of contract of an asset ID.
bhei
Get current block height.
bhsh
Get block header hash for height.
bldd
Load blob as data
bsiz
Get blob size
burn
Burns amount coins of the asset ID created from sub_id for the current contract.
call
Call a contract.
cb
Get current block proposer’s address.
ccp
Copy contract code for a contract.
cfe
Extend the current call frame’s stack
cfei
Extend the current call frame’s stack by an immediate value.
cfs
Shrink the current call frame’s stack
cfsi
Shrink the current call frame’s stack by an immediate value.
croo
Get code root of a contract.
csiz
Get code size of a contract.
div
Divides two registers.
divi
Divides a register and an immediate value.
ecal
Call external function
eck1
The 64-byte public key (x, y) recovered from 64-byte signature on 32-byte message hash.
ecop
Given some curve, performs an operation on points
ecr1
The 64-byte Secp256r1 public key (x, y) recovered from 64-byte signature on 32-byte message hash.
ed19
Verify ED25519 public key and signature match a message.
epar
Given some curve, performs a pairing on groups of points
eq
Compares two registers for equality.
exp
Raises one register to the power of another.
expi
Raises one register to the power of an immediate value.
flag
Set flag register to a register.
gm
Get metadata from memory.
gm_args
Construct a GM instruction from its arguments.
gt
Compares two registers for greater-than.
gtf
Get transaction fields.
gtf_args
Construct a GM instruction from its arguments.
ji
Jump.
jmp
Dynamic jump.
jmpb
Unconditional dynamic relative jump backwards, with a constant offset.
jmpf
Unconditional dynamic relative jump forwards, with a constant offset.
jne
Conditional dynamic jump.
jneb
Dynamic relative jump backwards, conditional on comparsion, with a constant offset.
jnef
Dynamic relative jump forwards, conditional on comparsion, with a constant offset.
jnei
Conditional jump.
jnzb
Dynamic relative jump backwards, conditional against zero, with a constant offset.
jnzf
Dynamic relative jump forwards, conditional against zero, with a constant offset.
jnzi
Conditional jump against zero.
k256
The keccak-256 hash of a slice.
lb
A byte is loaded from the specified address offset by an immediate value.
ldc
Load code as executable either from contract, blob, or memory.
log
Log an event.
logd
Log data.
lt
Compares two registers for less-than.
lw
A word is loaded from the specified address offset by an immediate value.
mcl
Clear a variable number of bytes in memory.
mcli
Clear an immediate number of bytes in memory.
mcp
Copy a variable number of bytes in memory.
mcpi
Copy an immediate number of bytes in memory.
meq
Compare bytes in memory.
mint
Mints amount coins of the asset ID created from sub_id for the current contract.
mldv
Fused multiply-divide with arbitrary precision intermediate step.
mlog
The integer logarithm of a register.
mod_
Modulo remainder of two registers.
modi
Modulo remainder of a register and an immediate value.
move_
Copy from one register to another.
movi
Copy immediate value into a register
mroo
The integer root of a register.
mul
Multiplies two registers.
muli
Multiplies a register and an immediate value.
noop
Performs no operation.
not
Bitwise NOT a register.
or
Bitwise ORs two registers.
ori
Bitwise ORs a register and an immediate value.
poph
Pop 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.
pshh
Push a bitmask-selected set of registers in range 40..64 to the stack.
pshl
Push a bitmask-selected set of registers in range 16..40 to the stack.
ret
Return from context.
retd
Return from context with data.
rvrt
Halt execution, reverting state changes and returning a value.
s256
The SHA-2-256 hash of a slice.
sb
Write the least significant byte of a register to memory.
scwq
Clear a series of slots from contract storage.
sll
Left shifts a register by a register.
slli
Left shifts a register by an immediate value.
smo
Send a message to recipient address with call abi, coins, and output.
srl
Right shifts a register by a register.
srli
Right shifts a register by an immediate value.
srw
Load a word from contract storage.
srwq
Load a series of 32 byte slots from contract storage.
sub
Subtracts two registers.
subi
Subtracts a register and an immediate value.
sw
Write a register to memory.
sww
Store a word in contract storage.
swwq
Store a series of 32 byte slots in contract storage.
time
Get timestamp of block at given height.
tr
Transfer coins to a contract unconditionally.
tro
Transfer coins to a variable output.
wdam
AddMod 128bit
wdcm
Compare 128bit integers
wdcm_args
Construct a WDCM instruction from its arguments.
wddv
Divide 128bit
wddv_args
Construct a WDDV instruction from its arguments.
wdmd
Fused multiply-divide 128bit
wdml
Multiply 128bit
wdml_args
Construct a WDML instruction from its arguments.
wdmm
MulMod 128bit
wdop
Simple 128bit operations
wdop_args
Construct a WDOP instruction from its arguments.
wqam
AddMod 256bit
wqcm
Compare 256bit integers
wqcm_args
Construct a WQCM instruction from its arguments.
wqdv
Divide 256bit
wqdv_args
Construct a WQDV instruction from its arguments.
wqmd
Fused multiply-divide 256bit
wqml
Multiply 256bit
wqml_args
Construct a WQML instruction from its arguments.
wqmm
MulMod 256bit
wqop
Simple 256bit operations
wqop_args
Construct a WQOP instruction from its arguments.
xor
Bitwise XORs two registers.
xori
Bitwise XORs a register and an immediate value.