Skip to main content

tvm_instructions

namealiastlbcategoryopcodefift_asmstackgasdesctvm_asmextra_info
0NOP#00stack_basic00NOP-18Does nothing.
Expand
Basically does nothing.
Look at compile_XHIG in ever-assembler for more stacks info
1SWAPXCHG_0I#01stack_basic01SWAPx y - y x18Same as s1 XCHG0.
Expand
Do nonsense
Really nonsense
2XCHG_0I#0 i:(## 4) {1 <= i}stack_basic0is[i] XCHG018Interchanges s0 with s[i], 1 <= i <= 15.
Expand

How to calculate the tvm_asm?
3XCHG_IJ#10 i:(## 4) j:(## 4) {1 <= i} {i + 1 <= j}stack_basic10ijs[i] s[j] XCHG26Interchanges s[i] with s[j], 1 <= i < j <= 15.
Expand

4XCHG_0I_LONG#11 ii:uint8stack_basic11iis0 [ii] s() XCHG26Interchanges s0 with s[ii], 0 <= ii <= 255.
Expand

5XCHG_1I#1 i:(## 4) {2 <= i}stack_basic1is1 s[i] XCHG18Interchanges s1 with s[i], 2 <= i <= 15.
Expand

6PUSH#2 i:uint4stack_basic2is[i] PUSH18Pushes a copy of the old s[i] into the stack.
Expand

7DUPPUSH#20stack_basic20DUPx - x x18Same as s0 PUSH.0x20
Expand

8OVERPUSH#21stack_basic21OVERx y - x y x18Same as s1 PUSH.0x21
Expand

9POP#3 i:uint4stack_basic3is[i] POP18Pops the old s0 value into the old s[i].
Expand

10DROPPOP#30stack_basic30DROPx -18Same as s0 POP, discards the top-of-stack value.0x30
Expand

11NIPPOP#31stack_basic31NIPx y - y18Same as s1 POP.0x31
Expand

12XCHG3#4 i:uint4 j:uint4 k:uint4stack_complex4ijks[i] s[j] s[k] XCHG326Equivalent to s2 s[i] XCHG s1 s[j] XCHG s[k] XCHG0.[s1 = parse_stack_register_u4][s2 = parse_stack_register_u4] [s3 = parse_stack_register_u4] 0x40 | s1, (s2 << 4) | s3
Expand

13XCHG2#50 i:uint4 j:uint4stack_complex50ijs[i] s[j] XCHG226Equivalent to s1 s[i] XCHG s[j] XCHG0.[s1 = parse_stack_register_u4][s2 = parse_stack_register_u4] 0x50, (s1 << 4) | s2
Expand

14XCPU#51 i:uint4 j:uint4stack_complex51ijs[i] s[j] XCPU26Equivalent to s[i] XCHG0 s[j] PUSH.[s1 = parse_stack_register_u4][s2 = parse_stack_register_u4] 0x51, (s1 << 4) | s2
Expand

15PUXC#52 i:uint4 j:uint4stack_complex52ijs[i] s[j-1] PUXC26Equivalent to s[i] PUSH SWAP s[j] XCHG0.[s1 = parse_stack_register_u4][s2 = parse_stack_register_u4_minus_one] 0x52, (s1 << 4) | s2
Expand

16PUSH2#53 i:uint4 j:uint4stack_complex53ijs[i] s[j] PUSH226Equivalent to s[i] PUSH s[j+1] PUSH.[s1 = parse_stack_register_u4][s2 = parse_stack_register_u4] 0x53, (s1 << 4) | s2
Expand

17XCHG3_ALT#540 i:uint4 j:uint4 k:uint4stack_complex540ijks[i] s[j] s[k] XCHG3_l34Long form of XCHG3.
Expand

18XC2PU#541 i:uint4 j:uint4 k:uint4stack_complex541ijks[i] s[j] s[k] XC2PU34Equivalent to s[i] s[j] XCHG2 s[k] PUSH.[s1 = parse_stack_register_u4][s2 = parse_stack_register_u4] [s3 = parse_stack_register_u4] 0x54, 0x10 | s1, (s2 << 4) | s3
Expand

19XCPUXC#542 i:uint4 j:uint4 k:uint4stack_complex542ijks[i] s[j] s[k-1] XCPUXC34Equivalent to s1 s[i] XCHG s[j] s[k-1] PUXC.[s1 = parse_stack_register_u4][s2 = parse_stack_register_u4] [s3 = parse_stack_register_u4_minus_one] 0x54, 0x20 | s1, (s2 << 4) | s3
Expand

20XCPU2#543 i:uint4 j:uint4 k:uint4stack_complex543ijks[i] s[j] s[k] XCPU234Equivalent to s[i] XCHG0 s[j] s[k] PUSH2.[s1 = parse_stack_register_u4][s2 = parse_stack_register_u4] [s3 = parse_stack_register_u4] 0x54, 0x30 | s1, (s2 << 4) | s3
Expand

21PUXC2#544 i:uint4 j:uint4 k:uint4stack_complex544ijks[i] s[j-1] s[k-1] PUXC234Equivalent to s[i] PUSH s2 XCHG0 s[j] s[k] XCHG2.
Expand

22PUXCPU#545 i:uint4 j:uint4 k:uint4stack_complex545ijks[i] s[j-1] s[k-1] PUXCPU34Equivalent to s[i] s[j-1] PUXC s[k] PUSH.[s1 = parse_stack_register_u4][s2 = parse_stack_register_u4_minus_one] [s3 = parse_stack_register_u4_minus_one] 0x54, 0x50 | s1, (s2 << 4) | s3
Expand

23PU2XC#546 i:uint4 j:uint4 k:uint4stack_complex546ijks[i] s[j-1] s[k-2] PU2XC34Equivalent to s[i] PUSH SWAP s[j] s[k-1] PUXC.[s1 = parse_stack_register_u4][s2 = parse_stack_register_u4_minus_one] [s3 = parse_stack_register_u4_minus_two] 0x54, 0x60 | s1, (s2 << 4) | s3
Expand

24PUSH3#547 i:uint4 j:uint4 k:uint4stack_complex547ijks[i] s[j] s[k] PUSH334Equivalent to s[i] PUSH s[j+1] s[k+1] PUSH2.
Expand

25BLKSWAP#55 i:uint4 j:uint4stack_complex55ij[i+1][j+1] BLKSWAP26Permutes two blocks s[j+i+1] … s[j+1] and s[j] … s0.[c1 = parse_const_u4_plus_one][c2 = parse_const_u4_plus_one] => 0x55, (c1 << 4) | c2
Expand

0 <= i,j <= 15
Equivalent to [i+1] [j+1] REVERSE [j+1] 0 REVERSE [i+j+2] 0 REVERSE.
26ROT2BLKSWAP#5513stack_complex5513ROT2a b c d e f - c d e f a b26Rotates the three topmost pairs of stack entries.0x55, 0x13
Expand

2ROT
27ROLLBLKSWAP#550 i:uint4stack_complex550i[i+1] ROLL26Rotates the top i+1 stack entries.[c = parse_const_u4_plus_one] 0x55, c
Expand

Equivalent to 1 [i+1] BLKSWAP.
28ROLLREVBLKSWAP#55 i:uint4 zero:(## 4) {zero = 0}stack_complex55i0[i+1] -ROLL26Rotates the top i+1 stack entries in the other direction.[c = parse_const_u4_plus_one] 0x55, c << 4
Expand

[i+1] ROLLREVEquivalent to [i+1] 1 BLKSWAP.
29PUSH_LONG#56 ii:uint8stack_complex56ii[ii] s() PUSH26Pushes a copy of the old s[ii] into the stack.
Expand

0 <= ii <= 255
30POP_LONG#57 ii:uint8stack_complex57ii[ii] s() POP26Pops the old s0 value into the old s[ii].
Expand

0 <= ii <= 255
31ROT#58stack_complex58ROTa b c - b c a18Equivalent to 1 2 BLKSWAP or to s2 s1 XCHG2.0x58
Expand

32ROTREV#59stack_complex59ROTREVa b c - c a b18Equivalent to 2 1 BLKSWAP or to s2 s2 XCHG2.0x59
Expand

-ROT
33SWAP2#5Astack_complex5ASWAP2a b c d - c d a b18Equivalent to 2 2 BLKSWAP or to s3 s2 XCHG2.0x5A
Expand

2SWAP
34DROP2#5Bstack_complex5BDROP2a b -18Equivalent to DROP DROP.0x5B
Expand

2DROP
35DUP2#5Cstack_complex5CDUP2a b - a b a b18Equivalent to s1 s0 PUSH2.0x5C
Expand

2DUP
36OVER2#5Dstack_complex5DOVER2a b c d - a b c d a b18Equivalent to s3 s2 PUSH2.0x5D
Expand

2OVER
37REVERSE#5E i:uint4 j:uint4stack_complex5Eij[i+2][j] REVERSE26Reverses the order of s[j+i+1] … s[j].[c1 = parse_const_u4_plus_two][c2 = parse_const_u4] 0x5E, (c1 << 4) | c2
Expand

38BLKDROP#5F0 i:uint4stack_complex5F0i[i] BLKDROP26Equivalent to DROP performed i times.[c = parse_const_u4] 0x5F, c
Expand

39BLKPUSH#5F i:(## 4) j:uint4 {1 <= i}stack_complex5Fij[i][j] BLKPUSH26Equivalent to PUSH s(j) performed i times.[c1 = parse_const_u4_nonzero][c2 = parse_const_u4] 0x5F, (c1 << 4) | c2
Expand

1 <= i <= 15, 0 <= j <= 15.
40PICK#60stack_complex60PICK18Pops integer i from the stack, then performs s[i] PUSH.0x60
Expand

PUSHX
41ROLLX#61stack_complex61ROLLX18Pops integer i from the stack, then performs 1 [i] BLKSWAP.0x61
Expand

42-ROLLX#62stack_complex62-ROLLX18Pops integer i from the stack, then performs [i] 1 BLKSWAP.0x62
Expand

ROLLREVX
43BLKSWX#63stack_complex63BLKSWX18Pops integers i,j from the stack, then performs [i] [j] BLKSWAP.0x63
Expand

44REVX#64stack_complex64REVX18Pops integers i,j from the stack, then performs [i] [j] REVERSE.0x64
Expand

45DROPX#65stack_complex65DROPX18Pops integer i from the stack, then performs [i] BLKDROP.0x65
Expand

46TUCK#66stack_complex66TUCKa b - b a b18Equivalent to SWAP OVER or to s1 s1 XCPU.0x66
Expand

47XCHGX#67stack_complex67XCHGX18Pops integer i from the stack, then performs s[i] XCHG.0x67
Expand

48DEPTH#68stack_complex68DEPTH- depth18Pushes the current depth of the stack.0x68
Expand

49CHKDEPTH#69stack_complex69CHKDEPTHi -18/58Pops integer i from the stack, then checks whether there are at least i elements, generating a stack underflow exception otherwise.0x69
Expand

50ONLYTOPX#6Astack_complex6AONLYTOPX18Pops integer i from the stack, then removes all but the top i elements.0x6A
Expand

51ONLYX#6Bstack_complex6BONLYX18Pops integer i from the stack, then leaves only the bottom i elements. Approximately equivalent to DEPTH SWAP SUB DROPX.0x6B
Expand

52BLKDROP2#6C i:(## 4) j:uint4 {1 <= i}stack_complex6Cij[i][j] BLKDROP226Drops i stack elements under the top j elements.[c1 = parse_const_u4_nonzero][c2 = parse_const_u4] 0x6C, (c1 << 4) | c2
Expand

1 <= i <= 15, 0 <= j <= 15
Equivalent to [i+j] 0 REVERSE [i] BLKDROP [j] 0 REVERSE.
53NULL#6Dtuple6DNULL- null18Pushes the only value of type Null.0x6D
Expand

PUSHNULL
54ISNULL#6Etuple6EISNULLx - ?18Checks whether x is a Null, and returns -1 or 0 accordingly.0x6E
Expand

55TUPLE#6F0 n:uint4tuple6F0n[n] TUPLEx_1 ... x_n - t26+nCreates a new Tuple t=(x_1, … ,x_n) containing n values x_1,..., x_n.[s = parse_const_u4] 0x6F, s
Expand

0 <= n <= 15
56NILTUPLE#6F00tuple6F00NIL- t26Pushes the only Tuple t=() of length zero.0x6F, 0x00
Expand

57SINGLETUPLE#6F01tuple6F01SINGLEx - t27Creates a singleton t:=(x), i.e., a Tuple of length one.0x6F, 0x01
Expand

58PAIRTUPLE#6F02tuple6F02PAIRx y - t28Creates pair t:=(x,y).0x6F, 0x02
Expand

CONS
59TRIPLETUPLE#6F03tuple6F03TRIPLEx y z - t29Creates triple t:=(x,y,z).0x6F, 0x03
Expand

60INDEX#6F1 k:uint4tuple6F1k[k] INDEXt - x26Returns the k-th element of a Tuple t.[c = parse_const_u4] 0x6F, 0x10 | c
Expand

0 <= k <= 15.
61FIRSTINDEX#6F10tuple6F10FIRSTt - x26Returns the first element of a Tuple.0x6F, 0x10
Expand

CAR
62SECONDINDEX#6F11tuple6F11SECONDt - y26Returns the second element of a Tuple.0x6F, 0x11
Expand

CDR
63THIRDINDEX#6F12tuple6F12THIRDt - z26Returns the third element of a Tuple.0x6F, 0x12
Expand

64UNTUPLE#6F2 n:uint4tuple6F2n[n] UNTUPLEt - x_1 ... x_n26+nUnpacks a Tuple t=(x_1,...,x_n) of length equal to 0 <= n <= 15.[c = parse_const_u4] 0x6F, 0x20 | c
Expand

If t is not a Tuple, or if \|t\| != n, a type check exception is thrown.
65UNSINGLEUNTUPLE#6F21tuple6F21UNSINGLEt - x27Unpacks a singleton t=(x).0x6F, 0x21
Expand

66UNPAIRUNTUPLE#6F22tuple6F22UNPAIRt - x y28Unpacks a pair t=(x,y).0x6F, 0x22
Expand

UNCONS
67UNTRIPLEUNTUPLE#6F23tuple6F23UNTRIPLEt - x y z29Unpacks a triple t=(x,y,z).0x6F, 0x23
Expand

68UNPACKFIRST#6F3 k:uint4tuple6F3k[k] UNPACKFIRSTt - x_1 ... x_k26+kUnpacks first 0 <= k <= 15 elements of a Tuple t.[c = parse_const_u4] 0x6F, 0x30 | c
Expand

If \|t\|<k, throws a type check exception.
69CHKTUPLEUNPACKFIRST#6F30tuple6F30CHKTUPLEt -26Checks whether t is a Tuple. If not, throws a type check exception.0x6F, 0x30
Expand

70EXPLODE#6F4 n:uint4tuple6F4n[n] EXPLODEt - x_1 ... x_m m26+mUnpacks a Tuple t=(x_1,...,x_m) and returns its length m, but only if m <= n <= 15. Otherwise throws a type check exception.[c = parse_const_u4] 0x6F, 0x40 | c
Expand

71SETINDEX#6F5 k:uint4tuple6F5k[k] SETINDEXt x - t'26+|t|Computes Tuple t' that differs from t only at position t'_{k+1}, which is set to x.[c = parse_const_u4] 0x6F, 0x50 | c
Expand

0 <= k <= 15
If k >= \|t\|, throws a range check exception.
72SETFIRSTSETINDEX#6F50tuple6F50SETFIRSTt x - t'26+|t|Sets the first component of Tuple t to x and returns the resulting Tuple t'.0x6F, 0x50
Expand

73SETSECONDSETINDEX#6F51tuple6F51SETSECONDt x - t'26+|t|Sets the second component of Tuple t to x and returns the resulting Tuple t'.0x6F, 0x51
Expand

74SETTHIRDSETINDEX#6F52tuple6F52SETTHIRDt x - t'26+|t|Sets the third component of Tuple t to x and returns the resulting Tuple t'.0x6F, 0x52
Expand

75INDEXQ#6F6 k:uint4tuple6F6k[k] INDEXQt - x26Returns the k-th element of a Tuple t, where 0 <= k <= 15. In other words, returns x_{k+1} if t=(x_1,...,x_n). If k>=n, or if t is Null, returns a Null instead of x.[c = parse_const_u4] 0x6F, 0x60 | c
Expand

76FIRSTQINDEXQ#6F60tuple6F60FIRSTQt - x26Returns the first element of a Tuple.0x6F, 0x60
Expand

CARQ
77SECONDQINDEXQ#6F61tuple6F61SECONDQt - y26Returns the second element of a Tuple.0x6F, 0x61
Expand

CDRQ
78THIRDQINDEXQ#6F62tuple6F62THIRDQt - z26Returns the third element of a Tuple.0x6F, 0x62
Expand

79SETINDEXQ#6F7 k:uint4tuple6F7k[k] SETINDEXQt x - t'26+|t’|Sets the k-th component of Tuple t to x, where 0 <= k < 16, and returns the resulting Tuple t'.[c = parse_const_u4] 0x6F, 0x70 | c
Expand

If \|t\| <= k, first extends the original Tuple to length n’=k+1 by setting all new components to Null. If the original value of t is Null, treats it as an empty Tuple. If t is not Null or Tuple, throws an exception. If x is Null and either \|t\| <= k or t is Null, then always returns t'=t (and does not consume tuple creation gas).
80SETFIRSTQSETINDEXQ#6F70tuple6F70SETFIRSTQt x - t'26+|t’|Sets the first component of Tuple t to x and returns the resulting Tuple t'.0x6F , 0x70
Expand

81SETSECONDQSETINDEXQ#6F71tuple6F71SETSECONDQt x - t'26+|t’|Sets the second component of Tuple t to x and returns the resulting Tuple t'.0x6F , 0x71
Expand

82SETTHIRDQSETINDEXQ#6F72tuple6F72SETTHIRDQt x - t'26+|t’|Sets the third component of Tuple t to x and returns the resulting Tuple t'.0x6F , 0x72
Expand

83TUPLEVAR#6F80tuple6F80TUPLEVARx_1 ... x_n n - t26+nCreates a new Tuple t of length n similarly to TUPLE, but with 0 <= n <= 255 taken from the stack.0x6F , 0x80
Expand

84INDEXVAR#6F81tuple6F81INDEXVARt k - x26Similar to k INDEX, but with 0 <= k <= 254 taken from the stack.0x6F , 0x81
Expand

85UNTUPLEVAR#6F82tuple6F82UNTUPLEVARt n - x_1 ... x_n26+nSimilar to n UNTUPLE, but with 0 <= n <= 255 taken from the stack.0x6F , 0x82
Expand

86UNPACKFIRSTVAR#6F83tuple6F83UNPACKFIRSTVARt n - x_1 ... x_n26+nSimilar to n UNPACKFIRST, but with 0 <= n <= 255 taken from the stack.0x6F , 0x83
Expand

87EXPLODEVAR#6F84tuple6F84EXPLODEVARt n - x_1 ... x_m m26+mSimilar to n EXPLODE, but with 0 <= n <= 255 taken from the stack.0x6F , 0x84
Expand

88SETINDEXVAR#6F85tuple6F85SETINDEXVARt x k - t'26+|t’|Similar to k SETINDEX, but with 0 <= k <= 254 taken from the stack.0x6F , 0x85
Expand

89INDEXVARQ#6F86tuple6F86INDEXVARQt k - x26Similar to n INDEXQ, but with 0 <= k <= 254 taken from the stack.0x6F , 0x86
Expand

90SETINDEXVARQ#6F87tuple6F87SETINDEXVARQt x k - t'26+|t’|Similar to k SETINDEXQ, but with 0 <= k <= 254 taken from the stack.0x6F , 0x87
Expand

91TLEN#6F88tuple6F88TLENt - n26Returns the length of a Tuple.0x6F , 0x88
Expand

92QTLEN#6F89tuple6F89QTLENt - n or -126Similar to TLEN, but returns -1 if t is not a Tuple.0x6F , 0x89
Expand

93ZEROSWAPIF#6F90tuple6F90ZEROSWAPIFx - x or 0 x26Pushes a Zero under the topmost Integer x, but only if x != 0.0x6F, 0x90
Expand

94ZEROSWAPIFNOT#6F91tuple6F91ZEROSWAPIFNOTx – x or 0 x26Pushes a Zero under the topmost Integer x, but only if x = 0.0x6F, 0x91
Expand

95ZEROROTRIF#6F92tuple6F92ZEROROTRIFx y – x y or 0 x26Pushes a Zero under the second stack entry from the top, but only if the topmost Integer y is non-zero.0x6F, 0x92
Expand

96ZEROROTRIFNOT#6F93tuple6F93ZEROROTRIFNOTx y – x y or 0 x y26Pushes a Zero under the second stack entry from the top, but only if the topmost Integer y is zero.0x6F, 0x93
Expand

97ZEROSWAPIF2#6F94tuple6F94ZEROSWAPIF2x – x or 0 0 x26Pushes two Zeros under the topmost Integer x, but only if x != 0. Equivalent to ZEROSWAPIF; ZEROSWAPIF.0x6F, 0x94
Expand

98ZEROSWAPIFNOT2#6F95tuple6F95ZEROSWAPIFNOT2x – x or 0 0 x26Pushes two Zeros under the topmost Integer x, but only if x = 0. Equivalent to ZEROSWAPIFNOT; ZEROSWAPIFNOT.0x6F, 0x95
Expand

99ZEROROTRIF2#6F96tuple6F96ZEROROTRIF2x y – x y or 0 0 x y26Pushes two Zeros under the second stack entry from the top, but only if the topmost Integer y is non-zero. Equivalent to ZEROROTRIF; ZEROROTRIF.0x6F, 0x96
Expand

100ZEROROTRIFNOT2#6F97tuple6F97ZEROROTRIFNOT2x y – x y or 0 0 x y26Pushes two Zeros under the second stack entry from the top, but only if the topmost Integer y is zero. Equivalent to ZEROROTRIFNOT; ZEROROTRIFNOT.0x6F, 0x97
Expand

101ISTUPLE#6F8Atuple6F8AISTUPLEt - ?26Returns -1 or 0 depending on whether t is a Tuple.0x6F , 0x8A
Expand

102LAST#6F8Btuple6F8BLASTt - x26Returns the last element of a non-empty Tuple t.0x6F , 0x8B
Expand

103TPUSH#6F8Ctuple6F8CTPUSHt x - t'26+|t’|Appends a value x to a Tuple t=(x_1,...,x_n), but only if the resulting Tuple t'=(x_1,...,x_n,x) is of length at most 255. Otherwise throws a type check exception.0x6F , 0x8C
Expand

COMMA
104TPOP#6F8Dtuple6F8DTPOPt - t' x26+|t’|Detaches the last element x=x_n from a non-empty Tuple t=(x_1,...,x_n), and returns both the resulting Tuple t'=(x_1,...,x_{n-1}) and the original last element x.0x6F , 0x8D
Expand

105NULLSWAPIF#6FA0tuple6FA0NULLSWAPIFx - x or null x26Pushes a Null under the topmost Integer x, but only if x!=0.0x6F , 0xA0
Expand

106NULLSWAPIFNOT#6FA1tuple6FA1NULLSWAPIFNOTx - x or null x26Pushes a Null under the topmost Integer x, but only if x=0. May be used for stack alignment after quiet primitives such as PLDUXQ.0x6F , 0xA1
Expand

107NULLROTRIF#6FA2tuple6FA2NULLROTRIFx y - x y or null x y26Pushes a Null under the second stack entry from the top, but only if the topmost Integer y is non-zero.0x6F , 0xA2
Expand

108NULLROTRIFNOT#6FA3tuple6FA3NULLROTRIFNOTx y - x y or null x y26Pushes a Null under the second stack entry from the top, but only if the topmost Integer y is zero. May be used for stack alignment after quiet primitives such as LDUXQ.0x6F , 0xA3
Expand

109NULLSWAPIF2#6FA4tuple6FA4NULLSWAPIF2x - x or null null x26Pushes two nulls under the topmost Integer x, but only if x!=0.0x6F , 0xA4
Expand

Equivalent to NULLSWAPIF NULLSWAPIF.
110NULLSWAPIFNOT2#6FA5tuple6FA5NULLSWAPIFNOT2x - x or null null x26Pushes two nulls under the topmost Integer x, but only if x=0.0x6F , 0xA5
Expand

Equivalent to NULLSWAPIFNOT NULLSWAPIFNOT.
111NULLROTRIF2#6FA6tuple6FA6NULLROTRIF2x y - x y or null null x y26Pushes two nulls under the second stack entry from the top, but only if the topmost Integer y is non-zero.0x6F , 0xA6
Expand

Equivalent to NULLROTRIF NULLROTRIF.
112NULLROTRIFNOT2#6FA7tuple6FA7NULLROTRIFNOT2x y - x y or null null x y26Pushes two nulls under the second stack entry from the top, but only if the topmost Integer y is zero.0x6F , 0xA7
Expand

Equivalent to NULLROTRIFNOT NULLROTRIFNOT.
113INDEX2#6FB i:uint2 j:uint2tuple6FBij[i][j] INDEX2t - x26Recovers x=(t_{i+1})_{j+1} for 0 <= i,j <= 3.[i = parse_const_u2][j = parse_const_u2] 0x6F, 0xB0 | (i << 2) | j
Expand

Equivalent to [i] INDEX [j] INDEX.
114CADRINDEX2#6FB4tuple6FB4CADRt - x26Recovers x=(t_2)_1.0x6F, 0xB4
Expand

115CDDRINDEX2#6FB5tuple6FB5CDDRt - x26Recovers x=(t_2)_2.0x6F, 0xB5
Expand

116INDEX3#6FE_ i:uint2 j:uint2 k:uint2tuple6FE_ijk[i][j] [k] INDEX3t - x26Recovers x=t_{i+1}_{j+1}_{k+1}.[i = parse_const_u2][j = parse_const_u2] [k = parse_const_u2] 0x6F, 0xC0 | (i << 4) | (j << 2) | k
Expand

0 <= i,j,k <= 3
Equivalent to [i] [j] INDEX2 [k] INDEX.
117CADDRINDEX3#6FD4tuple6FD4CADDRt - x26Recovers x=t_2_2_1.0x6F, 0xD4
Expand

118CDDDRINDEX3#6FD5tuple6FD5CDDDRt - x26Recovers x=t_2_2_2.0x6F, 0xD5
Expand

119PUSHINT_4#7 i:uint4const_int7i[x] PUSHINT- x18Pushes integer x into the stack. -5 <= x <= 10.
Expand

[x] INTHere i equals four lower-order bits of x (i=x mod 16).
120ZEROPUSHINT_4#70const_int70ZERO- 018Pushes a zero.0x70
Expand

FALSE
121ONEPUSHINT_4#71const_int71ONE- 1180x71
Expand

122TWOPUSHINT_4#72const_int72TWO- 2180x72
Expand

123TENPUSHINT_4#7Aconst_int7ATEN- 1018Pushes a ten.0x7A
Expand

124TRUEPUSHINT_4#7Fconst_int7FTRUE- -1180x7F
Expand

125PUSHINT_8#80 xx:int8const_int80xx[xx] PUSHINT- xx26Pushes integer xx. -128 <= xx <= 127.
Expand

[xx] INT
126PUSHINT_16#81 xxxx:int16const_int81xxxx[xxxx] PUSHINT- xxxx34Pushes integer xxxx. -2^15 <= xx < 2^15.
Expand

[xxxx] INT
127#81FC18const_int81FC18[1000] PUSHINT- 100034
Expand

128PUSHINT_LONG#82 l:(## 5) xxx:(int (8 * l + 19))const_int82lxxx[xxx] PUSHINT- xxx23Pushes integer xxx.
Expand

[xxx] INTDetails: 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.
129PUSHPOW2#83 xx:uint8const_int83xx[xx+1] PUSHPOW2- 2^(xx+1)26(Quietly) pushes 2^(xx+1) for 0 <= xx <= 255.[s1 = parse_const_u8_plus_one] 0x83, s1
Expand

2^256 is a NaN.
130PUSHNANPUSHPOW2#83FFconst_int83FFPUSHNAN- NaN26Pushes a NaN.0x83, 0xFF
Expand

131PUSHPOW2DEC#84 xx:uint8const_int84xx[xx+1] PUSHPOW2DEC- 2^(xx+1)-126Pushes 2^(xx+1)-1 for 0 <= xx <= 255.[s1 = parse_const_u8_plus_one] 0x84, s1
Expand

132PUSHNEGPOW2#85 xx:uint8const_int85xx[xx+1] PUSHNEGPOW2- -2^(xx+1)26Pushes -2^(xx+1) for 0 <= xx <= 255.[s1 = parse_const_u8_plus_one] 0x85, s1
Expand

133PUSHREF#88 c:^Cellconst_data88[ref] PUSHREF- c18Pushes the reference ref into the stack.
Expand

Details: Pushes the first reference of cc.code into the stack as a Cell (and removes this reference from the current continuation).
134PUSHREFSLICE#89 c:^Cellconst_data89[ref] PUSHREFSLICE- s118/43Similar to PUSHREF, but converts the cell into a Slice.
Expand

135PUSHREFCONT#8A c:^Cellconst_data8A[ref] PUSHREFCONT- cont118/43Similar to PUSHREFSLICE, but makes a simple ordinary Continuation out of the cell.
Expand

136PUSHSLICE#8B x:(## 4) sss:((8 x + 4) Bit)const_data8Bxsss[slice] PUSHSLICE- s22Pushes the slice slice into the stack.
Expand

[slice] SLICEDetails: 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.
137#8B04const_data8B04[x8] PUSHSLICE- sPushes an empty slice (bitstring ``).
Expand

138#8B08const_data8B08[x4] PUSHSLICE- sPushes bitstring 0.
Expand

139#8B0Cconst_data8B0C[xC] PUSHSLICE- spushes bitstring 1.
Expand

140PUSHSLICE_REFS#8C r:(## 2) xx:(## 5) c:((r + 1) ^Cell) ssss:((8 xx + 1) * Bit)const_data8Crxxssss[slice] PUSHSLICE- s25Pushes the slice slice into the stack.
Expand

[slice] SLICEDetails: 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.
141#8C01const_data8C01[ref] PUSHREFSLICE- s118/43Is equivalent to PUSHREFSLICE.
Expand

142PUSHSLICE_LONG#8D r:(#<= 4) xx:(## 7) c:(r ^Cell) ssss:((8 xx + 6) * Bit)const_data8Drxxsssss[slice] PUSHSLICE- s28Pushes the slice slice into the stack.
Expand

[slice] SLICEDetails: 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.
143const_datax{} PUSHSLICE- sExamples of PUSHSLICE.
Expand

x{ABCD1234} PUSHSLICEx{} is an empty slice. x{...} is a hexadecimal literal. b{...} is a binary literal.
b{01101} PUSHSLICEMore 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).
144const_data<b x{AB12} s, b> PUSHREF- c/sExamples of PUSHREF and PUSHREFSLICE.
Expand

<b x{AB12} s, b> PUSHREFSLICEMore on building cells in fift here.
145PUSHCONT#8F_ r:(## 2) xx:(## 7) c:(r ^Cell) ssss:((8 xx) * Bit)const_data8F_rxxcccc[builder] PUSHCONT- c26Pushes a continuation made from builder.
Expand

[builder] CONTDetails: Pushes the simple ordinary continuation cccc made from the first 0 <= r <= 3 references and the first 0 <= xx <= 127 bytes of cc.code.
146PUSHCONT_SHORT#9 x:(## 4) ssss:((8 x) Bit)const_data9xccc[builder] PUSHCONT- c18Pushes a continuation made from builder.
Expand

[builder] CONTDetails: Pushes an x-byte continuation for 0 <= x <= 15.
147const_data<{ code }> PUSHCONT- cPushes a continuation with code code.
Expand

<{ code }> CONTNote that the assembler can replace PUSHCONT with PUSHREFCONT in certain situations (e.g. if there’s not enough space in the current continuation).
CONT:<{ code }>
148ADD#A0arithm_basicA0ADDx y - x+y18Adds together two integers0xA0
Expand

149SUB#A1arithm_basicA1SUBx y - x-y180xA1
Expand

150SUBR#A2arithm_basicA2SUBRx y - y-x18Equivalent to SWAP SUB.0xA2
Expand

151NEGATE#A3arithm_basicA3NEGATEx - -x18Equivalent to -1 MULCONST or to ZERO SUBR.0xA3
Expand

Notice that it triggers an integer overflow exception if x=-2^256.
152INC#A4arithm_basicA4INCx - x+118Equivalent to 1 ADDCONST.0xA4
Expand

153DEC#A5arithm_basicA5DECx - x-118Equivalent to -1 ADDCONST.0xA5
Expand

154ADDCONST#A6 cc:int8arithm_basicA6cc[cc] ADDCONSTx - x+cc26-128 <= cc <= 127.[z = parse_const_i8] 0xA6, z
Expand

[cc] ADDINT
[-cc] SUBCONST
[-cc] SUBINT
155MULCONST#A7 cc:int8arithm_basicA7cc[cc] MULCONSTx - x*cc26-128 <= cc <= 127.[z = parse_const_i8] 0xA7, z
Expand

[cc] MULINT
156MUL#A8arithm_basicA8MULx y - x*y180xA8
Expand

157DIV_BASE#A9 m:uint1 s:uint2 cdft:(Either [ d:uint2 f:uint2 ][ d:uint2 f:uint2 tt:uint8 ])arithm_divA9mscdf26This is the general encoding of division, with an optional pre-multiplication and an optional replacement of the division or multiplication by a shift. Variable fields are as follows:
Expand

0 <= m <= 1 - Indicates whether there is pre-multiplication (MULDIV and its variants), possibly replaced by a left shift.
0 <= s <= 2 - Indicates whether either the multiplication or the division have been replaced by shifts: s=0 - no replacement, s=1 - division replaced by a right shift, s=2 - multiplication replaced by a left shift (possible only for m=1).
0 <= c <= 1 - Indicates whether there is a constant one-byte argument tt for the shift operator (if s!=0). For s=0, c=0. If c=1, then 0 <= tt <= 255, and the shift is performed by tt+1 bits. If s!=0 and c=0, then the shift amount is provided to the instruction as a top-of-stack Integer in range 0...256.
1 <= d <= 3 - Indicates which results of division are required: 1 - only the quotient, 2 - only the remainder, 3 - both.
0 <= f <= 2 - Rounding mode: 0 - floor, 1 - nearest integer, 2 - ceiling.
All instructions below are variants of this.
158DIVDIV_BASE#A904arithm_divA904DIVx y - q26q=floor(x/y), r=x-y*q0xA9, 0x04
Expand

159DIVRDIV_BASE#A905arithm_divA905DIVRx y - q’26q’=round(x/y), r’=x-y*q’0xA9, 0x05
Expand

160DIVCDIV_BASE#A906arithm_divA906DIVCx y - q''26q’’=ceil(x/y), r’’=x-y*q’’0xA9, 0x06
Expand

161MODDIV_BASE#A908arithm_divA908MODx y - r26where q=floor(x/y), r=x mod y=x-yq.0xA9, 0x08
Expand

162DIVMODDIV_BASE#A90Carithm_divA90CDIVMODx y - q r26where q=floor(x/y), r=x-yq.0xA9, 0x0C
Expand

163DIVMODRDIV_BASE#A90Darithm_divA90DDIVMODRx y - q' r'26where q' = floor(x/y + 1/2), r' = x - yq'.0xA9, 0x0D
Expand

164DIVMODCDIV_BASE#A90Earithm_divA90EDIVMODCx y - q'' r''26where q'' = ceil(x/y), r'' = x - yq''.0xA9, 0x0E
Expand

165#A924arithm_divA924RSHIFTx y - floor(x*c/2^y)
Expand

166RSHIFTR_VARDIV_BASE#A925arithm_divA925RSHIFTRx y - round(x/2^y)260xA9, 0x25
Expand

167RSHIFTC_VARDIV_BASE#A926arithm_divA926RSHIFTCx y - ceil(x/2^y)340xA9, 0x26
Expand

168#A934 tt:uint8arithm_divA934tt[tt+1] RSHIFTx - x mod 2^(tt+1)34
Expand

169RSHIFTRDIV_BASE#A935 tt:uint8arithm_divA935tt[tt+1] RSHIFTR#x y - round(x/2^(tt+1))34
Expand

170RSHIFTCDIV_BASE#A936 tt:uint8arithm_divA936tt[tt+1] RSHIFTC#x y - ceil(x/2^(tt+1))34
Expand

171MODPOW2DIV_BASE#A938 tt:uint8arithm_divA938tt[tt+1] MODPOW2#x - x mod 2^(tt+1)26
Expand

172MULDIVDIV_BASE#A984arithm_divA98MULDIVx y z - q26q=floor(x*y/z)0xA9, 0x84
Expand

173MULDIVRDIV_BASE#A985arithm_divA985MULDIVRx y z - q'26q'=round(x*y/z)0xA9, 0x85
Expand

174MULDIVMODDIV_BASE#A98Carithm_divA98CMULDIVMODx y z - q r26q=floor(x*y/z), r=x*y-z*q0xA9, 0x8C
Expand

175MULRSHIFT_VARDIV_BASE#A9A4arithm_divA9A4MULRSHIFTx y z - floor(x*y/2^z)260 <= z <= 2560xA9, 0xA4
Expand

176MULRSHIFTR_VARDIV_BASE#A9A5arithm_divA9A5MULRSHIFTRx y z - round(x*y/2^z)260 <= z <= 2560xA9, 0xA5
Expand

177MULRSHIFTC_VARDIV_BASE#A9A6arithm_divA9A6MULRSHIFTCx y z - ceil(x*y/2^z)340 <= z <= 2560xA9, 0xA6
Expand

178MULRSHIFTDIV_BASE#A9B4 tt:uint8arithm_divA9B4tt[tt+1] MULRSHIFT#x y - floor(x*y/2^(tt+1))34
Expand

179MULRSHIFTRDIV_BASE#A9B5 tt:uint8arithm_divA9B5tt[tt+1] MULRSHIFTR#x y - round(x*y/2^(tt+1))34
Expand

180MULRSHIFTCDIV_BASE#A9B6 tt:uint8arithm_divA9B6tt[tt+1] MULRSHIFTC#x y - ceil(x*y/2^(tt+1))26
Expand

181LSHIFTDIV_VARDIV_BASE#A9C4arithm_divA9C4LSHIFTDIVx y z - floor(2^z*x/y)260 <= z <= 2560xA9, 0xC4
Expand

182LSHIFTDIVR_VARDIV_BASE#A9C5arithm_divA9C5LSHIFTDIVRx y z - round(2^z*x/y)260 <= z <= 2560xA9, 0xC5
Expand

183LSHIFTDIVC_VARDIV_BASE#A9C6arithm_divA9C6LSHIFTDIVCx y z - ceil(2^z*x/y)340 <= z <= 2560xA9, 0xC6
Expand

184LSHIFTDIVDIV_BASE#A9D4 tt:uint8arithm_divA9D4tt[tt+1] LSHIFT#DIVx y - floor(2^(tt+1)*x/y)34
Expand

185LSHIFTDIVRDIV_BASE#A9D5 tt:uint8arithm_divA9D5tt[tt+1] LSHIFT#DIVRx y - round(2^(tt+1)*x/y)34
Expand

186LSHIFTDIVCDIV_BASE#A9D6 tt:uint8arithm_divA9D6tt[tt+1] LSHIFT#DIVCx y - ceil(2^(tt+1)*x/y)26
Expand

187LSHIFT#AA cc:uint8arithm_logicalAAcc[cc+1] LSHIFT#x - x*2^(cc+1)260 <= cc <= 255
Expand

188#AA00arithm_logicalAA00[1] LSHIFT#Equivalent to MULCONST 2 or to Forth's 2*.
Expand

189RSHIFT#AB cc:uint8arithm_logicalABcc[cc+1] RSHIFT#x - floor(x/2^(cc+1))180 <= cc <= 255
Expand

190LSHIFT_VAR#ACarithm_logicalACLSHIFTx y - x*2^y180 <= y <= 10230xAC
Expand

191RSHIFT_VAR#ADarithm_logicalADRSHIFTx y - floor(x/2^y)180 <= y <= 10230xAD
Expand

192POW2#AEarithm_logicalAEPOW2y - 2^y180 <= y <= 10230xAE
Expand

Equivalent to ONE SWAP LSHIFT.
193AND#B0arithm_logicalB0ANDx y - x&y18Bitwise and of two signed integers x and y, sign-extended to infinity.0xB0
Expand

194OR#B1arithm_logicalB1ORx y - x|y18Bitwise or of two integers.0xB1
Expand

195XOR#B2arithm_logicalB2XORx y - x xor y18Bitwise xor of two integers.0xB2
Expand

196NOT#B3arithm_logicalB3NOTx - ~x26Bitwise not of an integer.0xB3
Expand

197FITS#B4 cc:uint8arithm_logicalB4cc[cc+1] FITSx - x26/76Checks whether x is a cc+1-bit signed integer for 0 <= cc <= 255 (i.e., whether -2^cc <= x < 2^cc).[z = parse_const_u8_plus_one] 0xB4, z
Expand

If not, either triggers an integer overflow exception, or replaces x with a NaN (quiet version).
198CHKBOOLFITS#B400arithm_logicalB400CHKBOOLx - x26/76Checks whether x is a “boolean value'' (i.e., either 0 or -1).0xB4, 0x00
Expand

199UFITS#B5 cc:uint8arithm_logicalB5cc[cc+1] UFITSx - x26/76Checks whether x is a cc+1-bit unsigned integer for 0 <= cc <= 255 (i.e., whether 0 <= x < 2^(cc+1)).[z = parse_const_u8_plus_one] 0xB5, z
Expand

200CHKBITUFITS#B500arithm_logicalB500CHKBITx - x26/76Checks whether x is a binary digit (i.e., zero or one).0xB5, 0x00
Expand

201FITSX#B600arithm_logicalB600FITSXx c - x26/76Checks whether x is a c-bit signed integer for 0 <= c <= 1023.0xB6, 0x00
Expand

202UFITSX#B601arithm_logicalB601UFITSXx c - x26/76Checks whether x is a c-bit unsigned integer for 0 <= c <= 1023.0xB6, 0x01
Expand

203BITSIZE#B602arithm_logicalB602BITSIZEx - c26Computes smallest c >= 0 such that x fits into a c-bit signed integer (-2^(c-1) <= c < 2^(c-1)).0xB6, 0x02
Expand

204UBITSIZE#B603arithm_logicalB603UBITSIZEx - c26Computes smallest c >= 0 such that x fits into a c-bit unsigned integer (0 <= x < 2^c), or throws a range check exception.0xB6, 0x03
Expand

205MIN#B608arithm_logicalB608MINx y - x or y26Computes the minimum of two integers x and y.0xB6, 0x08
Expand

206MAX#B609arithm_logicalB609MAXx y - x or y26Computes the maximum of two integers x and y.0xB6, 0x09
Expand

207MINMAX#B60Aarithm_logicalB60AMINMAXx y - x y or y x26Sorts two integers. Quiet version of this operation returns two NaNs if any of the arguments are NaNs.0xB6, 0x0A
Expand

INTSORT2
208ABS#B60Barithm_logicalB60BABSx - |x|26Computes the absolute value of an integer x.0xB6, 0x0B
Expand

209QUIET#B7 xx:uint8arthim_quietB7xxQUIETprefix, transforming any arithmetic operation into its "quiet" variant, indicated by prefixing a Q to its mnemonic. Such operations return NaNs instead of throwing integer overflow exceptions if the results do not fit in Integer's, or if one of their arguments is a NaN. Notice that this does not extend to shift amounts and other parameters that must be within a small range (e.g., 0-1023). Also notice that this does not disable type-checking exceptions if a value of a type other than Integer is supplied.
Expand

210QADD#B7A0arithm_quietB7A0QADDx y - x+y26Always works if x and y are Integers, but returns a NaN if the addition cannot be performed.0xB7, 0xA0
Expand

211QSUB#B7A1arithm_quietB7A1QSUBx y - x-y260xB7, 0xA1
Expand

212QSUBR#B7A2arithm_quietB7A2QSUBRx y - y-x260xB7, 0xA2
Expand

213QNEGATE#B7A3arithm_quietB7A3QNEGATEx - -x260xB7, 0xA3
Expand

214QINC#B7A4arithm_quietB7A4QINCx - x+1260xB7, 0xA4
Expand

215QDEC#B7A5arithm_quietB7A5QDECx - x-1260xB7, 0xA5
Expand

216QMUL#B7A8arithm_quietB7A8QMULx y - x*y260xB7, 0xA8
Expand

217QDIV#B7A904arithm_quietB7A904QDIVx y - q34Division returns NaN if y=0.0xB7, 0xA9, 0x04
Expand

218QDIVR#B7A905arithm_quietB7A905QDIVRx y - q’340xB7, 0xA9, 0x05
Expand

219QDIVC#B7A906arithm_quietB7A906QDIVCx y - q''340xB7, 0xA9, 0x06
Expand

220QMOD#B7A908arithm_quietB7A908QMODx y - r340xB7, 0xA9, 0x08
Expand

221QDIVMOD#B7A90Carithm_quietB7A90CQDIVMODx y - q r340xB7, 0xA9, 0x0C
Expand

222QDIVMODR#B7A90Darithm_quietB7A90DQDIVMODRx y - q' r'340xB7, 0xA9, 0x0D
Expand

223QDIVMODC#B7A90Earithm_quietB7A90EQDIVMODCx y - q'' r''340xB7, 0xA9, 0x0E
Expand

224QMULDIVR#B7A985arithm_quietB7A985QMULDIVRx y z - q'340xB7, 0xA9, 0x85
Expand

225QMULDIVMOD#B7A98Carithm_quietB7A98CQMULDIVMODx y z - q r340xB7, 0xA9, 0x8C
Expand

226QLSHIFT#B7ACarithm_quietB7ACQLSHIFTx y - x*2^y260xB7, 0xAC
Expand

227QRSHIFT#B7ADarithm_quietB7ADQRSHIFTx y - floor(x/2^y)260xB7, 0xAD
Expand

228QPOW2#B7AEarithm_quietB7AEQPOW2y - 2^y260xB7, 0xAE
Expand

229QAND#B7B0arithm_quietB7B0QANDx y - x&y26Bitwise and (similar to AND), but returns a NaN if either x or y is a NaN instead of throwing an integer overflow exception. However, if one of the arguments is zero, and the other is a NaN, the result is zero.0xB7, 0xB0
Expand

230QOR#B7B1arithm_quietB7B1QORx y - x|y26Bitwise or. If x = -1 or y = -1, the result is always -1, even if the other argument is a NaN.0xB7, 0xB1
Expand

231QXOR#B7B2arithm_quietB7B2QXORx y - x xor y260xB7, 0xB2
Expand

232QNOT#B7B3arithm_quietB7B3QNOTx - ~x260xB7, 0xB3
Expand

233QFITS#B7B4 cc:uint8arithm_quietB7B4cc[cc+1] QFITSx - x34Replaces x with a NaN if x is not a cc+1-bit signed integer, leaves it intact otherwise.[z = parse_const_u8_plus_one] 0xB7, 0xB4, z
Expand

234QUFITS#B7B5 cc:uint8arithm_quietB7B5cc[cc+1] QUFITSx - x34Replaces x with a NaN if x is not a cc+1-bit unsigned integer, leaves it intact otherwise.[z = parse_const_u8_plus_one] 0xB7, 0xB5, z
Expand

235QUFITS_8#B7B507arithm_quietB7B507[8] QUFITSx - x'34Checks whether x is an unsigned byte (i.e., whether 0 <= x < 2^8), and replaces x with a NaN if this is not the case; leaves x intact otherwise (i.e., if x is an unsigned byte).
Expand

236QFITSX#B7B600arithm_quietB7B600QFITSXx c - x34Replaces x with a NaN if x is not a c-bit signed integer, leaves it intact otherwise.0xB7, 0xB6, 0x00
Expand

237QUFITSX#B7B601arithm_quietB7B601QUFITSXx c - x34Replaces x with a NaN if x is not a c-bit unsigned integer, leaves it intact otherwise.0xB7, 0xB6, 0x01
Expand

238SGN#B8compare_intB8SGNx - sgn(x)18Computes the sign of an integer x:0xB8
Expand

-1 if x<0, 0 if x=0, 1 if x>0.
239LESS#B9compare_intB9LESSx y - x<y18Returns -1 if x<y, 0 otherwise.0xB9
Expand

240EQUAL#BAcompare_intBAEQUALx y - x=y18Returns -1 if x=y, 0 otherwise.0xBA
Expand

241LEQ#BBcompare_intBBLEQx y - x<=y180xBB
Expand

242GREATER#BCcompare_intBCGREATERx y - x>y180xBC
Expand

243NEQ#BDcompare_intBDNEQx y - x!=y18Equivalent to EQUAL NOT.0xBD
Expand

244GEQ#BEcompare_intBEGEQx y - x>=y18Equivalent to LESS NOT.0xBE
Expand

245CMP#BFcompare_intBFCMPx y - sgn(x-y)18Computes the sign of x-y:0xBF
Expand

-1 if x<y, 0 if x=y, 1 if x>y.
No integer overflow can occur here unless x or y is a NaN.
246EQINT#C0 yy:int8compare_intC0yy[yy] EQINTx - x=yy26Returns -1 if x=yy, 0 otherwise.[z = parse_const_i8] 0xC0, z
Expand

-2^7 <= yy < 2^7.
247ISZEROEQINT#C000compare_intC000ISZEROx - x=026Checks whether an integer is zero. Corresponds to Forth's 0=.0xC0, 0x00
Expand

248LESSINT#C1 yy:int8compare_intC1yy[yy] LESSINTx - x<yy26Returns -1 if x<yy, 0 otherwise.[z = parse_const_i8] 0xC1, z
Expand

[yy-1] LEQINT-2^7 <= yy < 2^7.
249ISNEGLESSINT#C100compare_intC100ISNEGx - x<026Checks whether an integer is negative. Corresponds to Forth's 0<.0xC1, 0x00
Expand

250ISNPOSLESSINT#C101compare_intC101ISNPOSx - x<=026Checks whether an integer is non-positive.0xC1, 0x01
Expand

251GTINT#C2 yy:int8compare_intC2yy[yy] GTINTx - x>yy26Returns -1 if x>yy, 0 otherwise.[z = parse_const_i8] 0xC2, z
Expand

[yy+1] GEQINT-2^7 <= yy < 2^7.
252ISPOSGTINT#C200compare_intC200ISPOSx - x>026Checks whether an integer is positive. Corresponds to Forth's 0>.0xC2, 0x00
Expand

253ISNNEGGTINT#C2FFcompare_intC2FFISNNEGx - x >=026Checks whether an integer is non-negative.0xC2, 0xFF
Expand

254NEQINT#C3 yy:int8compare_intC3yy[yy] NEQINTx - x!=yy26Returns -1 if x!=yy, 0 otherwise.[z = parse_const_i8] 0xC3, z
Expand

-2^7 <= yy < 2^7.
255ISNAN#C4compare_intC4ISNANx - x=NaN18Checks whether x is a NaN.0xC4
Expand

256CHKNAN#C5compare_intC5CHKNANx - x18/68Throws an arithmetic overflow exception if x is a NaN.0xC5
Expand

257SEMPTY#C700compare_otherC700SEMPTYs - ?26Checks whether a Slice s is empty (i.e., contains no bits of data and no cell references).0xC7, 0x00
Expand

258SDEMPTY#C701compare_otherC701SDEMPTYs - ?26Checks whether Slice s has no bits of data.0xC7, 0x01
Expand

259SREMPTY#C702compare_otherC702SREMPTYs - ?26Checks whether Slice s has no references.0xC7, 0x02
Expand

260SDFIRST#C703compare_otherC703SDFIRSTs - ?26Checks whether the first bit of Slice s is a one.0xC7, 0x03
Expand

261SDLEXCMP#C704compare_otherC704SDLEXCMPs s' - x26Compares the data of s lexicographically with the data of s', returning -1, 0, or 1 depending on the result.0xC7, 0x04
Expand

262SDEQ#C705compare_otherC705SDEQs s' - ?26Checks whether the data parts of s and s' coincide, equivalent to SDLEXCMP ISZERO.0xC7, 0x05
Expand

263SDPFX#C708compare_otherC708SDPFXs s' - ?26Checks whether s is a prefix of s'.0xC7, 0x08
Expand

264SDPFXREV#C709compare_otherC709SDPFXREVs s' - ?26Checks whether s' is a prefix of s, equivalent to SWAP SDPFX.0xC7, 0x09
Expand

265SDPPFX#C70Acompare_otherC70ASDPPFXs s' - ?26Checks whether s is a proper prefix of s' (i.e., a prefix distinct from s').0xC7, 0x0A
Expand

266SDPPFXREV#C70Bcompare_otherC70BSDPPFXREVs s' - ?26Checks whether s' is a proper prefix of s.0xC7, 0x0B
Expand

267SDSFX#C70Ccompare_otherC70CSDSFXs s' - ?26Checks whether s is a suffix of s'.0xC7, 0x0C
Expand

268SDSFXREV#C70Dcompare_otherC70DSDSFXREVs s' - ?26Checks whether s' is a suffix of s.0xC7, 0x0D
Expand

269SDPSFX#C70Ecompare_otherC70ESDPSFXs s' - ?26Checks whether s is a proper suffix of s'.0xC7, 0x0E
Expand

270SDPSFXREV#C70Fcompare_otherC70FSDPSFXREVs s' - ?26Checks whether s' is a proper suffix of s.0xC7, 0x0F
Expand

271SDCNTLEAD0#C710compare_otherC710SDCNTLEAD0s - n26Returns the number of leading zeroes in s.0xC7, 0x10
Expand

272SDCNTLEAD1#C711compare_otherC711SDCNTLEAD1s - n26Returns the number of leading ones in s.0xC7, 0x11
Expand

273SDCNTTRAIL0#C712compare_otherC712SDCNTTRAIL0s - n26Returns the number of trailing zeroes in s.0xC7, 0x12
Expand

274SDCNTTRAIL1#C713compare_otherC713SDCNTTRAIL1s - n26Returns the number of trailing ones in s.0xC7, 0x13
Expand

275DIFF#C714diff_operationC714DIFFc c - c26Calculates diff between first and second parameters and returns it as cell.0xC7, 0x14
Expand

276DIFF_PATCH#C715diff_operationC715DIFF_PATCHc c - c26Takes the first parameter as document, the second parameter as patch, received on DIFF command, applies patch and saves result document to cell.0xC7, 0x15
Expand

277ZIP#C716diff_operationC716ZIPc - c26Zip string to cell0xC7, 0x16
Expand

278UNZIP#C717diff_operationC717UNZIPc - c26Unzip cell to string0xC7, 0x17
Expand

279DIFF_ZIP#C718diff_operationC718DIFF_ZIPc c - c26like DIFF but unzip parameters before operation and zip to cell after operation.0xC7, 0x18
Expand

280DIFF_PATCH_ZIP#C719diff_operationC719DIFF_PATCH_ZIPc c - c26like DIFF_PATCH but unzip parameters before operation and zip to cell after operation.0xC7, 0x19
Expand

281DIFF_PATCH_Q#C720diff_operationC720DIFF_PATCH_Qc c - c26quiet version of DIFF_PATCH0xC7, 0x20
Expand

282DIFF_PATCH_ZIPQ#C721diff_operationC721DIFF_PATCH_ZIPQc c - c26quiet version of DIFF_PATCH_ZIP0xC7, 0x21
Expand

283DIFF_PATCH_BINARY#C722diff_operationC722DIFF_PATCH_BINARYc c - c26like DIFF_PATCH but takes and returns binary arrays instead of string.0xC7, 0x22
Expand

284DIFF_PATCH_BINARY_ZIP#C723diff_operationC723DIFF_PATCH_BINARY_ZIPc c - c26like DIFF_PATCH_ZIP but takes and returns binary arrays instead of string.0xC7, 0x23
Expand

285DIFF_PATCH_BINARYQ#C724diff_operationC724DIFF_PATCH_BINARYQc c - c26like DIFF_PATCHQ but takes and returns binary arrays instead of string.0xC7, 0x24
Expand

286DIFF_PATCH_BINARY_ZIPQ#C725diff_operationC725DIFF_PATCH_BINARY_ZIPQc c - c26like DIFF_PATCH_ZIPQ but takes and returns binary arrays instead of string.0xC7, 0x25
Expand

287NEWC#C8cell_buildC8NEWC- b18Creates a new empty Builder.0xC8
Expand

288ENDC#C9cell_buildC9ENDCb - c518Converts a Builder into an ordinary Cell.0xC9
Expand

289STI#CA cc:uint8cell_buildCAcc[cc+1] STIx b - b'26Stores a signed cc+1-bit integer x into Builder b for 0 <= cc <= 255, throws a range check exception if x does not fit into cc+1 bits.[z = parse_const_u8_plus_one] 0xCA, z
Expand

290STU#CB cc:uint8cell_buildCBcc[cc+1] STUx b - b'26Stores an unsigned cc+1-bit integer x into Builder b. In all other respects it is similar to STI.[z = parse_const_u8_plus_one] 0xCB, z
Expand

291STREF#CCcell_buildCCSTREFc b - b'18Stores a reference to Cell c into Builder b.0xCC
Expand

292STBREFR#CDcell_buildCDSTBREFRb b'' - b518Equivalent to ENDC SWAP STREF.0xCD
Expand

ENDCST
293STSLICE#CEcell_buildCESTSLICEs b - b'18Stores Slice s into Builder b.0xCE
Expand

294STIX#CF00cell_buildCF00STIXx b l - b'26Stores a signed l-bit integer x into b for 0 <= l <= 257.0xCF, 0x00
Expand

295STUX#CF01cell_buildCF01STUXx b l - b'26Stores an unsigned l-bit integer x into b for 0 <= l <= 256.0xCF, 0x01
Expand

296STIXR#CF02cell_buildCF02STIXRb x l - b'26Similar to STIX, but with arguments in a different order.0xCF, 0x02
Expand

297STUXR#CF03cell_buildCF03STUXRb x l - b'26Similar to STUX, but with arguments in a different order.0xCF, 0x03
Expand

298STIXQ#CF04cell_buildCF04STIXQx b l - x b f or b' 026A quiet version of STIX. If there is no space in b, sets b'=b and f=-1.0xCF, 0x04
Expand

If x does not fit into l bits, sets b'=b and f=1.
If the operation succeeds, b' is the new Builder and f=0.
However, 0 <= l <= 257, with a range check exception if this is not so.
299STUXQ#CF05cell_buildCF05STUXQx b l - x b f or b' 026A quiet version of STUX.0xCF, 0x05
Expand

300STIXRQ#CF06cell_buildCF06STIXRQb x l - b x f or b' 026A quiet version of STIXR.0xCF, 0x06
Expand

301STUXRQ#CF07cell_buildCF07STUXRQb x l - b x f or b' 026A quiet version of STUXR.0xCF, 0x07
Expand

302STI_ALT#CF08 cc:uint8cell_buildCF08cc[cc+1] STI_lx b - b'34A longer version of [cc+1] STI.
Expand

303STU_ALT#CF09 cc:uint8cell_buildCF09cc[cc+1] STU_lx b - b'34A longer version of [cc+1] STU.
Expand

304STIR#CF0A cc:uint8cell_buildCF0Acc[cc+1] STIRb x - b'34Equivalent to SWAP [cc+1] STI.[z = parse_const_u8_plus_one] 0xCF, 0x0A, z
Expand

305STUR#CF0B cc:uint8cell_buildCF0Bcc[cc+1] STURb x - b'34Equivalent to SWAP [cc+1] STU.[z = parse_const_u8_plus_one] 0xCF, 0x0B, z
Expand

306STIQ#CF0C cc:uint8cell_buildCF0Ccc[cc+1] STIQx b - x b f or b' 034A quiet version of STI.[z = parse_const_u8_plus_one] 0xCF, 0x0C, z
Expand

307STUQ#CF0D cc:uint8cell_buildCF0Dcc[cc+1] STUQx b - x b f or b' 034A quiet version of STU.[z = parse_const_u8_plus_one] 0xCF, 0x0D, z
Expand

308STIRQ#CF0E cc:uint8cell_buildCF0Ecc[cc+1] STIRQb x - b x f or b' 034A quiet version of STIR.[z = parse_const_u8_plus_one] 0xCF, 0x0E, z
Expand

309STURQ#CF0F cc:uint8cell_buildCF0Fcc[cc+1] STURQb x - b x f or b' 034A quiet version of STUR.[z = parse_const_u8_plus_one] 0xCF, 0x0F, z
Expand

310STREF_ALT#CF10cell_buildCF10STREF_lc b - b'26A longer version of STREF.0xCF, 0x10
Expand

311STBREF#CF11cell_buildCF11STBREFb' b - b''526Equivalent to SWAP STBREFR.0xCF, 0x11
Expand

312STSLICE_ALT#CF12cell_buildCF12STSLICE_ls b - b'26A longer version of STSLICE.0xCF, 0x12
Expand

313STB#CF13cell_buildCF13STBb' b - b''26Appends all data from Builder b' to Builder b.0xCF, 0x13
Expand

314STREFR#CF14cell_buildCF14STREFRb c - b'26Equivalent to SWAP STREF.0xCF, 0x14
Expand

315STBREFR_ALT#CF15cell_buildCF15STBREFR_lb b' - b''526A longer encoding of STBREFR.0xCF, 0x15
Expand

316STSLICER#CF16cell_buildCF16STSLICERb s - b'26Equivalent to SWAP STSLICE.0xCF, 0x16
Expand

317STBR#CF17cell_buildCF17STBRb b' - b''26Concatenates two builders.0xCF, 0x17
Expand

BCONCATEquivalent to SWAP STB.
318STREFQ#CF18cell_buildCF18STREFQc b - c b -1 or b' 026Quiet version of STREF.0xCF, 0x18
Expand

319STBREFQ#CF19cell_buildCF19STBREFQb' b - b' b -1 or b'' 0526Quiet version of STBREF.0xCF, 0x19
Expand

320STSLICEQ#CF1Acell_buildCF1ASTSLICEQs b - s b -1 or b' 026Quiet version of STSLICE.0xCF, 0x1A
Expand

321STBQ#CF1Bcell_buildCF1BSTBQb' b - b' b -1 or b'' 026Quiet version of STB.0xCF, 0x1B
Expand

322STREFRQ#CF1Ccell_buildCF1CSTREFRQb c - b c -1 or b' 026Quiet version of STREFR.0xCF, 0x1C
Expand

323STBREFRQ#CF1Dcell_buildCF1DSTBREFRQb b' - b b' -1 or b'' 0526Quiet version of STBREFR.0xCF, 0x1D
Expand

324STSLICERQ#CF1Ecell_buildCF1ESTSLICERQb s - b s -1 or b'' 026Quiet version of STSLICER.0xCF, 0x1E
Expand

325STBRQ#CF1Fcell_buildCF1FSTBRQb b' - b b' -1 or b'' 026Quiet version of STBR.0xCF, 0x1F
Expand

BCONCATQ
326STREFCONST#CF20 c:^Cellcell_buildCF20[ref] STREFCONSTb - b’26Equivalent to PUSHREF STREFR.0xCF, 0x20
Expand

327STREF2CONST#CF21 c1:^Cell c2:^Cellcell_buildCF21[ref][ref] STREF2CONSTb - b’26Equivalent to STREFCONST STREFCONST.0xCF, 0x21
Expand

328ENDXC#CF23cell_buildCF23b x - c526If x!=0, creates a special or exotic cell from Builder b.0xCF, 0x23
Expand

The type of the exotic cell must be stored in the first 8 bits of b.
If x=0, it is equivalent to ENDC. Otherwise some validity checks on the data and references of b are performed before creating the exotic cell.
329STILE4#CF28cell_buildCF28STILE4x b - b'26Stores a little-endian signed 32-bit integer.0xCF, 0x28
Expand

330STULE4#CF29cell_buildCF29STULE4x b - b'26Stores a little-endian unsigned 32-bit integer.0xCF, 0x29
Expand

331STILE8#CF2Acell_buildCF2ASTILE8x b - b'26Stores a little-endian signed 64-bit integer.0xCF, 0x2A
Expand

332STULE8#CF2Bcell_buildCF2BSTULE8x b - b'26Stores a little-endian unsigned 64-bit integer.0xCF, 0x2B
Expand

333BDEPTH#CF30cell_buildCF30BDEPTHb - x26Returns the depth of Builder b. If no cell references are stored in b, then x=0; otherwise x is one plus the maximum of depths of cells referred to from b.0xCF, 0x30
Expand

334BBITS#CF31cell_buildCF31BBITSb - x26Returns the number of data bits already stored in Builder b.0xCF, 0x31
Expand

335BREFS#CF32cell_buildCF32BREFSb - y26Returns the number of cell references already stored in b.0xCF, 0x32
Expand

336BBITREFS#CF33cell_buildCF33BBITREFSb - x y26Returns the numbers of both data bits and cell references in b.0xCF, 0x33
Expand

337BREMBITS#CF35cell_buildCF35BREMBITSb - x'26Returns the number of data bits that can still be stored in b.0xCF, 0x35
Expand

338BREMREFS#CF36cell_buildCF36BREMREFSb - y'26Returns the number of references that can still be stored in b.0xCF, 0x36
Expand

339BREMBITREFS#CF37cell_buildCF37BREMBITREFSb - x' y'26Returns the numbers of both data bits and references that can still be stored in b.0xCF, 0x37
Expand

340BCHKBITS#CF38 cc:uint8cell_buildCF38cc[cc+1] BCHKBITS#b -34/84Checks whether cc+1 bits can be stored into b, where 0 <= cc <= 255.
Expand

341BCHKBITS_VAR#CF39cell_buildCF39BCHKBITSb x -26/76Checks whether x bits can be stored into b, 0 <= x <= 1023. If there is no space for x more bits in b, or if x is not within the range 0...1023, throws an exception.0xCF, 0x39
Expand

342BCHKREFS#CF3Acell_buildCF3ABCHKREFSb y -26/76Checks whether y references can be stored into b, 0 <= y <= 7.0xCF, 0x3A
Expand

343BCHKBITREFS#CF3Bcell_buildCF3BBCHKBITREFSb x y -26/76Checks whether x bits and y references can be stored into b, 0 <= x <= 1023, 0 <= y <= 7.0xCF, 0x3B
Expand

344BCHKBITSQ#CF3C cc:uint8cell_buildCF3Ccc[cc+1] BCHKBITSQ#b - ?34Checks whether cc+1 bits can be stored into b, where 0 <= cc <= 255.
Expand

345BCHKBITSQ_VAR#CF3Dcell_buildCF3DBCHKBITSQb x - ?26Checks whether x bits can be stored into b, 0 <= x <= 1023.0xCF, 0x3D
Expand

346BCHKREFSQ#CF3Ecell_buildCF3EBCHKREFSQb y - ?26Checks whether y references can be stored into b, 0 <= y <= 7.0xCF, 0x3E
Expand

347BCHKBITREFSQ#CF3Fcell_buildCF3FBCHKBITREFSQb x y - ?26Checks whether x bits and y references can be stored into b, 0 <= x <= 1023, 0 <= y <= 7.0xCF, 0x3F
Expand

348STZEROES#CF40cell_buildCF40STZEROESb n - b'26Stores n binary zeroes into Builder b.0xCF, 0x40
Expand

349STONES#CF41cell_buildCF41STONESb n - b'26Stores n binary ones into Builder b.0xCF, 0x41
Expand

350STSAME#CF42cell_buildCF42STSAMEb n x - b'26Stores n binary xes (0 <= x <= 1) into Builder b.0xCF, 0x42
Expand

351STCONT#CF43cell_buildCF43STCONTcont b - b'26Stores Continuation cont into Builder b.0xCF, 0x43
Expand

352STSLICECONST#CFC0_ x:(## 2) y:(## 3) c:(x ^Cell) sss:((8 y + 2) * Bit)cell_buildCFC0_xysss[slice] STSLICECONSTb - b'24Stores a constant subslice sss.
Expand

Details: sss consists of 0 <= x <= 3 references and up to 8y+2 data bits, with 0 <= y <= 7. Completion bit is assumed.
Note that the assembler can replace STSLICECONST with PUSHSLICE STSLICER if the slice is too big.
353STZEROSTSLICECONST#CF81cell_buildCF81STZEROb - b'24Stores one binary zero.0xCF, 0x81
Expand

354STONESTSLICECONST#CF83cell_buildCF83STONEb - b'24Stores one binary one.0xCF, 0x83
Expand

355CTOS#D0cell_parseD0CTOSc - s118/43Converts a Cell into a Slice. Notice that c must be either an ordinary cell, or an exotic cell which is automatically loaded to yield an ordinary cell c', converted into a Slice afterwards.0xD0
Expand

356ENDS#D1cell_parseD1ENDSs -18/68Removes a Slice s from the stack, and throws an exception if it is not empty.0xD1
Expand

357LDI#D2 cc:uint8cell_parseD2cc[cc+1] LDIs - x s'26Loads (i.e., parses) a signed cc+1-bit integer x from Slice s, and returns the remainder of s as s'.
Expand

358LDU#D3 cc:uint8cell_parseD3cc[cc+1] LDUs - x s'26Loads an unsigned cc+1-bit integer x from Slice s.[cc = parse_const_u8_plus_one] 0xD2, cc
Expand

359LDREF#D4cell_parseD4LDREFs - c s'18Loads a cell reference c from s.0xD4
Expand

360LDREFRTOS#D5cell_parseD5LDREFRTOSs - s' s''118/43Equivalent to LDREF SWAP CTOS.0xD5
Expand

361LDSLICE#D6 cc:uint8cell_parseD6cc[cc+1] LDSLICEs - s'' s'26Cuts the next cc+1 bits of s into a separate Slice s''.[cc = parse_const_u8_plus_one] 0xD6, cc
Expand

362LDIX#D700cell_parseD700LDIXs l - x s'26Loads a signed l-bit (0 <= l <= 257) integer x from Slice s, and returns the remainder of s as s'.0xD7, 0x00
Expand

363LDUX#D701cell_parseD701LDUXs l - x s'26Loads an unsigned l-bit integer x from (the first l bits of) s, with 0 <= l <= 256.0xD7, 0x01
Expand

364PLDIX#D702cell_parseD702PLDIXs l - x26Preloads a signed l-bit integer from Slice s, for 0 <= l <= 257.0xD7, 0x02
Expand

365PLDUX#D703cell_parseD703PLDUXs l - x26Preloads an unsigned l-bit integer from s, for 0 <= l <= 256.0xD7, 0x03
Expand

366LDIXQ#D704cell_parseD704LDIXQs l - x s' -1 or s 026Quiet version of LDIX: loads a signed l-bit integer from s similarly to LDIX, but returns a success flag, equal to -1 on success or to 0 on failure (if s does not have l bits), instead of throwing a cell underflow exception.0xD7, 0x04
Expand

367LDUXQ#D705cell_parseD705LDUXQs l - x s' -1 or s 026Quiet version of LDUX.0xD7, 0x05
Expand

368PLDIXQ#D706cell_parseD706PLDIXQs l - x -1 or 026Quiet version of PLDIX.0xD7, 0x06
Expand

369PLDUXQ#D707cell_parseD707PLDUXQs l - x -1 or 026Quiet version of PLDUX.0xD7, 0x08
Expand

370LDI_ALT#D708 cc:uint8cell_parseD708cc[cc+1] LDI_ls - x s'34A longer encoding for LDI.
Expand

371LDU_ALT#D709 cc:uint8cell_parseD709cc[cc+1] LDU_ls - x s'34A longer encoding for LDU.
Expand

372PLDI#D70A cc:uint8cell_parseD70Acc[cc+1] PLDIs - x34Preloads a signed cc+1-bit integer from Slice s.[cc = parse_const_u8_plus_one] 0xD7, 0x0A, cc
Expand

373PLDU#D70B cc:uint8cell_parseD70Bcc[cc+1] PLDUs - x34Preloads an unsigned cc+1-bit integer from s.[cc = parse_const_u8_plus_one] 0xD7, 0x0B, cc
Expand

374LDIQ#D70C cc:uint8cell_parseD70Ccc[cc+1] LDIQs - x s' -1 or s 034A quiet version of LDI.[cc = parse_const_u8_plus_one] 0xD7, 0x0C, cc
Expand

375LDUQ#D70D cc:uint8cell_parseD70Dcc[cc+1] LDUQs - x s' -1 or s 034A quiet version of LDU.[cc = parse_const_u8_plus_one] 0xD7, 0x0D, cc
Expand

376PLDIQ#D70E cc:uint8cell_parseD70Ecc[cc+1] PLDIQs - x -1 or 034A quiet version of PLDI.[cc = parse_const_u8_plus_one] 0xD7, 0x0E, cc
Expand

377PLDUQ#D70F cc:uint8cell_parseD70Fcc[cc+1] PLDUQs - x -1 or 034A quiet version of PLDU.[cc = parse_const_u8_plus_one] 0xD7, 0x0F, cc
Expand

378PLDUZ#D714_ c:uint3cell_parseD714_c[32(c+1)] PLDUZs - s x26Preloads the first 32(c+1) bits of Slice s into an unsigned integer x, for 0 <= c <= 7. If s is shorter than necessary, missing bits are assumed to be zero. This operation is intended to be used along with IFBITJMP and similar instructions.[c = parse_plduz_parameter] 0xD7, 0x10 | c
Expand

379LDSLICEX#D718cell_parseD718LDSLICEXs l - s'' s'26Loads the first 0 <= l <= 1023 bits from Slice s into a separate Slice s'', returning the remainder of s as s'.0xD7, 0x18
Expand

380PLDSLICEX#D719cell_parseD719PLDSLICEXs l - s''26Returns the first 0 <= l <= 1023 bits of s as s''.0xD7, 0x19
Expand

381LDSLICEXQ#D71Acell_parseD71ALDSLICEXQs l - s'' s' -1 or s 026A quiet version of LDSLICEX.0xD7, 0x1A
Expand

382PLDSLICEXQ#D71Bcell_parseD71BPLDSLICEXQs l - s' -1 or 026A quiet version of LDSLICEXQ.0xD7, 0x1B
Expand

383LDSLICE_ALT#D71C cc:uint8cell_parseD71Ccc[cc+1] LDSLICE_ls - s'' s'34A longer encoding for LDSLICE.
Expand

384PLDSLICE#D71D cc:uint8cell_parseD71Dcc[cc+1] PLDSLICEs - s''34Returns the first 0 < cc+1 <= 256 bits of s as s''.[cc = parse_const_u8_plus_one] 0xD7, 0x1D, cc
Expand

385LDSLICEQ#D71E cc:uint8cell_parseD71Ecc[cc+1] LDSLICEQs - s'' s' -1 or s 034A quiet version of LDSLICE.[cc = parse_const_u8_plus_one] 0xD7, 0x1E, cc
Expand

386PLDSLICEQ#D71F cc:uint8cell_parseD71Fcc[cc+1] PLDSLICEQs - s'' -1 or 034A quiet version of PLDSLICE.[cc = parse_const_u8_plus_one] 0xD7, 0x1F, cc
Expand

387SDCUTFIRST#D720cell_parseD720SDCUTFIRSTs l - s'26Returns the first 0 <= l <= 1023 bits of s. It is equivalent to PLDSLICEX.0xD7, 0x20
Expand

388SDSKIPFIRST#D721cell_parseD721SDSKIPFIRSTs l - s'26Returns all but the first 0 <= l <= 1023 bits of s. It is equivalent to LDSLICEX NIP.0xD7, 0x21
Expand

389SDCUTLAST#D722cell_parseD722SDCUTLASTs l - s'26Returns the last 0 <= l <= 1023 bits of s.0xD7, 0x22
Expand

390SDSKIPLAST#D723cell_parseD723SDSKIPLASTs l - s'26Returns all but the last 0 <= l <= 1023 bits of s.0xD7, 0x23
Expand

391SDSUBSTR#D724cell_parseD724SDSUBSTRs l l' - s'26Returns 0 <= l' <= 1023 bits of s starting from offset 0 <= l <= 1023, thus extracting a bit substring out of the data of s.0xD7, 0x24
Expand

392SDBEGINSX#D726cell_parseD726SDBEGINSXs s' - s''26Checks whether s begins with (the data bits of) s', and removes s' from s on success. On failure throws a cell deserialization exception. Primitive SDPFXREV can be considered a quiet version of SDBEGINSX.0xD7, 0x26
Expand

393SDBEGINSXQ#D727cell_parseD727SDBEGINSXQs s' - s'' -1 or s 026A quiet version of SDBEGINSX.0xD7, 0x27
Expand

394SDBEGINS#D72A_ x:(## 7) sss:((8 x + 3) Bit)cell_parseD72A_xsss[slice] SDBEGINSs - s''31Checks whether s begins with constant bitstring sss of length 8x+3 (with continuation bit assumed), where 0 <= x <= 127, and removes sss from s on success.
Expand

395SDBEGINS_0#D72802cell_parseD72802[0] SDBEGINSs - s''31Checks whether s begins with a binary zero.
Expand

396SDBEGINS_1#D72806cell_parseD72802[1] SDBEGINSs - s''31Checks whether s begins with a binary one.
Expand

397SDBEGINSQ#D72E_ x:(## 7) sss:((8 x + 3) Bit)cell_parseD72E_xsss[slice] SDBEGINSQs - s'' -1 or s 031A quiet version of SDBEGINS.
Expand

398SCUTFIRST#D730cell_parseD730SCUTFIRSTs l r - s'26Returns the first 0 <= l <= 1023 bits and first 0 <= r <= 4 references of s.0xD7, 0x30
Expand

399SSKIPFIRST#D731cell_parseD731SSKIPFIRSTs l r - s'26Returns all but the first l bits of s and r references of s.0xD7, 0x31
Expand

400SCUTLAST#D732cell_parseD732SCUTLASTs l r - s'26Returns the last 0 <= l <= 1023 data bits and last 0 <= r <= 4 references of s.0xD7, 0x32
Expand

401SSKIPLAST#D733cell_parseD733SSKIPLASTs l r - s'26Returns all but the last l bits of s and r references of s.0xD7, 0x33
Expand

402SUBSLICE#D734cell_parseD734SUBSLICEs l r l' r' - s'26Returns 0 <= l' <= 1023 bits and 0 <= r' <= 4 references from Slice s, after skipping the first 0 <= l <= 1023 bits and first 0 <= r <= 4 references.0xD7, 0x34
Expand

403SPLIT#D736cell_parseD736SPLITs l r - s' s''26Splits the first 0 <= l <= 1023 data bits and first 0 <= r <= 4 references from s into s', returning the remainder of s as s''.0xD7, 0x36
Expand

404SPLITQ#D737cell_parseD737SPLITQs l r - s' s'' -1 or s 026A quiet version of SPLIT.0xD7, 0x37
Expand

405XCTOS#D739cell_parseD739c - s ?Transforms an ordinary or exotic cell into a Slice, as if it were an ordinary cell. A flag is returned indicating whether c is exotic. If that be the case, its type can later be deserialized from the first eight bits of s.0xD7, 0x39
Expand

406XLOAD#D73Acell_parseD73Ac - c'Loads an exotic cell c and returns an ordinary cell c'. If c is already ordinary, does nothing. If c cannot be loaded, throws an exception.0xD7, 0x3A
Expand

407XLOADQ#D73Bcell_parseD73Bc - c' -1 or c 0Loads an exotic cell c and returns an ordinary cell c'. If c is already ordinary, does nothing. If c cannot be loaded, returns 0.0xD7, 0x3B
Expand

408SCHKBITS#D741cell_parseD741SCHKBITSs l -26/76Checks whether there are at least l data bits in Slice s. If this is not the case, throws a cell deserialisation (i.e., cell underflow) exception.0xD7, 0x41
Expand

409SCHKREFS#D742cell_parseD742SCHKREFSs r -26/76Checks whether there are at least r references in Slice s.0xD7, 0x42
Expand

410SCHKBITREFS#D743cell_parseD743SCHKBITREFSs l r -26/76Checks whether there are at least l data bits and r references in Slice s.0xD7, 0x43
Expand

411SCHKBITSQ#D745cell_parseD745SCHKBITSQs l - ?26Checks whether there are at least l data bits in Slice s.0xD7, 0x45
Expand

412SCHKREFSQ#D746cell_parseD746SCHKREFSQs r - ?26Checks whether there are at least r references in Slice s.0xD7, 0x46
Expand

413SCHKBITREFSQ#D747cell_parseD747SCHKBITREFSQs l r - ?26Checks whether there are at least l data bits and r references in Slice s.0xD7, 0x47
Expand

414PLDREFVAR#D748cell_parseD748PLDREFVARs n - c26Returns the n-th cell reference of Slice s for 0 <= n <= 3.0xD7, 0x48
Expand

415SBITS#D749cell_parseD749SBITSs - l26Returns the number of data bits in Slice s.0xD7, 0x49
Expand

416SREFS#D74Acell_parseD74ASREFSs - r26Returns the number of references in Slice s.0xD7, 0x4A
Expand

417SBITREFS#D74Bcell_parseD74BSBITREFSs - l r26Returns both the number of data bits and the number of references in s.0xD7, 0x4B
Expand

418PLDREFIDX#D74E_ n:uint2cell_parseD74E_n[n] PLDREFIDXs - c26Returns the n-th cell reference of Slice s, where 0 <= n <= 3.[n = parse_const_u2] 0xD7, 0x4C | n
Expand

419PLDREFPLDREFIDX#D74Ccell_parseD74CPLDREFs - c26Preloads the first cell reference of a Slice.0xD7, 0x4C
Expand

420LDILE4#D750cell_parseD750LDILE4s - x s'26Loads a little-endian signed 32-bit integer.0xD7, 0x50
Expand

421LDULE4#D751cell_parseD751LDULE4s - x s'26Loads a little-endian unsigned 32-bit integer.0xD7, 0x51
Expand

422LDILE8#D752cell_parseD752LDILE8s - x s'26Loads a little-endian signed 64-bit integer.0xD7, 0x52
Expand

423LDULE8#D753cell_parseD753LDULE8s - x s'26Loads a little-endian unsigned 64-bit integer.0xD7, 0x53
Expand

424PLDILE4#D754cell_parseD754PLDILE4s - x26Preloads a little-endian signed 32-bit integer.0xD7, 0x54
Expand

425PLDULE4#D755cell_parseD755PLDULE4s - x26Preloads a little-endian unsigned 32-bit integer.0xD7, 0x55
Expand

426PLDILE8#D756cell_parseD756PLDILE8s - x26Preloads a little-endian signed 64-bit integer.0xD7, 0x56
Expand

427PLDULE8#D757cell_parseD757PLDULE8s - x26Preloads a little-endian unsigned 64-bit integer.0xD7, 0x57
Expand

428LDILE4Q#D758cell_parseD758LDILE4Qs - x s' -1 or s 026Quietly loads a little-endian signed 32-bit integer.0xD7, 0x58
Expand

429LDULE4Q#D759cell_parseD759LDULE4Qs - x s' -1 or s 026Quietly loads a little-endian unsigned 32-bit integer.0xD7, 0x59
Expand

430LDILE8Q#D75Acell_parseD75ALDILE8Qs - x s' -1 or s 026Quietly loads a little-endian signed 64-bit integer.0xD7, 0x5A
Expand

431LDULE8Q#D75Bcell_parseD75BLDULE8Qs - x s' -1 or s 026Quietly loads a little-endian unsigned 64-bit integer.0xD7, 0x5B
Expand

432PLDILE4Q#D75Ccell_parseD75CPLDILE4Qs - x -1 or 026Quietly preloads a little-endian signed 32-bit integer.0xD7, 0x5C
Expand

433PLDULE4Q#D75Dcell_parseD75DPLDULE4Qs - x -1 or 026Quietly preloads a little-endian unsigned 32-bit integer.0xD7, 0x5D
Expand

434PLDILE8Q#D75Ecell_parseD75EPLDILE8Qs - x -1 or 026Quietly preloads a little-endian signed 64-bit integer.0xD7, 0x5E
Expand

435PLDULE8Q#D75Fcell_parseD75FPLDULE8Qs - x -1 or 026Quietly preloads a little-endian unsigned 64-bit integer.0xD7, 0x5F
Expand

436LDZEROES#D760cell_parseD760LDZEROESs - n s'26Returns the count n of leading zero bits in s, and removes these bits from s.0xD7, 0x60
Expand

437LDONES#D761cell_parseD761LDONESs - n s'26Returns the count n of leading one bits in s, and removes these bits from s.0xD7, 0x61
Expand

438LDSAME#D762cell_parseD762LDSAMEs x - n s'26Returns the count n of leading bits equal to 0 <= x <= 1 in s, and removes these bits from s.0xD7, 0x62
Expand

439SDEPTH#D764cell_parseD764SDEPTHs - x26Returns the depth of Slice s. If s has no references, then x=0; otherwise x is one plus the maximum of depths of cells referred to from s.0xD7, 0x64
Expand

440CDEPTH#D765cell_parseD765CDEPTHc - x26Returns the depth of Cell c. If c has no references, then x=0; otherwise x is one plus the maximum of depths of cells referred to from c. If c is a Null instead of a Cell, returns zero.0xD7, 0x65
Expand

441LDCONT#D766cell_parseD766LDCONTs - cont s'26Loads a continuation cont from s.0xD7, 0x66
Expand

442EXECUTE#D8cont_basicD8EXECUTEc -18Calls, or executes, continuation c.0xD8
Expand

CALLX
443JMPX#D9cont_basicD9JMPXc -18Jumps, or transfers control, to continuation c.0xD9
Expand

The remainder of the previous current continuation cc is discarded.
444CALLXARGS#DA p:uint4 r:uint4cont_basicDApr[p][r] CALLXARGSc -26Calls continuation c with p parameters and expecting r return values
Expand

0 <= p <= 15, 0 <= r <= 15
445CALLXARGS_VAR#DB0 p:uint4cont_basicDB0p[p] -1 CALLXARGSc -26Calls continuation c with 0 <= p <= 15 parameters, expecting an arbitrary number of return values.
Expand

446JMPXARGS#DB1 p:uint4cont_basicDB1p[p] JMPXARGSc -26Jumps to continuation c, passing only the top 0 <= p <= 15 values from the current stack to it (the remainder of the current stack is discarded).[p = parse_const_u4] 0xDB, 0x10 | p
Expand

447RETARGS#DB2 r:uint4cont_basicDB2r[r] RETARGS26Returns to c0, with 0 <= r <= 15 return values taken from the current stack.[r = parse_const_u4] 0xDB, 0x20 | r
Expand

448RET#DB30cont_basicDB30RET26Returns to the continuation at c0. The remainder of the current continuation cc is discarded.0xDB, 0x30
Expand

RETTRUEApproximately equivalent to c0 PUSHCTR JMPX.
449RETALT#DB31cont_basicDB31RETALT26Returns to the continuation at c1.0xDB, 0x31
Expand

RETFALSEApproximately equivalent to c1 PUSHCTR JMPX.
450BRANCH#DB32cont_basicDB32BRANCHf -26Performs RETTRUE if integer f!=0, or RETFALSE if f=0.0xDB, 0x32
Expand

RETBOOL
451CALLCC#DB34cont_basicDB34CALLCCc -26Call with current continuation, transfers control to c, pushing the old value of cc into c's stack (instead of discarding it or writing it into new c0).0xDB, 0x34
Expand

452JMPXDATA#DB35cont_basicDB35JMPXDATAc -26Similar to CALLCC, but the remainder of the current continuation (the old value of cc) is converted into a Slice before pushing it into the stack of c.0xDB, 0x35
Expand

453CALLCCARGS#DB36 p:uint4 r:uint4cont_basicDB36pr[p][r] CALLCCARGSc -34Similar to CALLXARGS, but pushes the old value of cc (along with the top 0 <= p <= 15 values from the original stack) into the stack of newly-invoked continuation c, setting cc.nargs to -1 <= r <= 14.[c1 = parse_const_u4][c2 = parse_const_i4] 0xDB, 0x36, (c1 << 4) | c2
Expand

454CALLXVARARGS#DB38cont_basicDB38CALLXVARARGSc p r -26Similar to CALLXARGS, but takes -1 <= p,r <= 254 from the stack. The next three operations also take p and r from the stack, both in the range -1...254.0xDB, 0x38
Expand

455RETVARARGS#DB39cont_basicDB39RETVARARGSp r -26Similar to RETARGS.0xDB, 0x39
Expand

456JMPXVARARGS#DB3Acont_basicDB3AJMPXVARARGSc p r -26Similar to JMPXARGS.0xDB, 0x3A
Expand

457CALLCCVARARGS#DB3Bcont_basicDB3BCALLCCVARARGSc p r -26Similar to CALLCCARGS.0xDB, 0x3B
Expand

458CALLREF#DB3C c:^Cellcont_basicDB3C[ref] CALLREF126/51Equivalent to PUSHREFCONT CALLX.
Expand

459JMPREF#DB3D c:^Cellcont_basicDB3D[ref] JMPREF126/51Equivalent to PUSHREFCONT JMPX.
Expand

460JMPREFDATA#DB3E c:^Cellcont_basicDB3E[ref] JMPREFDATA126/51Equivalent to PUSHREFCONT JMPXDATA.0xDB, 0x3E
Expand

461RETDATA#DB3Fcont_basicDB3FRETDATA26Equivalent to c0 PUSHCTR JMPXDATA. In this way, the remainder of the current continuation is converted into a Slice and returned to the caller.0xDB, 0x3F
Expand

462IFRET#DCcont_conditionalDCIFRETf -18Performs a RET, but only if integer f is non-zero. If f is a NaN, throws an integer overflow exception.0xDC
Expand

IFNOT:
463IFNOTRET#DDcont_conditionalDDIFNOTRETf -18Performs a RET, but only if integer f is zero.0xDD
Expand

IF:
464IF#DEcont_conditionalDEIFf c -18Performs EXECUTE for c (i.e., executes c), but only if integer f is non-zero. Otherwise simply discards both values.0xDE
Expand

465cont_conditionalDEIF:<{ code }>f -Equivalent to <{ code }> CONT IF.
Expand

<{ code }>IF
466IFNOT#DFcont_conditionalDFIFNOTf c -18Executes continuation c, but only if integer f is zero. Otherwise simply discards both values.0xDF
Expand

467cont_conditionalDFIFNOT:<{ code }>f -Equivalent to <{ code }> CONT IFNOT.
Expand

<{ code }>IFNOT
468IFJMP#E0cont_conditionalE0IFJMPf c -18Jumps to c (similarly to JMPX), but only if f is non-zero.0xE0
Expand

469cont_conditionalE0IFJMP:<{ code }>f -Equivalent to <{ code }> CONT IFJMP.
Expand

470IFNOTJMP#E1cont_conditionalE1IFNOTJMPf c -18Jumps to c (similarly to JMPX), but only if f is zero.0xE1
Expand

471cont_conditionalE1IFNOTJMP:<{ code }>f -Equivalent to <{ code }> CONT IFNOTJMP.
Expand

472IFELSE#E2cont_conditionalE2IFELSEf c c' -18If integer f is non-zero, executes c, otherwise executes c'. Equivalent to CONDSELCHK EXECUTE.0xE2
Expand

473cont_conditionalE2IF:<{ code1 }>ELSE<{ code2 }>f -Equivalent to <{ code1 }> CONT <{ code2 }> CONT IFELSE.
Expand

474IFREF#E300 c:^Cellcont_conditionalE300[ref] IFREFf -26/126/51Equivalent to PUSHREFCONT IF, with the optimization that the cell reference is not actually loaded into a Slice and then converted into an ordinary Continuation if f=0.
Expand

Gas consumption of this primitive depends on whether f=0 and whether the reference was loaded before.
Similar remarks apply other primitives that accept a continuation as a reference.
475IFNOTREF#E301 c:^Cellcont_conditionalE301[ref] IFNOTREFf -26/126/51Equivalent to PUSHREFCONT IFNOT.
Expand

476IFJMPREF#E302 c:^Cellcont_conditionalE302[ref] IFJMPREFf -26/126/51Equivalent to PUSHREFCONT IFJMP.
Expand

477IFNOTJMPREF#E303 c:^Cellcont_conditionalE303[ref] IFNOTJMPREFf -26/126/51Equivalent to PUSHREFCONT IFNOTJMP.
Expand

478CONDSEL#E304cont_conditionalE304CONDSELf x y - x or y26If integer f is non-zero, returns x, otherwise returns y. Notice that no type checks are performed on x and y; as such, it is more like a conditional stack operation. Roughly equivalent to ROT ISZERO INC ROLLX NIP.0xE3, 0x04
Expand

479CONDSELCHK#E305cont_conditionalE305CONDSELCHKf x y - x or y26Same as CONDSEL, but first checks whether x and y have the same type.0xE3, 0x05
Expand

480IFRETALT#E308cont_conditionalE308IFRETALTf -26Performs RETALT if integer f!=0.0xE3, 0x08
Expand

481IFNOTRETALT#E309cont_conditionalE309IFNOTRETALTf -26Performs RETALT if integer f=0.0xE3, 0x09
Expand

482IFREFELSE#E30D c:^Cellcont_conditionalE30D[ref] IFREFELSEf c -26/126/51Equivalent to PUSHREFCONT SWAP IFELSE, with the optimization that the cell reference is not actually loaded into a Slice and then converted into an ordinary Continuation if f=0. Similar remarks apply to the next two primitives: cells are converted into continuations only when necessary.
Expand

483IFELSEREF#E30E c:^Cellcont_conditionalE30E[ref] IFELSEREFf c -26/126/51Equivalent to PUSHREFCONT IFELSE.
Expand

484IFREFELSEREF#E30F c1:^Cell c2:^Cellcont_conditionalE30F[ref][ref] IFREFELSEREFf -126/51Equivalent to PUSHREFCONT PUSHREFCONT IFELSE.
Expand

485IFBITJMP#E39_ n:uint5cont_conditionalE39_n[n] IFBITJMPx c - x26Checks whether bit 0 <= n <= 31 is set in integer x, and if so, performs JMPX to continuation c. Value x is left in the stack.[n = parse_const_u5] 0xE3, 0x80 | n
Expand

486IFNBITJMP#E3B_ n:uint5cont_conditionalE3B_n[n] IFNBITJMPx c - x26Jumps to c if bit 0 <= n <= 31 is not set in integer x.[n = parse_const_u5] 0xE3, 0xA0 | n
Expand

487IFBITJMPREF#E3D_ n:uint5 c:^Cellcont_conditionalE3D_n[ref][n] IFBITJMPREFx - x126/51Performs a JMPREF if bit 0 <= n <= 31 is set in integer x.[n = parse_const_u5] 0xE3, 0xC0 | n
Expand

488IFNBITJMPREF#E3F_ n:uint5 c:^Cellcont_conditionalE3F_n[ref][n] IFNBITJMPREFx - x126/51Performs a JMPREF if bit 0 <= n <= 31 is not set in integer x.[n = parse_const_u5] 0xE3, 0xE0 | n
Expand

489REPEAT#E4cont_loopsE4REPEATn c -18Executes continuation c n times, if integer n is non-negative. If n>=2^31 or n<-2^31, generates a range check exception.0xE4
Expand

Notice that a RET inside the code of c works as a continue, not as a break. One should use either alternative (experimental) loops or alternative RETALT (along with a SETEXITALT before the loop) to break out of a loop.
490cont_loopsE4REPEAT:<{ code }>n -Equivalent to <{ code }> CONT REPEAT.
Expand

<{ code }>REPEAT
491REPEATEND#E5cont_loopsE5REPEATENDn -18Similar to REPEAT, but it is applied to the current continuation cc.0xE5
Expand

REPEAT:
492UNTIL#E6cont_loopsE6UNTILc -18Executes continuation c, then pops an integer x from the resulting stack. If x is zero, performs another iteration of this loop. The actual implementation of this primitive involves an extraordinary continuation ec_until with its arguments set to the body of the loop (continuation c) and the original current continuation cc. This extraordinary continuation is then saved into the savelist of c as c.c0 and the modified c is then executed. The other loop primitives are implemented similarly with the aid of suitable extraordinary continuations.0xE6
Expand

493cont_loopsE6UNTIL:<{ code }>-Equivalent to <{ code }> CONT UNTIL.
Expand

<{ code }>UNTIL
494UNTILEND#E7cont_loopsE7UNTILEND-18Similar to UNTIL, but executes the current continuation cc in a loop. When the loop exit condition is satisfied, performs a RET.0xE7
Expand

UNTIL:
495WHILE#E8cont_loopsE8WHILEc' c -18Executes c' and pops an integer x from the resulting stack. If x is zero, exists the loop and transfers control to the original cc. If x is non-zero, executes c, and then begins a new iteration.0xE8
Expand

496cont_loopsE8WHILE:<{ cond }>DO<{ code }>-Equivalent to <{ cond }> CONT <{ code }> CONT WHILE.
Expand

497WHILEEND#E9cont_loopsE9WHILEENDc' -18Similar to WHILE, but uses the current continuation cc as the loop body.0xE9
Expand

498AGAIN#EAcont_loopsEAAGAINc -18Similar to REPEAT, but executes c infinitely many times. A RET only begins a new iteration of the infinite loop, which can be exited only by an exception, or a RETALT (or an explicit JMPX).0xEA
Expand

499cont_loopsEAAGAIN:<{ code }>-Equivalent to <{ code }> CONT AGAIN.
Expand

<{ code }>AGAIN
500AGAINEND#EBcont_loopsEBAGAINEND-18Similar to AGAIN, but performed with respect to the current continuation cc.0xEB
Expand

AGAIN:
501REPEATBRK#E314cont_loopsE314REPEATBRKn c -26Similar to REPEAT, but also sets c1 to the original cc after saving the old value of c1 into the savelist of the original cc. In this way RETALT could be used to break out of the loop body.0xE3, 0x14
Expand

502cont_loopsE314REPEATBRK:<{ code }>n -Equivalent to <{ code }> CONT REPEATBRK.
Expand

<{ code }>REPEATBRK
503REPEATENDBRK#E315cont_loopsE315REPEATENDBRKn -26Similar to REPEATEND, but also sets c1 to the original c0 after saving the old value of c1 into the savelist of the original c0. Equivalent to SAMEALTSAVE REPEATEND.0xE3, 0x15
Expand

504UNTILBRK#E316cont_loopsE316UNTILBRKc -26Similar to UNTIL, but also modifies c1 in the same way as REPEATBRK.0xE3, 0x16
Expand

505cont_loopsE316UNTILBRK:<{ code }>-Equivalent to <{ code }> CONT UNTILBRK.
Expand

506UNTILENDBRK#E317cont_loopsE317UNTILENDBRK-26Equivalent to SAMEALTSAVE UNTILEND.0xE3, 0x17
Expand

UNTILBRK:
507WHILEBRK#E318cont_loopsE318WHILEBRKc' c -26Similar to WHILE, but also modifies c1 in the same way as REPEATBRK.0xE3, 0x18
Expand

508cont_loopsE318WHILEBRK:<{ cond }>DO<{ code }>-Equivalent to <{ cond }> CONT <{ code }> CONT WHILEBRK.
Expand

509WHILEENDBRK#E319cont_loopsE319WHILEENDBRKc -26Equivalent to SAMEALTSAVE WHILEEND.0xE3, 0x19
Expand

510AGAINBRK#E31Acont_loopsE31AAGAINBRKc -26Similar to AGAIN, but also modifies c1 in the same way as REPEATBRK.0xE3, 0x1A
Expand

511cont_loopsE31AAGAINBRK:<{ code }>-Equivalent to <{ code }> CONT AGAINBRK.
Expand

512AGAINENDBRK#E31Bcont_loopsE31BAGAINENDBRK-26Equivalent to SAMEALTSAVE AGAINEND.0xE3, 0x1B
Expand

AGAINBRK:
513SETCONTARGS_N#EC r:uint4 n:(#<= 14)cont_stackECrn[r][n] SETCONTARGSx_1 x_2...x_r c - c'26+s”Similar to [r] -1 SETCONTARGS, but sets c.nargs to the final size of the stack of c' plus n. In other words, transforms c into a closure or a partially applied function, with 0 <= n <= 14 arguments missing.
Expand

514SETNUMARGSSETCONTARGS_N#EC0 n:(#<= 14)cont_stackEC0n[n] SETNUMARGSc - c'26Sets c.nargs to n plus the current depth of c's stack, where 0 <= n <= 14. If c.nargs is already set to a non-negative value, does nothing.[c = parse_const_u4_14] 0xEC, c
Expand

515SETCONTARGS#EC r:uint4 n:(## 4) {n = 15}cont_stackECrF[r] -1 SETCONTARGSx_1 x_2...x_r c - c'26+s”Pushes 0 <= r <= 15 values x_1...x_r into the stack of (a copy of) the continuation c, starting with x_1. If the final depth of c's stack turns out to be greater than c.nargs, a stack overflow exception is generated.
Expand

516RETURNARGS#ED0 p:uint4cont_stackED0p[p] RETURNARGS-26+s”Leaves only the top 0 <= p <= 15 values in the current stack (somewhat similarly to ONLYTOPX), with all the unused bottom values not discarded, but saved into continuation c0 in the same way as SETCONTARGS does.[c = parse_const_u4] 0xED, c
Expand

517RETURNVARARGS#ED10cont_stackED10RETURNVARARGSp -26+s”Similar to RETURNARGS, but with Integer 0 <= p <= 255 taken from the stack.0xED, 0x10
Expand

518SETCONTVARARGS#ED11cont_stackED11SETCONTVARARGSx_1 x_2...x_r c r n - c'26+s”Similar to SETCONTARGS, but with 0 <= r <= 255 and -1 <= n <= 255 taken from the stack.0xED, 0x11
Expand

519SETNUMVARARGS#ED12cont_stackED12SETNUMVARARGSc n - c'26-1 <= n <= 2550xED, 0x12
Expand

If n=-1, this operation does nothing (c'=c).
Otherwise its action is similar to [n] SETNUMARGS, but with n taken from the stack.
520BLESS#ED1Econt_createED1EBLESSs - c26Transforms a Slice s into a simple ordinary continuation c, with c.code=s and an empty stack and savelist.0xED, 0x1E
Expand

521BLESSVARARGS#ED1Fcont_createED1FBLESSVARARGSx_1...x_r s r n - c26+s”Equivalent to ROT BLESS ROTREV SETCONTVARARGS.0xED, 0x1F
Expand

522BLESSARGS#EE r:uint4 n:uint4cont_createEErn[r][n] BLESSARGSx_1...x_r s - c260 <= r <= 15, -1 <= n <= 14[c1 = parse_const_u4][c2 = parse_const_i4] 0xEE, (c1 << 4) | c2
Expand

Equivalent to BLESS [r] [n] SETCONTARGS.
The value of n is represented inside the instruction by the 4-bit integer n mod 16.
523BLESSNUMARGSBLESSARGS#EE0 n:uint4cont_createEE0n[n] BLESSNUMARGSs - c26Also transforms a Slice s into a Continuation c, but sets c.nargs to 0 <= n <= 14.[c = parse_const_u4_14] 0xEE, c
Expand

524PUSHCTR#ED4 i:uint4cont_registersED4ic[i] PUSHCTR- x26Pushes the current value of control register c(i). If the control register is not supported in the current codepage, or if it does not have a value, an exception is triggered.[z = parse_control_register] 0xED, 0x40 | z
Expand

c[i] PUSH
525PUSHROOTPUSHCTR#ED44cont_registersED44c4 PUSHCTR- x26Pushes the “global data root'' cell reference, thus enabling access to persistent smart-contract data.0xED, 0x44
Expand

c4 PUSH
526POPCTR#ED5 i:uint4cont_registersED5ic[i] POPCTRx -26Pops a value x from the stack and stores it into control register c(i), if supported in the current codepage. Notice that if a control register accepts only values of a specific type, a type-checking exception may occur.[z = parse_control_register] 0xED, 0x50 | z
Expand

c[i] POP
527POPROOTPOPCTR#ED54cont_registersED54c4 POPCTRx -26Sets the “global data root'' cell reference, thus allowing modification of persistent smart-contract data.0xED, 0x54
Expand

c4 POP
528SETCONTCTR#ED6 i:uint4cont_registersED6ic[i] SETCONTx c - c'26Stores x into the savelist of continuation c as c(i), and returns the resulting continuation c'. Almost all operations with continuations may be expressed in terms of SETCONTCTR, POPCTR, and PUSHCTR.[z = parse_control_register] 0xED, 0x60 | z
Expand

c[i] SETCONTCTR
529SETRETCTR#ED7 i:uint4cont_registersED7ic[i] SETRETCTRx -26Equivalent to c0 PUSHCTR c[i] SETCONTCTR c0 POPCTR.[z = parse_control_register] 0xED, 0x70 | z
Expand

530SETALTCTR#ED8 i:uint4cont_registersED8ic[i] SETALTCTRx -26Equivalent to c1 PUSHCTR c[i] SETCONTCTR c0 POPCTR.[z = parse_control_register] 0xED, 0x80 | z
Expand

531POPSAVE#ED9 i:uint4cont_registersED9ic[i] POPSAVEx -26Similar to c[i] POPCTR, but also saves the old value of c[i] into continuation c0.[z = parse_control_register] 0xED, 0x90 | z
Expand

c[i] POPCTRSAVEEquivalent (up to exceptions) to c[i] SAVECTR c[i] POPCTR.
532SAVE#EDA i:uint4cont_registersEDAic[i] SAVE26Saves the current value of c(i) into the savelist of continuation c0. If an entry for c[i] is already present in the savelist of c0, nothing is done. Equivalent to c[i] PUSHCTR c[i] SETRETCTR.[z = parse_control_register] 0xED, 0xA0 | z
Expand

c[i] SAVECTR
533SAVEALT#EDB i:uint4cont_registersEDBic[i] SAVEALT26Similar to c[i] SAVE, but saves the current value of c[i] into the savelist of c1, not c0.[z = parse_control_register] 0xED, 0xB0 | z
Expand

c[i] SAVEALTCTR
534SAVEBOTH#EDC i:uint4cont_registersEDCic[i] SAVEBOTH26Equivalent to DUP c[i] SAVE c[i] SAVEALT.[z = parse_control_register] 0xED, 0xC0 | z
Expand

c[i] SAVEBOTHCTR
535PUSHCTRX#EDE0cont_registersEDE0PUSHCTRXi - x26Similar to c[i] PUSHCTR, but with i, 0 <= i <= 255, taken from the stack.0xED, 0xE0
Expand

Notice that this primitive is one of the few “exotic'' primitives, which are not polymorphic like stack manipulation primitives, and at the same time do not have well-defined types of parameters and return values, because the type of x depends on i.
536POPCTRX#EDE1cont_registersEDE1POPCTRXx i -26Similar to c[i] POPCTR, but with 0 <= i <= 255 from the stack.0xED, 0xE1
Expand

537SETCONTCTRX#EDE2cont_registersEDE2SETCONTCTRXx c i - c'26Similar to c[i] SETCONTCTR, but with 0 <= i <= 255 from the stack.0xED, 0xE2
Expand

538COMPOS#EDF0cont_registersEDF0COMPOSc c' - c''26Computes the composition compose0(c, c’), which has the meaning of “perform c, and, if successful, perform c''' (if c is a boolean circuit) or simply “perform c, then c'''. Equivalent to SWAP c0 SETCONT.0xED, 0xF0
Expand

BOOLAND
539COMPOSALT#EDF1cont_registersEDF1COMPOSALTc c' - c''26Computes the alternative composition compose1(c, c’), which has the meaning of “perform c, and, if not successful, perform c''' (if c is a boolean circuit). Equivalent to SWAP c1 SETCONT.0xED, 0xF1
Expand

BOOLOR
540COMPOSBOTH#EDF2cont_registersEDF2COMPOSBOTHc c' - c''26Computes composition compose1(compose0(c, c’), c’), which has the meaning of “compute boolean circuit c, then compute c', regardless of the result of c''.0xED, 0xF2
Expand

541ATEXIT#EDF3cont_registersEDF3ATEXITc -26Sets c0 to compose0(c, c0). In other words, c will be executed before exiting current subroutine.0xED, 0xF3
Expand

542cont_registersEDF3ATEXIT:<{ code }>-Equivalent to <{ code }> CONT ATEXIT.
Expand

<{ code }>ATEXIT
543ATEXITALT#EDF4cont_registersEDF4ATEXITALTc -26Sets c1 to compose1(c, c1). In other words, c will be executed before exiting current subroutine by its alternative return path.0xED, 0xF4
Expand

544cont_registersEDF4ATEXITALT:<{ code }>-Equivalent to <{ code }> CONT ATEXITALT.
Expand

<{ code }>ATEXITALT
545SETEXITALT#EDF5cont_registersEDF5SETEXITALTc -26Sets c1 to compose1(compose0(c, c0), c1),0xED, 0xF5
Expand

In this way, a subsequent RETALT will first execute c, then transfer control to the original c0. This can be used, for instance, to exit from nested loops.
546THENRET#EDF6cont_registersEDF6THENRETc - c'26Computes compose0(c, c0).0xED, 0xF6
Expand

547THENRETALT#EDF7cont_registersEDF7THENRETALTc - c'26Computes compose0(c, c1)0xED, 0xF7
Expand

548INVERT#EDF8cont_registersEDF8INVERT-26Interchanges c0 and c1.0xED, 0xF8
Expand

549BOOLEVAL#EDF9cont_registersEDF9BOOLEVALc - ?26Performs cc:=compose1(compose0(c, compose0(-1 PUSHINT, cc)), compose0(0 PUSHINT, cc)). If c represents a boolean circuit, the net effect is to evaluate it and push either -1 or 0 into the stack before continuing.0xED, 0xF9
Expand

550SAMEALT#EDFAcont_registersEDFASAMEALT-26Sets c1 to c0. Equivalent to c0 PUSHCTR c1 POPCTR.0xED, 0xFA
Expand

551SAMEALTSAVE#EDFBcont_registersEDFBSAMEALTSAVE-26Sets c1 to c0, but first saves the old value of c1 into the savelist of c0.0xED, 0xFB
Expand

Equivalent to c1 SAVE SAMEALT.
552CALLDICT#F0 n:uint8cont_dictF0nn[nn] CALL- nnCalls the continuation in c3, pushing integer 0 <= nn <= 255 into its stack as an argument.
Expand

[nn] CALLDICTApproximately equivalent to [nn] PUSHINT c3 PUSHCTR EXECUTE.
553CALLDICT_LONG#F12_ n:uint14cont_dictF12_n[n] CALL- nFor 0 <= n < 2^14, an encoding of [n] CALL for larger values of n.
Expand

[n] CALLDICT
554JMPDICT#F16_ n:uint14cont_dictF16_n[n] JMP- nJumps to the continuation in c3, pushing integer 0 <= n < 2^14 as its argument.
Expand

Approximately equivalent to n PUSHINT c3 PUSHCTR JMPX.
555PREPAREDICT#F1A_ n:uint14cont_dictF1A_n[n] PREPARE- n cEquivalent to n PUSHINT c3 PUSHCTR, for 0 <= n < 2^14.[n = parse_const_u14] 0xF1, 0x80 | ((n / 256) as u8), ((n % 256) as u8)
Expand

[n] PREPAREDICTIn this way, [n] CALL is approximately equivalent to [n] PREPARE EXECUTE, and [n] JMP is approximately equivalent to [n] PREPARE JMPX.
One might use, for instance, CALLXARGS or CALLCC instead of EXECUTE here.
556THROW_SHORT#F22_ n:uint6exceptionsF22_n[n] THROW- 0 n76Throws exception 0 <= n <= 63 with parameter zero.
Expand

In other words, it transfers control to the continuation in c2, pushing 0 and n into its stack, and discarding the old stack altogether.
557THROWIF_SHORT#F26_ n:uint6exceptionsF26_n[n] THROWIFf -26/76Throws exception 0 <= n <= 63 with parameter zero only if integer f!=0.
Expand

558THROWIFNOT_SHORT#F2A_ n:uint6exceptionsF2A_n[n] THROWIFNOTf -26/76Throws exception 0 <= n <= 63 with parameter zero only if integer f=0.
Expand

559THROW#F2C4_ n:uint11exceptionsF2C4_n[n] THROW- 0 nn84For 0 <= n < 2^11, an encoding of [n] THROW for larger values of n.
Expand

560THROWARG#F2CC_ n:uint11exceptionsF2CC_n[n] THROWARGx - x nn84Throws exception 0 <= n < 2^11 with parameter x, by copying x and n into the stack of c2 and transferring control to c2.[n = parse_const_u11] 0xF2, 0xC8 | ((n / 256) as u8), ((n % 256) as u8)
Expand

561THROWIF#F2D4_ n:uint11exceptionsF2D4_n[n] THROWIFf -34/84For 0 <= n < 2^11, an encoding of [n] THROWIF for larger values of n.
Expand

562THROWARGIF#F2DC_ n:uint11exceptionsF2DC_n[n] THROWARGIFx f -34/84Throws exception 0 <= nn < 2^11 with parameter x only if integer f!=0.[n = parse_const_u11] 0xF2, 0xD8 | ((n / 256) as u8), ((n % 256) as u8)
Expand

563THROWIFNOT#F2E4_ n:uint11exceptionsF2E4_n[n] THROWIFNOTf -34/84For 0 <= n < 2^11, an encoding of [n] THROWIFNOT for larger values of n.
Expand

564THROWARGIFNOT#F2EC_ n:uint11exceptionsF2EC_n[n] THROWARGIFNOTx f -34/84Throws exception 0 <= n < 2^11 with parameter x only if integer f=0.[n = parse_const_u11] 0xF2, 0xE8 | ((n / 256) as u8), ((n % 256) as u8)
Expand

565THROWANY#F2F0exceptionsF2F0THROWANYn - 0 n76Throws exception 0 <= n < 2^16 with parameter zero.0xF2, 0xF0
Expand

Approximately equivalent to ZERO SWAP THROWARGANY.
566THROWARGANY#F2F1exceptionsF2F1THROWARGANYx n - x n76Throws exception 0 <= n < 2^16 with parameter x, transferring control to the continuation in c2.0xF2, 0xF1
Expand

Approximately equivalent to c2 PUSHCTR 2 JMPXARGS.
567THROWANYIF#F2F2exceptionsF2F2THROWANYIFn f -26/76Throws exception 0 <= n < 2^16 with parameter zero only if f!=0.0xF2, 0xF2
Expand

568THROWARGANYIF#F2F3exceptionsF2F3THROWARGANYIFx n f -26/76Throws exception 0 <= n<2^16 with parameter x only if f!=0.0xF2, 0xF3
Expand

569THROWANYIFNOT#F2F4exceptionsF2F4THROWANYIFNOTn f -26/76Throws exception 0 <= n<2^16 with parameter zero only if f=0.0xF2, 0xF4
Expand

570THROWARGANYIFNOT#F2F5exceptionsF2F5THROWARGANYIFNOTx n f -26/76Throws exception 0 <= n<2^16 with parameter x only if f=0.0xF2, 0xF5
Expand

571TRY#F2FFexceptionsF2FFTRYc c' -26Sets c2 to c', first saving the old value of c2 both into the savelist of c' and into the savelist of the current continuation, which is stored into c.c0 and c'.c0. Then runs c similarly to EXECUTE. If c does not throw any exceptions, the original value of c2 is automatically restored on return from c. If an exception occurs, the execution is transferred to c', but the original value of c2 is restored in the process, so that c' can re-throw the exception by THROWANY if it cannot handle it by itself.0xF2, 0xFF
Expand

572exceptionsF2FFTRY:<{ code1 }>CATCH<{ code2 }>-Equivalent to <{ code1 }> CONT <{ code2 }> CONT TRY.
Expand

573TRYARGS#F3 p:uint4 r:uint4exceptionsF3pr[p][r] TRYARGSc c' -26Similar to TRY, but with [p] [r] CALLXARGS internally used instead of EXECUTE.[s1 = parse_const_u4][s2 = parse_const_u4] 0xF3, (s1 << 4 | s2)
Expand

In this way, all but the top 0 <= p <= 15 stack elements will be saved into current continuation's stack, and then restored upon return from either c or c', with the top 0 <= r <= 15 values of the resulting stack of c or c' copied as return values.
574NEWDICTNULL#6Ddict_create6DNEWDICT- D18Returns a new empty dictionary.0x6D
Expand

It is an alternative mnemonics for PUSHNULL.
575DICTEMPTYISNULL#6Edict_create6EDICTEMPTYD - ?18Checks whether dictionary D is empty, and returns -1 or 0 accordingly.0x6E
Expand

It is an alternative mnemonics for ISNULL.
576STDICTSSTSLICE#CEdict_serialCESTDICTSs b - b'18Stores a Slice-represented dictionary s into Builder b.0xCE
Expand

It is actually a synonym for STSLICE.
577STDICT#F400dict_serialF400STDICTD b - b'26Stores dictionary D into Builder b, returing the resulting Builder b'.0xF4, 0x00
Expand

STOPTREFIn other words, if D is a cell, performs STONE and STREF; if D is Null, performs NIP and STZERO; otherwise throws a type checking exception.
578SKIPDICT#F401dict_serialF401SKIPDICTs - s'26Equivalent to LDDICT NIP.0xF4, 0x01
Expand

SKIPOPTREF
579LDDICTS#F402dict_serialF402LDDICTSs - s' s''26Loads (parses) a (Slice-represented) dictionary s' from Slice s, and returns the remainder of s as s''.0xF4, 0x02
Expand

This is a “split function'' for all HashmapE(n,X) dictionary types.
580PLDDICTS#F403dict_serialF403PLDDICTSs - s'26Preloads a (Slice-represented) dictionary s' from Slice s.0xF4, 0x03
Expand

Approximately equivalent to LDDICTS DROP.
581LDDICT#F404dict_serialF404LDDICTs - D s'26Loads (parses) a dictionary D from Slice s, and returns the remainder of s as s'. May be applied to dictionaries or to values of arbitrary (^Y)? types.0xF4, 0x04
Expand

LDOPTREF
582PLDDICT#F405dict_serialF405PLDDICTs - D26Preloads a dictionary D from Slice s.0xF4, 0x05
Expand

PLDOPTREFApproximately equivalent to LDDICT DROP.
583LDDICTQ#F406dict_serialF406LDDICTQs - D s' -1 or s 026A quiet version of LDDICT.0xF4, 0x06
Expand

584PLDDICTQ#F407dict_serialF407PLDDICTQs - D -1 or 026A quiet version of PLDDICT.0xF4, 0x07
Expand

585DICTGET#F40Adict_getF40ADICTGETk D n - x -1 or 0Looks up key k (represented by a Slice, the first 0 <= n <= 1023 data bits of which are used as a key) in dictionary D of type HashmapE(n,X) with n-bit keys.0xF4, 0x0A
Expand

On success, returns the value found as a Slice x.
586DICTGETREF#F40Bdict_getF40BDICTGETREFk D n - c -1 or 0Similar to DICTGET, but with a LDREF ENDS applied to x on success.0xF4, 0x0B
Expand

This operation is useful for dictionaries of type HashmapE(n,^Y).
587DICTIGET#F40Cdict_getF40CDICTIGETi D n - x -1 or 0Similar to DICTGET, but with a signed (big-endian) n-bit Integer i as a key. If i does not fit into n bits, returns 0. If i is a NaN, throws an integer overflow exception.0xF4, 0x0C
Expand

588DICTIGETREF#F40Ddict_getF40DDICTIGETREFi D n - c -1 or 0Combines DICTIGET with DICTGETREF: it uses signed n-bit Integer i as a key and returns a Cell instead of a Slice on success.0xF4, 0x0D
Expand

589DICTUGET#F40Edict_getF40EDICTUGETi D n - x -1 or 0Similar to DICTIGET, but with unsigned (big-endian) n-bit Integer i used as a key.0xF4, 0x0E
Expand

590DICTUGETREF#F40Fdict_getF40FDICTUGETREFi D n - c -1 or 0Similar to DICTIGETREF, but with an unsigned n-bit Integer key i.0xF4, 0x0F
Expand

591DICTSET#F412dict_setF412DICTSETx k D n - D'Sets the value associated with n-bit key k (represented by a Slice as in DICTGET) in dictionary D (also represented by a Slice) to value x (again a Slice), and returns the resulting dictionary as D'.0xF4, 0x12
Expand

592DICTSETREF#F413dict_setF413DICTSETREFc k D n - D'Similar to DICTSET, but with the value set to a reference to Cell c.0xF4, 0x13
Expand

593DICTISET#F414dict_setF414DICTISETx i D n - D'Similar to DICTSET, but with the key represented by a (big-endian) signed n-bit integer i. If i does not fit into n bits, a range check exception is generated.0xF4, 0x14
Expand

594DICTISETREF#F415dict_setF415DICTISETREFc i D n - D'Similar to DICTSETREF, but with the key a signed n-bit integer as in DICTISET.0xF4, 0x15
Expand

595DICTUSET#F416dict_setF416DICTUSETx i D n - D'Similar to DICTISET, but with i an unsigned n-bit integer.0xF4, 0x16
Expand

596DICTUSETREF#F417dict_setF417DICTUSETREFc i D n - D'Similar to DICTISETREF, but with i unsigned.0xF4, 0x17
Expand

597DICTSETGET#F41Adict_setF41ADICTSETGETx k D n - D' y -1 or D' 0Combines DICTSET with DICTGET: it sets the value corresponding to key k to x, but also returns the old value y associated with the key in question, if present.0xF4, 0x1A
Expand

598DICTSETGETREF#F41Bdict_setF41BDICTSETGETREFc k D n - D' c' -1 or D' 0Combines DICTSETREF with DICTGETREF similarly to DICTSETGET.0xF4, 0x1B
Expand

599DICTISETGET#F41Cdict_setF41CDICTISETGETx i D n - D' y -1 or D' 0DICTISETGET, but with i a signed n-bit integer.0xF4, 0x1C
Expand

600DICTISETGETREF#F41Ddict_setF41DDICTISETGETREFc i D n - D' c' -1 or D' 0DICTISETGETREF, but with i a signed n-bit integer.0xF4, 0x1D
Expand

601DICTUSETGET#F41Edict_setF41EDICTUSETGETx i D n - D' y -1 or D' 0DICTISETGET, but with i an unsigned n-bit integer.0xF4, 0x1E
Expand

602DICTUSETGETREF#F41Fdict_setF41FDICTUSETGETREFc i D n - D' c' -1 or D' 0DICTISETGETREF, but with i an unsigned n-bit integer.0xF4, 0x1F
Expand

603DICTREPLACE#F422dict_setF422DICTREPLACEx k D n - D' -1 or D 0A Replace operation, which is similar to DICTSET, but sets the value of key k in dictionary D to x only if the key k was already present in D.0xF4, 0x22
Expand

604DICTREPLACEREF#F423dict_setF423DICTREPLACEREFc k D n - D' -1 or D 0A Replace counterpart of DICTSETREF.0xF4, 0x23
Expand

605DICTIREPLACE#F424dict_setF424DICTIREPLACEx i D n - D' -1 or D 0DICTREPLACE, but with i a signed n-bit integer.0xF4, 0x24
Expand

606DICTIREPLACEREF#F425dict_setF425DICTIREPLACEREFc i D n - D' -1 or D 0DICTREPLACEREF, but with i a signed n-bit integer.0xF4, 0x25
Expand

607DICTUREPLACE#F426dict_setF426DICTUREPLACEx i D n - D' -1 or D 0DICTREPLACE, but with i an unsigned n-bit integer.0xF4, 0x26
Expand

608DICTUREPLACEREF#F427dict_setF427DICTUREPLACEREFc i D n - D' -1 or D 0DICTREPLACEREF, but with i an unsigned n-bit integer.0xF4, 0x27
Expand

609DICTREPLACEGET#F42Adict_setF42ADICTREPLACEGETx k D n - D' y -1 or D 0A Replace counterpart of DICTSETGET: on success, also returns the old value associated with the key in question.0xF4, 0x2A
Expand

610DICTREPLACEGETREF#F42Bdict_setF42BDICTREPLACEGETREFc k D n - D' c' -1 or D 0A Replace counterpart of DICTSETGETREF.0xF4, 0x2B
Expand

611DICTIREPLACEGET#F42Cdict_setF42CDICTIREPLACEGETx i D n - D' y -1 or D 0DICTREPLACEGET, but with i a signed n-bit integer.0xF4, 0x2C
Expand

612DICTIREPLACEGETREF#F42Ddict_setF42DDICTIREPLACEGETREFc i D n - D' c' -1 or D 0DICTREPLACEGETREF, but with i a signed n-bit integer.0xF4, 0x2D
Expand

613DICTUREPLACEGET#F42Edict_setF42EDICTUREPLACEGETx i D n - D' y -1 or D 0DICTREPLACEGET, but with i an unsigned n-bit integer.0xF4, 0x2E
Expand

614DICTUREPLACEGETREF#F42Fdict_setF42FDICTUREPLACEGETREFc i D n - D' c' -1 or D 0DICTREPLACEGETREF, but with i an unsigned n-bit integer.0xF4, 0x2F
Expand

615DICTADD#F432dict_setF432DICTADDx k D n - D' -1 or D 0An Add counterpart of DICTSET: sets the value associated with key k in dictionary D to x, but only if it is not already present in D.0xF4, 0x32
Expand

616DICTADDREF#F433dict_setF433DICTADDREFc k D n - D' -1 or D 0An Add counterpart of DICTSETREF.0xF4, 0x33
Expand

617DICTIADD#F434dict_setF434DICTIADDx i D n - D' -1 or D 0DICTADD, but with i a signed n-bit integer.0xF4, 0x34
Expand

618DICTIADDREF#F435dict_setF435DICTIADDREFc i D n - D' -1 or D 0DICTADDREF, but with i a signed n-bit integer.0xF4, 0x35
Expand

619DICTUADD#F436dict_setF436DICTUADDx i D n - D' -1 or D 0DICTADD, but with i an unsigned n-bit integer.0xF4, 0x36
Expand

620DICTUADDREF#F437dict_setF437DICTUADDREFc i D n - D' -1 or D 0DICTADDREF, but with i an unsigned n-bit integer.0xF4, 0x37
Expand

621DICTADDGET#F43Adict_setF43ADICTADDGETx k D n - D' -1 or D y 0An Add counterpart of DICTSETGET: sets the value associated with key k in dictionary D to x, but only if key k is not already present in D. Otherwise, just returns the old value y without changing the dictionary.0xF4, 0x3A
Expand

622DICTADDGETREF#F43Bdict_setF43BDICTADDGETREFc k D n - D' -1 or D c' 0An Add counterpart of DICTSETGETREF.0xF4, 0x3B
Expand

623DICTIADDGET#F43Cdict_setF43CDICTIADDGETx i D n - D' -1 or D y 0DICTADDGET, but with i a signed n-bit integer.0xF4, 0x3C
Expand

624DICTIADDGETREF#F43Ddict_setF43DDICTIADDGETREFc i D n - D' -1 or D c' 0DICTADDGETREF, but with i a signed n-bit integer.0xF4, 0x3D
Expand

625DICTUADDGET#F43Edict_setF43EDICTUADDGETx i D n - D' -1 or D y 0DICTADDGET, but with i an unsigned n-bit integer.0xF4, 0x3E
Expand

626DICTUADDGETREF#F43Fdict_setF43FDICTUADDGETREFc i D n - D' -1 or D c' 0DICTADDGETREF, but with i an unsigned n-bit integer.0xF4, 0x3F
Expand

627DICTSETB#F441dict_set_builderF441DICTSETBb k D n - D'0xF4, 0x41
Expand

628DICTISETB#F442dict_set_builderF442DICTISETBb i D n - D'0xF4, 0x42
Expand

629DICTUSETB#F443dict_set_builderF443DICTUSETBb i D n - D'0xF4, 0x43
Expand

630DICTSETGETB#F445dict_set_builderF445DICTSETGETBb k D n - D' y -1 or D' 00xF4, 0x44
Expand

631DICTISETGETB#F446dict_set_builderF446DICTISETGETBb i D n - D' y -1 or D' 00xF4, 0x46
Expand

632DICTUSETGETB#F447dict_set_builderF447DICTUSETGETBb i D n - D' y -1 or D' 00xF4, 0x47
Expand

633DICTREPLACEB#F449dict_set_builderF449DICTREPLACEBb k D n - D' -1 or D 00xF4, 0x49
Expand

634DICTIREPLACEB#F44Adict_set_builderF44ADICTIREPLACEBb i D n - D' -1 or D 00xF4, 0x4A
Expand

635DICTUREPLACEB#F44Bdict_set_builderF44BDICTUREPLACEBb i D n - D' -1 or D 00xF4, 0x4B
Expand

636DICTREPLACEGETB#F44Ddict_set_builderF44DDICTREPLACEGETBb k D n - D' y -1 or D 00xF4, 0x4D
Expand

637DICTIREPLACEGETB#F44Edict_set_builderF44EDICTIREPLACEGETBb i D n - D' y -1 or D 00xF4, 0x4E
Expand

638DICTUREPLACEGETB#F44Fdict_set_builderF44FDICTUREPLACEGETBb i D n - D' y -1 or D 00xF4, 0x4F
Expand

639DICTADDB#F451dict_set_builderF451DICTADDBb k D n - D' -1 or D 00xF4, 0x51
Expand

640DICTIADDB#F452dict_set_builderF452DICTIADDBb i D n - D' -1 or D 00xF4, 0x52
Expand

641DICTUADDB#F453dict_set_builderF453DICTUADDBb i D n - D' -1 or D 00xF4, 0x53
Expand

642DICTADDGETB#F455dict_set_builderF455DICTADDGETBb k D n - D' -1 or D y 00xF4, 0x55
Expand

643DICTIADDGETB#F456dict_set_builderF456DICTIADDGETBb i D n - D' -1 or D y 00xF4, 0x56
Expand

644DICTUADDGETB#F457dict_set_builderF457DICTUADDGETBb i D n - D' -1 or D y 00xF4, 0x57
Expand

645DICTDEL#F459dict_deleteF459DICTDELk D n - D' -1 or D 0Deletes n-bit key, represented by a Slice k, from dictionary D. If the key is present, returns the modified dictionary D' and the success flag -1. Otherwise, returns the original dictionary D and 0.0xF4, 0x59
Expand

646DICTIDEL#F45Adict_deleteF45ADICTIDELi D n - D' ?A version of DICTDEL with the key represented by a signed n-bit Integer i. If i does not fit into n bits, simply returns D 0 (“key not found, dictionary unmodified'').0xF4, 0x5A
Expand

647DICTUDEL#F45Bdict_deleteF45BDICTUDELi D n - D' ?Similar to DICTIDEL, but with i an unsigned n-bit integer.0xF4, 0x5B
Expand

648DICTDELGET#F462dict_deleteF462DICTDELGETk D n - D' x -1 or D 0Deletes n-bit key, represented by a Slice k, from dictionary D. If the key is present, returns the modified dictionary D', the original value x associated with the key k (represented by a Slice), and the success flag -1. Otherwise, returns the original dictionary D and 0.0xF4, 0x62
Expand

649DICTDELGETREF#F463dict_deleteF463DICTDELGETREFk D n - D' c -1 or D 0Similar to DICTDELGET, but with LDREF ENDS applied to x on success, so that the value returned c is a Cell.0xF4, 0x63
Expand

650DICTIDELGET#F464dict_deleteF464DICTIDELGETi D n - D' x -1 or D 0DICTDELGET, but with i a signed n-bit integer.0xF4, 0x64
Expand

651DICTIDELGETREF#F465dict_deleteF465DICTIDELGETREFi D n - D' c -1 or D 0DICTDELGETREF, but with i a signed n-bit integer.0xF4, 0x65
Expand

652DICTUDELGET#F466dict_deleteF466DICTUDELGETi D n - D' x -1 or D 0DICTDELGET, but with i an unsigned n-bit integer.0xF4, 0x66
Expand

653DICTUDELGETREF#F467dict_deleteF467DICTUDELGETREFi D n - D' c -1 or D 0DICTDELGETREF, but with i an unsigned n-bit integer.0xF4, 0x67
Expand

654DICTGETOPTREF#F469dict_mayberefF469DICTGETOPTREFk D n - c^?A variant of DICTGETREF that returns Null instead of the value c^? if the key k is absent from dictionary D.0xF4, 0x69
Expand

655DICTIGETOPTREF#F46Adict_mayberefF46ADICTIGETOPTREFi D n - c^?DICTGETOPTREF, but with i a signed n-bit integer. If the key i is out of range, also returns Null.0xF4, 0x6A
Expand

656DICTUGETOPTREF#F46Bdict_mayberefF46BDICTUGETOPTREFi D n - c^?DICTGETOPTREF, but with i an unsigned n-bit integer. If the key i is out of range, also returns Null.0xF4, 0x6B
Expand

657DICTSETGETOPTREF#F46Ddict_mayberefF46DDICTSETGETOPTREFc^? k D n - D' ~c^?A variant of both DICTGETOPTREF and DICTSETGETREF that sets the value corresponding to key k in dictionary D to c^? (if c^? is Null, then the key is deleted instead), and returns the old value ~c^? (if the key k was absent before, returns Null instead).0xF4, 0x6D
Expand

658DICTISETGETOPTREF#F46Edict_mayberefF46EDICTISETGETOPTREFc^? i D n - D' ~c^?Similar to primitive DICTSETGETOPTREF, but using signed n-bit Integer i as a key. If i does not fit into n bits, throws a range checking exception.0xF4, 0x6E
Expand

659DICTUSETGETOPTREF#F46Fdict_mayberefF46FDICTUSETGETOPTREFc^? i D n - D' ~c^?Similar to primitive DICTSETGETOPTREF, but using unsigned n-bit Integer i as a key.0xF4, 0x6F
Expand

660PFXDICTSET#F470dict_prefixF470PFXDICTSETx k D n - D' -1 or D 00xF4, 0x70
Expand

661PFXDICTREPLACE#F471dict_prefixF471PFXDICTREPLACEx k D n - D' -1 or D 00xF4, 0x71
Expand

662PFXDICTADD#F472dict_prefixF472PFXDICTADDx k D n - D' -1 or D 00xF4, 0x72
Expand

663PFXDICTDEL#F473dict_prefixF473PFXDICTDELk D n - D' -1 or D 00xF4, 0x73
Expand

664DICTGETNEXT#F474dict_nextF474DICTGETNEXTk D n - x' k' -1 or 0Computes the minimal key k' in dictionary D that is lexicographically greater than k, and returns k' (represented by a Slice) along with associated value x' (also represented by a Slice).0xF4, 0x74
Expand

665DICTGETNEXTEQ#F475dict_nextF475DICTGETNEXTEQk D n - x' k' -1 or 0Similar to DICTGETNEXT, but computes the minimal key k' that is lexicographically greater than or equal to k.0xF4, 0x75
Expand

666DICTGETPREV#F476dict_nextF476DICTGETPREVk D n - x' k' -1 or 0Similar to DICTGETNEXT, but computes the maximal key k' lexicographically smaller than k.0xF4, 0x76
Expand

667DICTGETPREVEQ#F477dict_nextF477DICTGETPREVEQk D n - x' k' -1 or 0Similar to DICTGETPREV, but computes the maximal key k' lexicographically smaller than or equal to k.0xF4, 0x77
Expand

668DICTIGETNEXT#F478dict_nextF478DICTIGETNEXTi D n - x' i' -1 or 0Similar to DICTGETNEXT, but interprets all keys in dictionary D as big-endian signed n-bit integers, and computes the minimal key i' that is larger than Integer i (which does not necessarily fit into n bits).0xF4, 0x78
Expand

669DICTIGETNEXTEQ#F479dict_nextF479DICTIGETNEXTEQi D n - x' i' -1 or 0Similar to DICTGETNEXTEQ, but interprets keys as signed n-bit integers.0xF4, 0x79
Expand

670DICTIGETPREV#F47Adict_nextF47ADICTIGETPREVi D n - x' i' -1 or 0Similar to DICTGETPREV, but interprets keys as signed n-bit integers.0xF4, 0x7A
Expand

671DICTIGETPREVEQ#F47Bdict_nextF47BDICTIGETPREVEQi D n - x' i' -1 or 0Similar to DICTGETPREVEQ, but interprets keys as signed n-bit integers.0xF4, 0x7B
Expand

672DICTUGETNEXT#F47Cdict_nextF47CDICTUGETNEXTi D n - x' i' -1 or 0Similar to DICTGETNEXT, but interprets all keys in dictionary D as big-endian unsigned n-bit integers, and computes the minimal key i' that is larger than Integer i (which does not necessarily fit into n bits, and is not necessarily non-negative).0xF4, 0x7C
Expand

673DICTUGETNEXTEQ#F47Ddict_nextF47DDICTUGETNEXTEQi D n - x' i' -1 or 0Similar to DICTGETNEXTEQ, but interprets keys as unsigned n-bit integers.0xF4, 0x7D
Expand

674DICTUGETPREV#F47Edict_nextF47EDICTUGETPREVi D n - x' i' -1 or 0Similar to DICTGETPREV, but interprets keys as unsigned n-bit integers.0xF4, 0x7E
Expand

675DICTUGETPREVEQ#F47Fdict_nextF47FDICTUGETPREVEQi D n - x' i' -1 or 0Similar to DICTGETPREVEQ, but interprets keys a unsigned n-bit integers.0xF4, 0x7F
Expand

676DICTMIN#F482dict_minF482DICTMIND n - x k -1 or 0Computes the minimal key k (represented by a Slice with n data bits) in dictionary D, and returns k along with the associated value x.0xF4, 0x82
Expand

677DICTMINREF#F483dict_minF483DICTMINREFD n - c k -1 or 0Similar to DICTMIN, but returns the only reference in the value as a Cell c.0xF4, 0x83
Expand

678DICTIMIN#F484dict_minF484DICTIMIND n - x i -1 or 0Similar to DICTMIN, but computes the minimal key i under the assumption that all keys are big-endian signed n-bit integers. Notice that the key and value returned may differ from those computed by DICTMIN and DICTUMIN.0xF4, 0x84
Expand

679DICTIMINREF#F485dict_minF485DICTIMINREFD n - c i -1 or 0Similar to DICTIMIN, but returns the only reference in the value.0xF4, 0x85
Expand

680DICTUMIN#F486dict_minF486DICTUMIND n - x i -1 or 0Similar to DICTMIN, but returns the key as an unsigned n-bit Integer i.0xF4, 0x86
Expand

681DICTUMINREF#F487dict_minF487DICTUMINREFD n - c i -1 or 0Similar to DICTUMIN, but returns the only reference in the value.0xF4, 0x87
Expand

682DICTMAX#F48Adict_minF48ADICTMAXD n - x k -1 or 0Computes the maximal key k (represented by a Slice with n data bits) in dictionary D, and returns k along with the associated value x.0xF4, 0x8A
Expand

683DICTMAXREF#F48Bdict_minF48BDICTMAXREFD n - c k -1 or 0Similar to DICTMAX, but returns the only reference in the value.0xF4, 0x8B
Expand

684DICTIMAX#F48Cdict_minF48CDICTIMAXD n - x i -1 or 0Similar to DICTMAX, but computes the maximal key i under the assumption that all keys are big-endian signed n-bit integers. Notice that the key and value returned may differ from those computed by DICTMAX and DICTUMAX.0xF4, 0x8C
Expand

685DICTIMAXREF#F48Ddict_minF48DDICTIMAXREFD n - c i -1 or 0Similar to DICTIMAX, but returns the only reference in the value.0xF4, 0x8D
Expand

686DICTUMAX#F48Edict_minF48EDICTUMAXD n - x i -1 or 0Similar to DICTMAX, but returns the key as an unsigned n-bit Integer i.0xF4, 0x8E
Expand

687DICTUMAXREF#F48Fdict_minF48FDICTUMAXREFD n - c i -1 or 0Similar to DICTUMAX, but returns the only reference in the value.0xF4, 0x8F
Expand

688DICTREMMIN#F492dict_minF492DICTREMMIND n - D' x k -1 or D 0Computes the minimal key k (represented by a Slice with n data bits) in dictionary D, removes k from the dictionary, and returns k along with the associated value x and the modified dictionary D'.0xF4, 0x92
Expand

689DICTREMMINREF#F493dict_minF493DICTREMMINREFD n - D' c k -1 or D 0Similar to DICTREMMIN, but returns the only reference in the value as a Cell c.0xF4, 0x93
Expand

690DICTIREMMIN#F494dict_minF494DICTIREMMIND n - D' x i -1 or D 0Similar to DICTREMMIN, but computes the minimal key i under the assumption that all keys are big-endian signed n-bit integers. Notice that the key and value returned may differ from those computed by DICTREMMIN and DICTUREMMIN.0xF4, 0x94
Expand

691DICTIREMMINREF#F495dict_minF495DICTIREMMINREFD n - D' c i -1 or D 0Similar to DICTIREMMIN, but returns the only reference in the value.0xF4, 0x95
Expand

692DICTUREMMIN#F496dict_minF496DICTUREMMIND n - D' x i -1 or D 0Similar to DICTREMMIN, but returns the key as an unsigned n-bit Integer i.0xF4, 0x96
Expand

693DICTUREMMINREF#F497dict_minF497DICTUREMMINREFD n - D' c i -1 or D 0Similar to DICTUREMMIN, but returns the only reference in the value.0xF4, 0x937
Expand

694DICTREMMAX#F49Adict_minF49ADICTREMMAXD n - D' x k -1 or D 0Computes the maximal key k (represented by a Slice with n data bits) in dictionary D, removes k from the dictionary, and returns k along with the associated value x and the modified dictionary D'.0xF4, 0x9A
Expand

695DICTREMMAXREF#F49Bdict_minF49BDICTREMMAXREFD n - D' c k -1 or D 0Similar to DICTREMMAX, but returns the only reference in the value as a Cell c.0xF4, 0x9B
Expand

696DICTIREMMAX#F49Cdict_minF49CDICTIREMMAXD n - D' x i -1 or D 0Similar to DICTREMMAX, but computes the minimal key i under the assumption that all keys are big-endian signed n-bit integers. Notice that the key and value returned may differ from those computed by DICTREMMAX and DICTUREMMAX.0xF4, 0x9C
Expand

697DICTIREMMAXREF#F49Ddict_minF49DDICTIREMMAXREFD n - D' c i -1 or D 0Similar to DICTIREMMAX, but returns the only reference in the value.0xF4, 0x9D
Expand

698DICTUREMMAX#F49Edict_minF49EDICTUREMMAXD n - D' x i -1 or D 0Similar to DICTREMMAX, but returns the key as an unsigned n-bit Integer i.0xF4, 0x9E
Expand

699DICTUREMMAXREF#F49Fdict_minF49FDICTUREMMAXREFD n - D' c i -1 or D 0Similar to DICTUREMMAX, but returns the only reference in the value.0xF4, 0x9F
Expand

700DICTIGETJMP#F4A0dict_specialF4A0DICTIGETJMPi D n -Similar to DICTIGET, but with x BLESSed into a continuation with a subsequent JMPX to it on success. On failure, does nothing. This is useful for implementing switch/case constructions.0xF4, 0xA0
Expand

701DICTUGETJMP#F4A1dict_specialF4A1DICTUGETJMPi D n -Similar to DICTIGETJMP, but performs DICTUGET instead of DICTIGET.0xF4, 0xA1
Expand

702DICTIGETEXEC#F4A2dict_specialF4A2DICTIGETEXECi D n -Similar to DICTIGETJMP, but with EXECUTE instead of JMPX.0xF4, 0xA2
Expand

703DICTUGETEXEC#F4A3dict_specialF4A3DICTUGETEXECi D n -Similar to DICTUGETJMP, but with EXECUTE instead of JMPX.0xF4, 0xA3
Expand

704DICTPUSHCONST#F4A6_ d:^Cell n:uint10dict_specialF4A6_n[ref][n] DICTPUSHCONST- D n34Pushes a non-empty constant dictionary D (as a Cell^?) along with its key length 0 <= n <= 1023, stored as a part of the instruction. The dictionary itself is created from the first of remaining references of the current continuation. In this way, the complete DICTPUSHCONST instruction can be obtained by first serializing xF4A4_, then the non-empty dictionary itself (one 1 bit and a cell reference), and then the unsigned 10-bit integer n (as if by a STU 10 instruction). An empty dictionary can be pushed by a NEWDICT primitive instead.[n = parse_const_u10] 0xF4, 0xA4 | (n >> 8) as u8, n as u8
Expand

705PFXDICTGETQ#F4A8dict_specialF4A8PFXDICTGETQs D n - s' x s'' -1 or s 0Looks up the unique prefix of Slice s present in the prefix code dictionary represented by Cell^? D and 0 <= n <= 1023. If found, the prefix of s is returned as s', and the corresponding value (also a Slice) as x. The remainder of s is returned as a Slice s''. If no prefix of s is a key in prefix code dictionary D, returns the unchanged s and a zero flag to indicate failure.0xF4, 0xA8
Expand

706PFXDICTGET#F4A9dict_specialF4A9PFXDICTGETs D n - s' x s''Similar to PFXDICTGET, but throws a cell deserialization failure exception on failure.0xF4, 0xA9
Expand

707PFXDICTGETJMP#F4AAdict_specialF4AAPFXDICTGETJMPs D n - s' s'' or sSimilar to PFXDICTGETQ, but on success BLESSes the value x into a Continuation and transfers control to it as if by a JMPX. On failure, returns s unchanged and continues execution.0xF4, 0xAA
Expand

708PFXDICTGETEXEC#F4ABdict_specialF4ABPFXDICTGETEXECs D n - s' s''Similar to PFXDICTGETJMP, but EXECutes the continuation found instead of jumping to it. On failure, throws a cell deserialization exception.0xF4, 0xAB
Expand

709PFXDICTCONSTGETJMP#F4AE_ d:^Cell n:uint10dict_specialF4AE_n[ref][n] PFXDICTCONSTGETJMPs - s' s'' or sCombines [n] DICTPUSHCONST for 0 <= n <= 1023 with PFXDICTGETJMP.[n = parse_const_u10] 0xF4, 0xAC | (n >> 8) as u8, n as u8
Expand

[ref][n] PFXDICTSWITCH
710DICTIGETJMPZ#F4BCdict_specialF4BCDICTIGETJMPZi D n - i or nothingA variant of DICTIGETJMP that returns index i on failure.0xF4, 0xBC
Expand

711DICTUGETJMPZ#F4BDdict_specialF4BDDICTUGETJMPZi D n - i or nothingA variant of DICTUGETJMP that returns index i on failure.0xF4, 0xBD
Expand

712DICTIGETEXECZ#F4BEdict_specialF4BEDICTIGETEXECZi D n - i or nothingA variant of DICTIGETEXEC that returns index i on failure.0xF4, 0xBE
Expand

713DICTUGETEXECZ#F4BFdict_specialF4BFDICTUGETEXECZi D n - i or nothingA variant of DICTUGETEXEC that returns index i on failure.0xF4, 0xBF
Expand

714SUBDICTGET#F4B1dict_subF4B1SUBDICTGETk l D n - D'Constructs a subdictionary consisting of all keys beginning with prefix k (represented by a Slice, the first 0 <= l <= n <= 1023 data bits of which are used as a key) of length l in dictionary D of type HashmapE(n,X) with n-bit keys. On success, returns the new subdictionary of the same type HashmapE(n,X) as a Slice D'.0xF4, 0xB1
Expand

715SUBDICTIGET#F4B2dict_subF4B2SUBDICTIGETx l D n - D'Variant of SUBDICTGET with the prefix represented by a signed big-endian l-bit Integer x, where necessarily l <= 257.0xF4, 0xB2
Expand

716SUBDICTUGET#F4B3dict_subF4B3SUBDICTUGETx l D n - D'Variant of SUBDICTGET with the prefix represented by an unsigned big-endian l-bit Integer x, where necessarily l <= 256.0xF4, 0xB3
Expand

717SUBDICTRPGET#F4B5dict_subF4B5SUBDICTRPGETk l D n - D'Similar to SUBDICTGET, but removes the common prefix k from all keys of the new dictionary D', which becomes of type HashmapE(n-l,X).0xF4, 0xB5
Expand

718SUBDICTIRPGET#F4B6dict_subF4B6SUBDICTIRPGETx l D n - D'Variant of SUBDICTRPGET with the prefix represented by a signed big-endian l-bit Integer x, where necessarily l <= 257.0xF4, 0xB6
Expand

719SUBDICTURPGET#F4B7dict_subF4B7SUBDICTURPGETx l D n - D'Variant of SUBDICTRPGET with the prefix represented by an unsigned big-endian l-bit Integer x, where necessarily l <= 256.0xF4, 0xB7
Expand

720ACCEPT#F800app_gasF800ACCEPT-26Sets current gas limit g_l to its maximal allowed value g_m, and resets the gas credit g_c to zero, decreasing the value of g_r by g_c in the process.0xF8, 0x00
Expand

In other words, the current smart contract agrees to buy some gas to finish the current transaction. This action is required to process external messages, which bring no value (hence no gas) with themselves.
721SETGASLIMIT#F801app_gasF801SETGASLIMITg -26Sets current gas limit g_l to the minimum of g and g_m, and resets the gas credit g_c to zero. If the gas consumed so far (including the present instruction) exceeds the resulting value of g_l, an (unhandled) out of gas exception is thrown before setting new gas limits. Notice that SETGASLIMIT with an argument g >= 2^63-1 is equivalent to ACCEPT.0xF8, 0x01
Expand

722BUYGAS#F802app_gasF802BUYGASx -26Computes the amount of gas that can be bought for x nanograms, and sets g_l accordingly in the same way as SETGASLIMIT.0xF8, 0x02
Expand

723GRAMTOGAS#F804app_gasF804GRAMTOGASx - gComputes the amount of gas that can be bought for x nanograms. If x is negative, returns 0. If g exceeds 2^63 - 1, it is replaced with this value.0xF8, 0x04
Expand

724GASTOGRAM#F805app_gasF805GASTOGRAMg - xComputes the price of g gas in nanograms.0xF8, 0x05
Expand

725COMMIT#F80Fapp_gasF80FCOMMIT-26Commits the current state of registers c4 (“persistent data'') and c5 (“actions'') so that the current execution is considered “successful'' with the saved values even if an exception is thrown later.0xF8, 0x0F
Expand

726RANDU256#F810app_rndF810RANDU256- x26+|c7|+|c1_1|Generates a new pseudo-random unsigned 256-bit Integer x. The algorithm is as follows: if r is the old value of the random seed, considered as a 32-byte array (by constructing the big-endian representation of an unsigned 256-bit integer), then its sha512(r) is computed; the first 32 bytes of this hash are stored as the new value r' of the random seed, and the remaining 32 bytes are returned as the next random value x.0xF8, 0x10
Expand

727RAND#F811app_rndF811RANDy - z26+|c7|+|c1_1|Generates a new pseudo-random integer z in the range 0...y-1 (or y...-1, if y<0). More precisely, an unsigned random value x is generated as in RAND256U; then z:=floor(x*y/2^256) is computed.0xF8, 0x11
Expand

Equivalent to RANDU256 256 MULRSHIFT.
728SETRAND#F814app_rndF814SETRANDx -26+|c7|+|c1_1|Sets the random seed to unsigned 256-bit Integer x.0xF8, 0x14
Expand

729ADDRAND#F815app_rndF815ADDRANDx -26Mixes unsigned 256-bit Integer x into the random seed r by setting the random seed to Sha of the concatenation of two 32-byte strings: the first with the big-endian representation of the old seed r, and the second with the big-endian representation of x.0xF8, 0x15
Expand

RANDOMIZE
730GETPARAM#F82 i:uint4app_configF82i[i] GETPARAM- x26Returns the i-th parameter from the Tuple provided at c7 for 0 <= i <= 15. Equivalent to c7 PUSHCTR FIRST [i] INDEX.[c = parse_const_u4] 0xF8, 0x20 | c
Expand

If one of these internal operations fails, throws an appropriate type checking or range checking exception.
731NOWGETPARAM#F823app_configF823NOW- x26Returns the current Unix time as an Integer. If it is impossible to recover the requested value starting from c7, throws a type checking or range checking exception as appropriate.0xF8, 0x23
Expand

Equivalent to 3 GETPARAM.
732BLOCKLTGETPARAM#F824app_configF824BLOCKLT- x26Returns the starting logical time of the current block.0xF8, 0x24
Expand

Equivalent to 4 GETPARAM.
733LTIMEGETPARAM#F825app_configF825LTIME- x26Returns the logical time of the current transaction.0xF8, 0x25
Expand

Equivalent to 5 GETPARAM.
734RANDSEEDGETPARAM#F826app_configF826RANDSEED- x26Returns the current random seed as an unsigned 256-bit Integer.0xF8, 0x26
Expand

Equivalent to 6 GETPARAM.
735BALANCEGETPARAM#F827app_configF827BALANCE- t26Returns the remaining balance of the smart contract as a Tuple consisting of an Integer (the remaining Gram balance in nanograms) and a Maybe Cell (a dictionary with 32-bit keys representing the balance of “extra currencies'').0xF8, 0x27
Expand

Equivalent to 7 GETPARAM.
Note that RAW primitives such as SENDRAWMSG do not update this field.
736MYADDRGETPARAM#F828app_configF828MYADDR- s26Returns the internal address of the current smart contract as a Slice with a MsgAddressInt. If necessary, it can be parsed further using primitives such as PARSEMSGADDR or REWRITESTDADDR.0xF8, 0x28
Expand

Equivalent to 8 GETPARAM.
737CONFIGROOTGETPARAM#F829app_configF829CONFIGROOT- D26Returns the Maybe Cell D with the current global configuration dictionary. Equivalent to 9 GETPARAM .0xF8, 0x29
Expand

738MYCODEGETPARAM#F82Aapp_configF82AMYCODE- s26Returns the Cell with the current code of the smart contract. Smart contract has own code, the cell representation of which can be obtained by this instruction.0xF8, 0x2A
Expand

Equivalent to 10 GETPARAM
739INITCODEHASHGETPARAM#F82Bapp_configF82BINITCODEHASH- x26Returns the integer represented 256 bit hash of code cell with which the contract was deployed.0xF8, 0x2B
Expand

Equivalent to 11 GETPARAM.
740STORAGEFEE#F82Capp_configF82CSTORAGEFEE- x26Returns the Integer with collected storage fee from account in this transaction.0xF8, 0x2C
Expand

Equivalent to 12 GETPARAM.
741SEQNO#F82Dapp_configF82DSEQNO- x26returns the Integer with current sequence number of collating block.0xF8, 0x2D
Expand

Equivalent to 13 GETPARAM.
742CONFIGDICT#F830app_configF830CONFIGDICT- D 3226Returns the global configuration dictionary along with its key length (32).0xF8, 0x30
Expand

Equivalent to CONFIGROOT 32 PUSHINT.
743CONFIGPARAM#F832app_configF832CONFIGPARAMi - c -1 or 0Returns the value of the global configuration parameter with integer index i as a Cell c, and a flag to indicate success.0xF8, 0x32
Expand

Equivalent to CONFIGDICT DICTIGETREF.
744CONFIGOPTPARAM#F833app_configF833CONFIGOPTPARAMi - c^?Returns the value of the global configuration parameter with integer index i as a Maybe Cell c^?.0xF8, 0x33
Expand

Equivalent to CONFIGDICT DICTIGETOPTREF.
745GETGLOBVAR#F840app_globalF840GETGLOBVARk - x26Returns the k-th global variable for 0 <= k < 255.0xF8, 0x40
Expand

Equivalent to c7 PUSHCTR SWAP INDEXVARQ.
746GETGLOB#F85_ k:(## 5) {1 <= k}app_globalF85_k[k] GETGLOB- x26Returns the k-th global variable for 1 <= k <= 31.[k = parse_const_u5] 0xF8, 0x40 | k
Expand

Equivalent to c7 PUSHCTR [k] INDEXQ.
747SETGLOBVAR#F860app_globalF860SETGLOBVARx k -26+|c7’|Assigns x to the k-th global variable for 0 <= k < 255.0xF8, 0x60
Expand

Equivalent to c7 PUSHCTR ROTREV SETINDEXVARQ c7 POPCTR.
748SETGLOB#F87_ k:(## 5) {1 <= k}app_globalF87_k[k] SETGLOBx -26+|c7’|Assigns x to the k-th global variable for 1 <= k <= 31.[k = parse_const_u5] 0xF8, 0x60 | k
Expand

Equivalent to c7 PUSHCTR SWAP k SETINDEXQ c7 POPCTR.
749HASHCU#F900app_cryptoF900HASHCUc - x26Computes the representation hash of a Cell c and returns it as a 256-bit unsigned integer x. Useful for signing and checking signatures of arbitrary entities represented by a tree of cells.0xF9, 0x00
Expand

750HASHSU#F901app_cryptoF901HASHSUs - x526Computes the hash of a Slice s and returns it as a 256-bit unsigned integer x. The result is the same as if an ordinary cell containing only data and references from s had been created and its hash computed by HASHCU.0xF9, 0x01
Expand

751SHA256U#F902app_cryptoF902SHA256Us - x26Computes Sha of the data bits of Slice s. If the bit length of s is not divisible by eight, throws a cell underflow exception. The hash value is returned as a 256-bit unsigned integer x.0xF9, 0x02
Expand

752CHKSIGNU#F910app_cryptoF910CHKSIGNUh s k - ?26Checks the Ed25519-signature s of a hash h (a 256-bit unsigned integer, usually computed as the hash of some data) using public key k (also represented by a 256-bit unsigned integer).0xF9, 0x10
Expand

The signature s must be a Slice containing at least 512 data bits; only the first 512 bits are used. The result is -1 if the signature is valid, 0 otherwise.
Notice that CHKSIGNU is equivalent to ROT NEWC 256 STU ENDC ROTREV CHKSIGNS, i.e., to CHKSIGNS with the first argument d set to 256-bit Slice containing h. Therefore, if h is computed as the hash of some data, these data are hashed twice, the second hashing occurring inside CHKSIGNS.
753CHKSIGNS#F911app_cryptoF911CHKSIGNSd s k - ?26Checks whether s is a valid Ed25519-signature of the data portion of Slice d using public key k, similarly to CHKSIGNU. If the bit length of Slice d is not divisible by eight, throws a cell underflow exception. The verification of Ed25519 signatures is the standard one, with Sha used to reduce d to the 256-bit number that is actually signed.0xF9, 0x11
Expand

754CDATASIZEQ#F940app_miscF940CDATASIZEQc n - x y z -1 or 0Recursively computes the count of distinct cells x, data bits y, and cell references z in the dag rooted at Cell c, effectively returning the total storage used by this dag taking into account the identification of equal cells. The values of x, y, and z are computed by a depth-first traversal of this dag, with a hash table of visited cell hashes used to prevent visits of already-visited cells. The total count of visited cells x cannot exceed non-negative Integer n; otherwise the computation is aborted before visiting the (n+1)-st cell and a zero is returned to indicate failure. If c is Null, returns x=y=z=0.0xF9, 0x40
Expand

755CDATASIZE#F941app_miscF941CDATASIZEc n - x y zA non-quiet version of CDATASIZEQ that throws a cell overflow exception (8) on failure.0xF9, 0x41
Expand

756SDATASIZEQ#F942app_miscF942SDATASIZEQs n - x y z -1 or 0Similar to CDATASIZEQ, but accepting a Slice s instead of a Cell. The returned value of x does not take into account the cell that contains the slice s itself; however, the data bits and the cell references of s are accounted for in y and z.0xF9, 0x42
Expand

757SDATASIZE#F943app_miscF943SDATASIZEs n - x y zA non-quiet version of SDATASIZEQ that throws a cell overflow exception (8) on failure.0xF9, 0x43
Expand

758FIND_BY_INIT_CODE_HASH#F944app_miscF944FIND_BY_INIT_CODE_HASHs - tReturns the list of accounts with initial code hash specified in 256 bit of Slice s.0xF9, 0x44
Expand

759FIND_BY_CODE_HASH#F945app_miscF945FIND_BY_CODE_HASHs - tReturns the list of accounts with code hash specified in 256 bit of Slice s.0xF9, 0x45
Expand

760FIND_BY_DATA_HASH#F946app_miscF946FIND_BY_DATA_HASHs - tReturns the list of accounts with data hash specified in 256 bit of Slice s.0xF9, 0x46
Expand

761TRYELECT#F950app_miscF950TRYELECTD - c c' D' x x'Executes try_elect method for accounts got by config param 30. D is the input Hashmap with credits, c - contains serialized validator set, c' is the HashmapE with frozen stakes, D' is the HashmapE with credits, x is the integer with total stake, x' is the integer with total weight.
Expand

762LDGRAMS#FA00app_currencyFA00LDGRAMSs - x s'26Loads (deserializes) a Gram or VarUInteger 16 amount from Slice s, and returns the amount as Integer x along with the remainder s' of s. The expected serialization of x consists of a 4-bit unsigned big-endian integer l, followed by an 8l-bit unsigned big-endian representation of x.0xFA, 0x00
Expand

LDVARUINT16The net effect is approximately equivalent to 4 LDU SWAP 3 LSHIFT# LDUX.
763LDVARINT16#FA01app_currencyFA01LDVARINT16s - x s'26Similar to LDVARUINT16, but loads a signed Integer x.0xFA, 0x01
Expand

Approximately equivalent to 4 LDU SWAP 3 LSHIFT# LDIX.
764STGRAMS#FA02app_currencyFA02STGRAMSb x - b'26Stores (serializes) an Integer x in the range 0...2^120-1 into Builder b, and returns the resulting Builder b'. The serialization of x consists of a 4-bit unsigned big-endian integer l, which is the smallest integer l>=0, such that x<2^(8l), followed by an 8l-bit unsigned big-endian representation of x. If x does not belong to the supported range, a range check exception is thrown.0xFA, 0x02
Expand

STVARUINT16
765STVARINT16#FA03app_currencyFA03STVARINT16b x - b'26Similar to STVARUINT16, but serializes a signed Integer x in the range -2^119...2^119-1.0xFA, 0x03
Expand

766LDVARUINT32#FA04app_currencyFA04LDVARUINT32s - x s'Loads (deserializes) a VarUInteger 32 from CellSlices, and returns the deserialized value as an Integer 0 <= x<2^248. The expected serialization of x consists of a 5-bit unsigned big-endian integer l, followed by an 8l-bit unsigned big-endian representation of x. The net effect is approximately equivalent to LDU 5; SWAP; SHIFT 3; LDUX.0xFA, 0x04
Expand

767LDVARINT32#FA05app_currencyFA05LDVARINT32s - x s'Deserializes a VarInteger 32 from CellSlices, and returns the deserialized value as an Integer-2^247 <= x<2^247.0xFA, 0x05
Expand

768STVARUINT32#FA06app_currencyFA06STVARUINT32b x - b'26Serializes an Integer 0<=x<2^248 as a VarUInteger 32.0xFA, 0x06
Expand

769STVARINT32#FA07app_currencyFA07STVARINT32b x - b'26serializes an Integer -2^247<=x<2^{247} as a VarInteger 32.0xFA, 0x07
Expand

770LDMSGADDR#FA40app_addrFA40LDMSGADDRs - s' s''26Loads from Slice s the only prefix that is a valid MsgAddress, and returns both this prefix s' and the remainder s'' of s as slices.0xFA, 0x40
Expand

771LDMSGADDRQ#FA41app_addrFA41LDMSGADDRQs - s' s'' -1 or s 026A quiet version of LDMSGADDR: on success, pushes an extra -1; on failure, pushes the original s and a zero.0xFA, 0x41
Expand

772PARSEMSGADDR#FA42app_addrFA42PARSEMSGADDRs - t26Decomposes Slice s containing a valid MsgAddress into a Tuple t with separate fields of this MsgAddress. If s is not a valid MsgAddress, a cell deserialization exception is thrown.0xFA, 0x42
Expand

773PARSEMSGADDRQ#FA43app_addrFA43PARSEMSGADDRQs - t -1 or 026A quiet version of PARSEMSGADDR: returns a zero on error instead of throwing an exception.0xFA, 0x43
Expand

774REWRITESTDADDR#FA44app_addrFA44REWRITESTDADDRs - x y26Parses Slice s containing a valid MsgAddressInt (usually a msg_addr_std), applies rewriting from the anycast (if present) to the same-length prefix of the address, and returns both the workchain x and the 256-bit address y as integers. If the address is not 256-bit, or if s is not a valid serialization of MsgAddressInt, throws a cell deserialization exception.0xFA, 0x44
Expand

775REWRITESTDADDRQ#FA45app_addrFA45REWRITESTDADDRQs - x y -1 or 026A quiet version of primitive REWRITESTDADDR.0xFA, 0x45
Expand

776REWRITEVARADDR#FA46app_addrFA46REWRITEVARADDRs - x s'26A variant of REWRITESTDADDR that returns the (rewritten) address as a Slice s, even if it is not exactly 256 bit long (represented by a msg_addr_var).0xFA, 0x46
Expand

777REWRITEVARADDRQ#FA47app_addrFA47REWRITEVARADDRQs - x s' -1 or 026A quiet version of primitive REWRITEVARADDR.0xFA, 0x47
Expand

778SENDRAWMSG#FB00app_actionsFB00SENDRAWMSGc x -526Sends a raw message contained in Cell c, which should contain a correctly serialized object Message X, with the only exception that the source address is allowed to have dummy value addr_none (to be automatically replaced with the current smart-contract address), and ihr_fee, fwd_fee, created_lt and created_at fields can have arbitrary values (to be rewritten with correct values during the action phase of the current transaction). Integer parameter x contains the flags. Currently x=0 is used for ordinary messages; x=128 is used for messages that are to carry all the remaining balance of the current smart contract (instead of the value originally indicated in the message); x=64 is used for messages that carry all the remaining value of the inbound message in addition to the value initially indicated in the new message (if bit 0 is not set, the gas fees are deducted from this amount); x'=x+1 means that the sender wants to pay transfer fees separately; x'=x+2 means that any errors arising while processing this message during the action phase should be ignored. Finally, x'=x+32 means that the current account must be destroyed if its resulting balance is zero. This flag is usually employed together with +128.0xFB, 0x00
Expand

779RAWRESERVE#FB02app_actionsFB02RAWRESERVEx y -526Creates an output action which would reserve exactly x nanograms (if y=0), at most x nanograms (if y=2), or all but x nanograms (if y=1 or y=3), from the remaining balance of the account. It is roughly equivalent to creating an outbound message carrying x nanograms (or b-x nanograms, where b is the remaining balance) to oneself, so that the subsequent output actions would not be able to spend more money than the remainder. Bit +2 in y means that the external action does not fail if the specified amount cannot be reserved; instead, all remaining balance is reserved. Bit +8 in y means x:=-x before performing any further actions. Bit +4 in y means that x is increased by the original balance of the current account (before the compute phase), including all extra currencies, before performing any other checks and actions. Currently x must be a non-negative integer, and y must be in the range 0...15.0xFB, 0x02
Expand

780RAWRESERVEX#FB03app_actionsFB03RAWRESERVEXx D y -526Similar to RAWRESERVE, but also accepts a dictionary D (represented by a Cell or Null) with extra currencies. In this way currencies other than Grams can be reserved.0xFB, 0x03
Expand

781SETCODE#FB04app_actionsFB04SETCODEc -526Creates an output action that would change this smart contract code to that given by Cell c. Notice that this change will take effect only after the successful termination of the current run of the smart contract.0xFB, 0x04
Expand

782SETLIBCODE#FB06app_actionsFB06SETLIBCODEc x -526Creates an output action that would modify the collection of this smart contract libraries by adding or removing library with code given in Cell c. If x=0, the library is actually removed if it was previously present in the collection (if not, this action does nothing). If x=1, the library is added as a private library, and if x=2, the library is added as a public library (and becomes available to all smart contracts if the current smart contract resides in the masterchain); if the library was present in the collection before, its public/private status is changed according to x. Values of x other than 0...2 are invalid.0xFB, 0x06
Expand

783CHANGELIB#FB07app_actionsFB07CHANGELIBh x -526Creates an output action similarly to SETLIBCODE, but instead of the library code accepts its hash as an unsigned 256-bit integer h. If x!=0 and the library with hash h is absent from the library collection of this smart contract, this output action will fail.0xFB, 0x07
Expand

784COPYLEFT#FB0Aapp_actionsFB0ACOPYLEFTs x -526Where s - is slice of 256-bit AccountId and x - is type of license. Add license payment to code creator. The license payment calculates from compute _phase_fees taking the appropriate percentage. If summary payment is less than license _payment_threshold, then value saves in unsplit_shard_state of masterblock. If summary payment in unsplit_shard_state is more than license_payment_threshold then node sends internal message to account address in masterchain, specified in slice s. The instruction return an error on contracts in masterchain.0xFB, 0x0A
Expand

785DEBUG#FE nn:(#<= 239)debugFEnn{nn} DEBUG-260 <= nn < 240[z = parse_const_u8_240] 0xFE, z
Expand

786DEBUGSTR#FEF n:(## 4) ssss:((n 8 + 8) Bit)debugFEFnssss{string} DEBUGSTR-260 <= n < 16. Length of ssss is n+1 bytes.[z = parse_const_u8_setcp] 0xFF, z
Expand

{string} {x} DEBUGSTRI{string} is a string literal.
DEBUGSTR: ssss is the given string.
DEBUGSTRI: ssss is one-byte integer 0 <= x <= 255 followed by the given string.
787DUMPSTKDEBUG#FE00debugFE00DUMPSTK-26Dumps the stack (at most the top 255 values) and shows the total stack depth.0xFE, 0x00
Expand

788DUMPSTKTOP#FE0 n:(## 4)debugFE0n{n} DUMPSTKTOP-261<=n<15, dumps the top n values from the stack, starting from the deepest of them. If there are d<n values available, dumps only d values.[z = parse_const_u4_1_14] 0xFE, z
Expand

789HEXDUMP#FE10debugFE10HEXDUMP-26Dumps s0 in hexadecimal form, be it a Slice or an Integer.0xFE, 0x10
Expand

790HEXPRINT#FE11debugFE11HEXPRINT-26Similar to HEXDUMP, except the hexadecimal representation of s0 is not immediately output, but rather concatenated to an output text buffer.0xFE, 0x11
Expand

791BINDUMP#FE12debugFE12BINDUMP-26Dumps s0 in binary form, similarly to HEXDUMP.0xFE, 0x12
Expand

792BINPRINT#FE13debugFE13BINPRINT-26Outputs the binary representation of s0 to a text buffer.0xFE, 0x13
Expand

793STRDUMP#FE14debugFE14STRDUMP-26Dumps the Slice at s0 as an UTF-8 string.0xFE, 0x14
Expand

794STRPRINT#FE15debugFE15STRPRINT-26Similar to STRDUMP, but outputs the string into a text buffer (without carriage return).0xFE, 0x15
Expand

795DEBUGOFF#FE1EdebugFE1EDEBUGOFF-26Disables all debug output until it is re-enabled by a DEBUGON. More precisely, this primitive increases an internal counter, which disables all debug operations (except DEBUGOFF and DEBUGON) when strictly positive.0xFE, 0x1E
Expand

796DEBUGON#FE1FdebugFE1FDEBUGON-26Enables debug output (in a debug version of TVM).0xFE, 0x1F
Expand

797DUMPDEBUG#FE2 i:uint4debugFE2is[i] DUMP-26Dumps s[i].[z = parse_const_u4_14] 0xFE, 0x20 | z
Expand

798PRINT#FE3 n:uint4debugFE3is[n] PRINT-260<=n<15, concatenates the text representation of s(n) (without any leading or trailing spaces or carriage returns) to a text buffer which will be output before the output of any other debug operation.[z = parse_const_u4_14] 0xFE, 0x30 | z
Expand

799DUMPTOSFMT#FEF n:(## 4) ssss:((n 8 + 8) Bit)debugFEFnssss[ssss]DUMPTOSFMT-26Dumps s0 formatted according to the (n+1)-byte string ssss. This string might contain (a prefix of) the name of a TL-B type supported by the debugger. If the string begins with a zero byte, simply outputs it (without the first byte) into the debug log. If the string begins with a byte equal to one, concatenates it to a buffer, which will be output before the output of any other debug operation (effectively outputs a string without a carriage return).
Expand

800LOGSTR#FEF n:(## 4) 00 ssss:((n 8 + 8) Bit)debugFEFn00ssss[ssss]LOGSTR-26String ssss is n bytes long.
Expand

801LOGFLUSH#FEF000debugFEF000LOGFLUSH-26Flushes all pending debug output from the buffer into the debug log.0xFE, 0xF0, 0x00
Expand

802PRINTSTR#FEF n:(## 4) 01 ssss:((n 8 + 8) Bit)debugFEFn01ssss[ssss]PRINTSTR-26String ssss is n bytes long.
Expand

803SETCPcodepageFFnn[nn] SETCP-26Selects TVM codepage 0 <= nn < 240. If the codepage is not supported, throws an invalid opcode exception.[z = parse_const_u8_setcp] 0xFF, z
Expand

804SETCP0SETCP#FF nn:(#<= 239)codepageFF00SETCP0-26Selects TVM (test) codepage zero as described in this document.0xFF, 0x00
Expand

805SETCP_SPECIAL#FFF z:(## 4) {1 <= z}codepageFFFz[z-16] SETCP-26Selects TVM codepage z-16 for 1 <= z <= 15. Negative codepages -13...-1 are reserved for restricted versions of TVM needed to validate runs of TVM in other codepages. Negative codepage -14 is reserved for experimental codepages, not necessarily compatible between different TVM implementations, and should be disabled in the production versions of TVM.
Expand

806SETCPX#FFF0codepageFFF0SETCPXc -26Selects codepage c with -2^15 <= c < 2^15 passed in the top of the stack.0xFF, 0xF0
Expand