Argonaut Strategy Language

From BTG Wiki
Revision as of 21:53, 16 March 2025 by Nullpo (talk | contribs) (Added Opcodes)
Jump to navigation Jump to search

Argonaut Strategy Language (ASL) is the In-game scripting language used by Bionicle The Game and many other titles created by Argonaut. The language gets compiled into a proprietary Bytecode. It is currently not exactly known what ASL looked before compilation.

Virtual Machine

This is currently being investigated.

Opcodes

A collection of the currently known opcodes for the ASL Virtual Machine.

Instruction Structure

op |v1|v2|v3|

op |v1|v2|li|

Linker

The last 16-bit short in each logical function pointer indicates how many instructions are before the next function pointer.

This is how the linker skips over ASL instructions and translates each logical pointer into physical pointers.

Known Opcodes

Opcode Description
0x00 Add v3(lowest byte) to v2 and store the result in v1.
0x01 Subtract v3(lowest byte) from v2 and store the result in v1.
0x02 Multiply v3(lowest byte) by v2 and store the result in v1.
0x03 Divide v2 by v3(lowest byte) and store the result in v1.
0x04 Subtract v2 from v3(lowest byte) and store the result in v1.
0x05 Divide v3(lowest byte) by v2 and store the result in v1.
0x06 Bitwise AND v3(lowest byte) with v2 and store the result in v1.
0x07 Bitwise OR v3(lowest byte) with v2 and store the result in v1.
0x08 Bitwise XOR v3(lowest byte) with v2 and store the result in v1.
0x09 Logical OR v2 with v3(lowest byte). If true, set v1 to 1. If false set v1 to 0.
0x0A Move v3(lowest byte) into v1.
0x0B Float add v2 to v3(lowest byte) and store the result in v1.
0x0C Float subtract v3(lowest byte) from v2 and store the result in v1.
0x0D Float multiply v2 by v3 and store the result in v1.
0x0E Float divide v2 by v3 and store the result in v1.
0x0F Float subtract v2 from v3 and store the result in v1.
0x10 Float divide v3 by v2 and store the result in v1.
0x12 Shift bits of v2 left by v3 and store the result in v1.
0x13, 0x14 Shift bits of v2 right by v3 and store the result in v1.
0x20 Logical OR not v2 with not v3 (NAND). If true, set v1 to 0, else set v1 to 1.
0x23 Modulus v2 by v3 and store the result in v1.
0x24 Modulus v3 by v2 and store the result in v1.
0x25 Float (fmod) modulus v2 by v3 and store the result in v1.
0x26 Float modulus (fmod) v3 by v2 and store the result in v1.
0x28 Add v2 to the literal (lowest byte) and store the result in v1.
0x29 Subtract the literal (lowest byte) from v2 and store the result in v1.
0x2A Multiply v2 by the literal (lowest byte) and store the result in v1.
0x2B Divide v2 by the literal (lowest byte) and store the result in v1.
0x2C Subtract v2 from the literal and store the result in v1.
0x2D Divide the literal (lowest byte) by v2 and store the result in v1.