Constant or Literal Primitives
TVM Instructions Content List
- Overview
- Stack Manipulation
- Tuple, List and Null
- Constants and Literals
- Arithmetic Operations
- Data Comparison
- Cell Manipulation
- Continuation and Control Flow
- Exception Generation and Handling
- Dictionary Manipulation
- Application-specific Primitives
- Miscellaneous
Opcode | Fift syntax | Stack | Description | Gas |
---|---|---|---|---|
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 | - x | Pushes integer x into the stack. -5 <= x <= 10 .Here i equals four lower-order bits of x (i=x mod 16 ). | 18 |
70 | ZERO FALSE | - 0 | 18 | |
71 | ONE | - 1 | 18 | |
72 | TWO | - 2 | 18 | |
7A | TEN | - 10 | 18 | |
7F | TRUE | - -1 | 18 | |
80xx | [xx] PUSHINT [xx] INT | - xx | Pushes integer xx . -128 <= xx <= 127 . | 26 |
81xxxx | [xxxx] PUSHINT [xxxx] INT | - xxxx | Pushes integer xxxx . -2^15 <= xx < 2^15 . | 34 |
82lxxx | [xxx] PUSHINT [xxx] INT | - xxx | Pushes 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 |
83FF | PUSHNAN | - NaN | Pushes a NaN . | 26 |
84xx | [xx+1] PUSHPOW2DEC | - 2^(xx+1)-1 | Pushes 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 | - c | Pushes 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 | - s | Similar to PUSHREF , but converts the cell into a Slice. | 118/43 |
8A | [ref] PUSHREFCONT | - cont | Similar to PUSHREFSLICE , but makes a simple ordinary Continuation out of the cell. | 118/43 |
8Bxsss | [slice] PUSHSLICE [slice] SLICE | - s | Pushes 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 | - s | Pushes 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 | - s | Pushes 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 | - s | Examples 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/s | Examples of PUSHREF and PUSHREFSLICE .More on building cells in fift here. | ||
8F_rxxcccc | [builder] PUSHCONT [builder] CONT | - c | Pushes 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 | - c | Pushes a continuation made from builder .Details: Pushes an x -byte continuation for 0 <= x <= 15 . | 18 |
<{ code }> PUSHCONT <{ code }> CONT CONT:<{ code }> | - c | Pushes 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). |