.
This commit is contained in:
11
doc/OPCODES
11
doc/OPCODES
@@ -3,7 +3,14 @@ Operations
|
||||
|
||||
Operations take either 0 or 1 parameter. The ones that take a parameter, it can be either a int8, int16 or int32.
|
||||
|
||||
The binary of the opcode is: XXYY.YYYY, where XX defines the parameter type, and YY.YYYY is the instruction. For the XX values:
|
||||
Instructions follow this logic:
|
||||
|
||||
00 ~ 9F : no parameter
|
||||
A0 ~ BF : int8 (1 byte)
|
||||
C0 ~ DF : int16 (2 bytes)
|
||||
E0 ~ FF : int32 (4 bytes)
|
||||
|
||||
The operations of 1, 2 and 4 bytes are always interchangeable by adding/subtracting 0x20.
|
||||
|
||||
,----------- no parameter
|
||||
| ,-------- int8
|
||||
@@ -12,7 +19,7 @@ The binary of the opcode is: XXYY.YYYY, where XX defines the parameter type, and
|
||||
NP I8 I16 I32 Opc Instruction Description
|
||||
|
||||
Stack operations:
|
||||
a0 c0 e0 pushn [int] Push int
|
||||
a0 c0 e0 pushi [int] Push int
|
||||
a1 c1 e1 pushc [index] Push constant
|
||||
a2 c2 e2 pushf [function] Push function id
|
||||
00 pushz Push zero (or false)
|
||||
|
||||
Reference in New Issue
Block a user