Skip to content
This repository was archived by the owner on Oct 4, 2021. It is now read-only.

Perling Instructions

Tarith Jayasooriya edited this page Apr 23, 2021 · 1 revision

A instruction is code that the perling VM can understand this instruction is 4 bytes in size.

Ex: This instruction loads 0x02(2) to register 0x04(4)

0x01 0x04 0x00 0x02

but this type of programming is inefficient so we created PASM.

LOAD 04 00 02 # this is the same code but in PASM it will compiled into hex

The template for a PASM instruction looks like this.

[OPCODE] [ARG1] [ARG2] [ARG3]

OPCODE

A opcode is the specifies the type of instruction and what it wants to do.

Examples:
  • LOAD opcode tells the vm to load the specified value to the register

  • LOCK opcode tells the vm to lock the register and marks it as read-only

  • ADD opcode tells the vm to add two numbers together and store the result in a separate register

ARG’s

A arg is a argument to the opcode. The number of arguments and many other factors change depending on the opcode. Some opcode such as LOAD allows the use of arg2 and arg3 to store a single value in Little Endian Format.

Clone this wiki locally