• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In
No new info detected.

CityOfZion / neo3-boa / 9a535731-11a4-476e-ac4c-f4b1ec2d8bb7

25 Sep 2023 08:49PM UTC coverage: 91.739% (+0.001%) from 91.738%
9a535731-11a4-476e-ac4c-f4b1ec2d8bb7

push

circleci

Mirella de Medeiros
CU-864ea8yf8 - Create functional tests for Neo 3.6 features

4 of 4 new or added lines in 4 files covered. (100.0%)

19967 of 21765 relevant lines covered (91.74%)

3.62 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

99.75
/boa3/internal/neo/vm/opcode/Opcode.py
1
from __future__ import annotations
4✔
2

3
from enum import Enum
4✔
4

5

6
class Opcode(bytes, Enum):
4✔
7
    """
8
    Opcodes are similar to instructions in assembly language.
9
    """
10

11
    # region Constants
12

13
    PUSHINT8 = b'\x00'
4✔
14
    """
1✔
15
    Pushes a 1-byte signed integer onto the stack.
16

17
    :meta hide-value:
18
    """
19
    PUSHINT16 = b'\x01'
4✔
20
    """
1✔
21
    Pushes a 2-byte signed integer onto the stack.
22

23
    :meta hide-value:
24
    """
25
    PUSHINT32 = b'\x02'
4✔
26
    """
1✔
27
    Pushes a 4-byte signed integer onto the stack.
28

29
    :meta hide-value:
30
    """
31
    PUSHINT64 = b'\x03'
4✔
32
    """
1✔
33
    Pushes a 8-byte signed integer onto the stack.
34

35
    :meta hide-value:
36
    """
37
    PUSHINT128 = b'\x04'
4✔
38
    """
1✔
39
    Pushes a 16-byte signed integer onto the stack.
40

41
    :meta hide-value:
42
    """
43
    PUSHINT256 = b'\x05'
4✔
44
    """
1✔
45
    Pushes a 32-byte signed integer onto the stack.
46

47
    :meta hide-value:
48
    """
49

50
    PUSHT = b'\x08'
4✔
51
    """
1✔
52
    Pushes the boolean value True onto the stack.
53

54
    :meta hide-value:
55
    """
56
    PUSHF = b'\x09'
4✔
57
    """
1✔
58
    Pushes the boolean value False onto the stack.
59

60
    :meta hide-value:
61
    """
62
    PUSHA = b'\x0A'
4✔
63
    """
1✔
64
    Converts the 4-bytes offset to a Pointer, and pushes it onto the stack.
65

66
    :meta hide-value:
67
    """
68
    PUSHNULL = b'\x0B'
4✔
69
    """
1✔
70
    The item null is pushed onto the stack.
71

72
    :meta hide-value:
73
    """
74
    PUSHDATA1 = b'\x0C'
4✔
75
    """
1✔
76
    The next byte contains the number of bytes to be pushed onto the stack.
77

78
    :meta hide-value:
79
    """
80
    PUSHDATA2 = b'\x0D'
4✔
81
    """
1✔
82
    The next two bytes contain the number of bytes to be pushed onto the stack.
83

84
    :meta hide-value:
85
    """
86
    PUSHDATA4 = b'\x0E'
4✔
87
    """
1✔
88
    The next four bytes contain the number of bytes to be pushed onto the stack.
89

90
    :meta hide-value:
91
    """
92

93
    PUSHM1 = b'\x0F'
4✔
94
    """
1✔
95
    The number -1 is pushed onto the stack.
96

97
    :meta hide-value:
98
    """
99
    PUSH0 = b'\x10'
4✔
100
    """
1✔
101
    The number 0 is pushed onto the stack.
102

103
    :meta hide-value:
104
    """
105
    PUSH1 = b'\x11'
4✔
106
    """
1✔
107
    The number 1 is pushed onto the stack.
108

109
    :meta hide-value:
110
    """
111
    PUSH2 = b'\x12'
4✔
112
    """
1✔
113
    The number 2 is pushed onto the stack.
114

115
    :meta hide-value:
116
    """
117
    PUSH3 = b'\x13'
4✔
118
    """
1✔
119
    The number 3 is pushed onto the stack.
120

121
    :meta hide-value:
122
    """
123
    PUSH4 = b'\x14'
4✔
124
    """
1✔
125
    The number 4 is pushed onto the stack.
126

127
    :meta hide-value:
128
    """
129
    PUSH5 = b'\x15'
4✔
130
    """
1✔
131
    The number 5 is pushed onto the stack.
132

133
    :meta hide-value:
134
    """
135
    PUSH6 = b'\x16'
4✔
136
    """
1✔
137
    The number 6 is pushed onto the stack.
138

139
    :meta hide-value:
140
    """
141
    PUSH7 = b'\x17'
4✔
142
    """
1✔
143
    The number 7 is pushed onto the stack.
144

145
    :meta hide-value:
146
    """
147
    PUSH8 = b'\x18'
4✔
148
    """
1✔
149
    The number 8 is pushed onto the stack.
150

151
    :meta hide-value:
152
    """
153
    PUSH9 = b'\x19'
4✔
154
    """
1✔
155
    The number 9 is pushed onto the stack.
156

157
    :meta hide-value:
158
    """
159
    PUSH10 = b'\x1A'
4✔
160
    """
1✔
161
    The number 10 is pushed onto the stack.
162

163
    :meta hide-value:
164
    """
165
    PUSH11 = b'\x1B'
4✔
166
    """
1✔
167
    The number 11 is pushed onto the stack.
168

169
    :meta hide-value:
170
    """
171
    PUSH12 = b'\x1C'
4✔
172
    """
1✔
173
    The number 12 is pushed onto the stack.
174

175
    :meta hide-value:
176
    """
177
    PUSH13 = b'\x1D'
4✔
178
    """
1✔
179
    The number 13 is pushed onto the stack.
180

181
    :meta hide-value:
182
    """
183
    PUSH14 = b'\x1E'
4✔
184
    """
1✔
185
    The number 14 is pushed onto the stack.
186

187
    :meta hide-value:
188
    """
189
    PUSH15 = b'\x1F'
4✔
190
    """
1✔
191
    The number 15 is pushed onto the stack.
192

193
    :meta hide-value:
194
    """
195
    PUSH16 = b'\x20'
4✔
196
    """
1✔
197
    The number 16 is pushed onto the stack.
198

199
    :meta hide-value:
200
    """
201

202
    # endregion
203

204
    # region Flow control
205

206
    NOP = b'\x21'
4✔
207
    """
1✔
208
    The NOP operation does nothing. It is intended to fill in space if opcodes are patched.
209

210
    :meta hide-value:
211
    """
212
    JMP = b'\x22'
4✔
213
    """
1✔
214
    Unconditionally transfers control to a target instruction. The target instruction is represented as a 1-byte
215
    signed offset from the beginning of the current instruction.
216

217
    :meta hide-value:
218
    """
219
    JMP_L = b'\x23'
4✔
220
    """
1✔
221
    Unconditionally transfers control to a target instruction. The target instruction is represented as a 4-bytes
222
    signed offset from the beginning of the current instruction.
223

224
    :meta hide-value:
225
    """
226
    JMPIF = b'\x24'
4✔
227
    """
1✔
228
    Transfers control to a target instruction if the value is True, not null, or non-zero. The target instruction
229
    is represented as a 1-byte signed offset from the beginning of the current instruction.
230

231
    :meta hide-value:
232
    """
233
    JMPIF_L = b'\x25'
4✔
234
    """
1✔
235
    Transfers control to a target instruction if the value is True, not null, or non-zero. The target instruction
236
    is represented as a 4-bytes signed offset from the beginning of the current instruction.
237

238
    :meta hide-value:
239
    """
240
    JMPIFNOT = b'\x26'
4✔
241
    """
1✔
242
    Transfers control to a target instruction if the value is False, a null reference,
243
    or zero. The target instruction is represented as a 1-byte signed offset from the beginning of the current
244
    instruction.
245

246
    :meta hide-value:
247
    """
248
    JMPIFNOT_L = b'\x27'
4✔
249
    """
1✔
250
    Transfers control to a target instruction if the value is False, a null reference,
251
    or zero. The target instruction is represented as a 4-bytes signed offset from the beginning of the current
252
    instruction.
253

254
    :meta hide-value:
255
    """
256
    JMPEQ = b'\x28'
4✔
257
    """
1✔
258
    Transfers control to a target instruction if two values are equal. The target instruction is represented as a
259
    1-byte signed offset from the beginning of the current instruction.
260

261
    :meta hide-value:
262
    """
263
    JMPEQ_L = b'\x29'
4✔
264
    """
1✔
265
    Transfers control to a target instruction if two values are equal. The target instruction is represented as a
266
    4-bytes signed offset from the beginning of the current instruction.
267

268
    :meta hide-value:
269
    """
270
    JMPNE = b'\x2A'
4✔
271
    """
1✔
272
    Transfers control to a target instruction when two values are not equal. The target instruction is represented
273
    as a 1-byte signed offset from the beginning of the current instruction.
274

275
    :meta hide-value:
276
    """
277
    JMPNE_L = b'\x2B'
4✔
278
    """
1✔
279
    Transfers control to a target instruction when two values are not equal. The target instruction is represented
280
    as a 4-bytes signed offset from the beginning of the current instruction.
281

282
    :meta hide-value:
283
    """
284
    JMPGT = b'\x2C'
4✔
285
    """
1✔
286
    Transfers control to a target instruction if the first value is greater than the second value. The target
287
    instruction is represented as a 1-byte signed offset from the beginning of the current instruction.
288

289
    :meta hide-value:
290
    """
291
    JMPGT_L = b'\x2D'
4✔
292
    """
1✔
293
    Transfers control to a target instruction if the first value is greater than the second value. The target
294
    instruction is represented as a 4-bytes signed offset from the beginning of the current instruction.
295

296
    :meta hide-value:
297
    """
298
    JMPGE = b'\x2E'
4✔
299
    """
1✔
300
    Transfers control to a target instruction if the first value is greater than or equal to the second value. The
301
    target instruction is represented as a 1-byte signed offset from the beginning of the current instruction.
302

303
    :meta hide-value:
304
    """
305
    JMPGE_L = b'\x2F'
4✔
306
    """
1✔
307
    Transfers control to a target instruction if the first value is greater than or equal to the second value. The
308
    target instruction is represented as a 4-bytes signed offset from the beginning of the current instruction.
309

310
    :meta hide-value:
311
    """
312
    JMPLT = b'\x30'
4✔
313
    """
1✔
314
    Transfers control to a target instruction if the first value is less than the second value. The target
315
    instruction is represented as a 1-byte signed offset from the beginning of the current instruction.
316

317
    :meta hide-value:
318
    """
319
    JMPLT_L = b'\x31'
4✔
320
    """
1✔
321
    Transfers control to a target instruction if the first value is less than the second value. The target
322
    instruction is represented as a 4-bytes signed offset from the beginning of the current instruction.
323

324
    :meta hide-value:
325
    """
326
    JMPLE = b'\x32'
4✔
327
    """
1✔
328
    Transfers control to a target instruction if the first value is less than or equal to the second value. The
329
    target instruction is represented as a 1-byte signed offset from the beginning of the current instruction.
330

331
    :meta hide-value:
332
    """
333
    JMPLE_L = b'\x33'
4✔
334
    """
1✔
335
    Transfers control to a target instruction if the first value is less than or equal to the second value. The
336
    target instruction is represented as a 4-bytes signed offset from the beginning of the current instruction.
337

338
    :meta hide-value:
339
    """
340

341
    CALL = b'\x34'
4✔
342
    """
1✔
343
    Calls the function at the target address which is represented as a 1-byte signed offset from the beginning of
344
    the current instruction.
345

346
    :meta hide-value:
347
    """
348
    CALL_L = b'\x35'
4✔
349
    """
1✔
350
    Calls the function at the target address which is represented as a 4-bytes signed offset from the beginning of
351
    the current instruction.
352

353
    :meta hide-value:
354
    """
355
    CALLA = b'\x36'
4✔
356
    """
1✔
357
    Pop the address of a function from the stack, and call the function.
358

359
    :meta hide-value:
360
    """
361
    CALLT = b'\x37'
4✔
362
    """
1✔
363
    Calls the function which is described by the token.
364

365
    :meta hide-value:
366
    """
367
    ABORT = b'\x38'
4✔
368
    """
1✔
369
    It turns the vm state to FAULT immediately, and cannot be caught.
370

371
    :meta hide-value:
372
    """
373
    ASSERT = b'\x39'
4✔
374
    """
1✔
375
    Pop the top value of the stack, if it false, then exit vm execution and set vm state to FAULT.
376

377
    :meta hide-value:
378
    """
379
    THROW = b'\x3A'
4✔
380
    """
1✔
381
    Pop the top value of the stack, and throw it.
382

383
    :meta hide-value:
384
    """
385
    TRY = b'\x3B'
4✔
386
    """
1✔
387
    TRY CatchOffset(sbyte) FinallyOffset(sbyte). If there's no catch body, set CatchOffset 0. If there's no finally
388
    body, set FinallyOffset 0.
389

390
    :meta hide-value:
391
    """
392
    TRY_L = b'\x3C'
4✔
393
    """
1✔
394
    TRY_L CatchOffset(int) FinallyOffset(int). If there's no catch body, set CatchOffset 0. If there's no finally
395
    body, set FinallyOffset 0.
396

397
    :meta hide-value:
398
    """
399
    ENDTRY = b'\x3D'
4✔
400
    """
1✔
401
    Ensures that the appropriate surrounding finally blocks are executed. And then unconditionally transfers
402
    control to the specific target instruction, represented as a 1-byte signed offset from the beginning of the
403
    current instruction.
404

405
    :meta hide-value:
406
    """
407
    ENDTRY_L = b'\x3E'
4✔
408
    """
1✔
409
    Ensures that the appropriate surrounding finally blocks are executed. And then unconditionally transfers
410
    control to the specific target instruction, represented as a 4-byte signed offset from the beginning of the
411
    current instruction.
412

413
    :meta hide-value:
414
    """
415
    ENDFINALLY = b'\x3F'
4✔
416
    """
1✔
417
    End finally, If no exception happen or be catched, vm will jump to the target instruction of ENDTRY/ENDTRY_L.
418
    Otherwise vm will rethrow the exception to upper layer.
419

420
    :meta hide-value:
421
    """
422
    RET = b'\x40'
4✔
423
    """
1✔
424
    Returns from the current method.
425

426
    :meta hide-value:
427
    """
428
    SYSCALL = b'\x41'
4✔
429
    """
1✔
430
    Calls to an interop service.
431

432
    :meta hide-value:
433
    """
434

435
    # endregion
436

437
    # region Stack
438

439
    DEPTH = b'\x43'
4✔
440
    """
1✔
441
    Puts the number of stack items onto the stack.
442

443
    :meta hide-value:
444
    """
445
    DROP = b'\x45'
4✔
446
    """
1✔
447
    Removes the top stack item.
448

449
    :meta hide-value:
450
    """
451
    NIP = b'\x46'
4✔
452
    """
1✔
453
    Removes the second-to-top stack item.
454

455
    :meta hide-value:
456
    """
457
    XDROP = b'\x48'
4✔
458
    """
1✔
459
    The item n back in the main stack is removed.
460

461
    :meta hide-value:
462
    """
463
    CLEAR = b'\x49'
4✔
464
    """
1✔
465
    Clear the stack
466

467
    :meta hide-value:
468
    """
469

470
    DUP = b'\x4A'
4✔
471
    """
1✔
472
    Duplicates the top stack item.
473

474
    :meta hide-value:
475
    """
476
    OVER = b'\x4B'
4✔
477
    """
1✔
478
    Copies the second-to-top stack item to the top.
479

480
    :meta hide-value:
481
    """
482
    PICK = b'\x4D'
4✔
483
    """
1✔
484
    The item n back in the stack is copied to the top.
485

486
    :meta hide-value:
487
    """
488

489
    TUCK = b'\x4E'
4✔
490
    """
1✔
491
    The item at the top of the stack is copied and inserted before the second-to-top item.
492

493
    :meta hide-value:
494
    """
495
    SWAP = b'\x50'
4✔
496
    """
1✔
497
    The top two items on the stack are swapped.
498

499
    :meta hide-value:
500
    """
501
    ROT = b'\x51'
4✔
502
    """
1✔
503
    The top three items on the stack are rotated to the left.
504

505
    :meta hide-value:
506
    """
507
    ROLL = b'\x52'
4✔
508
    """
1✔
509
    The item n back in the stack is moved to the top.
510

511
    :meta hide-value:
512
    """
513
    REVERSE3 = b'\x53'
4✔
514
    """
1✔
515
    Reverse the order of the top 3 items on the stack.
516

517
    :meta hide-value:
518
    """
519
    REVERSE4 = b'\x54'
4✔
520
    """
1✔
521
    Reverse the order of the top 4 items on the stack.
522

523
    :meta hide-value:
524
    """
525
    REVERSEN = b'\x55'
4✔
526
    """
1✔
527
    Pop the number N on the stack, and reverse the order of the top N items on the stack.
528

529
    :meta hide-value:
530
    """
531

532
    # endregion
533

534
    # region Slot
535

536
    INITSSLOT = b'\x56'
4✔
537
    """
1✔
538
    Initialize the static field list for the current execution context.
539

540
    :meta hide-value:
541
    """
542
    INITSLOT = b'\x57'
4✔
543
    """
1✔
544
    Initialize the argument slot and the local variable list for the current execution context.
545

546
    :meta hide-value:
547
    """
548

549
    LDSFLD0 = b'\x58'
4✔
550
    """
1✔
551
    Loads the static field at index 0 onto the evaluation stack.
552

553
    :meta hide-value:
554
    """
555
    LDSFLD1 = b'\x59'
4✔
556
    """
1✔
557
    Loads the static field at index 1 onto the evaluation stack.
558

559
    :meta hide-value:
560
    """
561
    LDSFLD2 = b'\x5A'
4✔
562
    """
1✔
563
    Loads the static field at index 2 onto the evaluation stack.
564

565
    :meta hide-value:
566
    """
567
    LDSFLD3 = b'\x5B'
4✔
568
    """
1✔
569
    Loads the static field at index 3 onto the evaluation stack.
570

571
    :meta hide-value:
572
    """
573
    LDSFLD4 = b'\x5C'
4✔
574
    """
1✔
575
    Loads the static field at index 4 onto the evaluation stack.
576

577
    :meta hide-value:
578
    """
579
    LDSFLD5 = b'\x5D'
4✔
580
    """
1✔
581
    Loads the static field at index 5 onto the evaluation stack.
582

583
    :meta hide-value:
584
    """
585
    LDSFLD6 = b'\x5E'
4✔
586
    """
1✔
587
    Loads the static field at index 6 onto the evaluation stack.
588

589
    :meta hide-value:
590
    """
591
    LDSFLD = b'\x5F'
4✔
592
    """
1✔
593
    Loads the static field at a specified index onto the evaluation stack. The index is represented as a 1-byte
594
    unsigned integer.
595

596
    :meta hide-value:
597
    """
598
    STSFLD0 = b'\x60'
4✔
599
    """
1✔
600
    Stores the value on top of the evaluation stack in the static field list at index 0.
601

602
    :meta hide-value:
603
    """
604
    STSFLD1 = b'\x61'
4✔
605
    """
1✔
606
    Stores the value on top of the evaluation stack in the static field list at index 1.
607

608
    :meta hide-value:
609
    """
610
    STSFLD2 = b'\x62'
4✔
611
    """
1✔
612
    Stores the value on top of the evaluation stack in the static field list at index 2.
613

614
    :meta hide-value:
615
    """
616
    STSFLD3 = b'\x63'
4✔
617
    """
1✔
618
    Stores the value on top of the evaluation stack in the static field list at index 3.
619

620
    :meta hide-value:
621
    """
622
    STSFLD4 = b'\x64'
4✔
623
    """
1✔
624
    Stores the value on top of the evaluation stack in the static field list at index 4.
625

626
    :meta hide-value:
627
    """
628
    STSFLD5 = b'\x65'
4✔
629
    """
1✔
630
    Stores the value on top of the evaluation stack in the static field list at index 5.
631

632
    :meta hide-value:
633
    """
634
    STSFLD6 = b'\x66'
4✔
635
    """
1✔
636
    Stores the value on top of the evaluation stack in the static field list at index 6.
637

638
    :meta hide-value:
639
    """
640
    STSFLD = b'\x67'
4✔
641
    """
1✔
642
    Stores the value on top of the evaluation stack in the static field list at a specified index. The index is
643
    represented as a 1-byte unsigned integer.
644

645
    :meta hide-value:
646
    """
647
    LDLOC0 = b'\x68'
4✔
648
    """
1✔
649
    Loads the local variable at index 0 onto the evaluation stack.
650

651
    :meta hide-value:
652
    """
653
    LDLOC1 = b'\x69'
4✔
654
    """
1✔
655
    Loads the local variable at index 1 onto the evaluation stack.
656

657
    :meta hide-value:
658
    """
659
    LDLOC2 = b'\x6A'
4✔
660
    """
1✔
661
    Loads the local variable at index 2 onto the evaluation stack.
662

663
    :meta hide-value:
664
    """
665
    LDLOC3 = b'\x6B'
4✔
666
    """
1✔
667
    Loads the local variable at index 3 onto the evaluation stack.
668

669
    :meta hide-value:
670
    """
671
    LDLOC4 = b'\x6C'
4✔
672
    """
1✔
673
    Loads the local variable at index 4 onto the evaluation stack.
674

675
    :meta hide-value:
676
    """
677
    LDLOC5 = b'\x6D'
4✔
678
    """
1✔
679
    Loads the local variable at index 5 onto the evaluation stack.
680

681
    :meta hide-value:
682
    """
683
    LDLOC6 = b'\x6E'
4✔
684
    """
1✔
685
    Loads the local variable at index 6 onto the evaluation stack.
686

687
    :meta hide-value:
688
    """
689
    LDLOC = b'\x6F'
4✔
690
    """
1✔
691
    Loads the local variable at a specified index onto the evaluation stack. The index is represented as a 1-byte
692
    unsigned integer.
693

694
    :meta hide-value:
695
    """
696
    STLOC0 = b'\x70'
4✔
697
    """
1✔
698
    Stores the value on top of the evaluation stack in the local variable list at index 0.
699

700
    :meta hide-value:
701
    """
702
    STLOC1 = b'\x71'
4✔
703
    """
1✔
704
    Stores the value on top of the evaluation stack in the local variable list at index 1.
705

706
    :meta hide-value:
707
    """
708
    STLOC2 = b'\x72'
4✔
709
    """
1✔
710
    Stores the value on top of the evaluation stack in the local variable list at index 2.
711

712
    :meta hide-value:
713
    """
714
    STLOC3 = b'\x73'
4✔
715
    """
1✔
716
    Stores the value on top of the evaluation stack in the local variable list at index 3.
717

718
    :meta hide-value:
719
    """
720
    STLOC4 = b'\x74'
4✔
721
    """
1✔
722
    Stores the value on top of the evaluation stack in the local variable list at index 4.
723

724
    :meta hide-value:
725
    """
726
    STLOC5 = b'\x75'
4✔
727
    """
1✔
728
    Stores the value on top of the evaluation stack in the local variable list at index 5.
729

730
    :meta hide-value:
731
    """
732
    STLOC6 = b'\x76'
4✔
733
    """
1✔
734
    Stores the value on top of the evaluation stack in the local variable list at index 6.
735

736
    :meta hide-value:
737
    """
738
    STLOC = b'\x77'
4✔
739
    """
1✔
740
    Stores the value on top of the evaluation stack in the local variable list at a specified index. The index is
741
    represented as a 1-byte unsigned integer.
742

743
    :meta hide-value:
744
    """
745
    LDARG0 = b'\x78'
4✔
746
    """
1✔
747
    Loads the argument at index 0 onto the evaluation stack.
748

749
    :meta hide-value:
750
    """
751
    LDARG1 = b'\x79'
4✔
752
    """
1✔
753
    Loads the argument at index 1 onto the evaluation stack.
754

755
    :meta hide-value:
756
    """
757
    LDARG2 = b'\x7A'
4✔
758
    """
1✔
759
    Loads the argument at index 2 onto the evaluation stack.
760

761
    :meta hide-value:
762
    """
763
    LDARG3 = b'\x7B'
4✔
764
    """
1✔
765
    Loads the argument at index 3 onto the evaluation stack.
766

767
    :meta hide-value:
768
    """
769
    LDARG4 = b'\x7C'
4✔
770
    """
1✔
771
    Loads the argument at index 4 onto the evaluation stack.
772

773
    :meta hide-value:
774
    """
775
    LDARG5 = b'\x7D'
4✔
776
    """
1✔
777
    Loads the argument at index 5 onto the evaluation stack.
778

779
    :meta hide-value:
780
    """
781
    LDARG6 = b'\x7E'
4✔
782
    """
1✔
783
    Loads the argument at index 6 onto the evaluation stack.
784

785
    :meta hide-value:
786
    """
787
    LDARG = b'\x7F'
4✔
788
    """
1✔
789
    Loads the argument at a specified index onto the evaluation stack. The index is represented as a 1-byte
790
    unsigned integer.
791

792
    :meta hide-value:
793
    """
794
    STARG0 = b'\x80'
4✔
795
    """
1✔
796
    Stores the value on top of the evaluation stack in the argument slot at index 0.
797

798
    :meta hide-value:
799
    """
800
    STARG1 = b'\x81'
4✔
801
    """
1✔
802
    Stores the value on top of the evaluation stack in the argument slot at index 1.
803

804
    :meta hide-value:
805
    """
806
    STARG2 = b'\x82'
4✔
807
    """
1✔
808
    Stores the value on top of the evaluation stack in the argument slot at index 2.
809

810
    :meta hide-value:
811
    """
812
    STARG3 = b'\x83'
4✔
813
    """
1✔
814
    Stores the value on top of the evaluation stack in the argument slot at index 3.
815

816
    :meta hide-value:
817
    """
818
    STARG4 = b'\x84'
4✔
819
    """
1✔
820
    Stores the value on top of the evaluation stack in the argument slot at index 4.
821

822
    :meta hide-value:
823
    """
824
    STARG5 = b'\x85'
4✔
825
    """
1✔
826
    Stores the value on top of the evaluation stack in the argument slot at index 5.
827

828
    :meta hide-value:
829
    """
830
    STARG6 = b'\x86'
4✔
831
    """
1✔
832
    Stores the value on top of the evaluation stack in the argument slot at index 6.
833

834
    :meta hide-value:
835
    """
836
    STARG = b'\x87'
4✔
837
    """
1✔
838
    Stores the value on top of the evaluation stack in the argument slot at a specified index. The index is
839
    represented as a 1-byte unsigned integer.
840

841
    :meta hide-value:
842
    """
843

844
    # endregion
845

846
    # region Splice
847

848
    NEWBUFFER = b'\x88'
4✔
849
    """
1✔
850
    Creates a new Buffer and pushes it onto the stack.
851

852
    :meta hide-value:
853
    """
854
    MEMCPY = b'\x89'
4✔
855
    """
1✔
856
    Copies a range of bytes from one Buffer to another.
857

858
    :meta hide-value:
859
    """
860
    CAT = b'\x8B'
4✔
861
    """
1✔
862
    Concatenates two strings.
863

864
    :meta hide-value:
865
    """
866
    SUBSTR = b'\x8C'
4✔
867
    """
1✔
868
    Returns a section of a string.
869

870
    :meta hide-value:
871
    """
872
    LEFT = b'\x8D'
4✔
873
    """
1✔
874
    Keeps only characters left of the specified point in a string.
875

876
    :meta hide-value:
877
    """
878
    RIGHT = b'\x8E'
4✔
879
    """
1✔
880
    Keeps only characters right of the specified point in a string.
881

882
    :meta hide-value:
883
    """
884

885
    # endregion
886

887
    # region Bitwise logic
888

889
    INVERT = b'\x90'
4✔
890
    """
1✔
891
    Flips all of the bits in the input.
892

893
    :meta hide-value:
894
    """
895
    AND = b'\x91'
4✔
896
    """
1✔
897
    Boolean and between each bit in the inputs.
898

899
    :meta hide-value:
900
    """
901
    OR = b'\x92'
4✔
902
    """
1✔
903
    Boolean or between each bit in the inputs.
904

905
    :meta hide-value:
906
    """
907
    XOR = b'\x93'
4✔
908
    """
1✔
909
    Boolean exclusive or between each bit in the inputs.
910

911
    :meta hide-value:
912
    """
913
    EQUAL = b'\x97'
4✔
914
    """
1✔
915
    Returns 1 if the inputs are exactly equal, 0 otherwise.
916

917
    :meta hide-value:
918
    """
919
    NOTEQUAL = b'\x98'
4✔
920
    """
1✔
921
    Returns 1 if the inputs are not equal, 0 otherwise.
922

923
    :meta hide-value:
924
    """
925

926
    # endregion
927

928
    # region Arithmetic
929

930
    SIGN = b'\x99'
4✔
931
    """
1✔
932
    Puts the sign of top stack item on top of the main stack. If value is negative, put -1; if positive,
933
    put 1; if value is zero, put 0.
934

935
    :meta hide-value:
936
    """
937
    ABS = b'\x9A'
4✔
938
    """
1✔
939
    The input is made positive.
940

941
    :meta hide-value:
942
    """
943
    NEGATE = b'\x9B'
4✔
944
    """
1✔
945
    The sign of the input is flipped.
946

947
    :meta hide-value:
948
    """
949
    INC = b'\x9C'
4✔
950
    """
1✔
951
    1 is added to the input.
952

953
    :meta hide-value:
954
    """
955
    DEC = b'\x9D'
4✔
956
    """
1✔
957
    1 is subtracted from the input.
958

959
    :meta hide-value:
960
    """
961
    ADD = b'\x9E'
4✔
962
    """
1✔
963
    a is added to b.
964

965
    :meta hide-value:
966
    """
967
    SUB = b'\x9F'
4✔
968
    """
1✔
969
    b is subtracted from a.
970

971
    :meta hide-value:
972
    """
973
    MUL = b'\xA0'
4✔
974
    """
1✔
975
    a is multiplied by b.
976

977
    :meta hide-value:
978
    """
979
    DIV = b'\xA1'
4✔
980
    """
1✔
981
    a is divided by b.
982

983
    :meta hide-value:
984
    """
985
    MOD = b'\xA2'
4✔
986
    """
1✔
987
    Returns the remainder after dividing a by b.
988

989
    :meta hide-value:
990
    """
991
    POW = b'\xA3'
4✔
992
    """
1✔
993
    The result of raising value to the exponent power.
994

995
    :meta hide-value:
996
    """
997
    SQRT = b'\xA4'
4✔
998
    """
1✔
999
    Returns the square root of a specified number.
1000

1001
    :meta hide-value:
1002
    """
1003
    MODMUL = b'\xA5'
4✔
1004
    """
1✔
1005
    Performs modulus division on a number multiplied by another number.
1006

1007
    :meta hide-value:
1008
    """
1009
    MODPOW = b'\xA6'
4✔
1010
    """
1✔
1011
    Performs modulus division on a number raised to the power of another number.
1012
    If the exponent is -1, it will have the calculation of the modular inverse.
1013

1014
    :meta hide-value:
1015
    """
1016
    SHL = b'\xA8'
4✔
1017
    """
1✔
1018
    Shifts a left b bits, preserving sign.
1019

1020
    :meta hide-value:
1021
    """
1022
    SHR = b'\xA9'
4✔
1023
    """
1✔
1024
    Shifts a right b bits, preserving sign.
1025

1026
    :meta hide-value:
1027
    """
1028
    NOT = b'\xAA'
4✔
1029
    """
1✔
1030
    If the input is 0 or 1, it is flipped. Otherwise the output will be 0.
1031

1032
    :meta hide-value:
1033
    """
1034
    BOOLAND = b'\xAB'
4✔
1035
    """
1✔
1036
    If both a and b are not 0, the output is 1. Otherwise 0.
1037

1038
    :meta hide-value:
1039
    """
1040
    BOOLOR = b'\xAC'
4✔
1041
    """
1✔
1042
    If a or b is not 0, the output is 1. Otherwise 0.
1043

1044
    :meta hide-value:
1045
    """
1046
    NZ = b'\xB1'
4✔
1047
    """
1✔
1048
    Returns 0 if the input is 0. 1 otherwise.
1049

1050
    :meta hide-value:
1051
    """
1052
    NUMEQUAL = b'\xB3'
4✔
1053
    """
1✔
1054
    Returns 1 if the numbers are equal, 0 otherwise.
1055

1056
    :meta hide-value:
1057
    """
1058
    NUMNOTEQUAL = b'\xB4'
4✔
1059
    """
1✔
1060
    Returns 1 if the numbers are not equal, 0 otherwise.
1061

1062
    :meta hide-value:
1063
    """
1064
    LT = b'\xB5'
4✔
1065
    """
1✔
1066
    Returns 1 if a is less than b, 0 otherwise.
1067

1068
    :meta hide-value:
1069
    """
1070
    LE = b'\xB6'
4✔
1071
    """
1✔
1072
    Returns 1 if a is less than or equal to b, 0 otherwise.
1073

1074
    :meta hide-value:
1075
    """
1076
    GT = b'\xB7'
4✔
1077
    """
1✔
1078
    Returns 1 if a is greater than b, 0 otherwise.
1079

1080
    :meta hide-value:
1081
    """
1082
    GE = b'\xB8'
4✔
1083
    """
1✔
1084
    Returns 1 if a is greater than or equal to b, 0 otherwise.
1085

1086
    :meta hide-value:
1087
    """
1088
    MIN = b'\xB9'
4✔
1089
    """
1✔
1090
    Returns the smaller of a and b.
1091

1092
    :meta hide-value:
1093
    """
1094
    MAX = b'\xBA'
4✔
1095
    """
1✔
1096
    Returns the larger of a and b.
1097

1098
    :meta hide-value:
1099
    """
1100
    WITHIN = b'\xBB'
4✔
1101
    """
1✔
1102
    Returns 1 if x is within the specified range (left-inclusive), 0 otherwise.
1103

1104
    :meta hide-value:
1105
    """
1106

1107
    # endregion
1108

1109
    # region Compound-type
1110

1111
    PACKMAP = b'\xBE'
4✔
1112
    """
1✔
1113
    A value n is taken from top of main stack. The next n*2 items on main stack are removed, put inside n-sized map
1114
    and this map is put on top of the main stack.
1115

1116
    :meta hide-value:
1117
    """
1118
    PACKSTRUCT = b'\xBF'
4✔
1119
    """
1✔
1120
    A value n is taken from top of main stack. The next n items on main stack are removed, put inside n-sized
1121
    struct and this struct is put on top of the main stack.
1122

1123
    :meta hide-value:
1124
    """
1125
    PACK = b'\xC0'
4✔
1126
    """
1✔
1127
    A value n is taken from top of main stack. The next n items on main stack are removed, put inside n-sized array
1128
    and this array is put on top of the main stack.
1129

1130
    :meta hide-value:
1131
    """
1132
    UNPACK = b'\xC1'
4✔
1133
    """
1✔
1134
    A collection is removed from top of the main stack. Its elements are put on top of the main stack (in reverse order) and the collection size is also put on main stack.
1135

1136
    :meta hide-value:
1137
    """
1138
    NEWARRAY0 = b'\xC2'
4✔
1139
    """
1✔
1140
    An empty array (with size 0) is put on top of the main stack.
1141

1142
    :meta hide-value:
1143
    """
1144
    NEWARRAY = b'\xC3'
4✔
1145
    """
1✔
1146
    A value n is taken from top of main stack. A null-filled array with size n is put on top of the main stack.
1147

1148
    :meta hide-value:
1149
    """
1150
    NEWARRAY_T = b'\xC4'
4✔
1151
    """
1✔
1152
    A value n is taken from top of main stack. An array of type T with size n is put on top of the main stack.
1153

1154
    :meta hide-value:
1155
    """
1156
    NEWSTRUCT0 = b'\xC5'
4✔
1157
    """
1✔
1158
    An empty struct (with size 0) is put on top of the main stack.
1159

1160
    :meta hide-value:
1161
    """
1162
    NEWSTRUCT = b'\xC6'
4✔
1163
    """
1✔
1164
    A value n is taken from top of main stack. A zero-filled struct with size n is put on top of the main stack.
1165

1166
    :meta hide-value:
1167
    """
1168
    NEWMAP = b'\xC8'
4✔
1169
    """
1✔
1170
    A Map is created and put on top of the main stack.
1171

1172
    :meta hide-value:
1173
    """
1174
    SIZE = b'\xCA'
4✔
1175
    """
1✔
1176
    An array is removed from top of the main stack. Its size is put on top of the main stack.
1177

1178
    :meta hide-value:
1179
    """
1180
    HASKEY = b'\xCB'
4✔
1181
    """
1✔
1182
    An input index n (or key) and an array (or map) are removed from the top of the main stack. Puts True on top of
1183
    main stack if array[n] (or map[n]) exist, and False otherwise.
1184

1185
    :meta hide-value:
1186
    """
1187
    KEYS = b'\xCC'
4✔
1188
    """
1✔
1189
    A map is taken from top of the main stack. The keys of this map are put on top of the main stack.
1190

1191
    :meta hide-value:
1192
    """
1193
    VALUES = b'\xCD'
4✔
1194
    """
1✔
1195
    A map is taken from top of the main stack. The values of this map are put on top of the main stack.
1196

1197
    :meta hide-value:
1198
    """
1199
    PICKITEM = b'\xCE'
4✔
1200
    """
1✔
1201
    An input index n (or key) and an array (or map) are taken from main stack. Element array[n] (or map[n]) is put
1202
    on top of the main stack.
1203

1204
    :meta hide-value:
1205
    """
1206
    APPEND = b'\xCF'
4✔
1207
    """
1✔
1208
    The item on top of main stack is removed and appended to the second item on top of the main stack.
1209

1210
    :meta hide-value:
1211
    """
1212
    SETITEM = b'\xD0'
4✔
1213
    """
1✔
1214
    A value v, index n (or key) and an array (or map) are taken from main stack. Attribution array[n]=v
1215
    (or map[n]=v) is performed.
1216

1217
    :meta hide-value:
1218
    """
1219
    REVERSEITEMS = b'\xD1'
4✔
1220
    """
1✔
1221
    An array is removed from the top of the main stack and its elements are reversed.
1222

1223
    :meta hide-value:
1224
    """
1225
    REMOVE = b'\xD2'
4✔
1226
    """
1✔
1227
    An input index n (or key) and an array (or map) are removed from the top of the main stack. Element array[n]
1228
    (or map[n]) is removed.
1229

1230
    :meta hide-value:
1231
    """
1232
    CLEARITEMS = b'\xD3'
4✔
1233
    """
1✔
1234
    Remove all the items from the compound-type.
1235

1236
    :meta hide-value:
1237
    """
1238
    POPITEM = b'\xD4'
4✔
1239
    """
1✔
1240
    Remove the last element from an array, and push it onto the stack.
1241

1242
    :meta hide-value:
1243
    """
1244

1245
    # endregion
1246

1247
    # region Types
1248

1249
    ISNULL = b'\xD8'
4✔
1250
    """
1✔
1251
    Returns true if the input is null;
1252

1253
    :meta hide-value:
1254
    """
1255
    ISTYPE = b'\xD9'
4✔
1256
    """
1✔
1257
    Returns true if the top item of the stack is of the specified type;
1258

1259
    :meta hide-value:
1260
    """
1261
    CONVERT = b'\xDB'
4✔
1262
    """
1✔
1263
    Returns true if the input is null;
1264

1265
    :meta hide-value:
1266
    """
1267

1268
    # endregion
1269

1270
    # region Extensions
1271

1272
    ABORTMSG = b'\xE0'
4✔
1273
    """
1✔
1274
    Turns the vm state to FAULT immediately, and cannot be caught. Includes a reason.
1275

1276
    :meta hide-value:
1277
    """
1278

1279
    ASSERTMSG = b'\xE1'
4✔
1280
    """
1✔
1281
    Pop the top value of the stack, if it false, then exit vm execution and set vm state to FAULT. Includes a reason.
1282

1283
    :meta hide-value:
1284
    """
1285

1286
    # endregion
1287

1288
    def __repr__(self) -> str:
4✔
1289
        return str(self)
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc