Argonaut Strategy Language: Difference between revisions
Jump to navigation
Jump to search
A page about ASL Argonaut Strategy Language |
Added Opcodes |
||
Line 1: | Line 1: | ||
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 [https://en.wikipedia.org/wiki/Bytecode Bytecode]. It is currently not exactly known what ASL looked before compilation. | 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 [https://en.wikipedia.org/wiki/Bytecode 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 === | |||
<code>op |v1|v2|v3|</code> | |||
<code>op |v1|v2|li|</code> | |||
=== 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 === | |||
{| class="wikitable" | |||
|+ | |||
!Opcode | |||
!Description | |||
|- | |||
|<code>0x00</code> | |||
|Add v3(lowest byte) to v2 and store the result in v1. | |||
|- | |||
|<code>0x01</code> | |||
|Subtract v3(lowest byte) from v2 and store the result in v1. | |||
|- | |||
|<code>0x02</code> | |||
|Multiply v3(lowest byte) by v2 and store the result in v1. | |||
|- | |||
|<code>0x03</code> | |||
|Divide v2 by v3(lowest byte) and store the result in v1. | |||
|- | |||
|<code>0x04</code> | |||
|Subtract v2 from v3(lowest byte) and store the result in v1. | |||
|- | |||
|<code>0x05</code> | |||
|Divide v3(lowest byte) by v2 and store the result in v1. | |||
|- | |||
|<code>0x06</code> | |||
|Bitwise AND v3(lowest byte) with v2 and store the result in v1. | |||
|- | |||
|<code>0x07</code> | |||
|Bitwise OR v3(lowest byte) with v2 and store the result in v1. | |||
|- | |||
|<code>0x08</code> | |||
|Bitwise XOR v3(lowest byte) with v2 and store the result in v1. | |||
|- | |||
|<code>0x09</code> | |||
|Logical OR v2 with v3(lowest byte). If true, set v1 to 1. If false set v1 to 0. | |||
|- | |||
|<code>0x0A</code> | |||
|Move v3(lowest byte) into v1. | |||
|- | |||
|<code>0x0B</code> | |||
|Float add v2 to v3(lowest byte) and store the result in v1. | |||
|- | |||
|<code>0x0C</code> | |||
|Float subtract v3(lowest byte) from v2 and store the result in v1. | |||
|- | |||
|<code>0x0D</code> | |||
|Float multiply v2 by v3 and store the result in v1. | |||
|- | |||
|<code>0x0E</code> | |||
|Float divide v2 by v3 and store the result in v1. | |||
|- | |||
|<code>0x0F</code> | |||
|Float subtract v2 from v3 and store the result in v1. | |||
|- | |||
|<code>0x10</code> | |||
|Float divide v3 by v2 and store the result in v1. | |||
|- | |||
|<code>0x12</code> | |||
|Shift bits of v2 left by v3 and store the result in v1. | |||
|- | |||
|<code>0x13, 0x14</code> | |||
|Shift bits of v2 right by v3 and store the result in v1. | |||
|- | |||
|<code>0x20</code> | |||
|Logical OR not v2 with not v3 (NAND). If true, set v1 to 0, else set v1 to 1. | |||
|- | |||
|<code>0x23</code> | |||
|Modulus v2 by v3 and store the result in v1. | |||
|- | |||
|<code>0x24</code> | |||
|Modulus v3 by v2 and store the result in v1. | |||
|- | |||
|<code>0x25</code> | |||
|Float (fmod) modulus v2 by v3 and store the result in v1. | |||
|- | |||
|<code>0x26</code> | |||
|Float modulus (fmod) v3 by v2 and store the result in v1. | |||
|- | |||
|<code>0x28</code> | |||
|Add v2 to the literal (lowest byte) and store the result in v1. | |||
|- | |||
|<code>0x29</code> | |||
|Subtract the literal (lowest byte) from v2 and store the result in v1. | |||
|- | |||
|<code>0x2A</code> | |||
|Multiply v2 by the literal (lowest byte) and store the result in v1. | |||
|- | |||
|<code>0x2B</code> | |||
|Divide v2 by the literal (lowest byte) and store the result in v1. | |||
|- | |||
|<code>0x2C</code> | |||
|Subtract v2 from the literal and store the result in v1. | |||
|- | |||
|<code>0x2D</code> | |||
|Divide the literal (lowest byte) by v2 and store the result in v1. | |||
|} |
Revision as of 21:53, 16 March 2025
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. |