Skip to main content

Constant or Literal Primitives

TVM Instructions Content List

OpcodeFift syntaxStackDescriptionGas
Please enter a search query
No results found

Constant or Literal Primitives

Integer and Boolean Constants

xxxxxxx
Opcode
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Fift syntax
xxxxxxxxxxxxxxxxx
Stack
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Description
xxxx
Gas
7i[x] PUSHINT
[x] INT
- xPushes integer x into the stack. -5 <= x <= 10.
Here i equals four lower-order bits of x (i=x mod 16).
18
70ZERO
FALSE
- 018
71ONE- 118
72TWO- 218
7ATEN- 1018
7FTRUE- -118
80xx[xx] PUSHINT
[xx] INT
- xxPushes integer xx. -128 <= xx <= 127.26
81xxxx[xxxx] PUSHINT
[xxxx] INT
- xxxxPushes integer xxxx. -2^15 <= xx < 2^15.34
82lxxx[xxx] PUSHINT
[xxx] INT
- xxxPushes integer xxx.
Details: 5-bit 0 <= l <= 30 determines the length n=8l+19 of signed big-endian integer xxx.
The total length of this instruction is l+4 bytes or n+13=8l+32 bits.
23
83xx[xx+1] PUSHPOW2- 2^(xx+1)(Quietly) pushes 2^(xx+1) for 0 <= xx <= 255.
2^256 is a NaN.
26
83FFPUSHNAN- NaNPushes a NaN.26
84xx[xx+1] PUSHPOW2DEC- 2^(xx+1)-1Pushes 2^(xx+1)-1 for 0 <= xx <= 255.26
85xx[xx+1] PUSHNEGPOW2- -2^(xx+1)Pushes -2^(xx+1) for 0 <= xx <= 255.26

Constant slices, continuations, cells, and references

xxxxxxx
Opcode
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Fift syntax
xxxxxxxxxxxxxxxxx
Stack
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Description
xxxx
Gas
88[ref] PUSHREF- cPushes the reference ref into the stack.
Details: Pushes the first reference of cc.code into the stack as a Cell (and removes this reference from the current continuation).
18
89[ref] PUSHREFSLICE- sSimilar to PUSHREF, but converts the cell into a Slice.118/43
8A[ref] PUSHREFCONT- contSimilar to PUSHREFSLICE, but makes a simple ordinary Continuation out of the cell.118/43
8Bxsss[slice] PUSHSLICE
[slice] SLICE
- sPushes the slice slice into the stack.
Details: Pushes the (prefix) subslice of cc.code consisting of its first 8x+4 bits and no references (i.e., essentially a bitstring), where 0 <= x <= 15.
A completion tag is assumed, meaning that all trailing zeroes and the last binary one (if present) are removed from this bitstring.
If the original bitstring consists only of zeroes, an empty slice will be pushed.
22
8Crxxssss[slice] PUSHSLICE
[slice] SLICE
- sPushes the slice slice into the stack.
Details: Pushes the (prefix) subslice of cc.code consisting of its first 1 <= r+1 <= 4 references and up to first 8xx+1 bits of data, with 0 <= xx <= 31.
A completion tag is also assumed.
25
8Drxxsssss[slice] PUSHSLICE
[slice] SLICE
- sPushes the slice slice into the stack.
Details: Pushes the subslice of cc.code consisting of 0 <= r <= 4 references and up to 8xx+6 bits of data, with 0 <= xx <= 127.
A completion tag is assumed.
28
x{} PUSHSLICE
x{ABCD1234} PUSHSLICE
b{01101} PUSHSLICE
- sExamples of PUSHSLICE.
x{} is an empty slice. x{...} is a hexadecimal literal. b{...} is a binary literal.
More on slice literals here.
Note that the assembler can replace PUSHSLICE with PUSHREFSLICE in certain situations (e.g. if there’s not enough space in the current continuation).
<b x{AB12} s, b> PUSHREF
<b x{AB12} s, b> PUSHREFSLICE
- c/sExamples of PUSHREF and PUSHREFSLICE.
More on building cells in fift here.
8F_rxxcccc[builder] PUSHCONT
[builder] CONT
- cPushes a continuation made from builder.
Details: Pushes the simple ordinary continuation cccc made from the first 0 <= r <= 3 references and the first 0 <= xx <= 127 bytes of cc.code.
26
9xccc[builder] PUSHCONT
[builder] CONT
- cPushes a continuation made from builder.
Details: Pushes an x-byte continuation for 0 <= x <= 15.
18
<{ code }> PUSHCONT
<{ code }> CONT
CONT:<{ code }>
- cPushes a continuation with code code.
Note that the assembler can replace PUSHCONT with PUSHREFCONT in certain situations (e.g. if there’s not enough space in the current continuation).

TVM Instructions Content List