Categories of PVM (Polus VM) instructions

  • Stack manipulation primitives – a set of operations that manipulate the stack, enabling the pushing, popping, and manipulation of values stored on the stack during program execution.

  • Constant or literal primitives – in a virtual machine are predefined values embedded directly in the program code, representing fixed data used during program execution. They eliminate the need for calculations or dynamic assignments by providing direct inclusion of specific values into the program flow.

  • Arithmetic primitives – are operations that perform basic mathematical calculations, including addition, subtraction, multiplication, and division. They enable the manipulation and computation of numerical data within the virtual machine during program execution.

  • Data manipulation primitives – are operations specifically designed to manipulate byte streams. These primitives provide functionalities for tasks such as reading, writing, and transforming data at the byte level. They allow the virtual machine to handle and process raw data efficiently, making them essential for low-level operations and byte-level manipulations within the virtual machine environment.

  • Application-specific primitives – refer to operations that are specifically designed to cater to the needs of a particular application or use case. These primitives go beyond basic arithmetic or data manipulation and provide specialized functionalities tailored to the requirements of the application. Examples of such primitives include operations like TRANSFER, which allows token transfers within a blockchain, or SWAP_TOKENS, which facilitates the exchange of one token for another. These primitives enhance the flexibility and utility of the virtual machine, enabling application-specific operations within the blockchain ecosystem.

Last updated