Expand description
Assembly for the Essential VM.
§Op Table
| Opcode | Op | Short Description | 
|---|---|---|
| 0x01 | Stack Push | Push one word onto the stack. | 
| 0x02 | Stack Pop | Pop one word from the stack. | 
| 0x03 | Stack Dup | Duplicate the top word on the stack. | 
| 0x04 | Stack DupFrom | Duplicate the word at the given stack depth index. | 
| 0x05 | Stack Swap | Swap top two words on stack. | 
| 0x06 | Stack SwapIndex | Swap the top word on the stack with the word at the given stack depth index. | 
| 0x07 | Stack Select | Conditionally keep one of the top two elements on the stack. | 
| 0x08 | Stack SelectRange | Conditionally keep one of the top two ranges on the stack. | 
| 0x09 | Stack Repeat | Repeat a section of code the number of times. | 
| 0x0A | Stack RepeatEnd | Increment or decrements the top counter on the repeat stack. | 
| 0x0B | Stack Reserve | Reserve space on the stack for lenwords. | 
| 0x0C | Stack Load | Load the value at the given stack depth index relative to the bottom. | 
| 0x0D | Stack Store | Store the value at the given stack depth index relative to the bottom. | 
| 0x0E | Stack Drop | Drop the top nelements from the stack. | 
| 0x10 | Pred Eq | Check equality of two words. | 
| 0x11 | Pred EqRange | Check equality of two ranges on the stack. | 
| 0x12 | Pred Gt | Check if left-hand side is greater than right-hand side. | 
| 0x13 | Pred Lt | Check if left-hand side is less than right-hand side. | 
| 0x14 | Pred Gte | Check if left-hand side is greater than or equal to right-hand side. | 
| 0x15 | Pred Lte | Check if left-hand side is less than or equal to right-hand side. | 
| 0x16 | Pred And | Logical AND of two words. | 
| 0x17 | Pred Or | Logical OR of two words. | 
| 0x18 | Pred Not | Logical NOT of a word. | 
| 0x19 | Pred EqSet | Pop two sets off the stack and check if they are equal. | 
| 0x1A | Pred BitAnd | Bitwise AND of two words. | 
| 0x1B | Pred BitOr | Bitwise OR of two words. | 
| 0x20 | Alu Add | Add two words. | 
| 0x21 | Alu Sub | Subtract two words. | 
| 0x22 | Alu Mul | Multiply two words. | 
| 0x23 | Alu Div | Integer division. | 
| 0x24 | Alu Mod | Modulus of lhs by rhs. | 
| 0x25 | Alu Shl | Logical shift left by number of bits. | 
| 0x26 | Alu Shr | Logical shift right by number of bits. | 
| 0x27 | Alu ShrI | Arithmetic shift right by number of bits. | 
| 0x30 | Access ThisAddress | Get the content hash of this predicate. | 
| 0x31 | Access ThisContractAddress | Get the content hash of the contract this predicate belongs to. | 
| 0x34 | Access MutKeys | Push the keys of the proposed state mutations onto the stack. | 
| 0x38 | Access RepeatCounter | Access the top repeat counters current value. | 
| 0x3A | Access PredicateData | Access a range of lenwords starting fromvalue_ixwithin the | 
| 0x3B | Access PredicateDataLen | Get the length of a the predicate data value located at slot_ix. | 
| 0x3C | Access PredicateDataSlots | Get the number of predicate data slots. | 
| 0x3D | Access PredicateExists | Check if a solution to a predicate exists within the same solution | 
| 0x50 | Crypto Sha256 | Produce a SHA 256 hash from the specified data. | 
| 0x51 | Crypto VerifyEd25519 | Validate an Ed25519 signature against a public key. | 
| 0x52 | Crypto RecoverSecp256k1 | Recover the public key from a secp256k1 signature. | 
| 0x60 | TotalControlFlow Halt | End the execution of the program. | 
| 0x61 | TotalControlFlow HaltIf | Halt the program if the value is true. | 
| 0x62 | TotalControlFlow JumpIf | Jump the given number of instructions if the value is true. | 
| 0x63 | TotalControlFlow PanicIf | Panic if the conditionis true. | 
| 0x70 | Memory Alloc | Allocate a new block of memory to the end. | 
| 0x71 | Memory Free | Truncate memory to the specified new length, freeing all that follows. | 
| 0x72 | Memory Load | Load the value at the given index from memory onto the stack. | 
| 0x73 | Memory Store | Store the value at the given index within memory. | 
| 0x74 | Memory LoadRange | Load a range of words starting at the index within memory. | 
| 0x75 | Memory StoreRange | Store a range of words starting at the index within memory. | 
| 0x80 | StateRead KeyRange | Read a range of values at each key from state starting at the key | 
| 0x81 | StateRead KeyRangeExtern | Read a range of values at each key from external state starting at the key | 
Modules§
- bytes_iter 
- Provides the operation type bytes iterators.
- effects
- Determine the effects of a program.
- opcode
- Typed representation of the opcode, without any associated data.
- short
- Short hand names for the operations.
Structs§
- InvalidOpcode Error 
- An attempt to parse a byte as an opcode failed.
- NotEnoughBytes Error 
- An error occurring within Opcode::parse_opin the case that the provided bytes iterator contains insufficient bytes for the expected associated operation data.
Enums§
- Access
- Operations for accessing input data.
- Alu
- Operations for computing arithmetic and logic.
- Crypto
- Operations providing cryptographic functionality.
- FromBytes Error 
- Errors that can occur while parsing ops from bytes.
- Memory
- Operations for memory.
- Op
- All operations available to the Essential VM execution.
- Opcode
- All operations available to the Essential VM execution.
- Pred
- Operations for computing predicates.
- Stack
- Operations related to stack manipulation.
- StateRead 
- Operations related to reading state.
- TotalControl Flow 
- Control flow operations that keep the program total.
Traits§
- ToBytes
- Operation types that may be converted to their serialized form in bytes.
- ToOpcode
- Allows for converting an Opinto its associatedOpcode.
- TryFromBytes 
- Operation types that may be parsed from a bytecode representation.
Functions§
- from_bytes 
- Parse operations from the given iterator yielding bytes.
- to_bytes 
- Convert the given iterator yielding operations into and iterator yielding the serialized form in bytes.
Type Aliases§
- Word
- Single unit of data.