THIS IS OUTDATED, USE THE DOCUMENT HERE INSTEAD!
An implementation can be found here.
NOTE: Builds on Mirrawrs' documentation/this page on the Acolyte wiki and my correction/completion.
uint NameOffset;
uint _pad0; // unknown, some flags?
uint _pad1; // unknown
uint Occurrences;
uint FirstAddress; // probably
//NOTE: The lenght of the array is included in the chunk.
uint NameOffset;
uint Occurrences;
uint FirstAddress;
uint Name;
uint Length;
uint Unknown; // seems to be '1' (always)
int BytecodeOffset; // offset to the code's bytecode, RELATIVE TO THIS VALUE (i.e. reinterpret_cast<byte*>(&codeEntry->BytecodeOffset) + codeEntry->BytecodeOffset)
uint Unknown; // seems to be '0' (always)
The ComparisonType
is the third byte of a DoubleTypeInstruction
, only used when the OpCode
is Cmp
.
LowerThan = 1, // <
LTOrEqual = 2, // <=
Equality = 3, // ==
Inequality = 4, // !=
GTOrEqual = 5, // >=
GreaterThan = 6 // >
Conv = 0x07,
Mul = 0x08,
Div = 0x09,
Rem = 0x0A,
Mod = 0x0B,
Add = 0x0C,
Sub = 0x0D,
And = 0x0E,
Or = 0x0F,
Xor = 0x10,
Neg = 0x11,
Not = 0x12,
Shl = 0x13,
Shr = 0x14,
Cmp = 0x15, // the third byte of the DoubleTypeInstruction holds the comparison type
Set = 0x45,
Dup = 0x86,
Ret = 0x9C,
Exit = 0x9D,
Pop = 0x9E,
Br = 0xB6,
Brt = 0xB7,
Brf = 0xB8,
PushEnv = 0xBA,
PopEnv = 0xBB,
PushCst = 0xC0, // push constant
PushGlb = 0xC2, // push global variable
PushVar = 0xC3, // push other variable
PushI16 = 0x84, // push int16
// NOTE: the push type is preserved from the previous version, so the program can check for any of these values
// instead of every kind separate and then checking the actual type
Call = 0xD9,
Break = 0xFF