Each opcode represents a specific operation executed by the virtual machine.
*/
public class VMOpCode {
- // region 1. Arithmetic Operations (1–80)
- // region 1.1 int32 (1-10)
+ // region 1. Arithmetic Operations (1–100)
+ // region 1.1 int32 (0-9)
/**
* I_ADD Opcode: Represents the int32 addition operation in the virtual machine.
*
This opcode is implemented by the {@link IAddCommand} class, which defines its specific execution logic.
@@ -63,7 +63,7 @@ public class VMOpCode {
*
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
* primarily used to handle basic int32 addition tasks.
*/
- public static final int I_ADD = 1;
+ public static final int I_ADD = 0;
/**
* I_SUB Opcode: Represents the int32 subtraction operation in the virtual machine.
*
This opcode is implemented by the {@link ISubCommand} class, which defines its specific execution logic.
@@ -78,7 +78,7 @@ public class VMOpCode {
*
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
* primarily used to handle basic int32 subtraction tasks.
*/
- public static final int I_SUB = 2;
+ public static final int I_SUB = 1;
/**
* I_MUL Opcode: Represents the int32 multiplication operation in the virtual machine.
*
This opcode is implemented by the {@link IMulCommand} class, which defines its specific execution logic.
@@ -93,7 +93,7 @@ public class VMOpCode {
*
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
* primarily used to handle basic int32 multiplication tasks.
*/
- public static final int I_MUL = 3;
+ public static final int I_MUL = 2;
/**
* I_DIV Opcode: Represents the int32 division operation in the virtual machine.
*
This opcode is implemented by the {@link IDivCommand} class, which defines its specific execution logic.
@@ -109,7 +109,7 @@ public class VMOpCode {
*
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
* primarily used to handle basic int32 division tasks.
*/
- public static final int I_DIV = 4;
+ public static final int I_DIV = 3;
/**
* I_MOD Opcode: Represents the int32 modulus (remainder) operation in the virtual machine.
*
This opcode is implemented by the {@link IModCommand} class, which defines its specific execution logic.
@@ -125,7 +125,7 @@ public class VMOpCode {
*
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
* primarily used to handle basic int32 modulus (remainder) tasks.
*/
- public static final int I_MOD = 5;
+ public static final int I_MOD = 4;
/**
* I_INC Opcode: Represents the int32 increment operation for a local variable in the virtual machine.
*
This opcode is implemented by the {@link IIncCommand} class, which defines its specific execution logic.
@@ -142,8 +142,7 @@ public class VMOpCode {
*
*
This opcode is particularly useful for optimizing scenarios where a local variable, such as a counter or loop index, is frequently incremented.
*/
- public static final int I_INC = 6;
-
+ public static final int I_INC = 5;
/**
* I_NEG Opcode: Represents the int32 negation operation in the virtual machine.
*
This opcode is implemented by the {@link INegCommand} class, which defines its specific execution logic.
@@ -157,10 +156,10 @@ public class VMOpCode {
*
*
This opcode is typically used to negate an int32 value, making it a fundamental operation for arithmetic logic within the virtual machine.
*/
- public static final int I_NEG = 7;
-
+ public static final int I_NEG = 6;
// endregion
- // region 1.2 long64 (11-20)
+
+ // region 1.2 long64 (10-19)
/**
* L_ADD Opcode: Represents the long64 addition operation in the virtual machine.
*
This opcode is implemented by the {@link LAddCommand} class, which defines its specific execution logic.
@@ -175,8 +174,7 @@ public class VMOpCode {
*
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
* primarily used to handle basic long64 addition tasks.
*/
- public static final int L_ADD = 11;
-
+ public static final int L_ADD = 10;
/**
* L_SUB Opcode: Represents the long64 subtraction operation in the virtual machine.
*
This opcode is implemented by the {@link LSubCommand} class, which defines its specific execution logic.
@@ -191,8 +189,7 @@ public class VMOpCode {
*
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
* primarily used to handle basic long64 subtraction tasks.
*/
- public static final int L_SUB = 12;
-
+ public static final int L_SUB = 11;
/**
* L_MUL Opcode: Represents the long64 multiplication operation in the virtual machine.
*
This opcode is implemented by the {@link LMulCommand} class, which defines its specific execution logic.
@@ -207,8 +204,7 @@ public class VMOpCode {
*
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
* primarily used to handle basic long64 multiplication tasks.
*/
- public static final int L_MUL = 13;
-
+ public static final int L_MUL = 12;
/**
* L_DIV Opcode: Represents the long64 division operation in the virtual machine.
*
This opcode is implemented by the {@link LDivCommand} class, which defines its specific execution logic.
@@ -224,8 +220,7 @@ public class VMOpCode {
*
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
* primarily used to handle basic long64 division tasks.
*/
- public static final int L_DIV = 14;
-
+ public static final int L_DIV = 13;
/**
* L_MOD Opcode: Represents the long64 modulus (remainder) operation in the virtual machine.
*
This opcode is implemented by the {@link LModCommand} class, which defines its specific execution logic.
@@ -241,8 +236,7 @@ public class VMOpCode {
*
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
* primarily used to handle basic long64 modulus (remainder) tasks.
*/
- public static final int L_MOD = 15;
-
+ public static final int L_MOD = 14;
/**
* L_INC Opcode: Represents the long64 increment operation for a local variable in the virtual machine.
*
This opcode is implemented by the {@link LIncCommand} class, which defines its specific execution logic.
@@ -259,9 +253,7 @@ public class VMOpCode {
*
*
This opcode is particularly useful for optimizing scenarios where a local `long64` variable, such as a counter or loop index, is frequently incremented.
*/
- public static final int L_INC = 16;
-
-
+ public static final int L_INC = 15;
/**
* L_NEG Opcode: Represents the long64 negation operation in the virtual machine.
*
This opcode is implemented by the {@link LNegCommand} class, which defines its specific execution logic.
@@ -275,10 +267,10 @@ public class VMOpCode {
*
*
This opcode is typically used to negate a long64 value, making it a fundamental operation for arithmetic logic within the virtual machine.
*/
- public static final int L_NEG = 17;
-
+ public static final int L_NEG = 16;
// endregion
- // region 1.3 short16 (21-30)
+
+ // region 1.3 short16 (20-29)
/**
* S_ADD Opcode: Represents the short16 addition operation in the virtual machine.
*
This opcode is implemented by the {@link SAddCommand} class, which defines its specific execution logic.
@@ -293,8 +285,7 @@ public class VMOpCode {
*
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
* primarily used to handle basic short16 addition tasks.
*/
- public static final int S_ADD = 21;
-
+ public static final int S_ADD = 20;
/**
* S_SUB Opcode: Represents the short16 subtraction operation in the virtual machine.
*
This opcode is implemented by the {@link SSubCommand} class, which defines its specific execution logic.
@@ -309,8 +300,7 @@ public class VMOpCode {
*
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
* primarily used to handle basic short16 subtraction tasks.
*/
- public static final int S_SUB = 22;
-
+ public static final int S_SUB = 21;
/**
* S_MUL Opcode: Represents the short16 multiplication operation in the virtual machine.
*
This opcode is implemented by the {@link SMulCommand} class, which defines its specific execution logic.
@@ -325,8 +315,7 @@ public class VMOpCode {
*
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
* primarily used to handle basic short16 multiplication tasks.
*/
- public static final int S_MUL = 23;
-
+ public static final int S_MUL = 22;
/**
* S_DIV Opcode: Represents the short16 division operation in the virtual machine.
*
This opcode is implemented by the {@link SDivCommand} class, which defines its specific execution logic.
@@ -342,8 +331,7 @@ public class VMOpCode {
*
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
* primarily used to handle basic short16 division tasks.
*/
- public static final int S_DIV = 24;
-
+ public static final int S_DIV = 23;
/**
* S_MOD Opcode: Represents the short16 modulus (remainder) operation in the virtual machine.
*
This opcode is implemented by the {@link SModCommand} class, which defines its specific execution logic.
@@ -359,8 +347,7 @@ public class VMOpCode {
*
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
* primarily used to handle basic short16 modulus (remainder) tasks.
*/
- public static final int S_MOD = 25;
-
+ public static final int S_MOD = 24;
/**
* S_INC Opcode: Represents the short16 increment operation in the virtual machine.
*
This opcode is implemented by the {@link SIncCommand} class, which defines its specific execution logic.
@@ -378,8 +365,7 @@ public class VMOpCode {
*
This opcode is useful for scenarios where a local variable needs to be incremented, such as counters within loops,
* or for optimizing the modification of variables in tight loops.
*/
- public static final int S_INC = 26;
-
+ public static final int S_INC = 25;
/**
* S_NEG Opcode: Represents the short16 negation operation in the virtual machine.
*
This opcode is implemented by the {@link SNegCommand} class, which defines its specific execution logic.
@@ -393,9 +379,9 @@ public class VMOpCode {
*
*
This opcode is typically used to negate a short16 value, making it a fundamental operation for arithmetic logic within the virtual machine.
*/
- public static final int S_NEG = 27;
-
+ public static final int S_NEG = 26;
// endregion
+
// region 1.4 byte8 (31-40)
/**
* B_ADD Opcode: Represents the byte8 addition operation in the virtual machine.
@@ -412,7 +398,6 @@ public class VMOpCode {
* primarily used to handle basic byte8 addition tasks.
*/
public static final int B_ADD = 31;
-
/**
* B_SUB Opcode: Represents the byte8 subtraction operation in the virtual machine.
*
This opcode is implemented by the {@link BSubCommand} class, which defines its specific execution logic.
@@ -428,7 +413,6 @@ public class VMOpCode {
* primarily used to handle basic byte8 subtraction tasks.
*/
public static final int B_SUB = 32;
-
/**
* B_MUL Opcode: Represents the byte8 multiplication operation in the virtual machine.
*
This opcode is implemented by the {@link BMulCommand} class, which defines its specific execution logic.
@@ -444,7 +428,6 @@ public class VMOpCode {
* primarily used to handle basic byte8 multiplication tasks.
*/
public static final int B_MUL = 33;
-
/**
* B_DIV Opcode: Represents the byte8 division operation in the virtual machine.
*
This opcode is implemented by the {@link BDivCommand} class, which defines its specific execution logic.
@@ -461,7 +444,6 @@ public class VMOpCode {
* primarily used to handle basic byte8 division tasks.
*/
public static final int B_DIV = 34;
-
/**
* B_MOD Opcode: Represents the byte8 modulus (remainder) operation in the virtual machine.
*
This opcode is implemented by the {@link BModCommand} class, which defines its specific execution logic.
@@ -478,7 +460,6 @@ public class VMOpCode {
* primarily used to handle basic byte8 modulus (remainder) tasks.
*/
public static final int B_MOD = 35;
-
/**
* B_INC Opcode: Represents the byte8 increment operation for a local variable in the virtual machine.
*
This opcode is implemented by the {@link BIncCommand} class, which defines its specific execution logic.
@@ -496,8 +477,6 @@ public class VMOpCode {
*
This opcode is particularly useful for optimizing scenarios where a local `byte8` variable, such as a counter or loop index, is frequently incremented.
*/
public static final int B_INC = 36;
-
-
/**
* B_NEG Opcode: Represents the byte8 negation operation in the virtual machine.
*
This opcode is implemented by the {@link BNegCommand} class, which defines its specific execution logic.
@@ -512,8 +491,8 @@ public class VMOpCode {
*
This opcode is typically used to negate a byte8 value, making it a fundamental operation for arithmetic logic within the virtual machine.
*/
public static final int B_NEG = 37;
-
// endregion
+
// region 1.5 double64 (41-50)
/**
* D_ADD Opcode: Represents the double64 precision floating-point addition operation in the virtual machine.
@@ -530,7 +509,6 @@ public class VMOpCode {
* primarily used to handle basic double64 precision floating-point addition tasks.
*/
public static final int D_ADD = 41;
-
/**
* D_SUB Opcode: Represents the double64 precision floating-point subtraction operation in the virtual machine.
*
This opcode is implemented by the {@link DSubCommand} class, which defines its specific execution logic.
@@ -546,7 +524,6 @@ public class VMOpCode {
* primarily used to handle basic double64 precision floating-point subtraction tasks.
*/
public static final int D_SUB = 42;
-
/**
* D_MUL Opcode: Represents the double64 precision floating-point multiplication operation in the virtual machine.
*
This opcode is implemented by the {@link DMulCommand} class, which defines its specific execution logic.
@@ -562,7 +539,6 @@ public class VMOpCode {
* primarily used to handle basic double64 precision floating-point multiplication tasks.
*/
public static final int D_MUL = 43;
-
/**
* D_DIV Opcode: Represents the double64 precision floating-point division operation in the virtual machine.
*
This opcode is implemented by the {@link DDivCommand} class, which defines its specific execution logic.
@@ -579,7 +555,6 @@ public class VMOpCode {
* primarily used to handle basic double64 precision floating-point division tasks.
*/
public static final int D_DIV = 44;
-
/**
* D_MOD Opcode: Represents the double64 precision floating-point modulus (remainder) operation in the virtual machine.
*
This opcode is implemented by the {@link DModCommand} class, which defines its specific execution logic.
@@ -596,7 +571,6 @@ public class VMOpCode {
* primarily used to handle basic double64 precision floating-point modulus (remainder) tasks.
*/
public static final int D_MOD = 45;
-
/**
* D_INC Opcode: Represents the double64 increment operation for a local variable in the virtual machine.
*
This opcode is implemented by the {@link DIncCommand} class, which defines its specific execution logic.
@@ -614,7 +588,6 @@ public class VMOpCode {
*
This opcode is particularly useful for optimizing scenarios where a local `double64` variable, such as a counter or loop index, is frequently incremented.
*/
public static final int D_INC = 46;
-
/**
* D_NEG Opcode: Represents the double64 precision floating-point negation operation in the virtual machine.
*
This opcode is implemented by the {@link DNegCommand} class, which defines its specific execution logic.
@@ -629,8 +602,8 @@ public class VMOpCode {
*
This opcode is typically used to negate a double64 precision floating-point value, making it a fundamental operation for double64 precision arithmetic logic within the virtual machine.
*/
public static final int D_NEG = 47;
-
// endregion
+
// region 1.6 float32 (51-60)
/**
* F_ADD Opcode: Represents the float32 addition operation in the virtual machine.
@@ -726,7 +699,6 @@ public class VMOpCode {
*
This opcode is particularly useful for optimizing scenarios where a local `float32` variable, such as a counter or loop index, is frequently incremented.
*/
public static final int F_INC = 56;
-
/**
* F_NEG Opcode: Represents the float32 negation operation in the virtual machine.
*
This opcode is implemented by the {@link FNegCommand} class, which defines its specific execution logic.
@@ -741,7 +713,10 @@ public class VMOpCode {
*
This opcode is typically used to negate a float32 value, making it a fundamental operation for float32 arithmetic logic within the virtual machine.
*/
public static final int F_NEG = 57;
+ // endregion
+ // endregion
+ // region 2. Type Conversion Operation
/**
* I2L Opcode: Represents the type conversion operation from int32 to long64 in the virtual machine.
*
This opcode is implemented by the {@link I2LCommand} class, which defines its specific execution logic.
@@ -756,7 +731,6 @@ public class VMOpCode {
*
This opcode is commonly used to widen an int32 value to a long64 type to accommodate larger numeric ranges.
*/
public static final int I2L = 61;
-
/**
* I2S Opcode: Represents the type conversion operation from int32 to short16 in the virtual machine.
*
This opcode is implemented by the {@link I2SCommand} class, which defines its specific execution logic.
@@ -771,7 +745,6 @@ public class VMOpCode {
*
This opcode is typically used to narrow an int32 value to a short16 type when a smaller data representation is needed.
*/
public static final int I2S = 62;
-
/**
* I2B Opcode: Represents the type conversion operation from int32 to byte8 in the virtual machine.
*
This opcode is implemented by the {@link I2BCommand} class, which defines its specific execution logic.
@@ -786,7 +759,6 @@ public class VMOpCode {
*
This opcode is used to narrow an int32 value to a byte8 type, suitable when a smaller numeric type is required.
*/
public static final int I2B = 63;
-
/**
* I2D Opcode: Represents the type conversion operation from int32 to double64 in the virtual machine.
*
This opcode is implemented by the {@link I2DCommand} class, which defines its specific execution logic.
@@ -801,7 +773,6 @@ public class VMOpCode {
*
This opcode is used to widen an int32 value to a double64 type, providing high-precision floating-point calculations.
*/
public static final int I2D = 64;
-
/**
* I2F Opcode: Represents the type conversion operation from int32 to float32 in the virtual machine.
*
This opcode is implemented by the {@link I2FCommand} class, which defines its specific execution logic.
@@ -816,7 +787,6 @@ public class VMOpCode {
*
This opcode is used to convert an int32 value to a float32 type when floating-point arithmetic is required.
*/
public static final int I2F = 65;
-
/**
* L2I Opcode: Represents the type conversion operation from long64 to int32 in the virtual machine.
*
This opcode is implemented by the {@link L2ICommand} class, which defines its specific execution logic.
@@ -831,7 +801,6 @@ public class VMOpCode {
*
This opcode is typically used to narrow a long64 value to an int32 type for further integer operations.
*/
public static final int L2I = 66;
-
/**
* L2D Opcode: Represents the type conversion operation from long64 to double64 in the virtual machine.
*
This opcode is implemented by the {@link L2DCommand} class, which defines its specific execution logic.
@@ -981,9 +950,8 @@ public class VMOpCode {
*
This opcode is used to widen a byte8 value to an int32 type to ensure compatibility with integer-based operations.
*/
public static final int B2I = 76;
+ // endregion
- // endregion
- // endregion
// region 2. Bitwise Operations (81–90)
// region 2.1 int32 (81-85)
/**
@@ -1507,6 +1475,8 @@ public class VMOpCode {
*
*/
public static final int F_PUSH = 116;
+ // endregion
+ // region 4.2 POP (121-125)
/**
* I_POP Opcode: Represents a stack operation that removes the top element from the operand stack.
*
This opcode is implemented by the {@link PopCommand} class, which defines its specific execution logic.
@@ -1525,10 +1495,9 @@ public class VMOpCode {
*
Ensuring stack balance during function calls or control flow transitions.
*
*/
-
- // endregion
- // region 4.2 POP (121-125)
public static final int POP = 121;
+ // endregion
+ // region 4.3 DUP (126-130)
/**
* DUP Opcode: Represents a stack operation that duplicates the top element of the operand stack.
*
This opcode is implemented by the {@link DupCommand} class, which defines its specific execution logic.
@@ -1547,9 +1516,11 @@ public class VMOpCode {
*
Managing stack balance when performing operations that require repeated access to the same data.
*
*/
- // endregion
- // region 4.3 DUP (126-130)
+
public static final int DUP = 126;
+ // endregion
+
+ // region 4.4 SWAP (131-135)
/**
* SWAP Opcode: Represents a stack operation that swaps the top two values of the operand stack.
*
This opcode is implemented by the {@link SwapCommand} class, which defines its specific execution logic.
@@ -1569,12 +1540,9 @@ public class VMOpCode {
*
Ensuring proper operand placement for later instructions that depend on the order of stack elements.
*
*/
-
- // endregion
- // region 4.4 SWAP (131-135)
public static final int SWAP = 131;
-
// endregion
+
// endregion
// region 5. Memory Operations (151–166)
/**
@@ -1818,7 +1786,7 @@ public class VMOpCode {
*
*/
public static final int F_LOAD = 166;
- // endregion
+
/**
* MOV Opcode: Represents a move operation that transfers a value from one local variable to another within the local variable store.
*
This opcode is implemented by the {@link MovCommand} class, which defines its specific execution logic.
@@ -1839,7 +1807,8 @@ public class VMOpCode {
*
*/
public static final int MOV = 171;
- // region 6. function call
+ // endregion
+ // region 6. Function Call
/**
* CALL Opcode: Represents a function or subroutine call operation that transfers control to a specified function address.
*
This opcode is implemented by the {@link CallCommand} class, which defines its specific execution logic.
@@ -1898,6 +1867,7 @@ public class VMOpCode {
*/
public static final int HALT = 255;
// endregion
+
/**
* Default constructor for creating an instance of VMOpCode.
* This constructor is empty as no specific initialization is required.
From 4aa1804d4409eb20876941c43666e3d75be8536b Mon Sep 17 00:00:00 2001
From: Luke
Date: Thu, 26 Jun 2025 18:01:30 +0800
Subject: [PATCH 02/15] =?UTF-8?q?feat=EF=BC=9ACommand[]=20=E6=89=A9?=
=?UTF-8?q?=E5=AE=B9=E5=88=B0=200x04FF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../snow/vm/factories/CommandFactory.java | 26 +++++++++----------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/src/main/java/org/jcnc/snow/vm/factories/CommandFactory.java b/src/main/java/org/jcnc/snow/vm/factories/CommandFactory.java
index 5ededd8..a548fe4 100644
--- a/src/main/java/org/jcnc/snow/vm/factories/CommandFactory.java
+++ b/src/main/java/org/jcnc/snow/vm/factories/CommandFactory.java
@@ -52,7 +52,7 @@ import java.util.Optional;
*
This class uses an array for fast, constant-time access to corresponding command instances.
*/
public class CommandFactory {
- private static final Command[] COMMANDS = new Command[1000]; // Adjust, according to your VMOpCode range
+ private static final Command[] COMMANDS = new Command[0x04FF];
static {
// Initialize the array with corresponding commands based on opCode values
@@ -146,19 +146,19 @@ public class CommandFactory {
// 3.1 JUMP (91-91)
COMMANDS[VMOpCode.JUMP] = new JumpCommand(); // 91
// 3.2 int32 (92-97)
- COMMANDS[VMOpCode.IC_E] = new ICECommand(); // 92
- COMMANDS[VMOpCode.IC_NE] = new ICNECommand(); // 93
- COMMANDS[VMOpCode.IC_G] = new ICGCommand(); // 94
- COMMANDS[VMOpCode.IC_GE] = new ICGECommand(); // 95
- COMMANDS[VMOpCode.IC_L] = new ICLCommand(); // 96
- COMMANDS[VMOpCode.IC_LE] = new ICLECommand(); // 97
+ COMMANDS[VMOpCode.I_CE] = new ICECommand(); // 92
+ COMMANDS[VMOpCode.I_CNE] = new ICNECommand(); // 93
+ COMMANDS[VMOpCode.I_CG] = new ICGCommand(); // 94
+ COMMANDS[VMOpCode.I_CGE] = new ICGECommand(); // 95
+ COMMANDS[VMOpCode.I_CL] = new ICLCommand(); // 96
+ COMMANDS[VMOpCode.I_CLE] = new ICLECommand(); // 97
// 3.3 long64 (98-103)
- COMMANDS[VMOpCode.LC_E] = new LCECommand(); // 98
- COMMANDS[VMOpCode.LC_NE] = new LCNECommand(); // 99
- COMMANDS[VMOpCode.LC_G] = new LCGCommand(); // 100
- COMMANDS[VMOpCode.LC_GE] = new LCGECommand(); // 101
- COMMANDS[VMOpCode.LC_L] = new LCLCommand(); // 102
- COMMANDS[VMOpCode.LC_LE] = new LCLECommand(); // 103
+ COMMANDS[VMOpCode.L_CE] = new LCECommand(); // 98
+ COMMANDS[VMOpCode.L_CNE] = new LCNECommand(); // 99
+ COMMANDS[VMOpCode.L_CG] = new LCGCommand(); // 100
+ COMMANDS[VMOpCode.L_CGE] = new LCGECommand(); // 101
+ COMMANDS[VMOpCode.L_CL] = new LCLCommand(); // 102
+ COMMANDS[VMOpCode.L_CLE] = new LCLECommand(); // 103
// 4. Stack Operations (111–150)
// 4.1 PUSH (111-120)
From 40fc6383b11c1b7579865aaaa18581aac074a511 Mon Sep 17 00:00:00 2001
From: Luke
Date: Thu, 26 Jun 2025 18:02:22 +0800
Subject: [PATCH 03/15] =?UTF-8?q?style=EF=BC=9A=E7=BB=9F=E4=B8=80=E8=A7=84?=
=?UTF-8?q?=E8=8C=83=20VMOpCod=20e=E5=91=BD=E5=90=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../snow/compiler/backend/util/OpHelper.java | 24 +++++++++----------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/main/java/org/jcnc/snow/compiler/backend/util/OpHelper.java b/src/main/java/org/jcnc/snow/compiler/backend/util/OpHelper.java
index 8c7bba9..4bb0993 100644
--- a/src/main/java/org/jcnc/snow/compiler/backend/util/OpHelper.java
+++ b/src/main/java/org/jcnc/snow/compiler/backend/util/OpHelper.java
@@ -89,18 +89,18 @@ public final class OpHelper {
map.put("L_OR", Integer.toString(VMOpCode.L_OR));
map.put("L_XOR", Integer.toString(VMOpCode.L_XOR));
map.put("JUMP", Integer.toString(VMOpCode.JUMP));
- map.put("IC_E", Integer.toString(VMOpCode.IC_E));
- map.put("IC_NE", Integer.toString(VMOpCode.IC_NE));
- map.put("IC_G", Integer.toString(VMOpCode.IC_G));
- map.put("IC_GE", Integer.toString(VMOpCode.IC_GE));
- map.put("IC_L", Integer.toString(VMOpCode.IC_L));
- map.put("IC_LE", Integer.toString(VMOpCode.IC_LE));
- map.put("LC_E", Integer.toString(VMOpCode.LC_E));
- map.put("LC_NE", Integer.toString(VMOpCode.LC_NE));
- map.put("LC_G", Integer.toString(VMOpCode.LC_G));
- map.put("LC_GE", Integer.toString(VMOpCode.LC_GE));
- map.put("LC_L", Integer.toString(VMOpCode.LC_L));
- map.put("LC_LE", Integer.toString(VMOpCode.LC_LE));
+ map.put("IC_E", Integer.toString(VMOpCode.I_CE));
+ map.put("IC_NE", Integer.toString(VMOpCode.I_CNE));
+ map.put("IC_G", Integer.toString(VMOpCode.I_CG));
+ map.put("IC_GE", Integer.toString(VMOpCode.I_CGE));
+ map.put("IC_L", Integer.toString(VMOpCode.I_CL));
+ map.put("IC_LE", Integer.toString(VMOpCode.I_CLE));
+ map.put("LC_E", Integer.toString(VMOpCode.L_CE));
+ map.put("LC_NE", Integer.toString(VMOpCode.L_CNE));
+ map.put("LC_G", Integer.toString(VMOpCode.L_CG));
+ map.put("LC_GE", Integer.toString(VMOpCode.L_CGE));
+ map.put("LC_L", Integer.toString(VMOpCode.L_CL));
+ map.put("LC_LE", Integer.toString(VMOpCode.L_CLE));
map.put("I_PUSH", Integer.toString(VMOpCode.I_PUSH));
map.put("L_PUSH", Integer.toString(VMOpCode.L_PUSH));
map.put("S_PUSH", Integer.toString(VMOpCode.S_PUSH));
From 221812866337f84e61eb52d9fc1f7faf874ae656 Mon Sep 17 00:00:00 2001
From: Luke
Date: Thu, 26 Jun 2025 18:02:42 +0800
Subject: [PATCH 04/15] =?UTF-8?q?style=EF=BC=9A=E6=89=A9=E5=AE=B9opcode?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../org/jcnc/snow/vm/engine/VMOpCode.java | 2931 ++++++++---------
1 file changed, 1461 insertions(+), 1470 deletions(-)
diff --git a/src/main/java/org/jcnc/snow/vm/engine/VMOpCode.java b/src/main/java/org/jcnc/snow/vm/engine/VMOpCode.java
index f5e8762..386bf57 100644
--- a/src/main/java/org/jcnc/snow/vm/engine/VMOpCode.java
+++ b/src/main/java/org/jcnc/snow/vm/engine/VMOpCode.java
@@ -15,6 +15,7 @@ import org.jcnc.snow.vm.commands.bitwise.long64.LOrCommand;
import org.jcnc.snow.vm.commands.bitwise.long64.LXorCommand;
import org.jcnc.snow.vm.commands.control.all.JumpCommand;
import org.jcnc.snow.vm.commands.control.int32.*;
+import org.jcnc.snow.vm.commands.control.long64.*;
import org.jcnc.snow.vm.commands.function.CallCommand;
import org.jcnc.snow.vm.commands.function.RetCommand;
import org.jcnc.snow.vm.commands.memory.all.MovCommand;
@@ -47,88 +48,102 @@ import org.jcnc.snow.vm.module.LocalVariableStore;
*
Each opcode represents a specific operation executed by the virtual machine.
*/
public class VMOpCode {
- // region 1. Arithmetic Operations (1–100)
- // region 1.1 int32 (0-9)
+
+ // region Byte8 (0x0000-0x001F)
/**
- * I_ADD Opcode: Represents the int32 addition operation in the virtual machine.
- *
This opcode is implemented by the {@link IAddCommand} class, which defines its specific execution logic.
+ * B_ADD Opcode: Represents the byte8 addition operation in the virtual machine.
+ *
This opcode is implemented by the {@link BAddCommand} class, which defines its specific execution logic.
*
*
Execution Steps:
*
- *
Pops the top two int32 values from the operand stack (the first value popped is the second operand, and the second value popped is the first operand).
- *
Performs the addition operation on these two int32s.
+ *
Pops the top two byte8 values from the operand stack (the first value popped is the second operand, and the second value popped is the first operand).
+ *
Performs the addition operation on these two byte8 values.
*
Pushes the result of the addition back onto the operand stack for later instructions to use.
*
*
*
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
- * primarily used to handle basic int32 addition tasks.
+ * primarily used to handle basic byte8 addition tasks.
*/
- public static final int I_ADD = 0;
+ public static final int B_ADD = 0x0000;
/**
- * I_SUB Opcode: Represents the int32 subtraction operation in the virtual machine.
- *
This opcode is implemented by the {@link ISubCommand} class, which defines its specific execution logic.
+ * B_SUB Opcode: Represents the byte8 subtraction operation in the virtual machine.
+ *
This opcode is implemented by the {@link BSubCommand} class, which defines its specific execution logic.
*
*
Execution Steps:
*
- *
Pops the top two int32 values from the operand stack (the first value popped is the subtrahend, and the second value popped is the minuend).
+ *
Pops the top two byte8 values from the operand stack (the first value popped is the subtrahend, and the second value popped is the minuend).
*
Performs the subtraction operation by subtracting the subtrahend from the minuend (i.e., minuend - subtrahend).
*
Pushes the result of the subtraction back onto the operand stack for later instructions to use.
*
*
*
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
- * primarily used to handle basic int32 subtraction tasks.
+ * primarily used to handle basic byte8 subtraction tasks.
*/
- public static final int I_SUB = 1;
+ public static final int B_SUB = 0x0001;
/**
- * I_MUL Opcode: Represents the int32 multiplication operation in the virtual machine.
- *
This opcode is implemented by the {@link IMulCommand} class, which defines its specific execution logic.
+ * B_MUL Opcode: Represents the byte8 multiplication operation in the virtual machine.
+ *
This opcode is implemented by the {@link BMulCommand} class, which defines its specific execution logic.
*
*
Execution Steps:
*
- *
Pops the top two int32 values from the operand stack (the first value popped is the second operand, and the second value popped is the first operand).
- *
Performs the multiplication operation on these two int32s (i.e., firstOperand * secondOperand).
+ *
Pops the top two byte8 values from the operand stack (the first value popped is the second operand, and the second value popped is the first operand).
+ *
Performs the multiplication operation on these two byte8 values (i.e., firstOperand * secondOperand).
*
Pushes the result of the multiplication back onto the operand stack for later instructions to use.
*
*
*
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
- * primarily used to handle basic int32 multiplication tasks.
+ * primarily used to handle basic byte8 multiplication tasks.
*/
- public static final int I_MUL = 2;
+ public static final int B_MUL = 0x0002;
/**
- * I_DIV Opcode: Represents the int32 division operation in the virtual machine.
- *
This opcode is implemented by the {@link IDivCommand} class, which defines its specific execution logic.
+ * B_DIV Opcode: Represents the byte8 division operation in the virtual machine.
+ *
This opcode is implemented by the {@link BDivCommand} class, which defines its specific execution logic.
*
*
Execution Steps:
*
- *
Pops the top two int32 values from the operand stack (the first value popped is the divisor, and the second value popped is the dividend).
+ *
Pops the top two byte8 values from the operand stack (the first value popped is the divisor, and the second value popped is the dividend).
*
Performs the division operation by dividing the dividend by the divisor (i.e., dividend / divisor).
*
Checks for division by zero and throws an {@link ArithmeticException} if the divisor is zero, as this operation is undefined.
*
Pushes the result of the division back onto the operand stack for later instructions to use.
*
*
*
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
- * primarily used to handle basic int32 division tasks.
+ * primarily used to handle basic byte8 division tasks.
*/
- public static final int I_DIV = 3;
+ public static final int B_DIV = 0x0003;
/**
- * I_MOD Opcode: Represents the int32 modulus (remainder) operation in the virtual machine.
- *
This opcode is implemented by the {@link IModCommand} class, which defines its specific execution logic.
+ * B_MOD Opcode: Represents the byte8 modulus (remainder) operation in the virtual machine.
+ *
This opcode is implemented by the {@link BModCommand} class, which defines its specific execution logic.
*
*
Execution Steps:
*
- *
Pops the top two int32 values from the operand stack (the first value popped is the divisor, and the second value popped is the dividend).
+ *
Pops the top two byte8 values from the operand stack (the first value popped is the divisor, and the second value popped is the dividend).
*
Performs the modulus operation by calculating the remainder of the division of the dividend by the divisor (i.e., dividend % divisor).
*
Checks for division by zero and throws an {@link ArithmeticException} if the divisor is zero, as this operation is undefined.
*
Pushes the result of the modulus operation back onto the operand stack for later instructions to use.
*
*
*
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
- * primarily used to handle basic int32 modulus (remainder) tasks.
+ * primarily used to handle basic byte8 modulus (remainder) tasks.
*/
- public static final int I_MOD = 4;
+ public static final int B_MOD = 0x0004;
/**
- * I_INC Opcode: Represents the int32 increment operation for a local variable in the virtual machine.
- *
This opcode is implemented by the {@link IIncCommand} class, which defines its specific execution logic.
+ * B_NEG Opcode: Represents the byte8 negation operation in the virtual machine.
+ *
This opcode is implemented by the {@link BNegCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top byte8 value from the operand stack.
+ *
Performs the negation of the popped value (i.e., -value).
+ *
Pushes the negated result back onto the operand stack for later instructions to use.
+ *
+ *
+ *
This opcode is typically used to negate a byte8 value, making it a fundamental operation for arithmetic logic within the virtual machine.
+ */
+ public static final int B_NEG = 0x0005;
+ /**
+ * B_INC Opcode: Represents the byte8 increment operation for a local variable in the virtual machine.
+ *
This opcode is implemented by the {@link BIncCommand} class, which defines its specific execution logic.
*
*
Execution Steps:
*
@@ -140,152 +155,84 @@ public class VMOpCode {
*
Returns the updated program counter (PC) value, typically incremented by 1, unless control flow changes.
*
*
- *
This opcode is particularly useful for optimizing scenarios where a local variable, such as a counter or loop index, is frequently incremented.
+ *
This opcode is particularly useful for optimizing scenarios where a local `byte8` variable, such as a counter or loop index, is frequently incremented.
*/
- public static final int I_INC = 5;
+ public static final int B_INC = 0x0006;
+
+ public static final int B_AND = 0x0007;
+ public static final int B_OR = 0x0008;
+ public static final int B_XOR = 0x0009;
+
/**
- * I_NEG Opcode: Represents the int32 negation operation in the virtual machine.
- *
This opcode is implemented by the {@link INegCommand} class, which defines its specific execution logic.
+ * B_PUSH Opcode: Represents a stack operation that pushes a byte8 value onto the operand stack.
+ *
This opcode is implemented by the {@link BPushCommand} class, which defines its specific execution logic.
*
*
Execution Steps:
*
- *
Pops the top int32 value from the operand stack.
- *
Performs the negation of the popped value (i.e., -value).
- *
Pushes the negated result back onto the operand stack for later instructions to use.
+ *
Parses the byte8 value from the instruction parameters.
+ *
Pushes the parsed byte8 value onto the operand stack.
+ *
Increments the program counter (PC) to proceed with the next sequential instruction.
*
*
- *
This opcode is typically used to negate an int32 value, making it a fundamental operation for arithmetic logic within the virtual machine.
+ *
This opcode is commonly used for:
+ *
+ *
Loading constant values into the operand stack for later operations.
+ *
Preparing operands for arithmetic, logical, or comparison instructions.
+ *
Facilitating method calls or control flow by managing stack-based data.
+ *
*/
- public static final int I_NEG = 6;
+ public static final int B_PUSH = 0x000A;
+ /**
+ * B_LOAD Opcode: Represents a load operation that retrieves a byte8 value from the local variable store and pushes it onto the operand stack.
+ *
This opcode is implemented by the {@link BLoadCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Retrieves the index for the local variable from the instruction parameters.
+ *
Retrieves the corresponding value from the local variable store of the current method frame.
+ *
Pushes the retrieved value onto the operand stack for subsequent operations.
+ *
Increments the program counter (PC) to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Loading local variables onto the operand stack for further operations or computations.
+ *
Retrieving stored values that are needed for subsequent instructions, such as arithmetic or logic operations.
+ *
Preserving the necessary method-local state by pushing relevant values from the local variable store to the operand stack.
+ *
+ */
+ public static final int B_LOAD = 0x000B;
+ /**
+ * B_STORE Opcode: Represents a store operation that stores a byte8 value from the operand stack into the local variable store.
+ *
This opcode is implemented by the {@link BStoreCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Retrieves the index for the local variable from the instruction parameters.
+ *
Pops a byte8 value from the operand stack.
+ *
Stores the value into the local variable store at the specified index of the current method frame.
+ *
Increments the program counter (PC) to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Saving byte8 results or constants into method-local variables.
+ *
Enabling byte-level operations and temporary storage.
+ *
Transferring values from the stack to local scope in compact form.
+ *
+ */
+ public static final int B_STORE = 0x000C;
+
+ public static final int B_CE = 0x000D;
+ public static final int B_CNE = 0x000E;
+ public static final int B_CG = 0x000F;
+ public static final int B_CGE = 0x0010;
+ public static final int B_CL = 0x0011;
+ public static final int B_CLE = 0x0012;
// endregion
- // region 1.2 long64 (10-19)
- /**
- * L_ADD Opcode: Represents the long64 addition operation in the virtual machine.
- *
This opcode is implemented by the {@link LAddCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pops the top two long64 values from the operand stack (the first value popped is the second operand, and the second value popped is the first operand).
- *
Performs the addition operation on these two long64s.
- *
Pushes the result of the addition back onto the operand stack for later instructions to use.
- *
- *
- *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
- * primarily used to handle basic long64 addition tasks.
- */
- public static final int L_ADD = 10;
- /**
- * L_SUB Opcode: Represents the long64 subtraction operation in the virtual machine.
- *
This opcode is implemented by the {@link LSubCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pops the top two long64 values from the operand stack (the first value popped is the subtrahend, and the second value popped is the minuend).
- *
Performs the subtraction operation by subtracting the subtrahend from the minuend (i.e., minuend - subtrahend).
- *
Pushes the result of the subtraction back onto the operand stack for later instructions to use.
- *
- *
- *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
- * primarily used to handle basic long64 subtraction tasks.
- */
- public static final int L_SUB = 11;
- /**
- * L_MUL Opcode: Represents the long64 multiplication operation in the virtual machine.
- *
This opcode is implemented by the {@link LMulCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pops the top two long64 values from the operand stack (the first value popped is the second operand, and the second value popped is the first operand).
- *
Performs the multiplication operation on these two long64s (i.e., firstOperand * secondOperand).
- *
Pushes the result of the multiplication back onto the operand stack for later instructions to use.
- *
- *
- *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
- * primarily used to handle basic long64 multiplication tasks.
- */
- public static final int L_MUL = 12;
- /**
- * L_DIV Opcode: Represents the long64 division operation in the virtual machine.
- *
This opcode is implemented by the {@link LDivCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pops the top two long64 values from the operand stack (the first value popped is the divisor, and the second value popped is the dividend).
- *
Performs the division operation by dividing the dividend by the divisor (i.e., dividend / divisor).
- *
Checks for division by zero and throws an {@link ArithmeticException} if the divisor is zero, as this operation is undefined.
- *
Pushes the result of the division back onto the operand stack for later instructions to use.
- *
- *
- *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
- * primarily used to handle basic long64 division tasks.
- */
- public static final int L_DIV = 13;
- /**
- * L_MOD Opcode: Represents the long64 modulus (remainder) operation in the virtual machine.
- *
This opcode is implemented by the {@link LModCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pops the top two long64 values from the operand stack (the first value popped is the divisor, and the second value popped is the dividend).
- *
Performs the modulus operation by calculating the remainder of the division of the dividend by the divisor (i.e., dividend % divisor).
- *
Checks for division by zero and throws an {@link ArithmeticException} if the divisor is zero, as this operation is undefined.
- *
Pushes the result of the modulus operation back onto the operand stack for later instructions to use.
- *
- *
- *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
- * primarily used to handle basic long64 modulus (remainder) tasks.
- */
- public static final int L_MOD = 14;
- /**
- * L_INC Opcode: Represents the long64 increment operation for a local variable in the virtual machine.
- *
This opcode is implemented by the {@link LIncCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Retrieves the index of the local variable and the increment value from the instruction parameters.
- *
Gets the current value of the local variable at the specified index from the local variable store.
- *
Increments the local variable's value by the specified increment (i.e.,
- * localVariables[index] += increment).
- *
Updates the local variable store with the new incremented value.
- *
Returns the updated program counter (PC) value, typically incremented by 1, unless control flow changes.
- *
- *
- *
This opcode is particularly useful for optimizing scenarios where a local `long64` variable, such as a counter or loop index, is frequently incremented.
- */
- public static final int L_INC = 15;
- /**
- * L_NEG Opcode: Represents the long64 negation operation in the virtual machine.
- *
This opcode is implemented by the {@link LNegCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pops the top long64 value from the operand stack.
- *
Performs the negation of the popped value (i.e., -value).
- *
Pushes the negated result back onto the operand stack for later instructions to use.
- *
- *
- *
This opcode is typically used to negate a long64 value, making it a fundamental operation for arithmetic logic within the virtual machine.
- */
- public static final int L_NEG = 16;
- // endregion
-
- // region 1.3 short16 (20-29)
- /**
- * S_ADD Opcode: Represents the short16 addition operation in the virtual machine.
- *
This opcode is implemented by the {@link SAddCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pops the top two short16 values from the operand stack (the first value popped is the second operand, and the second value popped is the first operand).
- *
Performs the addition operation on these two short16 values.
- *
Pushes the result of the addition back onto the operand stack for later instructions to use.
- *
- *
- *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
- * primarily used to handle basic short16 addition tasks.
- */
- public static final int S_ADD = 20;
+ // region Short16 (0x0020-0x003F)
+ public static final int S_ADD = 0x0020;
/**
* S_SUB Opcode: Represents the short16 subtraction operation in the virtual machine.
*
This opcode is implemented by the {@link SSubCommand} class, which defines its specific execution logic.
@@ -300,7 +247,7 @@ public class VMOpCode {
*
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
* primarily used to handle basic short16 subtraction tasks.
*/
- public static final int S_SUB = 21;
+ public static final int S_SUB = 0x0021;
/**
* S_MUL Opcode: Represents the short16 multiplication operation in the virtual machine.
*
This opcode is implemented by the {@link SMulCommand} class, which defines its specific execution logic.
@@ -315,7 +262,7 @@ public class VMOpCode {
*
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
* primarily used to handle basic short16 multiplication tasks.
*/
- public static final int S_MUL = 22;
+ public static final int S_MUL = 0x0022;
/**
* S_DIV Opcode: Represents the short16 division operation in the virtual machine.
*
This opcode is implemented by the {@link SDivCommand} class, which defines its specific execution logic.
@@ -331,7 +278,7 @@ public class VMOpCode {
*
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
* primarily used to handle basic short16 division tasks.
*/
- public static final int S_DIV = 23;
+ public static final int S_DIV = 0x0023;
/**
* S_MOD Opcode: Represents the short16 modulus (remainder) operation in the virtual machine.
*
This opcode is implemented by the {@link SModCommand} class, which defines its specific execution logic.
@@ -347,7 +294,21 @@ public class VMOpCode {
*
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
* primarily used to handle basic short16 modulus (remainder) tasks.
*/
- public static final int S_MOD = 24;
+ public static final int S_MOD = 0x0024;
+ /**
+ * S_NEG Opcode: Represents the short16 negation operation in the virtual machine.
+ *
This opcode is implemented by the {@link SNegCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top short16 value from the operand stack.
+ *
Performs the negation of the popped value (i.e., -value).
+ *
Pushes the negated result back onto the operand stack for later instructions to use.
+ *
+ *
+ *
This opcode is typically used to negate a short16 value, making it a fundamental operation for arithmetic logic within the virtual machine.
+ */
+ public static final int S_NEG = 0x0025;
/**
* S_INC Opcode: Represents the short16 increment operation in the virtual machine.
*
This opcode is implemented by the {@link SIncCommand} class, which defines its specific execution logic.
@@ -365,1040 +326,12 @@ public class VMOpCode {
*
This opcode is useful for scenarios where a local variable needs to be incremented, such as counters within loops,
* or for optimizing the modification of variables in tight loops.
*/
- public static final int S_INC = 25;
- /**
- * S_NEG Opcode: Represents the short16 negation operation in the virtual machine.
- *
This opcode is implemented by the {@link SNegCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pops the top short16 value from the operand stack.
- *
Performs the negation of the popped value (i.e., -value).
- *
Pushes the negated result back onto the operand stack for later instructions to use.
- *
- *
- *
This opcode is typically used to negate a short16 value, making it a fundamental operation for arithmetic logic within the virtual machine.
- */
- public static final int S_NEG = 26;
- // endregion
+ public static final int S_INC = 0x0026;
- // region 1.4 byte8 (31-40)
- /**
- * B_ADD Opcode: Represents the byte8 addition operation in the virtual machine.
- *
This opcode is implemented by the {@link BAddCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pops the top two byte8 values from the operand stack (the first value popped is the second operand, and the second value popped is the first operand).
- *
Performs the addition operation on these two byte8 values.
- *
Pushes the result of the addition back onto the operand stack for later instructions to use.
- *
- *
- *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
- * primarily used to handle basic byte8 addition tasks.
- */
- public static final int B_ADD = 31;
- /**
- * B_SUB Opcode: Represents the byte8 subtraction operation in the virtual machine.
- *
This opcode is implemented by the {@link BSubCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pops the top two byte8 values from the operand stack (the first value popped is the subtrahend, and the second value popped is the minuend).
- *
Performs the subtraction operation by subtracting the subtrahend from the minuend (i.e., minuend - subtrahend).
- *
Pushes the result of the subtraction back onto the operand stack for later instructions to use.
- *
- *
- *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
- * primarily used to handle basic byte8 subtraction tasks.
- */
- public static final int B_SUB = 32;
- /**
- * B_MUL Opcode: Represents the byte8 multiplication operation in the virtual machine.
- *
This opcode is implemented by the {@link BMulCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pops the top two byte8 values from the operand stack (the first value popped is the second operand, and the second value popped is the first operand).
- *
Performs the multiplication operation on these two byte8 values (i.e., firstOperand * secondOperand).
- *
Pushes the result of the multiplication back onto the operand stack for later instructions to use.
- *
- *
- *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
- * primarily used to handle basic byte8 multiplication tasks.
- */
- public static final int B_MUL = 33;
- /**
- * B_DIV Opcode: Represents the byte8 division operation in the virtual machine.
- *
This opcode is implemented by the {@link BDivCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pops the top two byte8 values from the operand stack (the first value popped is the divisor, and the second value popped is the dividend).
- *
Performs the division operation by dividing the dividend by the divisor (i.e., dividend / divisor).
- *
Checks for division by zero and throws an {@link ArithmeticException} if the divisor is zero, as this operation is undefined.
- *
Pushes the result of the division back onto the operand stack for later instructions to use.
- *
- *
- *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
- * primarily used to handle basic byte8 division tasks.
- */
- public static final int B_DIV = 34;
- /**
- * B_MOD Opcode: Represents the byte8 modulus (remainder) operation in the virtual machine.
- *
This opcode is implemented by the {@link BModCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pops the top two byte8 values from the operand stack (the first value popped is the divisor, and the second value popped is the dividend).
- *
Performs the modulus operation by calculating the remainder of the division of the dividend by the divisor (i.e., dividend % divisor).
- *
Checks for division by zero and throws an {@link ArithmeticException} if the divisor is zero, as this operation is undefined.
- *
Pushes the result of the modulus operation back onto the operand stack for later instructions to use.
- *
- *
- *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
- * primarily used to handle basic byte8 modulus (remainder) tasks.
- */
- public static final int B_MOD = 35;
- /**
- * B_INC Opcode: Represents the byte8 increment operation for a local variable in the virtual machine.
- *
This opcode is implemented by the {@link BIncCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Retrieves the index of the local variable and the increment value from the instruction parameters.
- *
Gets the current value of the local variable at the specified index from the local variable store.
- *
Increments the local variable's value by the specified increment (i.e.,
- * localVariables[index] += increment).
- *
Updates the local variable store with the new incremented value.
- *
Returns the updated program counter (PC) value, typically incremented by 1, unless control flow changes.
- *
- *
- *
This opcode is particularly useful for optimizing scenarios where a local `byte8` variable, such as a counter or loop index, is frequently incremented.
- */
- public static final int B_INC = 36;
- /**
- * B_NEG Opcode: Represents the byte8 negation operation in the virtual machine.
- *
This opcode is implemented by the {@link BNegCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pops the top byte8 value from the operand stack.
- *
Performs the negation of the popped value (i.e., -value).
- *
Pushes the negated result back onto the operand stack for later instructions to use.
- *
- *
- *
This opcode is typically used to negate a byte8 value, making it a fundamental operation for arithmetic logic within the virtual machine.
- */
- public static final int B_NEG = 37;
- // endregion
+ public static final int S_AND = 0x0027;
+ public static final int S_OR = 0x0028;
+ public static final int S_XOR = 0x0029;
- // region 1.5 double64 (41-50)
- /**
- * D_ADD Opcode: Represents the double64 precision floating-point addition operation in the virtual machine.
- *
This opcode is implemented by the {@link DAddCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pops the top two double64 values from the operand stack (the first value popped is the second operand, and the second value popped is the first operand).
- *
Performs the double64 precision floating-point addition operation on these two operands.
- *
Pushes the result of the addition back onto the operand stack for later instructions to use.
- *
- *
- *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
- * primarily used to handle basic double64 precision floating-point addition tasks.
- */
- public static final int D_ADD = 41;
- /**
- * D_SUB Opcode: Represents the double64 precision floating-point subtraction operation in the virtual machine.
- *
This opcode is implemented by the {@link DSubCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pops the top two double64 values from the operand stack (the first value popped is the subtrahend, and the second value popped is the minuend).
- *
Performs the double64 precision floating-point subtraction operation by subtracting the subtrahend from the minuend (i.e., minuend - subtrahend).
- *
Pushes the result of the subtraction back onto the operand stack for later instructions to use.
- *
- *
- *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
- * primarily used to handle basic double64 precision floating-point subtraction tasks.
- */
- public static final int D_SUB = 42;
- /**
- * D_MUL Opcode: Represents the double64 precision floating-point multiplication operation in the virtual machine.
- *
This opcode is implemented by the {@link DMulCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pops the top two double64 values from the operand stack (the first value popped is the second operand, and the second value popped is the first operand).
- *
Performs the double64 precision floating-point multiplication operation on these two operands (i.e., firstOperand * secondOperand).
- *
Pushes the result of the multiplication back onto the operand stack for later instructions to use.
- *
- *
- *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
- * primarily used to handle basic double64 precision floating-point multiplication tasks.
- */
- public static final int D_MUL = 43;
- /**
- * D_DIV Opcode: Represents the double64 precision floating-point division operation in the virtual machine.
- *
This opcode is implemented by the {@link DDivCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pops the top two double64 values from the operand stack (the first value popped is the divisor, and the second value popped is the dividend).
- *
Performs the double64 precision floating-point division operation by dividing the dividend by the divisor (i.e., dividend / divisor).
- *
Checks for division by zero and throws an {@link ArithmeticException} if the divisor is zero, as this operation is undefined.
- *
Pushes the result of the division back onto the operand stack for later instructions to use.
- *
- *
- *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
- * primarily used to handle basic double64 precision floating-point division tasks.
- */
- public static final int D_DIV = 44;
- /**
- * D_MOD Opcode: Represents the double64 precision floating-point modulus (remainder) operation in the virtual machine.
- *
This opcode is implemented by the {@link DModCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pops the top two double64 values from the operand stack (the first value popped is the divisor, and the second value popped is the dividend).
- *
Performs the modulus operation by calculating the remainder of the division of the dividend by the divisor (i.e., dividend % divisor).
- *
Checks for division by zero and throws an {@link ArithmeticException} if the divisor is zero, as this operation is undefined.
- *
Pushes the result of the modulus operation back onto the operand stack for later instructions to use.
- *
- *
- *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
- * primarily used to handle basic double64 precision floating-point modulus (remainder) tasks.
- */
- public static final int D_MOD = 45;
- /**
- * D_INC Opcode: Represents the double64 increment operation for a local variable in the virtual machine.
- *
This opcode is implemented by the {@link DIncCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Retrieves the index of the local variable and the increment value from the instruction parameters.
- *
Gets the current value of the local variable at the specified index from the local variable store.
- *
Increments the local variable's value by the specified increment (i.e.,
- * localVariables[index] += increment).
- *
Updates the local variable store with the new incremented value.
- *
Returns the updated program counter (PC) value, typically incremented by 1, unless control flow changes.
- *
- *
- *
This opcode is particularly useful for optimizing scenarios where a local `double64` variable, such as a counter or loop index, is frequently incremented.
- */
- public static final int D_INC = 46;
- /**
- * D_NEG Opcode: Represents the double64 precision floating-point negation operation in the virtual machine.
- *
This opcode is implemented by the {@link DNegCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pops the top double64 value from the operand stack.
- *
Performs the negation of the popped value (i.e., -value).
- *
Pushes the negated result back onto the operand stack for later instructions to use.
- *
- *
- *
This opcode is typically used to negate a double64 precision floating-point value, making it a fundamental operation for double64 precision arithmetic logic within the virtual machine.
- */
- public static final int D_NEG = 47;
- // endregion
-
- // region 1.6 float32 (51-60)
- /**
- * F_ADD Opcode: Represents the float32 addition operation in the virtual machine.
- *
This opcode is implemented by the {@link FAddCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pops the top two float32 values from the operand stack (the first value popped is the second operand, and the second value popped is the first operand).
- *
Performs the float32 addition operation on these two operands.
- *
Pushes the result of the addition back onto the operand stack for later instructions to use.
- *
- *
- *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
- * primarily used to handle basic float32 addition tasks.
- */
- public static final int F_ADD = 51;
- /**
- * F_SUB Opcode: Represents the float32 subtraction operation in the virtual machine.
- *
This opcode is implemented by the {@link FSubCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pops the top two float32 values from the operand stack (the first value popped is the subtrahend, and the second value popped is the minuend).
- *
Performs the float32 subtraction operation by subtracting the subtrahend from the minuend (i.e., minuend - subtrahend).
- *
Pushes the result of the subtraction back onto the operand stack for later instructions to use.
- *
- *
- *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
- * primarily used to handle basic float32 subtraction tasks.
- */
- public static final int F_SUB = 52;
- /**
- * F_MUL Opcode: Represents the float32 multiplication operation in the virtual machine.
- *
This opcode is implemented by the {@link FMulCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pops the top two float32 values from the operand stack (the first value popped is the second operand, and the second value popped is the first operand).
- *
Performs the float32 multiplication operation on these two operands (i.e., firstOperand * secondOperand).
- *
Pushes the result of the multiplication back onto the operand stack for later instructions to use.
- *
- *
- *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
- * primarily used to handle basic float32 multiplication tasks.
- */
- public static final int F_MUL = 53;
- /**
- * F_DIV Opcode: Represents the float32 division operation in the virtual machine.
- *
This opcode is implemented by the {@link FDivCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pops the top two float32 values from the operand stack (the first value popped is the divisor, and the second value popped is the dividend).
- *
Performs the float32 division operation by dividing the dividend by the divisor (i.e., dividend / divisor).
- *
Checks for division by zero and throws an {@link ArithmeticException} if the divisor is zero, as this operation is undefined.
- *
Pushes the result of the division back onto the operand stack for later instructions to use.
- *
- *
- *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
- * primarily used to handle basic float32 division tasks.
- */
- public static final int F_DIV = 54;
- /**
- * F_MOD Opcode: Represents the float32 modulus (remainder) operation in the virtual machine.
- *
This opcode is implemented by the {@link FModCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pops the top two float32 values from the operand stack (the first value popped is the divisor, and the second value popped is the dividend).
- *
Performs the modulus operation by calculating the remainder of the division of the dividend by the divisor (i.e., dividend % divisor).
- *
Checks for division by zero and throws an {@link ArithmeticException} if the divisor is zero, as this operation is undefined.
- *
Pushes the result of the modulus operation back onto the operand stack for later instructions to use.
- *
- *
- *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
- * primarily used to handle basic float32 modulus (remainder) tasks.
- */
- public static final int F_MOD = 55;
- /**
- * F_INC Opcode: Represents the float32 increment operation for a local variable in the virtual machine.
- *
This opcode is implemented by the {@link FIncCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Retrieves the index of the local variable and the increment value from the instruction parameters.
- *
Gets the current value of the local variable at the specified index from the local variable store.
- *
Increments the local variable's value by the specified increment (i.e.,
- * localVariables[index] += increment).
- *
Updates the local variable store with the new incremented value.
- *
Returns the updated program counter (PC) value, typically incremented by 1, unless control flow changes.
- *
- *
- *
This opcode is particularly useful for optimizing scenarios where a local `float32` variable, such as a counter or loop index, is frequently incremented.
- */
- public static final int F_INC = 56;
- /**
- * F_NEG Opcode: Represents the float32 negation operation in the virtual machine.
- *
This opcode is implemented by the {@link FNegCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pops the top float32 value from the operand stack.
- *
Performs the negation of the popped value (i.e., -value).
- *
Pushes the negated result back onto the operand stack for later instructions to use.
- *
- *
- *
This opcode is typically used to negate a float32 value, making it a fundamental operation for float32 arithmetic logic within the virtual machine.
- */
- public static final int F_NEG = 57;
- // endregion
- // endregion
-
- // region 2. Type Conversion Operation
- /**
- * I2L Opcode: Represents the type conversion operation from int32 to long64 in the virtual machine.
- *
This opcode is implemented by the {@link I2LCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pop the top int32 value from the operand stack.
- *
Convert the int32 value to a long64 value.
- *
Push the converted long64 value back onto the operand stack for subsequent operations.
- *
- *
- *
This opcode is commonly used to widen an int32 value to a long64 type to accommodate larger numeric ranges.
- */
- public static final int I2L = 61;
- /**
- * I2S Opcode: Represents the type conversion operation from int32 to short16 in the virtual machine.
- *
This opcode is implemented by the {@link I2SCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pop the top int32 value from the operand stack.
- *
Convert the int32 value to a short16 value (this may involve truncation).
- *
Push the converted short16 value back onto the operand stack for subsequent operations.
- *
- *
- *
This opcode is typically used to narrow an int32 value to a short16 type when a smaller data representation is needed.
- */
- public static final int I2S = 62;
- /**
- * I2B Opcode: Represents the type conversion operation from int32 to byte8 in the virtual machine.
- *
This opcode is implemented by the {@link I2BCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pop the top int32 value from the operand stack.
- *
Convert the int32 value to a byte8 value (this may involve truncation).
- *
Push the converted byte8 value back onto the operand stack for subsequent operations.
- *
- *
- *
This opcode is used to narrow an int32 value to a byte8 type, suitable when a smaller numeric type is required.
- */
- public static final int I2B = 63;
- /**
- * I2D Opcode: Represents the type conversion operation from int32 to double64 in the virtual machine.
- *
This opcode is implemented by the {@link I2DCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pop the top int32 value from the operand stack.
- *
Convert the int32 value to a double64 value.
- *
Push the converted double64 value back onto the operand stack for subsequent operations.
- *
- *
- *
This opcode is used to widen an int32 value to a double64 type, providing high-precision floating-point calculations.
- */
- public static final int I2D = 64;
- /**
- * I2F Opcode: Represents the type conversion operation from int32 to float32 in the virtual machine.
- *
This opcode is implemented by the {@link I2FCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pop the top int32 value from the operand stack.
- *
Convert the int32 value to a float32 value.
- *
Push the converted float32 value back onto the operand stack for subsequent operations.
- *
- *
- *
This opcode is used to convert an int32 value to a float32 type when floating-point arithmetic is required.
- */
- public static final int I2F = 65;
- /**
- * L2I Opcode: Represents the type conversion operation from long64 to int32 in the virtual machine.
- *
This opcode is implemented by the {@link L2ICommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pop the top long64 value from the operand stack.
- *
Convert the long64 value to an int32 value (this may involve truncation).
- *
Push the converted int32 value back onto the operand stack for subsequent operations.
- *
- *
- *
This opcode is typically used to narrow a long64 value to an int32 type for further integer operations.
- */
- public static final int L2I = 66;
- /**
- * L2D Opcode: Represents the type conversion operation from long64 to double64 in the virtual machine.
- *
This opcode is implemented by the {@link L2DCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pop the top long64 value from the operand stack.
- *
Convert the long64 value to a double64 value.
- *
Push the converted double64 value back onto the operand stack for subsequent operations.
- *
- *
- *
This opcode is used to widen a long64 value to a double64 type for high-precision floating-point computations.
- */
- public static final int L2D = 67;
-
- /**
- * L2F Opcode: Represents the type conversion operation from long64 to float32 in the virtual machine.
- *
This opcode is implemented by the {@link L2FCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pop the top long64 value from the operand stack.
- *
Convert the long64 value to a float32 value.
- *
Push the converted float32 value back onto the operand stack for subsequent operations.
- *
- *
- *
This opcode is used to convert a long64 value to a float32 type, typically for floating-point arithmetic involving long values.
- */
- public static final int L2F = 68;
-
- /**
- * F2I Opcode: Represents the type conversion operation from float32 to int32 in the virtual machine.
- *
This opcode is implemented by the {@link F2ICommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pop the top float32 value from the operand stack.
- *
Convert the float32 value to an int32 value (this may involve truncation).
- *
Push the converted int32 value back onto the operand stack for subsequent operations.
- *
- *
- *
This opcode is used to convert a float32 value to an int32 type for further integer-based operations or comparisons.
- */
- public static final int F2I = 69;
-
- /**
- * F2L Opcode: Represents the type conversion operation from float32 to long64 in the virtual machine.
- *
This opcode is implemented by the {@link F2LCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pop the top float32 value from the operand stack.
- *
Convert the float32 value to a long64 value.
- *
Push the converted long64 value back onto the operand stack for subsequent operations.
- *
- *
- *
This opcode is used to widen a float32 value to a long64 type, which is useful when operations require a larger numeric range.
- */
- public static final int F2L = 70;
-
- /**
- * F2D Opcode: Represents the type conversion operation from float32 to double64 in the virtual machine.
- *
This opcode is implemented by the {@link F2DCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pop the top float32 value from the operand stack.
- *
Convert the float32 value to a double64 value.
- *
Push the converted double64 value back onto the operand stack for subsequent operations.
- *
- *
- *
This opcode is used to promote a float32 value to a double64 type, thereby increasing precision for floating-point computations.
- */
- public static final int F2D = 71;
-
- /**
- * D2I Opcode: Represents the type conversion operation from double64 to int32 in the virtual machine.
- *
This opcode is implemented by the {@link D2ICommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pop the top double64 value from the operand stack.
- *
Convert the double64 value to an int32 value (this may involve truncation).
- *
Push the converted int32 value back onto the operand stack for subsequent operations.
- *
- *
- *
This opcode is used to narrow a double64 value to an int32 type for further integer-based processing.
- */
- public static final int D2I = 72;
-
- /**
- * D2L Opcode: Represents the type conversion operation from double64 to long64 in the virtual machine.
- *
This opcode is implemented by the {@link D2LCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pop the top double64 value from the operand stack.
- *
Convert the double64 value to a long64 value (this may involve truncation).
- *
Push the converted long64 value back onto the operand stack for subsequent operations.
- *
- *
- *
This opcode is used to narrow a double64 value to a long64 type, which can then be used for integer operations.
- */
- public static final int D2L = 73;
-
- /**
- * D2F Opcode: Represents the type conversion operation from double64 to float32 in the virtual machine.
- *
This opcode is implemented by the {@link D2FCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pop the top double64 value from the operand stack.
- *
Convert the double64 value to a float32 value.
- *
Push the converted float32 value back onto the operand stack for subsequent operations.
- *
- *
- *
This opcode is used to narrow a double64 value to a float32 type when lower precision floating-point arithmetic is acceptable.
- */
- public static final int D2F = 74;
-
- /**
- * S2I Opcode: Represents the type conversion operation from short16 to int32 in the virtual machine.
- *
This opcode is implemented by the {@link S2ICommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pop the top short16 value from the operand stack.
- *
Convert the short16 value to an int32 value.
- *
Push the converted int32 value back onto the operand stack for subsequent operations.
- *
- *
- *
This opcode is used to widen a short16 value to an int32 type, facilitating subsequent integer arithmetic or comparison operations.
- */
- public static final int S2I = 75;
-
- /**
- * B2I Opcode: Represents the type conversion operation from byte8 to int32 in the virtual machine.
- *
This opcode is implemented by the {@link B2ICommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pop the top byte8 value from the operand stack.
- *
Convert the byte8 value to an int32 value.
- *
Push the converted int32 value back onto the operand stack for subsequent operations.
- *
- *
- *
This opcode is used to widen a byte8 value to an int32 type to ensure compatibility with integer-based operations.
- */
- public static final int B2I = 76;
- // endregion
-
- // region 2. Bitwise Operations (81–90)
- // region 2.1 int32 (81-85)
- /**
- * I_AND Opcode: Represents the int32 bitwise AND operation in the virtual machine.
- *
This opcode is implemented by the {@link IAndCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pops the top two int32 values from the operand stack. These values are treated as 32-bit binary representations.
- *
Performs the int32 bitwise AND operation on the two popped operands. The operation compares corresponding bits of both operands:
- *
- *
Each bit in the result is set to 1 only if the corresponding bits in both operands are also 1.
- *
If either of the corresponding bits is 0, the resulting bit is 0.
- *
- *
- *
Pushes the result of the int32 bitwise AND operation back onto the operand stack for further processing.
- *
- *
- *
This opcode is essential for low-level bit manipulation tasks.
- */
- public static final int I_AND = 81;
- /**
- * I_OR Opcode: Represents the int32 bitwise OR operation in the virtual machine.
- *
This opcode is implemented by the {@link IOrCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pops the top two int32 values from the operand stack. These values are treated as 32-bit binary representations.
- *
Performs the int32 bitwise OR operation on the two popped operands. The operation compares corresponding bits of both operands:
- *
- *
Each bit in the result is set to 1 if at least one of the corresponding bits in either operand is 1.
- *
If both corresponding bits are 0, the resulting bit is 0.
- *
- *
- *
Pushes the result of the int32 bitwise OR operation back onto the operand stack for further processing.
- *
- *
- *
This opcode is essential for low-level bit manipulation tasks.
- */
- public static final int I_OR = 82;
-
- /**
- * I_XOR Opcode: Represents the int32 bitwise XOR operation in the virtual machine.
- *
This opcode is implemented by the {@link IXorCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pops the top two int32 values from the operand stack. These values are treated as 32-bit binary representations.
- *
Performs the int32 bitwise XOR (exclusive OR) operation on the two operands:
- *
- *
If the corresponding bits are different, the result is 1.
- *
If the corresponding bits are the same, the result is 0.
- *
- *
- *
Pushes the result of the int32 bitwise XOR operation back onto the operand stack for further processing.
- *
- *
- *
This opcode is essential for low-level bit manipulation tasks.
- */
- public static final int I_XOR = 83;
-
- // endregion
- // region 2.2 Long64 (86-90)
- /**
- * L_AND Opcode: Represents the long64 bitwise AND operation in the virtual machine.
- *
This opcode is implemented by the {@link LAndCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pops the top two long64 values from the operand stack. These values are treated as 32-bit binary representations.
- *
Performs the long64 bitwise AND operation on the two popped operands. The operation compares corresponding bits of both operands:
- *
- *
Each bit in the result is set to 1 only if the corresponding bits in both operands are also 1.
- *
If either of the corresponding bits is 0, the resulting bit is 0.
- *
- *
- *
Pushes the result of the long64 bitwise AND operation back onto the operand stack for further processing.
- *
- *
- *
This opcode is essential for low-level bit manipulation tasks.
- */
- public static final int L_AND = 86;
- /**
- * L_OR Opcode: Represents the long64 bitwise OR operation in the virtual machine.
- *
This opcode is implemented by the {@link LOrCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pops the top two long64 values from the operand stack. These values are treated as 32-bit binary representations.
- *
Performs the long64 bitwise OR operation on the two popped operands. The operation compares corresponding bits of both operands:
- *
- *
Each bit in the result is set to 1 if at least one of the corresponding bits in either operand is 1.
- *
If both corresponding bits are 0, the resulting bit is 0.
- *
- *
- *
Pushes the result of the long64 bitwise OR operation back onto the operand stack for further processing.
- *
- *
- *
This opcode is essential for low-level bit manipulation tasks.
- */
- public static final int L_OR = 87;
-
- /**
- * L_XOR Opcode: Represents the long64 bitwise XOR operation in the virtual machine.
- *
This opcode is implemented by the {@link LXorCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Pops the top two long64 values from the operand stack. These values are treated as 32-bit binary representations.
- *
Performs the long64 bitwise XOR (exclusive OR) operation on the two operands:
- *
- *
If the corresponding bits are different, the result is 1.
- *
If the corresponding bits are the same, the result is 0.
- *
- *
- *
Pushes the result of the long64 bitwise XOR operation back onto the operand stack for further processing.
- *
- *
- *
This opcode is essential for low-level bit manipulation tasks.
- */
- public static final int L_XOR = 88;
-
-
- // endregion
- // endregion
- // region 3. Control Flow Operations (91–110)
- // region 3.1 JUMP (91-91)
- /**
- * JUMP Opcode: Represents an unconditional jump to a target instruction address.
- *
This opcode is implemented by the {@link JumpCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Parses the target instruction address from the instruction parameters.
- *
Validates the target address to ensure it is a non-negative int32.
- *
If the target address is valid (greater than or equal to 0), updates the program counter (PC) to the specified target address,
- * effectively skipping all intermediate instructions.
- *
If the target address is invalid (less than 0), logs an error message and halts execution by returning an invalid value (typically -1).
- *
- *
- *
This opcode is commonly used for:
- *
- *
Control flow management in virtual machine execution.
- *
- */
- public static final int JUMP = 91;
-
- // endregion
- // region 3.2 int32 (92-97)
- /**
- * IC_E Opcode: Represents a conditional jump based on int32 equality.
- *
This opcode is implemented by the {@link ICECommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Parses the target instruction address from the instruction parameters.
- *
Pops two int32 values from the operand stack.
- *
Compares the two int32s for equality.
- *
If the int32s are equal, updates the program counter (PC) to the specified target address,
- * effectively jumping to the target instruction.
- *
If the int32s are not equal, increments the program counter to proceed with the next sequential instruction.
- *
- *
- *
This opcode is commonly used for:
- *
- *
Conditional branching in virtual machine execution based on int32 comparison.
- *
Implementing control flow structures such as if-statements and loops.
- *
- */
- public static final int IC_E = 92;
- /**
- * IC_NE Opcode: Represents a conditional jump based on int32 inequality.
- *
This opcode is implemented by the {@link ICNECommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Parses the target instruction address from the instruction parameters.
- *
Pops two int32 values from the operand stack.
- *
Compares the two int32s for inequality.
- *
If the int32s are not equal, updates the program counter (PC) to the specified target address,
- * effectively jumping to the target instruction.
- *
If the int32s are equal, increments the program counter to proceed with the next sequential instruction.
- *
- *
- *
This opcode is commonly used for:
- *
- *
Conditional branching in virtual machine execution based on int32 comparison.
- *
Implementing control flow structures such as conditional loops and if-else statements.
- *
- */
- public static final int IC_NE = 93;
- /**
- * IC_G Opcode: Represents a conditional jump based on int32 comparison (greater than).
- *
This opcode is implemented by the {@link ICGCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Parses the target instruction address from the instruction parameters.
- *
Pops two int32 values from the operand stack.
- *
Compares the first int32 with the second to determine if it is greater.
- *
If the first int32 is greater than the second, updates the program counter (PC) to the specified target address,
- * effectively jumping to the target instruction.
- *
If the first int32 is not greater than the second, increments the program counter to proceed with the next sequential instruction.
- *
- *
- *
This opcode is commonly used for:
- *
- *
Conditional branching in virtual machine execution based on int32 comparison.
- *
Implementing control flow structures such as greater-than conditions in loops and conditional statements.
- *
- */
- public static final int IC_G = 94;
- /**
- * IC_GE Opcode: Represents a conditional jump based on int32 comparison (greater than or equal to).
- *
This opcode is implemented by the {@link ICGECommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Parses the target instruction address from the instruction parameters.
- *
Pops two int32 values from the operand stack.
- *
Compares the first int32 with the second to determine if it is greater than or equal to the second int32.
- *
If the first int32 is greater than or equal to the second, updates the program counter (PC) to the specified target address,
- * effectively jumping to the target instruction.
- *
If the first int32 is less than the second, increments the program counter to proceed with the next sequential instruction.
- *
- *
- *
This opcode is commonly used for:
- *
- *
Conditional branching in virtual machine execution based on int32 comparison.
- *
Implementing control flow structures such as loops, conditional statements, and range checks.
- *
- */
- public static final int IC_GE = 95;
- /**
- * IC_L Opcode: Represents a conditional jump based on int32 comparison (less than).
- *
This opcode is implemented by the {@link ICLCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Parses the target instruction address from the instruction parameters.
- *
Pops two int32 values from the operand stack.
- *
Compares the first int32 with the second to determine if it is less than the second int32.
- *
If the first int32 is less than the second, updates the program counter (PC) to the specified target address,
- * effectively jumping to the target instruction.
- *
If the first int32 is greater than or equal to the second, increments the program counter to proceed with the next sequential instruction.
- *
- *
- *
This opcode is commonly used for:
- *
- *
Conditional branching in virtual machine execution based on int32 comparison.
- *
Implementing control flow structures such as loops, conditional statements, and range validations.
- *
- */
- public static final int IC_L = 96;
- /**
- * IC_LE Opcode: Represents a conditional jump based on int32 comparison (less than or equal).
- *
This opcode is implemented by the {@link ICLECommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Parses the target instruction address from the instruction parameters.
- *
Pops two int32 values from the operand stack.
- *
Compares the first int32 with the second to determine if it is less than or equal to the second int32.
- *
If the first int32 is less than or equal to the second, updates the program counter (PC) to the specified target address,
- * effectively jumping to the target instruction.
- *
If the first int32 is greater than the second, increments the program counter to proceed with the next sequential instruction.
- *
- *
- *
This opcode is commonly used for:
- *
- *
Conditional branching in virtual machine execution based on int32 comparison.
- *
Implementing control flow structures such as loops, conditional statements, and boundary checks.
- *
- */
- public static final int IC_LE = 97;
-
- // endregion
- // region 3.3 long64 (98-103)
- /**
- * LC_E Opcode: Represents a conditional jump based on long64 equality.
- *
This opcode is implemented by the {@link ICECommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Parses the target instruction address from the instruction parameters.
- *
Pops two long64 values from the operand stack.
- *
Compares the two long64s for equality.
- *
If the long64s are equal, updates the program counter (PC) to the specified target address,
- * effectively jumping to the target instruction.
- *
If the long64s are not equal, increments the program counter to proceed with the next sequential instruction.
- *
- *
- *
This opcode is commonly used for:
- *
- *
Conditional branching in virtual machine execution based on long64 comparison.
- *
Implementing control flow structures such as if-statements and loops.
- *
- */
- public static final int LC_E = 98;
- /**
- * LC_NE Opcode: Represents a conditional jump based on long64 inequality.
- *
This opcode is implemented by the {@link ICNECommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Parses the target instruction address from the instruction parameters.
- *
Pops two long64 values from the operand stack.
- *
Compares the two long64s for inequality.
- *
If the long64s are not equal, updates the program counter (PC) to the specified target address,
- * effectively jumping to the target instruction.
- *
If the long64s are equal, increments the program counter to proceed with the next sequential instruction.
- *
- *
- *
This opcode is commonly used for:
- *
- *
Conditional branching in virtual machine execution based on long64 comparison.
- *
Implementing control flow structures such as conditional loops and if-else statements.
- *
- */
- public static final int LC_NE = 99;
- /**
- * LC_G Opcode: Represents a conditional jump based on long64 comparison (greater than).
- *
This opcode is implemented by the {@link ICGCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Parses the target instruction address from the instruction parameters.
- *
Pops two long64 values from the operand stack.
- *
Compares the first long64 with the second to determine if it is greater.
- *
If the first long64 is greater than the second, updates the program counter (PC) to the specified target address,
- * effectively jumping to the target instruction.
- *
If the first long64 is not greater than the second, increments the program counter to proceed with the next sequential instruction.
- *
- *
- *
This opcode is commonly used for:
- *
- *
Conditional branching in virtual machine execution based on long64 comparison.
- *
Implementing control flow structures such as greater-than conditions in loops and conditional statements.
- *
- */
- public static final int LC_G = 100;
- /**
- * LC_GE Opcode: Represents a conditional jump based on long64 comparison (greater than or equal to).
- *
This opcode is implemented by the {@link ICGECommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Parses the target instruction address from the instruction parameters.
- *
Pops two long64 values from the operand stack.
- *
Compares the first long64 with the second to determine if it is greater than or equal to the second long64.
- *
If the first long64 is greater than or equal to the second, updates the program counter (PC) to the specified target address,
- * effectively jumping to the target instruction.
- *
If the first long64 is less than the second, increments the program counter to proceed with the next sequential instruction.
- *
- *
- *
This opcode is commonly used for:
- *
- *
Conditional branching in virtual machine execution based on long64 comparison.
- *
Implementing control flow structures such as loops, conditional statements, and range checks.
- *
- */
- public static final int LC_GE = 101;
- /**
- * LC_L Opcode: Represents a conditional jump based on long64 comparison (less than).
- *
This opcode is implemented by the {@link ICLCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Parses the target instruction address from the instruction parameters.
- *
Pops two long64 values from the operand stack.
- *
Compares the first long64 with the second to determine if it is less than the second long64.
- *
If the first long64 is less than the second, updates the program counter (PC) to the specified target address,
- * effectively jumping to the target instruction.
- *
If the first long64 is greater than or equal to the second, increments the program counter to proceed with the next sequential instruction.
- *
- *
- *
This opcode is commonly used for:
- *
- *
Conditional branching in virtual machine execution based on long64 comparison.
- *
Implementing control flow structures such as loops, conditional statements, and range validations.
- *
- */
- public static final int LC_L = 102;
- /**
- * LC_LE Opcode: Represents a conditional jump based on long64 comparison (less than or equal).
- *
This opcode is implemented by the {@link ICLECommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Parses the target instruction address from the instruction parameters.
- *
Pops two long64 values from the operand stack.
- *
Compares the first long64 with the second to determine if it is less than or equal to the second long64.
- *
If the first long64 is less than or equal to the second, updates the program counter (PC) to the specified target address,
- * effectively jumping to the target instruction.
- *
If the first long64 is greater than the second, increments the program counter to proceed with the next sequential instruction.
- *
- *
- *
This opcode is commonly used for:
- *
- *
Conditional branching in virtual machine execution based on long64 comparison.
- *
Implementing control flow structures such as loops, conditional statements, and boundary checks.
- *
- */
- public static final int LC_LE = 103;
-
- // endregion
- // endregion
- // region 4. Stack Operations (111–150)
- // region 4.1 PUSH (111-120)
- /**
- * I_PUSH Opcode: Represents a stack operation that pushes an int32 value onto the operand stack.
- *
This opcode is implemented by the {@link IPushCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Parses the int32 value from the instruction parameters.
- *
Pushes the parsed int32 value onto the operand stack.
- *
Increments the program counter (PC) to proceed with the next sequential instruction.
- *
- *
- *
This opcode is commonly used for:
- *
- *
Loading constant values into the operand stack for later operations.
- *
Preparing operands for arithmetic, logical, or comparison instructions.
- *
Facilitating method calls or control flow by managing stack-based data.
- *
- */
- public static final int I_PUSH = 111;
- /**
- * L_PUSH Opcode: Represents a stack operation that pushes a long64 value onto the operand stack.
- *
This opcode is implemented by the {@link LPushCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Parses the long64 value from the instruction parameters.
- *
Pushes the parsed long64 value onto the operand stack.
- *
Increments the program counter (PC) to proceed with the next sequential instruction.
- *
- *
- *
This opcode is commonly used for:
- *
- *
Loading constant values into the operand stack for later operations.
- *
Preparing operands for arithmetic, logical, or comparison instructions.
- *
Facilitating method calls or control flow by managing stack-based data.
- *
- */
- public static final int L_PUSH = 112;
/**
* S_PUSH Opcode: Represents a stack operation that pushes a short16 value onto the operand stack.
*
This opcode is implemented by the {@link SPushCommand} class, which defines its specific execution logic.
@@ -1417,15 +350,231 @@ public class VMOpCode {
*
Facilitating method calls or control flow by managing stack-based data.
*
*/
- public static final int S_PUSH = 113;
+ public static final int S_PUSH = 0x002A;
/**
- * I_PUSH Opcode: Represents a stack operation that pushes a byte8 value onto the operand stack.
- *
This opcode is implemented by the {@link BPushCommand} class, which defines its specific execution logic.
+ * S_LOAD Opcode: Represents a load operation that retrieves a short16 value from the local variable store and pushes it onto the operand stack.
+ *
This opcode is implemented by the {@link SLoadCommand} class, which defines its specific execution logic.
*
*
Execution Steps:
*
- *
Parses the byte8 value from the instruction parameters.
- *
Pushes the parsed byte8 value onto the operand stack.
+ *
Retrieves the index for the local variable from the instruction parameters.
+ *
Retrieves the corresponding value from the local variable store of the current method frame.
+ *
Pushes the retrieved value onto the operand stack for subsequent operations.
+ *
Increments the program counter (PC) to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Loading local variables onto the operand stack for further operations or computations.
+ *
Retrieving stored values that are needed for subsequent instructions, such as arithmetic or logic operations.
+ *
Preserving the necessary method-local state by pushing relevant values from the local variable store to the operand stack.
+ *
+ */
+ public static final int S_LOAD = 0x002B;
+ /**
+ * S_STORE Opcode: Represents a store operation that stores a short16 value from the operand stack into the local variable store.
+ *
This opcode is implemented by the {@link SStoreCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Retrieves the index for the local variable from the instruction parameters.
+ *
Pops a short16 value from the operand stack.
+ *
Stores the value into the local variable store at the specified index of the current method frame.
+ *
Increments the program counter (PC) to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Storing short16 values resulting from calculations or conversions.
+ *
Temporarily saving data in local variables for later instructions.
+ *
Supporting typed local variable storage for short values.
+ *
+ */
+ public static final int S_STORE = 0x002C;
+
+ public static final int S_CE = 0x002D;
+ public static final int S_CNE = 0x002E;
+ public static final int S_CG = 0x002F;
+ public static final int S_CGE = 0x0030;
+ public static final int S_CL = 0x0031;
+ public static final int S_CLE = 0x0032;
+
+ // endregion
+
+ // region Int32 (0x0040-0x005F)
+ /**
+ * I_ADD Opcode: Represents the int32 addition operation in the virtual machine.
+ *
This opcode is implemented by the {@link IAddCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top two int32 values from the operand stack (the first value popped is the second operand, and the second value popped is the first operand).
+ *
Performs the addition operation on these two int32s.
+ *
Pushes the result of the addition back onto the operand stack for later instructions to use.
+ *
+ *
+ *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
+ * primarily used to handle basic int32 addition tasks.
+ */
+ public static final int I_ADD = 0x0040;
+ /**
+ * I_SUB Opcode: Represents the int32 subtraction operation in the virtual machine.
+ *
This opcode is implemented by the {@link ISubCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top two int32 values from the operand stack (the first value popped is the subtrahend, and the second value popped is the minuend).
+ *
Performs the subtraction operation by subtracting the subtrahend from the minuend (i.e., minuend - subtrahend).
+ *
Pushes the result of the subtraction back onto the operand stack for later instructions to use.
+ *
+ *
+ *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
+ * primarily used to handle basic int32 subtraction tasks.
+ */
+ public static final int I_SUB = 0x0041;
+ /**
+ * I_MUL Opcode: Represents the int32 multiplication operation in the virtual machine.
+ *
This opcode is implemented by the {@link IMulCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top two int32 values from the operand stack (the first value popped is the second operand, and the second value popped is the first operand).
+ *
Performs the multiplication operation on these two int32s (i.e., firstOperand * secondOperand).
+ *
Pushes the result of the multiplication back onto the operand stack for later instructions to use.
+ *
+ *
+ *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
+ * primarily used to handle basic int32 multiplication tasks.
+ */
+ public static final int I_MUL = 0x0042;
+ /**
+ * I_DIV Opcode: Represents the int32 division operation in the virtual machine.
+ *
This opcode is implemented by the {@link IDivCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top two int32 values from the operand stack (the first value popped is the divisor, and the second value popped is the dividend).
+ *
Performs the division operation by dividing the dividend by the divisor (i.e., dividend / divisor).
+ *
Checks for division by zero and throws an {@link ArithmeticException} if the divisor is zero, as this operation is undefined.
+ *
Pushes the result of the division back onto the operand stack for later instructions to use.
+ *
+ *
+ *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
+ * primarily used to handle basic int32 division tasks.
+ */
+ public static final int I_DIV = 0x0043;
+ /**
+ * I_MOD Opcode: Represents the int32 modulus (remainder) operation in the virtual machine.
+ *
This opcode is implemented by the {@link IModCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top two int32 values from the operand stack (the first value popped is the divisor, and the second value popped is the dividend).
+ *
Performs the modulus operation by calculating the remainder of the division of the dividend by the divisor (i.e., dividend % divisor).
+ *
Checks for division by zero and throws an {@link ArithmeticException} if the divisor is zero, as this operation is undefined.
+ *
Pushes the result of the modulus operation back onto the operand stack for later instructions to use.
+ *
+ *
+ *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
+ * primarily used to handle basic int32 modulus (remainder) tasks.
+ */
+ public static final int I_MOD = 0x0044;
+ /**
+ * I_NEG Opcode: Represents the int32 negation operation in the virtual machine.
+ *
This opcode is implemented by the {@link INegCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top int32 value from the operand stack.
+ *
Performs the negation of the popped value (i.e., -value).
+ *
Pushes the negated result back onto the operand stack for later instructions to use.
+ *
+ *
+ *
This opcode is typically used to negate an int32 value, making it a fundamental operation for arithmetic logic within the virtual machine.
+ */
+ public static final int I_NEG = 0x0045;
+ /**
+ * I_INC Opcode: Represents the int32 increment operation for a local variable in the virtual machine.
+ *
This opcode is implemented by the {@link IIncCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Retrieves the index of the local variable and the increment value from the instruction parameters.
+ *
Gets the current value of the local variable at the specified index from the local variable store.
+ *
Increments the local variable's value by the specified increment (i.e.,
+ * localVariables[index] += increment).
+ *
Updates the local variable store with the new incremented value.
+ *
Returns the updated program counter (PC) value, typically incremented by 1, unless control flow changes.
+ *
+ *
+ *
This opcode is particularly useful for optimizing scenarios where a local variable, such as a counter or loop index, is frequently incremented.
+ */
+ public static final int I_INC = 0x0046;
+ /**
+ * I_AND Opcode: Represents the int32 bitwise AND operation in the virtual machine.
+ *
This opcode is implemented by the {@link IAndCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top two int32 values from the operand stack. These values are treated as 32-bit binary representations.
+ *
Performs the int32 bitwise AND operation on the two popped operands. The operation compares corresponding bits of both operands:
+ *
+ *
Each bit in the result is set to 1 only if the corresponding bits in both operands are also 1.
+ *
If either of the corresponding bits is 0, the resulting bit is 0.
+ *
+ *
+ *
Pushes the result of the int32 bitwise AND operation back onto the operand stack for further processing.
+ *
+ *
+ *
This opcode is essential for low-level bit manipulation tasks.
+ */
+ public static final int I_AND = 0x0047;
+ /**
+ * I_OR Opcode: Represents the int32 bitwise OR operation in the virtual machine.
+ *
This opcode is implemented by the {@link IOrCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top two int32 values from the operand stack. These values are treated as 32-bit binary representations.
+ *
Performs the int32 bitwise OR operation on the two popped operands. The operation compares corresponding bits of both operands:
+ *
+ *
Each bit in the result is set to 1 if at least one of the corresponding bits in either operand is 1.
+ *
If both corresponding bits are 0, the resulting bit is 0.
+ *
+ *
+ *
Pushes the result of the int32 bitwise OR operation back onto the operand stack for further processing.
+ *
+ *
+ *
This opcode is essential for low-level bit manipulation tasks.
+ */
+ public static final int I_OR = 0x0048;
+ /**
+ * I_XOR Opcode: Represents the int32 bitwise XOR operation in the virtual machine.
+ *
This opcode is implemented by the {@link IXorCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top two int32 values from the operand stack. These values are treated as 32-bit binary representations.
+ *
Performs the int32 bitwise XOR (exclusive OR) operation on the two operands:
+ *
+ *
If the corresponding bits are different, the result is 1.
+ *
If the corresponding bits are the same, the result is 0.
+ *
+ *
+ *
Pushes the result of the int32 bitwise XOR operation back onto the operand stack for further processing.
+ *
+ *
+ *
This opcode is essential for low-level bit manipulation tasks.
+ */
+ public static final int I_XOR = 0x0049;
+ /**
+ * I_PUSH Opcode: Represents a stack operation that pushes an int32 value onto the operand stack.
+ *
This opcode is implemented by the {@link IPushCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the int32 value from the instruction parameters.
+ *
Pushes the parsed int32 value onto the operand stack.
*
Increments the program counter (PC) to proceed with the next sequential instruction.
*
*
@@ -1436,115 +585,27 @@ public class VMOpCode {
*
Facilitating method calls or control flow by managing stack-based data.
*
*/
- public static final int B_PUSH = 114;
+ public static final int I_PUSH = 0x004A;
/**
- * I_PUSH Opcode: Represents a stack operation that pushes a double64 value onto the operand stack.
- *
This opcode is implemented by the {@link DPushCommand} class, which defines its specific execution logic.
+ * I_LOAD Opcode: Represents a load operation that retrieves an int32 value from the local variable store and pushes it onto the operand stack.
+ *
This opcode is implemented by the {@link ILoadCommand} class, which defines its specific execution logic.
*
*
Execution Steps:
*
- *
Parses the double64 value from the instruction parameters.
- *
Pushes the parsed double64 value onto the operand stack.
+ *
Retrieves the index for the local variable from the instruction parameters.
+ *
Retrieves the corresponding value from the local variable store of the current method frame.
+ *
Pushes the retrieved value onto the operand stack for subsequent operations.
*
Increments the program counter (PC) to proceed with the next sequential instruction.
*
*
*
This opcode is commonly used for:
*
- *
Loading constant values into the operand stack for later operations.
- *
Preparing operands for arithmetic, logical, or comparison instructions.
- *
Facilitating method calls or control flow by managing stack-based data.
+ *
Loading local variables onto the operand stack for further operations or computations.
+ *
Retrieving stored values that are needed for subsequent instructions, such as arithmetic or logic operations.
+ *
Preserving the necessary method-local state by pushing relevant values from the local variable store to the operand stack.
*
*/
- public static final int D_PUSH = 115;
- /**
- * F_PUSH Opcode: Represents a stack operation that pushes a float32 value onto the operand stack.
- *
This opcode is implemented by the {@link FPushCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Parses the float32 value from the instruction parameters.
- *
Pushes the parsed float32 value onto the operand stack.
- *
Increments the program counter (PC) to proceed with the next sequential instruction.
- *
- *
- *
This opcode is commonly used for:
- *
- *
Loading constant values into the operand stack for later operations.
- *
Preparing operands for arithmetic, logical, or comparison instructions.
- *
Facilitating method calls or control flow by managing stack-based data.
- *
- */
- public static final int F_PUSH = 116;
- // endregion
- // region 4.2 POP (121-125)
- /**
- * I_POP Opcode: Represents a stack operation that removes the top element from the operand stack.
- *
This opcode is implemented by the {@link PopCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Removes (pops) the top element from the operand stack.
- *
Discards the popped value, as it is not stored or used further.
- *
Increments the program counter (PC) to proceed with the next sequential instruction.
- *
- *
- *
This opcode is commonly used for:
- *
- *
Clearing temporary or unnecessary data from the operand stack.
- *
Managing stack cleanup after operations that leave excess data.
- *
Ensuring stack balance during function calls or control flow transitions.
- *
- */
- public static final int POP = 121;
- // endregion
- // region 4.3 DUP (126-130)
- /**
- * DUP Opcode: Represents a stack operation that duplicates the top element of the operand stack.
- *
This opcode is implemented by the {@link DupCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Retrieves the top element from the operand stack.
- *
Duplicates the top value and pushes it back onto the stack.
- *
Increments the program counter (PC) to proceed with the next sequential instruction.
- *
- *
- *
This opcode is commonly used for:
- *
- *
Preserving the top element of the operand stack for later use in later operations.
- *
Duplicating values that are needed multiple times in the execution flow.
- *
Managing stack balance when performing operations that require repeated access to the same data.
- *
- */
-
- public static final int DUP = 126;
- // endregion
-
- // region 4.4 SWAP (131-135)
- /**
- * SWAP Opcode: Represents a stack operation that swaps the top two values of the operand stack.
- *
This opcode is implemented by the {@link SwapCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Ensures that there are at least two elements on the operand stack.
- *
Pops the two topmost values from the stack.
- *
Pushes the two values back onto the stack in reversed order.
- *
Increments the program counter (PC) to proceed with the next sequential instruction.
- *
- *
- *
This opcode is commonly used for:
- *
- *
Reversing the order of the top two elements on the stack, which may be required in certain algorithms or operations.
- *
Handling data rearrangements that require immediate swapping of operands during execution.
- *
Ensuring proper operand placement for later instructions that depend on the order of stack elements.
- *
- */
- public static final int SWAP = 131;
- // endregion
-
- // endregion
- // region 5. Memory Operations (151–166)
+ public static final int I_LOAD = 0x004B;
/**
* I_STORE Opcode: Represents a store operation that saves an int32 value from the operand stack into the local variable store.
*
@@ -1565,127 +626,320 @@ public class VMOpCode {
*
Transferring values from the operand stack to the method-local scope.
*
*/
- public static final int I_STORE = 151;
+ public static final int I_STORE = 0x004C;
/**
- * L_STORE Opcode: Represents a store operation that stores a long64 value from the operand stack into the local variable store.
- *
This opcode is implemented by the {@link LStoreCommand} class, which defines its specific execution logic.
+ * I_CE Opcode: Represents a conditional jump based on int32 equality.
+ *
This opcode is implemented by the {@link ICECommand} class, which defines its specific execution logic.
*
*
Execution Steps:
*
- *
Retrieves the index for the local variable from the instruction parameters.
- *
Pops a long64 value from the operand stack.
- *
Stores the value into the local variable store at the specified index of the current method frame.
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two int32 values from the operand stack.
+ *
Compares the two int32s for equality.
+ *
If the int32s are equal, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the int32s are not equal, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on int32 comparison.
+ *
Implementing control flow structures such as if-statements and loops.
+ *
+ */
+ public static final int I_CE = 0x004D;
+ /**
+ * I_CNE Opcode: Represents a conditional jump based on int32 inequality.
+ *
This opcode is implemented by the {@link ICNECommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two int32 values from the operand stack.
+ *
Compares the two int32s for inequality.
+ *
If the int32s are not equal, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the int32s are equal, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on int32 comparison.
+ *
Implementing control flow structures such as conditional loops and if-else statements.
+ *
+ */
+ public static final int I_CNE = 0x004E;
+ /**
+ * I_CG Opcode: Represents a conditional jump based on int32 comparison (greater than).
+ *
This opcode is implemented by the {@link ICGCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two int32 values from the operand stack.
+ *
Compares the first int32 with the second to determine if it is greater.
+ *
If the first int32 is greater than the second, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the first int32 is not greater than the second, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on int32 comparison.
+ *
Implementing control flow structures such as greater-than conditions in loops and conditional statements.
+ *
+ */
+ public static final int I_CG = 0x004F;
+ /**
+ * I_CGE Opcode: Represents a conditional jump based on int32 comparison (greater than or equal to).
+ *
This opcode is implemented by the {@link ICGECommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two int32 values from the operand stack.
+ *
Compares the first int32 with the second to determine if it is greater than or equal to the second int32.
+ *
If the first int32 is greater than or equal to the second, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the first int32 is less than the second, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on int32 comparison.
+ *
Implementing control flow structures such as loops, conditional statements, and range checks.
+ *
+ */
+ public static final int I_CGE = 0x0050;
+ /**
+ * I_CL Opcode: Represents a conditional jump based on int32 comparison (less than).
+ *
This opcode is implemented by the {@link ICLCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two int32 values from the operand stack.
+ *
Compares the first int32 with the second to determine if it is less than the second int32.
+ *
If the first int32 is less than the second, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the first int32 is greater than or equal to the second, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on int32 comparison.
+ *
Implementing control flow structures such as loops, conditional statements, and range validations.
+ *
+ */
+ public static final int I_CL = 0x0051;
+ /**
+ * I_CLE Opcode: Represents a conditional jump based on int32 comparison (less than or equal).
+ *
This opcode is implemented by the {@link ICLECommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two int32 values from the operand stack.
+ *
Compares the first int32 with the second to determine if it is less than or equal to the second int32.
+ *
If the first int32 is less than or equal to the second, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the first int32 is greater than the second, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on int32 comparison.
+ *
Implementing control flow structures such as loops, conditional statements, and boundary checks.
+ *
+ */
+ public static final int I_CLE = 0x0052;
+ // endregion
+
+ // region Long64 (0x0060-0x007F)
+ /**
+ * L_ADD Opcode: Represents the long64 addition operation in the virtual machine.
+ *
This opcode is implemented by the {@link LAddCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top two long64 values from the operand stack (the first value popped is the second operand, and the second value popped is the first operand).
+ *
Performs the addition operation on these two long64s.
+ *
Pushes the result of the addition back onto the operand stack for later instructions to use.
+ *
+ *
+ *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
+ * primarily used to handle basic long64 addition tasks.
+ */
+ public static final int L_ADD = 0x0060;
+ /**
+ * L_SUB Opcode: Represents the long64 subtraction operation in the virtual machine.
+ *
This opcode is implemented by the {@link LSubCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top two long64 values from the operand stack (the first value popped is the subtrahend, and the second value popped is the minuend).
+ *
Performs the subtraction operation by subtracting the subtrahend from the minuend (i.e., minuend - subtrahend).
+ *
Pushes the result of the subtraction back onto the operand stack for later instructions to use.
+ *
+ *
+ *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
+ * primarily used to handle basic long64 subtraction tasks.
+ */
+ public static final int L_SUB = 0x0061;
+ /**
+ * L_MUL Opcode: Represents the long64 multiplication operation in the virtual machine.
+ *
This opcode is implemented by the {@link LMulCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top two long64 values from the operand stack (the first value popped is the second operand, and the second value popped is the first operand).
+ *
Performs the multiplication operation on these two long64s (i.e., firstOperand * secondOperand).
+ *
Pushes the result of the multiplication back onto the operand stack for later instructions to use.
+ *
+ *
+ *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
+ * primarily used to handle basic long64 multiplication tasks.
+ */
+ public static final int L_MUL = 0x0062;
+ /**
+ * L_DIV Opcode: Represents the long64 division operation in the virtual machine.
+ *
This opcode is implemented by the {@link LDivCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top two long64 values from the operand stack (the first value popped is the divisor, and the second value popped is the dividend).
+ *
Performs the division operation by dividing the dividend by the divisor (i.e., dividend / divisor).
+ *
Checks for division by zero and throws an {@link ArithmeticException} if the divisor is zero, as this operation is undefined.
+ *
Pushes the result of the division back onto the operand stack for later instructions to use.
+ *
+ *
+ *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
+ * primarily used to handle basic long64 division tasks.
+ */
+ public static final int L_DIV = 0x0063;
+ /**
+ * L_MOD Opcode: Represents the long64 modulus (remainder) operation in the virtual machine.
+ *
This opcode is implemented by the {@link LModCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top two long64 values from the operand stack (the first value popped is the divisor, and the second value popped is the dividend).
+ *
Performs the modulus operation by calculating the remainder of the division of the dividend by the divisor (i.e., dividend % divisor).
+ *
Checks for division by zero and throws an {@link ArithmeticException} if the divisor is zero, as this operation is undefined.
+ *
Pushes the result of the modulus operation back onto the operand stack for later instructions to use.
+ *
+ *
+ *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
+ * primarily used to handle basic long64 modulus (remainder) tasks.
+ */
+ public static final int L_MOD = 0x0064;
+ /**
+ * L_NEG Opcode: Represents the long64 negation operation in the virtual machine.
+ *
This opcode is implemented by the {@link LNegCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top long64 value from the operand stack.
+ *
Performs the negation of the popped value (i.e., -value).
+ *
Pushes the negated result back onto the operand stack for later instructions to use.
+ *
+ *
+ *
This opcode is typically used to negate a long64 value, making it a fundamental operation for arithmetic logic within the virtual machine.
+ */
+ public static final int L_NEG = 0x0065;
+ /**
+ * L_INC Opcode: Represents the long64 increment operation for a local variable in the virtual machine.
+ *
This opcode is implemented by the {@link LIncCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Retrieves the index of the local variable and the increment value from the instruction parameters.
+ *
Gets the current value of the local variable at the specified index from the local variable store.
+ *
Increments the local variable's value by the specified increment (i.e.,
+ * localVariables[index] += increment).
+ *
Updates the local variable store with the new incremented value.
+ *
Returns the updated program counter (PC) value, typically incremented by 1, unless control flow changes.
+ *
+ *
+ *
This opcode is particularly useful for optimizing scenarios where a local `long64` variable, such as a counter or loop index, is frequently incremented.
+ */
+ public static final int L_INC = 0x0066;
+ /**
+ * L_AND Opcode: Represents the long64 bitwise AND operation in the virtual machine.
+ *
This opcode is implemented by the {@link LAndCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top two long64 values from the operand stack. These values are treated as 64-bit binary representations.
+ *
Performs the long64 bitwise AND operation on the two popped operands. The operation compares corresponding bits of both operands:
+ *
+ *
Each bit in the result is set to 1 only if the corresponding bits in both operands are also 1.
+ *
If either of the corresponding bits is 0, the resulting bit is 0.
+ *
+ *
+ *
Pushes the result of the long64 bitwise AND operation back onto the operand stack for further processing.
+ *
+ *
+ *
This opcode is essential for low-level bit manipulation tasks.
+ */
+ public static final int L_AND = 0x0067;
+ /**
+ * L_OR Opcode: Represents the long64 bitwise OR operation in the virtual machine.
+ *
This opcode is implemented by the {@link LOrCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top two long64 values from the operand stack. These values are treated as 64-bit binary representations.
+ *
Performs the long64 bitwise OR operation on the two popped operands. The operation compares corresponding bits of both operands:
+ *
+ *
Each bit in the result is set to 1 if at least one of the corresponding bits in either operand is 1.
+ *
If both corresponding bits are 0, the resulting bit is 0.
+ *
+ *
+ *
Pushes the result of the long64 bitwise OR operation back onto the operand stack for further processing.
+ *
+ *
+ *
This opcode is essential for low-level bit manipulation tasks.
+ */
+ public static final int L_OR = 0x0068;
+ /**
+ * L_XOR Opcode: Represents the long64 bitwise XOR operation in the virtual machine.
+ *
This opcode is implemented by the {@link LXorCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top two long64 values from the operand stack. These values are treated as 64-bit binary representations.
+ *
Performs the long64 bitwise XOR (exclusive OR) operation on the two operands:
+ *
+ *
If the corresponding bits are different, the result is 1.
+ *
If the corresponding bits are the same, the result is 0.
+ *
+ *
+ *
Pushes the result of the long64 bitwise XOR operation back onto the operand stack for further processing.
+ *
+ *
+ *
This opcode is essential for low-level bit manipulation tasks.
+ */
+ public static final int L_XOR = 0x0069;
+ /**
+ * L_PUSH Opcode: Represents a stack operation that pushes a long64 value onto the operand stack.
+ *
This opcode is implemented by the {@link LPushCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the long64 value from the instruction parameters.
+ *
Pushes the parsed long64 value onto the operand stack.
*
Increments the program counter (PC) to proceed with the next sequential instruction.
*
*
*
This opcode is commonly used for:
*
- *
Storing computed long64 values into local variables for reuse.
- *
Preserving long-type data across multiple instructions or calls.
- *
Moving data from the operand stack to a persistent method-local context.
+ *
Loading constant values into the operand stack for later operations.
+ *
Preparing operands for arithmetic, logical, or comparison instructions.
+ *
Facilitating method calls or control flow by managing stack-based data.
*
*/
- public static final int L_STORE = 152;
- /**
- * S_STORE Opcode: Represents a store operation that stores a short16 value from the operand stack into the local variable store.
- *
This opcode is implemented by the {@link SStoreCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Retrieves the index for the local variable from the instruction parameters.
- *
Pops a short16 value from the operand stack.
- *
Stores the value into the local variable store at the specified index of the current method frame.
- *
Increments the program counter (PC) to proceed with the next sequential instruction.
- *
- *
- *
This opcode is commonly used for:
- *
- *
Storing short16 values resulting from calculations or conversions.
- *
Temporarily saving data in local variables for later instructions.
- *
Supporting typed local variable storage for short values.
- *
- */
- public static final int S_STORE = 153;
- /**
- * B_STORE Opcode: Represents a store operation that stores a byte8 value from the operand stack into the local variable store.
- *
This opcode is implemented by the {@link BStoreCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Retrieves the index for the local variable from the instruction parameters.
- *
Pops a byte8 value from the operand stack.
- *
Stores the value into the local variable store at the specified index of the current method frame.
- *
Increments the program counter (PC) to proceed with the next sequential instruction.
- *
- *
- *
This opcode is commonly used for:
- *
- *
Saving byte8 results or constants into method-local variables.
- *
Enabling byte-level operations and temporary storage.
- *
Transferring values from the stack to local scope in compact form.
- *
- */
- public static final int B_STORE = 154;
- /**
- * D_STORE Opcode: Represents a store operation that stores a double64 value from the operand stack into the local variable store.
- *
This opcode is implemented by the {@link DStoreCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Retrieves the index for the local variable from the instruction parameters.
- *
Pops a double64 value from the operand stack.
- *
Stores the value into the local variable store at the specified index of the current method frame.
- *
Increments the program counter (PC) to proceed with the next sequential instruction.
- *
- *
- *
This opcode is commonly used for:
- *
- *
Saving double64-precision results after arithmetic or conversion operations.
- *
Ensuring floating-point values persist in method-local storage.
- *
Managing precision-critical calculations across instruction sequences.
- *
- */
- public static final int D_STORE = 155;
- /**
- * F_STORE Opcode: Represents a store operation that stores a float32 value from the operand stack into the local variable store.
- *
This opcode is implemented by the {@link FStoreCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Retrieves the index for the local variable from the instruction parameters.
- *
Pops a float32 value from the operand stack.
- *
Stores the value into the local variable store at the specified index of the current method frame.
- *
Increments the program counter (PC) to proceed with the next sequential instruction.
- *
- *
- *
This opcode is commonly used for:
- *
- *
Saving float32 results into method-local variables.
- *
Supporting floating-point local variable operations.
- *
Preserving floating-point values between instructions or calls.
- *
- */
- public static final int F_STORE = 156;
- /**
- * I_LOAD Opcode: Represents a load operation that retrieves an int32 value from the local variable store and pushes it onto the operand stack.
- *
This opcode is implemented by the {@link ILoadCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Retrieves the index for the local variable from the instruction parameters.
- *
Retrieves the corresponding value from the local variable store of the current method frame.
- *
Pushes the retrieved value onto the operand stack for subsequent operations.
- *
Increments the program counter (PC) to proceed with the next sequential instruction.
- *
- *
- *
This opcode is commonly used for:
- *
- *
Loading local variables onto the operand stack for further operations or computations.
- *
Retrieving stored values that are needed for subsequent instructions, such as arithmetic or logic operations.
- *
Preserving the necessary method-local state by pushing relevant values from the local variable store to the operand stack.
- *
- */
- public static final int I_LOAD = 161;
+ public static final int L_PUSH = 0x006A;
/**
* L_LOAD Opcode: Represents a load operation that retrieves a long64 value from the local variable store and pushes it onto the operand stack.
*
This opcode is implemented by the {@link LLoadCommand} class, which defines its specific execution logic.
@@ -1705,67 +959,283 @@ public class VMOpCode {
*
Preserving the necessary method-local state by pushing relevant values from the local variable store to the operand stack.
*
*/
- public static final int L_LOAD = 162;
+ public static final int L_LOAD = 0x006B;
/**
- * S_LOAD Opcode: Represents a load operation that retrieves a short16 value from the local variable store and pushes it onto the operand stack.
- *
This opcode is implemented by the {@link SLoadCommand} class, which defines its specific execution logic.
+ * L_STORE Opcode: Represents a store operation that stores a long64 value from the operand stack into the local variable store.
+ *
This opcode is implemented by the {@link LStoreCommand} class, which defines its specific execution logic.
*
*
Execution Steps:
*
*
Retrieves the index for the local variable from the instruction parameters.
- *
Retrieves the corresponding value from the local variable store of the current method frame.
- *
Pushes the retrieved value onto the operand stack for subsequent operations.
+ *
Pops a long64 value from the operand stack.
+ *
Stores the value into the local variable store at the specified index of the current method frame.
*
Increments the program counter (PC) to proceed with the next sequential instruction.
*
*
*
This opcode is commonly used for:
*
- *
Loading local variables onto the operand stack for further operations or computations.
- *
Retrieving stored values that are needed for subsequent instructions, such as arithmetic or logic operations.
- *
Preserving the necessary method-local state by pushing relevant values from the local variable store to the operand stack.
+ *
Storing computed long64 values into local variables for reuse.
+ *
Preserving long-type data across multiple instructions or calls.
+ *
Moving data from the operand stack to a persistent method-local context.
*
*/
- public static final int S_LOAD = 163;
+ public static final int L_STORE = 0x006C;
/**
- * B_LOAD Opcode: Represents a load operation that retrieves a byte8 value from the local variable store and pushes it onto the operand stack.
- *
This opcode is implemented by the {@link BLoadCommand} class, which defines its specific execution logic.
+ * L_CE Opcode: Represents a conditional jump based on long64 equality.
+ *
This opcode is implemented by the {@link LCECommand} class, which defines its specific execution logic.
*
*
Execution Steps:
*
- *
Retrieves the index for the local variable from the instruction parameters.
- *
Retrieves the corresponding value from the local variable store of the current method frame.
- *
Pushes the retrieved value onto the operand stack for subsequent operations.
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two long64 values from the operand stack.
+ *
Compares the two long64s for equality.
+ *
If the long64s are equal, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the long64s are not equal, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on long64 comparison.
+ *
Implementing control flow structures such as if-statements and loops.
+ *
+ */
+ public static final int L_CE = 0x006D;
+ /**
+ * L_CNE Opcode: Represents a conditional jump based on long64 inequality.
+ *
This opcode is implemented by the {@link LCNECommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two long64 values from the operand stack.
+ *
Compares the two long64s for inequality.
+ *
If the long64s are not equal, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the long64s are equal, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on long64 comparison.
+ *
Implementing control flow structures such as conditional loops and if-else statements.
+ *
+ */
+ public static final int L_CNE = 0x006E;
+ /**
+ * L_CG Opcode: Represents a conditional jump based on long64 comparison (greater than).
+ *
This opcode is implemented by the {@link LCGCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two long64 values from the operand stack.
+ *
Compares the first long64 with the second to determine if it is greater.
+ *
If the first long64 is greater than the second, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the first long64 is not greater than the second, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on long64 comparison.
+ *
Implementing control flow structures such as greater-than conditions in loops and conditional statements.
+ *
+ */
+ public static final int L_CG = 0x006F;
+ /**
+ * L_CGE Opcode: Represents a conditional jump based on long64 comparison (greater than or equal to).
+ *
This opcode is implemented by the {@link LCGECommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two long64 values from the operand stack.
+ *
Compares the first long64 with the second to determine if it is greater than or equal to the second long64.
+ *
If the first long64 is greater than or equal to the second, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the first long64 is less than the second, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on long64 comparison.
+ *
Implementing control flow structures such as loops, conditional statements, and range checks.
+ *
+ */
+ public static final int L_CGE = 0x0070;
+ /**
+ * L_CL Opcode: Represents a conditional jump based on long64 comparison (less than).
+ *
This opcode is implemented by the {@link LCLCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two long64 values from the operand stack.
+ *
Compares the first long64 with the second to determine if it is less than the second long64.
+ *
If the first long64 is less than the second, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the first long64 is greater than or equal to the second, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on long64 comparison.
+ *
Implementing control flow structures such as loops, conditional statements, and range validations.
+ *
+ */
+ public static final int L_CL = 0x0071;
+ /**
+ * L_CLE Opcode: Represents a conditional jump based on long64 comparison (less than or equal).
+ *
This opcode is implemented by the {@link LCLECommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two long64 values from the operand stack.
+ *
Compares the first long64 with the second to determine if it is less than or equal to the second long64.
+ *
If the first long64 is less than or equal to the second, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the first long64 is greater than the second, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on long64 comparison.
+ *
Implementing control flow structures such as loops, conditional statements, and boundary checks.
+ *
+ */
+ public static final int L_CLE = 0x0072;
+ // endregion
+
+ // region Float32 (0x0080-0x009F)
+ /**
+ * F_ADD Opcode: Represents the float32 addition operation in the virtual machine.
+ *
This opcode is implemented by the {@link FAddCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top two float32 values from the operand stack (the first value popped is the second operand, and the second value popped is the first operand).
+ *
Performs the float32 addition operation on these two operands.
+ *
Pushes the result of the addition back onto the operand stack for later instructions to use.
+ *
+ *
+ *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
+ * primarily used to handle basic float32 addition tasks.
+ */
+ public static final int F_ADD = 0x0080;
+ /**
+ * F_SUB Opcode: Represents the float32 subtraction operation in the virtual machine.
+ *
This opcode is implemented by the {@link FSubCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top two float32 values from the operand stack (the first value popped is the subtrahend, and the second value popped is the minuend).
+ *
Performs the float32 subtraction operation by subtracting the subtrahend from the minuend (i.e., minuend - subtrahend).
+ *
Pushes the result of the subtraction back onto the operand stack for later instructions to use.
+ *
+ *
+ *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
+ * primarily used to handle basic float32 subtraction tasks.
+ */
+ public static final int F_SUB = 0x0081;
+ /**
+ * F_MUL Opcode: Represents the float32 multiplication operation in the virtual machine.
+ *
This opcode is implemented by the {@link FMulCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top two float32 values from the operand stack (the first value popped is the second operand, and the second value popped is the first operand).
+ *
Performs the float32 multiplication operation on these two operands (i.e., firstOperand * secondOperand).
+ *
Pushes the result of the multiplication back onto the operand stack for later instructions to use.
+ *
+ *
+ *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
+ * primarily used to handle basic float32 multiplication tasks.
+ */
+ public static final int F_MUL = 0x0082;
+ /**
+ * F_DIV Opcode: Represents the float32 division operation in the virtual machine.
+ *
This opcode is implemented by the {@link FDivCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top two float32 values from the operand stack (the first value popped is the divisor, and the second value popped is the dividend).
+ *
Performs the float32 division operation by dividing the dividend by the divisor (i.e., dividend / divisor).
+ *
Checks for division by zero and throws an {@link ArithmeticException} if the divisor is zero, as this operation is undefined.
+ *
Pushes the result of the division back onto the operand stack for later instructions to use.
+ *
+ *
+ *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
+ * primarily used to handle basic float32 division tasks.
+ */
+ public static final int F_DIV = 0x0083;
+ /**
+ * F_MOD Opcode: Represents the float32 modulus (remainder) operation in the virtual machine.
+ *
This opcode is implemented by the {@link FModCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top two float32 values from the operand stack (the first value popped is the divisor, and the second value popped is the dividend).
+ *
Performs the modulus operation by calculating the remainder of the division of the dividend by the divisor (i.e., dividend % divisor).
+ *
Checks for division by zero and throws an {@link ArithmeticException} if the divisor is zero, as this operation is undefined.
+ *
Pushes the result of the modulus operation back onto the operand stack for later instructions to use.
+ *
+ *
+ *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
+ * primarily used to handle basic float32 modulus (remainder) tasks.
+ */
+ public static final int F_MOD = 0x0084;
+ /**
+ * F_NEG Opcode: Represents the float32 negation operation in the virtual machine.
+ *
This opcode is implemented by the {@link FNegCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top float32 value from the operand stack.
+ *
Performs the negation of the popped value (i.e., -value).
+ *
Pushes the negated result back onto the operand stack for later instructions to use.
+ *
+ *
+ *
This opcode is typically used to negate a float32 value, making it a fundamental operation for float32 arithmetic logic within the virtual machine.
+ */
+ public static final int F_NEG = 0x0085;
+ /**
+ * F_INC Opcode: Represents the float32 increment operation for a local variable in the virtual machine.
+ *
This opcode is implemented by the {@link FIncCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Retrieves the index of the local variable and the increment value from the instruction parameters.
+ *
Gets the current value of the local variable at the specified index from the local variable store.
+ *
Increments the local variable's value by the specified increment (i.e.,
+ * localVariables[index] += increment).
+ *
Updates the local variable store with the new incremented value.
+ *
Returns the updated program counter (PC) value, typically incremented by 1, unless control flow changes.
+ *
+ *
+ *
This opcode is particularly useful for optimizing scenarios where a local `float32` variable, such as a counter or loop index, is frequently incremented.
+ */
+ public static final int F_INC = 0x0086;
+ /**
+ * F_PUSH Opcode: Represents a stack operation that pushes a float32 value onto the operand stack.
+ *
This opcode is implemented by the {@link FPushCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the float32 value from the instruction parameters.
+ *
Pushes the parsed float32 value onto the operand stack.
*
Increments the program counter (PC) to proceed with the next sequential instruction.
*
*
*
This opcode is commonly used for:
*
- *
Loading local variables onto the operand stack for further operations or computations.
- *
Retrieving stored values that are needed for subsequent instructions, such as arithmetic or logic operations.
- *
Preserving the necessary method-local state by pushing relevant values from the local variable store to the operand stack.
+ *
Loading constant values into the operand stack for later operations.
+ *
Preparing operands for arithmetic, logical, or comparison instructions.
+ *
Facilitating method calls or control flow by managing stack-based data.
*
*/
- public static final int B_LOAD = 164;
- /**
- * D_LOAD Opcode: Represents a load operation that retrieves a double64 value from the local variable store and pushes it onto the operand stack.
- *
This opcode is implemented by the {@link DLoadCommand} class, which defines its specific execution logic.
- *
- *
Execution Steps:
- *
- *
Retrieves the index for the local variable from the instruction parameters.
- *
Retrieves the corresponding value from the local variable store of the current method frame.
- *
Pushes the retrieved value onto the operand stack for subsequent operations.
- *
Increments the program counter (PC) to proceed with the next sequential instruction.
- *
- *
- *
This opcode is commonly used for:
- *
- *
Loading local variables onto the operand stack for further operations or computations.
- *
Retrieving stored values that are needed for subsequent instructions, such as arithmetic or logic operations.
- *
Preserving the necessary method-local state by pushing relevant values from the local variable store to the operand stack.
- *
- */
- public static final int D_LOAD = 165;
+ public static final int F_PUSH = 0x0087;
/**
* F_LOAD Opcode: Represents a load operation that retrieves a float32 value from the local variable store and pushes it onto the operand stack.
*
This opcode is implemented by the {@link FLoadCommand} class, which defines its specific execution logic.
@@ -1785,30 +1255,523 @@ public class VMOpCode {
*
Preserving the necessary method-local state by pushing relevant values from the local variable store to the operand stack.
*
*/
- public static final int F_LOAD = 166;
-
+ public static final int F_LOAD = 0x0088;
/**
- * MOV Opcode: Represents a move operation that transfers a value from one local variable to another within the local variable store.
- *
This opcode is implemented by the {@link MovCommand} class, which defines its specific execution logic.
+ * F_STORE Opcode: Represents a store operation that stores a float32 value from the operand stack into the local variable store.
+ *
This opcode is implemented by the {@link FStoreCommand} class, which defines its specific execution logic.
*
*
Execution Steps:
*
- *
Parses the source and destination indices from the instruction parameters.
- *
Retrieves the value from the local variable store at the source index.
- *
Stores the retrieved value into the destination index of the local variable store.
+ *
Retrieves the index for the local variable from the instruction parameters.
+ *
Pops a float32 value from the operand stack.
+ *
Stores the value into the local variable store at the specified index of the current method frame.
*
Increments the program counter (PC) to proceed with the next sequential instruction.
*
*
*
This opcode is commonly used for:
*
- *
Transferring values between local variables within a method frame.
- *
Preserving computed results by moving them to designated local variable slots.
- *
Facilitating intermediate storage of values needed for later computations.
+ *
Saving float32 results into method-local variables.
+ *
Supporting floating-point local variable operations.
+ *
Preserving floating-point values between instructions or calls.
*
*/
- public static final int MOV = 171;
+ public static final int F_STORE = 0x0089;
+
+ public static final int F_CE = 0x008A;
+ public static final int F_CNE = 0x008B;
+ public static final int F_CG = 0x008C;
+ public static final int F_CGE = 0x008D;
+ public static final int F_CL = 0x008E;
+ public static final int F_CLE = 0x008F;
+
// endregion
- // region 6. Function Call
+
+ // region Double64 (0x00A0-0x00BF)
+ /**
+ * D_ADD Opcode: Represents the double64 precision floating-point addition operation in the virtual machine.
+ *
This opcode is implemented by the {@link DAddCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top two double64 values from the operand stack (the first value popped is the second operand, and the second value popped is the first operand).
+ *
Performs the double64 precision floating-point addition operation on these two operands.
+ *
Pushes the result of the addition back onto the operand stack for later instructions to use.
+ *
+ *
+ *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
+ * primarily used to handle basic double64 precision floating-point addition tasks.
+ */
+ public static final int D_ADD = 0x00A0;
+ /**
+ * D_SUB Opcode: Represents the double64 precision floating-point subtraction operation in the virtual machine.
+ *
This opcode is implemented by the {@link DSubCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top two double64 values from the operand stack (the first value popped is the subtrahend, and the second value popped is the minuend).
+ *
Performs the double64 precision floating-point subtraction operation by subtracting the subtrahend from the minuend (i.e., minuend - subtrahend).
+ *
Pushes the result of the subtraction back onto the operand stack for later instructions to use.
+ *
+ *
+ *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
+ * primarily used to handle basic double64 precision floating-point subtraction tasks.
+ */
+ public static final int D_SUB = 0x00A1;
+ /**
+ * D_MUL Opcode: Represents the double64 precision floating-point multiplication operation in the virtual machine.
+ *
This opcode is implemented by the {@link DMulCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top two double64 values from the operand stack (the first value popped is the second operand, and the second value popped is the first operand).
+ *
Performs the double64 precision floating-point multiplication operation on these two operands (i.e., firstOperand * secondOperand).
+ *
Pushes the result of the multiplication back onto the operand stack for later instructions to use.
+ *
+ *
+ *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
+ * primarily used to handle basic double64 precision floating-point multiplication tasks.
+ */
+ public static final int D_MUL = 0x00A2;
+ /**
+ * D_DIV Opcode: Represents the double64 precision floating-point division operation in the virtual machine.
+ *
This opcode is implemented by the {@link DDivCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top two double64 values from the operand stack (the first value popped is the divisor, and the second value popped is the dividend).
+ *
Performs the double64 precision floating-point division operation by dividing the dividend by the divisor (i.e., dividend / divisor).
+ *
Checks for division by zero and throws an {@link ArithmeticException} if the divisor is zero, as this operation is undefined.
+ *
Pushes the result of the division back onto the operand stack for later instructions to use.
+ *
+ *
+ *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
+ * primarily used to handle basic double64 precision floating-point division tasks.
+ */
+ public static final int D_DIV = 0x00A3;
+ /**
+ * D_MOD Opcode: Represents the double64 precision floating-point modulus (remainder) operation in the virtual machine.
+ *
This opcode is implemented by the {@link DModCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top two double64 values from the operand stack (the first value popped is the divisor, and the second value popped is the dividend).
+ *
Performs the modulus operation by calculating the remainder of the division of the dividend by the divisor (i.e., dividend % divisor).
+ *
Checks for division by zero and throws an {@link ArithmeticException} if the divisor is zero, as this operation is undefined.
+ *
Pushes the result of the modulus operation back onto the operand stack for later instructions to use.
+ *
+ *
+ *
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
+ * primarily used to handle basic double64 precision floating-point modulus (remainder) tasks.
+ */
+ public static final int D_MOD = 0x00A4;
+ /**
+ * D_NEG Opcode: Represents the double64 precision floating-point negation operation in the virtual machine.
+ *
This opcode is implemented by the {@link DNegCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top double64 value from the operand stack.
+ *
Performs the negation of the popped value (i.e., -value).
+ *
Pushes the negated result back onto the operand stack for later instructions to use.
+ *
+ *
+ *
This opcode is typically used to negate a double64 precision floating-point value, making it a fundamental operation for double64 precision arithmetic logic within the virtual machine.
+ */
+ public static final int D_NEG = 0x00A5;
+ /**
+ * D_INC Opcode: Represents the double64 increment operation for a local variable in the virtual machine.
+ *
This opcode is implemented by the {@link DIncCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Retrieves the index of the local variable and the increment value from the instruction parameters.
+ *
Gets the current value of the local variable at the specified index from the local variable store.
+ *
Increments the local variable's value by the specified increment (i.e.,
+ * localVariables[index] += increment).
+ *
Updates the local variable store with the new incremented value.
+ *
Returns the updated program counter (PC) value, typically incremented by 1, unless control flow changes.
+ *
+ *
+ *
This opcode is particularly useful for optimizing scenarios where a local `double64` variable, such as a counter or loop index, is frequently incremented.
+ */
+ public static final int D_INC = 0x00A6;
+ /**
+ * D_PUSH Opcode: Represents a stack operation that pushes a double64 value onto the operand stack.
+ *
This opcode is implemented by the {@link DPushCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the double64 value from the instruction parameters.
+ *
Pushes the parsed double64 value onto the operand stack.
+ *
Increments the program counter (PC) to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Loading constant values into the operand stack for later operations.
+ *
Preparing operands for arithmetic, logical, or comparison instructions.
+ *
Facilitating method calls or control flow by managing stack-based data.
+ *
+ */
+ public static final int D_PUSH = 0x00A7;
+ /**
+ * D_LOAD Opcode: Represents a load operation that retrieves a double64 value from the local variable store and pushes it onto the operand stack.
+ *
This opcode is implemented by the {@link DLoadCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Retrieves the index for the local variable from the instruction parameters.
+ *
Retrieves the corresponding value from the local variable store of the current method frame.
+ *
Pushes the retrieved value onto the operand stack for subsequent operations.
+ *
Increments the program counter (PC) to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Loading local variables onto the operand stack for further operations or computations.
+ *
Retrieving stored values that are needed for subsequent instructions, such as arithmetic or logic operations.
+ *
Preserving the necessary method-local state by pushing relevant values from the local variable store to the operand stack.
+ *
+ */
+ public static final int D_LOAD = 0x00A8;
+ /**
+ * D_STORE Opcode: Represents a store operation that stores a double64 value from the operand stack into the local variable store.
+ *
This opcode is implemented by the {@link DStoreCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Retrieves the index for the local variable from the instruction parameters.
+ *
Pops a double64 value from the operand stack.
+ *
Stores the value into the local variable store at the specified index of the current method frame.
+ *
Increments the program counter (PC) to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Saving double64-precision results after arithmetic or conversion operations.
+ *
Ensuring floating-point values persist in method-local storage.
+ *
Managing precision-critical calculations across instruction sequences.
+ *
+ */
+ public static final int D_STORE = 0x00A9;
+
+ public static final int D_CE = 0x00AA;
+ public static final int D_CNE = 0x00AB;
+ public static final int D_CG = 0x00AC;
+ public static final int D_CGE = 0x00AD;
+ public static final int D_CL = 0x00AE;
+ public static final int D_CLE = 0x00AF;
+
+ // endregion
+
+ // region Type Conversion (0x00C0-0x00DF)
+ /**
+ * I2L Opcode: Represents the type conversion operation from int32 to long64 in the virtual machine.
+ *
This opcode is implemented by the {@link I2LCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pop the top int32 value from the operand stack.
+ *
Convert the int32 value to a long64 value.
+ *
Push the converted long64 value back onto the operand stack for subsequent operations.
+ *
+ *
+ *
This opcode is commonly used to widen an int32 value to a long64 type to accommodate larger numeric ranges.
+ */
+ public static final int I2L = 0x00C0;
+ /**
+ * I2S Opcode: Represents the type conversion operation from int32 to short16 in the virtual machine.
+ *
This opcode is implemented by the {@link I2SCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pop the top int32 value from the operand stack.
+ *
Convert the int32 value to a short16 value (this may involve truncation).
+ *
Push the converted short16 value back onto the operand stack for subsequent operations.
+ *
+ *
+ *
This opcode is typically used to narrow an int32 value to a short16 type when a smaller data representation is needed.
+ */
+ public static final int I2S = 0x00C1;
+ /**
+ * I2B Opcode: Represents the type conversion operation from int32 to byte8 in the virtual machine.
+ *
This opcode is implemented by the {@link I2BCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pop the top int32 value from the operand stack.
+ *
Convert the int32 value to a byte8 value (this may involve truncation).
+ *
Push the converted byte8 value back onto the operand stack for subsequent operations.
+ *
+ *
+ *
This opcode is used to narrow an int32 value to a byte8 type, suitable when a smaller numeric type is required.
+ */
+ public static final int I2B = 0x00C2;
+ /**
+ * I2D Opcode: Represents the type conversion operation from int32 to double64 in the virtual machine.
+ *
This opcode is implemented by the {@link I2DCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pop the top int32 value from the operand stack.
+ *
Convert the int32 value to a double64 value.
+ *
Push the converted double64 value back onto the operand stack for subsequent operations.
+ *
+ *
+ *
This opcode is used to widen an int32 value to a double64 type, providing high-precision floating-point calculations.
+ */
+ public static final int I2D = 0x00C3;
+ /**
+ * I2F Opcode: Represents the type conversion operation from int32 to float32 in the virtual machine.
+ *
This opcode is implemented by the {@link I2FCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pop the top int32 value from the operand stack.
+ *
Convert the int32 value to a float32 value.
+ *
Push the converted float32 value back onto the operand stack for subsequent operations.
+ *
+ *
+ *
This opcode is used to convert an int32 value to a float32 type when floating-point arithmetic is required.
+ */
+ public static final int I2F = 0x00C4;
+ /**
+ * L2I Opcode: Represents the type conversion operation from long64 to int32 in the virtual machine.
+ *
This opcode is implemented by the {@link L2ICommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pop the top long64 value from the operand stack.
+ *
Convert the long64 value to an int32 value (this may involve truncation).
+ *
Push the converted int32 value back onto the operand stack for subsequent operations.
+ *
+ *
+ *
This opcode is typically used to narrow a long64 value to an int32 type for further integer operations.
+ */
+ public static final int L2I = 0x00C5;
+ /**
+ * L2D Opcode: Represents the type conversion operation from long64 to double64 in the virtual machine.
+ *
This opcode is implemented by the {@link L2DCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pop the top long64 value from the operand stack.
+ *
Convert the long64 value to a double64 value.
+ *
Push the converted double64 value back onto the operand stack for subsequent operations.
+ *
+ *
+ *
This opcode is used to widen a long64 value to a double64 type for high-precision floating-point computations.
+ */
+ public static final int L2D = 0x00C6;
+ /**
+ * L2F Opcode: Represents the type conversion operation from long64 to float32 in the virtual machine.
+ *
This opcode is implemented by the {@link L2FCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pop the top long64 value from the operand stack.
+ *
Convert the long64 value to a float32 value.
+ *
Push the converted float32 value back onto the operand stack for subsequent operations.
+ *
+ *
+ *
This opcode is used to convert a long64 value to a float32 type, typically for floating-point arithmetic involving long values.
+ */
+ public static final int L2F = 0x00C7;
+ /**
+ * F2I Opcode: Represents the type conversion operation from float32 to int32 in the virtual machine.
+ *
This opcode is implemented by the {@link F2ICommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pop the top float32 value from the operand stack.
+ *
Convert the float32 value to an int32 value (this may involve truncation).
+ *
Push the converted int32 value back onto the operand stack for subsequent operations.
+ *
+ *
+ *
This opcode is used to convert a float32 value to an int32 type for further integer-based operations or comparisons.
+ */
+ public static final int F2I = 0x00C8;
+ /**
+ * F2L Opcode: Represents the type conversion operation from float32 to long64 in the virtual machine.
+ *
This opcode is implemented by the {@link F2LCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pop the top float32 value from the operand stack.
+ *
Convert the float32 value to a long64 value.
+ *
Push the converted long64 value back onto the operand stack for subsequent operations.
+ *
+ *
+ *
This opcode is used to widen a float32 value to a long64 type, which is useful when operations require a larger numeric range.
+ */
+ public static final int F2L = 0x00C9;
+ /**
+ * F2D Opcode: Represents the type conversion operation from float32 to double64 in the virtual machine.
+ *
This opcode is implemented by the {@link F2DCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pop the top float32 value from the operand stack.
+ *
Convert the float32 value to a double64 value.
+ *
Push the converted double64 value back onto the operand stack for subsequent operations.
+ *
+ *
+ *
This opcode is used to promote a float32 value to a double64 type, thereby increasing precision for floating-point computations.
+ */
+ public static final int F2D = 0x00CA;
+ /**
+ * D2I Opcode: Represents the type conversion operation from double64 to int32 in the virtual machine.
+ *
This opcode is implemented by the {@link D2ICommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pop the top double64 value from the operand stack.
+ *
Convert the double64 value to an int32 value (this may involve truncation).
+ *
Push the converted int32 value back onto the operand stack for subsequent operations.
+ *
+ *
+ *
This opcode is used to narrow a double64 value to an int32 type for further integer-based processing.
+ */
+ public static final int D2I = 0x00CB;
+ /**
+ * D2L Opcode: Represents the type conversion operation from double64 to long64 in the virtual machine.
+ *
This opcode is implemented by the {@link D2LCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pop the top double64 value from the operand stack.
+ *
Convert the double64 value to a long64 value (this may involve truncation).
+ *
Push the converted long64 value back onto the operand stack for subsequent operations.
+ *
+ *
+ *
This opcode is used to narrow a double64 value to a long64 type, which can then be used for integer operations.
+ */
+ public static final int D2L = 0x00CC;
+ /**
+ * D2F Opcode: Represents the type conversion operation from double64 to float32 in the virtual machine.
+ *
This opcode is implemented by the {@link D2FCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pop the top double64 value from the operand stack.
+ *
Convert the double64 value to a float32 value.
+ *
Push the converted float32 value back onto the operand stack for subsequent operations.
+ *
+ *
+ *
This opcode is used to narrow a double64 value to a float32 type when lower precision floating-point arithmetic is acceptable.
+ */
+ public static final int D2F = 0x00CD;
+ /**
+ * S2I Opcode: Represents the type conversion operation from short16 to int32 in the virtual machine.
+ *
This opcode is implemented by the {@link S2ICommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pop the top short16 value from the operand stack.
+ *
Convert the short16 value to an int32 value.
+ *
Push the converted int32 value back onto the operand stack for subsequent operations.
+ *
+ *
+ *
This opcode is used to widen a short16 value to an int32 type, facilitating subsequent integer arithmetic or comparison operations.
+ */
+ public static final int S2I = 0x00CE;
+ /**
+ * B2I Opcode: Represents the type conversion operation from byte8 to int32 in the virtual machine.
+ *
This opcode is implemented by the {@link B2ICommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pop the top byte8 value from the operand stack.
+ *
Convert the byte8 value to an int32 value.
+ *
Push the converted int32 value back onto the operand stack for subsequent operations.
+ *
+ *
+ *
This opcode is used to widen a byte8 value to an int32 type to ensure compatibility with integer-based operations.
+ */
+ public static final int B2I = 0x00CF;
+ // endregion
+
+ // region Stack Control (0x0100-0x01FF)
+ /**
+ * POP Opcode: Represents a stack operation that removes the top element from the operand stack.
+ *
This opcode is implemented by the {@link PopCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Removes (pops) the top element from the operand stack.
+ *
Discards the popped value, as it is not stored or used further.
+ *
Increments the program counter (PC) to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Clearing temporary or unnecessary data from the operand stack.
+ *
Managing stack cleanup after operations that leave excess data.
+ *
Ensuring stack balance during function calls or control flow transitions.
+ *
+ */
+ public static final int POP = 0x0100;
+ /**
+ * DUP Opcode: Represents a stack operation that duplicates the top element of the operand stack.
+ *
This opcode is implemented by the {@link DupCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Retrieves the top element from the operand stack.
+ *
Duplicates the top value and pushes it back onto the stack.
+ *
Increments the program counter (PC) to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Preserving the top element of the operand stack for later use in later operations.
+ *
Duplicating values that are needed multiple times in the execution flow.
+ *
Managing stack balance when performing operations that require repeated access to the same data.
+ *
+ */
+ public static final int DUP = 0x0101;
+ /**
+ * SWAP Opcode: Represents a stack operation that swaps the top two values of the operand stack.
+ *
This opcode is implemented by the {@link SwapCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Ensures that there are at least two elements on the operand stack.
+ *
Pops the two topmost values from the stack.
+ *
Pushes the two values back onto the stack in reversed order.
+ *
Increments the program counter (PC) to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Reversing the order of the top two elements on the stack, which may be required in certain algorithms or operations.
+ *
Handling data rearrangements that require immediate swapping of operands during execution.
+ *
Ensuring proper operand placement for later instructions that depend on the order of stack elements.
+ *
+ */
+ public static final int SWAP = 0x0102;
+ // endregion
+
+ // region Flow Control (0x0200-0x02FF)
+ /**
+ * JUMP Opcode: Represents an unconditional jump to a target instruction address.
+ *
This opcode is implemented by the {@link JumpCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the target instruction address from the instruction parameters.
+ *
Validates the target address to ensure it is a non-negative int32.
+ *
If the target address is valid (greater than or equal to 0), updates the program counter (PC) to the specified target address,
+ * effectively skipping all intermediate instructions.
+ *
If the target address is invalid (less than 0), logs an error message and halts execution by returning an invalid value (typically -1).
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Control flow management in virtual machine execution.
+ *
+ */
+ public static final int JUMP = 0x0200;
/**
* CALL Opcode: Represents a function or subroutine call operation that transfers control to a specified function address.
*
This opcode is implemented by the {@link CallCommand} class, which defines its specific execution logic.
@@ -1828,7 +1791,7 @@ public class VMOpCode {
*
Facilitating modular and reusable code execution by enabling jumps to specific function addresses.
*
*/
- public static final int CALL = 201;
+ public static final int CALL = 0x0201;
/**
* RET Opcode: Represents a return operation that transfers control back to the calling method by restoring the saved return address.
*
This opcode is implemented by the {@link RetCommand} class, which defines its specific execution logic.
@@ -1848,7 +1811,33 @@ public class VMOpCode {
*
Cleaning up the local variables of the completed method to maintain memory consistency.
*
*/
- public static final int RET = 202;
+ public static final int RET = 0x0202;
+ // endregion
+
+ // region Register Control (0x0300-0x03FF)
+ /**
+ * MOV Opcode: Represents a move operation that transfers a value from one local variable to another within the local variable store.
+ *
This opcode is implemented by the {@link MovCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the source and destination indices from the instruction parameters.
+ *
Retrieves the value from the local variable store at the source index.
+ *
Stores the retrieved value into the destination index of the local variable store.
+ *
Increments the program counter (PC) to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Transferring values between local variables within a method frame.
+ *
Preserving computed results by moving them to designated local variable slots.
+ *
Facilitating intermediate storage of values needed for later computations.
+ *
+ */
+ public static final int MOV = 0x0300;
+ // endregion
+
+ // region System Control (0x0400-0x04FF)
/**
* HALT Opcode: Represents a termination operation that stops the execution of the virtual machine.
*
This opcode is implemented by the {@link HaltCommand} class, which defines its specific execution logic.
@@ -1865,7 +1854,9 @@ public class VMOpCode {
*
Serving as the final instruction in a program to indicate normal completion.
*
*/
- public static final int HALT = 255;
+ public static final int HALT = 0x0400;
+ public static final int SYSCALL = 0x0401;
+ public static final int DEBUG_TRAP = 0x0402;
// endregion
/**
@@ -1875,4 +1866,4 @@ public class VMOpCode {
public VMOpCode() {
// Empty constructor
}
-}
+}
\ No newline at end of file
From c5169b7654a4f949be6f1223afe41d477bb71964 Mon Sep 17 00:00:00 2001
From: Luke
Date: Fri, 27 Jun 2025 23:11:28 +0800
Subject: [PATCH 05/15] =?UTF-8?q?chore:=20=E4=BF=AE=E6=94=B9=20Demo=20?=
=?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.run/Demo1.run.xml | 2 +-
.run/Demo10.run.xml | 2 +-
.run/Demo2.run.xml | 2 +-
.run/Demo3.run.xml | 2 +-
.run/Demo4.run.xml | 2 +-
.run/Demo5.run.xml | 2 +-
.run/Demo6.run.xml | 2 +-
.run/Demo7.run.xml | 2 +-
.run/Demo8.run.xml | 2 +-
.run/Demo9.run.xml | 2 +-
10 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/.run/Demo1.run.xml b/.run/Demo1.run.xml
index 867e2f7..55005c8 100644
--- a/.run/Demo1.run.xml
+++ b/.run/Demo1.run.xml
@@ -3,7 +3,7 @@
-
+
diff --git a/.run/Demo10.run.xml b/.run/Demo10.run.xml
index 19c1c9c..94bfc43 100644
--- a/.run/Demo10.run.xml
+++ b/.run/Demo10.run.xml
@@ -3,7 +3,7 @@
-
+
diff --git a/.run/Demo2.run.xml b/.run/Demo2.run.xml
index 2661fde..882e77a 100644
--- a/.run/Demo2.run.xml
+++ b/.run/Demo2.run.xml
@@ -3,7 +3,7 @@
-
+
diff --git a/.run/Demo3.run.xml b/.run/Demo3.run.xml
index 57994d1..a949e95 100644
--- a/.run/Demo3.run.xml
+++ b/.run/Demo3.run.xml
@@ -3,7 +3,7 @@
-
+
diff --git a/.run/Demo4.run.xml b/.run/Demo4.run.xml
index 083127e..57afa15 100644
--- a/.run/Demo4.run.xml
+++ b/.run/Demo4.run.xml
@@ -3,7 +3,7 @@
-
+
diff --git a/.run/Demo5.run.xml b/.run/Demo5.run.xml
index 2c2bbf8..cb543d1 100644
--- a/.run/Demo5.run.xml
+++ b/.run/Demo5.run.xml
@@ -3,7 +3,7 @@
-
+
diff --git a/.run/Demo6.run.xml b/.run/Demo6.run.xml
index 9c76927..b6c3fdc 100644
--- a/.run/Demo6.run.xml
+++ b/.run/Demo6.run.xml
@@ -3,7 +3,7 @@
-
+
diff --git a/.run/Demo7.run.xml b/.run/Demo7.run.xml
index d78ab8c..6f25770 100644
--- a/.run/Demo7.run.xml
+++ b/.run/Demo7.run.xml
@@ -3,7 +3,7 @@
-
+
diff --git a/.run/Demo8.run.xml b/.run/Demo8.run.xml
index 0857919..4bb76fe 100644
--- a/.run/Demo8.run.xml
+++ b/.run/Demo8.run.xml
@@ -3,7 +3,7 @@
-
+
diff --git a/.run/Demo9.run.xml b/.run/Demo9.run.xml
index 97cff0d..a6bf203 100644
--- a/.run/Demo9.run.xml
+++ b/.run/Demo9.run.xml
@@ -3,7 +3,7 @@
-
+
From a674235e39b98531d4c02dcf0209f5f3d30b4152 Mon Sep 17 00:00:00 2001
From: Luke
Date: Fri, 27 Jun 2025 23:47:21 +0800
Subject: [PATCH 06/15] =?UTF-8?q?docs:=20=E5=AE=8C=E5=96=84=20VMOpCode.jav?=
=?UTF-8?q?a=20=E7=9A=84=E6=B3=A8=E9=87=8A?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../org/jcnc/snow/vm/engine/VMOpCode.java | 614 +++++++++++++++++-
1 file changed, 596 insertions(+), 18 deletions(-)
diff --git a/src/main/java/org/jcnc/snow/vm/engine/VMOpCode.java b/src/main/java/org/jcnc/snow/vm/engine/VMOpCode.java
index 386bf57..e707aa0 100644
--- a/src/main/java/org/jcnc/snow/vm/engine/VMOpCode.java
+++ b/src/main/java/org/jcnc/snow/vm/engine/VMOpCode.java
@@ -158,11 +158,63 @@ public class VMOpCode {
*
This opcode is particularly useful for optimizing scenarios where a local `byte8` variable, such as a counter or loop index, is frequently incremented.
*/
public static final int B_INC = 0x0006;
-
+ /**
+ * I_AND Opcode: Represents the byte8 bitwise AND operation in the virtual machine.
+ *
This opcode is implemented by the {@link IAndCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top two byte8 values from the operand stack. These values are treated as 32-bit binary representations.
+ *
Performs the byte8 bitwise AND operation on the two popped operands. The operation compares corresponding bits of both operands:
+ *
+ *
Each bit in the result is set to 1 only if the corresponding bits in both operands are also 1.
+ *
If either of the corresponding bits is 0, the resulting bit is 0.
+ *
+ *
+ *
Pushes the result of the byte8 bitwise AND operation back onto the operand stack for further processing.
+ *
+ *
+ *
This opcode is essential for low-level bit manipulation tasks.
+ */
public static final int B_AND = 0x0007;
+ /**
+ * I_OR Opcode: Represents the byte8 bitwise OR operation in the virtual machine.
+ *
This opcode is implemented by the {@link IOrCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top two byte8 values from the operand stack. These values are treated as 32-bit binary representations.
+ *
Performs the byte8 bitwise OR operation on the two popped operands. The operation compares corresponding bits of both operands:
+ *
+ *
Each bit in the result is set to 1 if at least one of the corresponding bits in either operand is 1.
+ *
If both corresponding bits are 0, the resulting bit is 0.
+ *
+ *
+ *
Pushes the result of the byte8 bitwise OR operation back onto the operand stack for further processing.
+ *
+ *
+ *
This opcode is essential for low-level bit manipulation tasks.
+ */
public static final int B_OR = 0x0008;
+ /**
+ * I_XOR Opcode: Represents the byte8 bitwise XOR operation in the virtual machine.
+ *
This opcode is implemented by the {@link IXorCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top two byte8 values from the operand stack. These values are treated as 32-bit binary representations.
+ *
Performs the byte8 bitwise XOR (exclusive OR) operation on the two operands:
+ *
+ *
If the corresponding bits are different, the result is 1.
+ *
If the corresponding bits are the same, the result is 0.
+ *
+ *
+ *
Pushes the result of the byte8 bitwise XOR operation back onto the operand stack for further processing.
+ *
+ *
+ *
This opcode is essential for low-level bit manipulation tasks.
+ */
public static final int B_XOR = 0x0009;
-
/**
* B_PUSH Opcode: Represents a stack operation that pushes a byte8 value onto the operand stack.
*
This opcode is implemented by the {@link BPushCommand} class, which defines its specific execution logic.
@@ -222,12 +274,131 @@ public class VMOpCode {
*
*/
public static final int B_STORE = 0x000C;
-
+ /**
+ * I_CE Opcode: Represents a conditional jump based on byte8 equality.
+ *
This opcode is implemented by the {@link ICECommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two byte8 values from the operand stack.
+ *
Compares the two byte8 for equality.
+ *
If the byte8 are equal, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the byte8 are not equal, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on byte8 comparison.
+ *
Implementing control flow structures such as if-statements and loops.
+ *
+ */
public static final int B_CE = 0x000D;
+ /**
+ * I_CNE Opcode: Represents a conditional jump based on byte8 inequality.
+ *
This opcode is implemented by the {@link ICNECommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two byte8 values from the operand stack.
+ *
Compares the two byte8 for inequality.
+ *
If the byte8 are not equal, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the byte8 are equal, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on byte8 comparison.
+ *
Implementing control flow structures such as conditional loops and if-else statements.
+ *
+ */
public static final int B_CNE = 0x000E;
+ /**
+ * I_CG Opcode: Represents a conditional jump based on byte8 comparison (greater than).
+ *
This opcode is implemented by the {@link ICGCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two byte8 values from the operand stack.
+ *
Compares the first byte8 with the second to determine if it is greater.
+ *
If the first byte8 is greater than the second, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the first byte8 is not greater than the second, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on byte8 comparison.
+ *
Implementing control flow structures such as greater-than conditions in loops and conditional statements.
+ *
+ */
public static final int B_CG = 0x000F;
+ /**
+ * I_CGE Opcode: Represents a conditional jump based on byte8 comparison (greater than or equal to).
+ *
This opcode is implemented by the {@link ICGECommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two byte8 values from the operand stack.
+ *
Compares the first byte8 with the second to determine if it is greater than or equal to the second byte8.
+ *
If the first byte8 is greater than or equal to the second, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the first byte8 is less than the second, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on byte8 comparison.
+ *
Implementing control flow structures such as loops, conditional statements, and range checks.
+ *
+ */
public static final int B_CGE = 0x0010;
+ /**
+ * I_CL Opcode: Represents a conditional jump based on byte8 comparison (less than).
+ *
This opcode is implemented by the {@link ICLCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two byte8 values from the operand stack.
+ *
Compares the first byte8 with the second to determine if it is less than the second byte8.
+ *
If the first byte8 is less than the second, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the first byte8 is greater than or equal to the second, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on byte8 comparison.
+ *
Implementing control flow structures such as loops, conditional statements, and range validations.
+ *
+ */
public static final int B_CL = 0x0011;
+ /**
+ * B_CLE Opcode: Represents a conditional jump based on byte8 comparison (less than or equal).
+ *
This opcode is implemented by the {@link ICLECommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two byte8 values from the operand stack.
+ *
Compares the first byte8 with the second to determine if it is less than or equal to the second byte8.
+ *
If the first byte8 is less than or equal to the second, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the first byte8 is greater than the second, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on byte8 comparison.
+ *
Implementing control flow structures such as loops, conditional statements, and boundary checks.
+ *
+ */
public static final int B_CLE = 0x0012;
// endregion
@@ -327,11 +498,63 @@ public class VMOpCode {
* or for optimizing the modification of variables in tight loops.
*/
public static final int S_INC = 0x0026;
-
+ /**
+ * I_AND Opcode: Represents the short16 bitwise AND operation in the virtual machine.
+ *
This opcode is implemented by the {@link IAndCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top two short16 values from the operand stack. These values are treated as 32-bit binary representations.
+ *
Performs the short16 bitwise AND operation on the two popped operands. The operation compares corresponding bits of both operands:
+ *
+ *
Each bit in the result is set to 1 only if the corresponding bits in both operands are also 1.
+ *
If either of the corresponding bits is 0, the resulting bit is 0.
+ *
+ *
+ *
Pushes the result of the short16 bitwise AND operation back onto the operand stack for further processing.
+ *
+ *
+ *
This opcode is essential for low-level bit manipulation tasks.
+ */
public static final int S_AND = 0x0027;
+ /**
+ * I_OR Opcode: Represents the short16 bitwise OR operation in the virtual machine.
+ *
This opcode is implemented by the {@link IOrCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top two short16 values from the operand stack. These values are treated as 32-bit binary representations.
+ *
Performs the short16 bitwise OR operation on the two popped operands. The operation compares corresponding bits of both operands:
+ *
+ *
Each bit in the result is set to 1 if at least one of the corresponding bits in either operand is 1.
+ *
If both corresponding bits are 0, the resulting bit is 0.
+ *
+ *
+ *
Pushes the result of the short16 bitwise OR operation back onto the operand stack for further processing.
+ *
+ *
+ *
This opcode is essential for low-level bit manipulation tasks.
+ */
public static final int S_OR = 0x0028;
+ /**
+ * I_XOR Opcode: Represents the short16 bitwise XOR operation in the virtual machine.
+ *
This opcode is implemented by the {@link IXorCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Pops the top two short16 values from the operand stack. These values are treated as 32-bit binary representations.
+ *
Performs the short16 bitwise XOR (exclusive OR) operation on the two operands:
+ *
+ *
If the corresponding bits are different, the result is 1.
+ *
If the corresponding bits are the same, the result is 0.
+ *
+ *
+ *
Pushes the result of the short16 bitwise XOR operation back onto the operand stack for further processing.
+ *
+ *
+ *
This opcode is essential for low-level bit manipulation tasks.
+ */
public static final int S_XOR = 0x0029;
-
/**
* S_PUSH Opcode: Represents a stack operation that pushes a short16 value onto the operand stack.
*
This opcode is implemented by the {@link SPushCommand} class, which defines its specific execution logic.
@@ -391,14 +614,132 @@ public class VMOpCode {
*
*/
public static final int S_STORE = 0x002C;
-
+ /**
+ * I_CE Opcode: Represents a conditional jump based on short16 equality.
+ *
This opcode is implemented by the {@link ICECommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two short16 values from the operand stack.
+ *
Compares the two short16 for equality.
+ *
If the short16 are equal, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the short16 are not equal, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on short16 comparison.
+ *
Implementing control flow structures such as if-statements and loops.
+ *
+ */
public static final int S_CE = 0x002D;
+ /**
+ * I_CNE Opcode: Represents a conditional jump based on short16 inequality.
+ *
This opcode is implemented by the {@link ICNECommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two short16 values from the operand stack.
+ *
Compares the two short16 for inequality.
+ *
If the short16 are not equal, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the short16 are equal, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on short16 comparison.
+ *
Implementing control flow structures such as conditional loops and if-else statements.
+ *
+ */
public static final int S_CNE = 0x002E;
+ /**
+ * I_CG Opcode: Represents a conditional jump based on short16 comparison (greater than).
+ *
This opcode is implemented by the {@link ICGCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two short16 values from the operand stack.
+ *
Compares the first short16 with the second to determine if it is greater.
+ *
If the first short16 is greater than the second, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the first short16 is not greater than the second, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on short16 comparison.
+ *
Implementing control flow structures such as greater-than conditions in loops and conditional statements.
+ *
+ */
public static final int S_CG = 0x002F;
+ /**
+ * I_CGE Opcode: Represents a conditional jump based on short16 comparison (greater than or equal to).
+ *
This opcode is implemented by the {@link ICGECommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two short16 values from the operand stack.
+ *
Compares the first short16 with the second to determine if it is greater than or equal to the second short16.
+ *
If the first short16 is greater than or equal to the second, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the first short16 is less than the second, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on short16 comparison.
+ *
Implementing control flow structures such as loops, conditional statements, and range checks.
+ *
+ */
public static final int S_CGE = 0x0030;
+ /**
+ * I_CL Opcode: Represents a conditional jump based on short16 comparison (less than).
+ *
This opcode is implemented by the {@link ICLCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two short16 values from the operand stack.
+ *
Compares the first short16 with the second to determine if it is less than the second short16.
+ *
If the first short16 is less than the second, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the first short16 is greater than or equal to the second, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on short16 comparison.
+ *
Implementing control flow structures such as loops, conditional statements, and range validations.
+ *
+ */
public static final int S_CL = 0x0031;
+ /**
+ * S_CLE Opcode: Represents a conditional jump based on short16 comparison (less than or equal).
+ *
This opcode is implemented by the {@link ICLECommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two short16 values from the operand stack.
+ *
Compares the first short16 with the second to determine if it is less than or equal to the second short16.
+ *
If the first short16 is less than or equal to the second, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the first short16 is greater than the second, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on short16 comparison.
+ *
Implementing control flow structures such as loops, conditional statements, and boundary checks.
+ *
+ */
public static final int S_CLE = 0x0032;
-
// endregion
// region Int32 (0x0040-0x005F)
@@ -763,7 +1104,7 @@ public class VMOpCode {
*
Execution Steps:
*
*
Pops the top two long64 values from the operand stack (the first value popped is the second operand, and the second value popped is the first operand).
- *
Performs the addition operation on these two long64s.
+ *
Performs the addition operation on these two long64.
*
Pushes the result of the addition back onto the operand stack for later instructions to use.
*
*
@@ -793,7 +1134,7 @@ public class VMOpCode {
*
Execution Steps:
*
*
Pops the top two long64 values from the operand stack (the first value popped is the second operand, and the second value popped is the first operand).
- *
Performs the multiplication operation on these two long64s (i.e., firstOperand * secondOperand).
+ *
Performs the multiplication operation on these two long64 (i.e., firstOperand * secondOperand).
*
Pushes the result of the multiplication back onto the operand stack for later instructions to use.
*
*
@@ -988,10 +1329,10 @@ public class VMOpCode {
*
*
Parses the target instruction address from the instruction parameters.
*
Pops two long64 values from the operand stack.
- *
Compares the two long64s for equality.
- *
If the long64s are equal, updates the program counter (PC) to the specified target address,
+ *
Compares the two long64 for equality.
+ *
If the long64 are equal, updates the program counter (PC) to the specified target address,
* effectively jumping to the target instruction.
- *
If the long64s are not equal, increments the program counter to proceed with the next sequential instruction.
+ *
If the long64 are not equal, increments the program counter to proceed with the next sequential instruction.
*
*
*
This opcode is commonly used for:
@@ -1009,10 +1350,10 @@ public class VMOpCode {
*
*
Parses the target instruction address from the instruction parameters.
*
Pops two long64 values from the operand stack.
- *
Compares the two long64s for inequality.
- *
If the long64s are not equal, updates the program counter (PC) to the specified target address,
+ *
Compares the two long64 for inequality.
+ *
If the long64 are not equal, updates the program counter (PC) to the specified target address,
* effectively jumping to the target instruction.
- *
If the long64s are equal, increments the program counter to proceed with the next sequential instruction.
+ *
If the long64 are equal, increments the program counter to proceed with the next sequential instruction.
*
*
*
This opcode is commonly used for:
@@ -1276,14 +1617,132 @@ public class VMOpCode {
*
*/
public static final int F_STORE = 0x0089;
-
+ /**
+ * L_CE Opcode: Represents a conditional jump based on float32 equality.
+ *
This opcode is implemented by the {@link LCECommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two float32 values from the operand stack.
+ *
Compares the two float32 for equality.
+ *
If the float32 are equal, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the float32 are not equal, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on float32 comparison.
+ *
Implementing control flow structures such as if-statements and loops.
+ *
+ */
public static final int F_CE = 0x008A;
+ /**
+ * L_CNE Opcode: Represents a conditional jump based on float32 inequality.
+ *
This opcode is implemented by the {@link LCNECommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two float32 values from the operand stack.
+ *
Compares the two float32 for inequality.
+ *
If the float32 are not equal, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the float32 are equal, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on float32 comparison.
+ *
Implementing control flow structures such as conditional loops and if-else statements.
+ *
+ */
public static final int F_CNE = 0x008B;
+ /**
+ * L_CG Opcode: Represents a conditional jump based on float32 comparison (greater than).
+ *
This opcode is implemented by the {@link LCGCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two float32 values from the operand stack.
+ *
Compares the first float32 with the second to determine if it is greater.
+ *
If the first float32 is greater than the second, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the first float32 is not greater than the second, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on float32 comparison.
+ *
Implementing control flow structures such as greater-than conditions in loops and conditional statements.
+ *
+ */
public static final int F_CG = 0x008C;
+ /**
+ * L_CGE Opcode: Represents a conditional jump based on float32 comparison (greater than or equal to).
+ *
This opcode is implemented by the {@link LCGECommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two float32 values from the operand stack.
+ *
Compares the first float32 with the second to determine if it is greater than or equal to the second float32.
+ *
If the first float32 is greater than or equal to the second, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the first float32 is less than the second, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on float32 comparison.
+ *
Implementing control flow structures such as loops, conditional statements, and range checks.
+ *
+ */
public static final int F_CGE = 0x008D;
+ /**
+ * L_CL Opcode: Represents a conditional jump based on float32 comparison (less than).
+ *
This opcode is implemented by the {@link LCLCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two float32 values from the operand stack.
+ *
Compares the first float32 with the second to determine if it is less than the second float32.
+ *
If the first float32 is less than the second, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the first float32 is greater than or equal to the second, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on float32 comparison.
+ *
Implementing control flow structures such as loops, conditional statements, and range validations.
+ *
+ */
public static final int F_CL = 0x008E;
+ /**
+ * L_CLE Opcode: Represents a conditional jump based on float32 comparison (less than or equal).
+ *
This opcode is implemented by the {@link LCLECommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two float32 values from the operand stack.
+ *
Compares the first float32 with the second to determine if it is less than or equal to the second float32.
+ *
If the first float32 is less than or equal to the second, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the first float32 is greater than the second, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on float32 comparison.
+ *
Implementing control flow structures such as loops, conditional statements, and boundary checks.
+ *
+ */
public static final int F_CLE = 0x008F;
-
// endregion
// region Double64 (0x00A0-0x00BF)
@@ -1454,12 +1913,131 @@ public class VMOpCode {
*
*/
public static final int D_STORE = 0x00A9;
-
+ /**
+ * L_CE Opcode: Represents a conditional jump based on double64 equality.
+ *
This opcode is implemented by the {@link LCECommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two double64 values from the operand stack.
+ *
Compares the two double64 for equality.
+ *
If the double64 are equal, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the double64 are not equal, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on double64 comparison.
+ *
Implementing control flow structures such as if-statements and loops.
+ *
+ */
public static final int D_CE = 0x00AA;
+ /**
+ * L_CNE Opcode: Represents a conditional jump based on double64 inequality.
+ *
This opcode is implemented by the {@link LCNECommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two double64 values from the operand stack.
+ *
Compares the two double64 for inequality.
+ *
If the double64 are not equal, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the double64 are equal, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on double64 comparison.
+ *
Implementing control flow structures such as conditional loops and if-else statements.
+ *
+ */
public static final int D_CNE = 0x00AB;
+ /**
+ * L_CG Opcode: Represents a conditional jump based on double64 comparison (greater than).
+ *
This opcode is implemented by the {@link LCGCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two double64 values from the operand stack.
+ *
Compares the first double64 with the second to determine if it is greater.
+ *
If the first double64 is greater than the second, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the first double64 is not greater than the second, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on double64 comparison.
+ *
Implementing control flow structures such as greater-than conditions in loops and conditional statements.
+ *
+ */
public static final int D_CG = 0x00AC;
+ /**
+ * L_CGE Opcode: Represents a conditional jump based on double64 comparison (greater than or equal to).
+ *
This opcode is implemented by the {@link LCGECommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two double64 values from the operand stack.
+ *
Compares the first double64 with the second to determine if it is greater than or equal to the second double64.
+ *
If the first double64 is greater than or equal to the second, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the first double64 is less than the second, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on double64 comparison.
+ *
Implementing control flow structures such as loops, conditional statements, and range checks.
+ *
+ */
public static final int D_CGE = 0x00AD;
+ /**
+ * L_CL Opcode: Represents a conditional jump based on double64 comparison (less than).
+ *
This opcode is implemented by the {@link LCLCommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two double64 values from the operand stack.
+ *
Compares the first double64 with the second to determine if it is less than the second double64.
+ *
If the first double64 is less than the second, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the first double64 is greater than or equal to the second, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on double64 comparison.
+ *
Implementing control flow structures such as loops, conditional statements, and range validations.
+ *
+ */
public static final int D_CL = 0x00AE;
+ /**
+ * L_CLE Opcode: Represents a conditional jump based on double64 comparison (less than or equal).
+ *
This opcode is implemented by the {@link LCLECommand} class, which defines its specific execution logic.
+ *
+ *
Execution Steps:
+ *
+ *
Parses the target instruction address from the instruction parameters.
+ *
Pops two double64 values from the operand stack.
+ *
Compares the first double64 with the second to determine if it is less than or equal to the second double64.
+ *
If the first double64 is less than or equal to the second, updates the program counter (PC) to the specified target address,
+ * effectively jumping to the target instruction.
+ *
If the first double64 is greater than the second, increments the program counter to proceed with the next sequential instruction.
+ *
+ *
+ *
This opcode is commonly used for:
+ *
+ *
Conditional branching in virtual machine execution based on double64 comparison.
+ *
Implementing control flow structures such as loops, conditional statements, and boundary checks.
+ *
+ */
public static final int D_CLE = 0x00AF;
// endregion
From 11a90cb920b3c94936698542c533e0f192a8d029 Mon Sep 17 00:00:00 2001
From: Luke
Date: Sat, 28 Jun 2025 00:17:25 +0800
Subject: [PATCH 07/15] =?UTF-8?q?feat:=20SnowVM=20=E6=94=AF=E6=8C=81=20B?=
=?UTF-8?q?=5FAND?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../commands/bitwise/byte8/BAndCommand.java | 56 +++++++++++++++++++
1 file changed, 56 insertions(+)
create mode 100644 src/main/java/org/jcnc/snow/vm/commands/bitwise/byte8/BAndCommand.java
diff --git a/src/main/java/org/jcnc/snow/vm/commands/bitwise/byte8/BAndCommand.java b/src/main/java/org/jcnc/snow/vm/commands/bitwise/byte8/BAndCommand.java
new file mode 100644
index 0000000..71ea581
--- /dev/null
+++ b/src/main/java/org/jcnc/snow/vm/commands/bitwise/byte8/BAndCommand.java
@@ -0,0 +1,56 @@
+package org.jcnc.snow.vm.commands.bitwise.byte8;
+
+import org.jcnc.snow.vm.interfaces.Command;
+import org.jcnc.snow.vm.module.CallStack;
+import org.jcnc.snow.vm.module.LocalVariableStore;
+import org.jcnc.snow.vm.module.OperandStack;
+
+/**
+ * The BAndCommand class implements the {@link Command} interface and represents the byte8 bitwise AND (`&`) operation command.
+ * This class performs a byte8 bitwise AND operation in the virtual machine by popping the top two values from the stack,
+ * computing their byte8 bitwise AND operation, and then pushing the result back onto the stack. It is a basic operation command within the virtual machine.
+ *
+ *
Specific behavior:
+ *
+ *
Pops two operands from the virtual machine stack.
+ *
Performs the byte8 bitwise AND (`&`) operation.
+ *
Pushes the result back onto the virtual machine stack.
+ *
+ */
+public class BAndCommand implements Command {
+ /**
+ * Default constructor for creating an instance of {@code BAndCommand}.
+ * This constructor is empty as no specific initialization is required.
+ */
+ public BAndCommand() {
+ // Empty constructor
+ }
+
+ /**
+ * Executes the virtual machine instruction's operation.
+ *
+ * @param parts The array of instruction parameters, which usually includes the operator and related arguments.
+ * @param currentPC The current program counter-value, indicating the address of the instruction being executed.
+ * @param operandStack The virtual machine's operand stack manager, responsible for pushing and popping values.
+ * @param localVariableStore The local variable store, typically used to manage method-local variables.
+ * @param callStack The virtual machine's call stack, used for managing method calls and returns.
+ * @return The updated program counter-value, typically `currentPC + 1` unless a control flow instruction is executed.
+ * @throws IllegalStateException if there are not enough operands on the stack to perform the operation.
+ */
+ @Override
+ public int execute(String[] parts, int currentPC, OperandStack operandStack, LocalVariableStore localVariableStore, CallStack callStack) {
+ // Ensure the stack has at least two operands
+ if (operandStack.size() < 2) {
+ throw new IllegalStateException("Not enough operands on the stack for BAND operation.");
+ }
+
+ // Pop the top two operands from the stack
+ final byte b = (byte) operandStack.pop();
+ final byte a = (byte) operandStack.pop();
+
+ // Perform the byte8 bitwise AND operation and push the result back onto the stack
+ operandStack.push(a & b);
+
+ return currentPC + 1;
+ }
+}
From 4f0ad45ecad4b2901477350bfd38d7dad7c4aaa3 Mon Sep 17 00:00:00 2001
From: Luke
Date: Sat, 28 Jun 2025 00:17:32 +0800
Subject: [PATCH 08/15] =?UTF-8?q?feat:=20SnowVM=20=E6=94=AF=E6=8C=81=20B?=
=?UTF-8?q?=5FOR?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../vm/commands/bitwise/byte8/BOrCommand.java | 56 +++++++++++++++++++
1 file changed, 56 insertions(+)
create mode 100644 src/main/java/org/jcnc/snow/vm/commands/bitwise/byte8/BOrCommand.java
diff --git a/src/main/java/org/jcnc/snow/vm/commands/bitwise/byte8/BOrCommand.java b/src/main/java/org/jcnc/snow/vm/commands/bitwise/byte8/BOrCommand.java
new file mode 100644
index 0000000..4902ae7
--- /dev/null
+++ b/src/main/java/org/jcnc/snow/vm/commands/bitwise/byte8/BOrCommand.java
@@ -0,0 +1,56 @@
+package org.jcnc.snow.vm.commands.bitwise.byte8;
+
+import org.jcnc.snow.vm.interfaces.Command;
+import org.jcnc.snow.vm.module.CallStack;
+import org.jcnc.snow.vm.module.LocalVariableStore;
+import org.jcnc.snow.vm.module.OperandStack;
+
+/**
+ * The {@code BOrCommand} class implements the {@link Command} interface and represents the byte8 bitwise OR (`|`) operation command.
+ * This class performs a byte8 bitwise OR operation in the virtual machine by popping the top two values from the stack,
+ * computing their OR, and then pushing the result back onto the stack. It is a basic operation command within the virtual machine.
+ *
+ *
Operation details:
+ *
+ *
Pops two operands from the virtual machine stack.
+ *
Performs the byte8 bitwise OR (`|`) operation.
+ *
Pushes the result back onto the virtual machine stack.
+ *
+ */
+public class BOrCommand implements Command {
+ /**
+ * Default constructor for creating an instance of {@code BOrCommand}.
+ * This constructor is empty as no specific initialization is required.
+ */
+ public BOrCommand() {
+ // Empty constructor
+ }
+
+ /**
+ * Executes the virtual machine instruction's operation.
+ *
+ * @param parts The array of instruction parameters, which usually includes the operator and related arguments.
+ * @param currentPC The current program counter-value, indicating the address of the instruction being executed.
+ * @param operandStack The virtual machine's operand stack manager, responsible for performing stack operations.
+ * @param localVariableStore The local variable store, typically used to manage method-local variables.
+ * @param callStack The virtual machine's call stack, which keeps track of method invocations.
+ * @return The updated program counter-value, typically {@code currentPC + 1}, unless a control flow instruction is executed.
+ * @throws IllegalStateException if there are not enough operands on the stack to perform the operation.
+ */
+ @Override
+ public int execute(String[] parts, int currentPC, OperandStack operandStack, LocalVariableStore localVariableStore, CallStack callStack) {
+ // Ensure the stack has at least two operands
+ if (operandStack.size() < 2) {
+ throw new IllegalStateException("Not enough operands on the stack for BOR operation.");
+ }
+
+ // Pop the top two operands from the stack
+ final byte b = (byte) operandStack.pop();
+ final byte a = (byte) operandStack.pop();
+
+ // Perform the byte8 bitwise OR operation and push the result back onto the stack
+ operandStack.push(a | b);
+
+ return currentPC + 1;
+ }
+}
\ No newline at end of file
From aef7e3b12a2fd399d979ea8f95bda5ba67846fc2 Mon Sep 17 00:00:00 2001
From: Luke
Date: Sat, 28 Jun 2025 00:17:39 +0800
Subject: [PATCH 09/15] =?UTF-8?q?feat:=20SnowVM=20=E6=94=AF=E6=8C=81=20B?=
=?UTF-8?q?=5FXOR?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../commands/bitwise/byte8/BXorCommand.java | 56 +++++++++++++++++++
1 file changed, 56 insertions(+)
create mode 100644 src/main/java/org/jcnc/snow/vm/commands/bitwise/byte8/BXorCommand.java
diff --git a/src/main/java/org/jcnc/snow/vm/commands/bitwise/byte8/BXorCommand.java b/src/main/java/org/jcnc/snow/vm/commands/bitwise/byte8/BXorCommand.java
new file mode 100644
index 0000000..f597485
--- /dev/null
+++ b/src/main/java/org/jcnc/snow/vm/commands/bitwise/byte8/BXorCommand.java
@@ -0,0 +1,56 @@
+package org.jcnc.snow.vm.commands.bitwise.byte8;
+
+import org.jcnc.snow.vm.interfaces.Command;
+import org.jcnc.snow.vm.module.CallStack;
+import org.jcnc.snow.vm.module.LocalVariableStore;
+import org.jcnc.snow.vm.module.OperandStack;
+
+/**
+ * The {@code BXorCommand} class implements the {@link Command} interface and represents the byte8 bitwise XOR (`^`) operation command.
+ * This class performs a byte8 bitwise XOR operation in the virtual machine by popping the top two values from the stack,
+ * computing their XOR, and then pushing the result back onto the stack. It is a basic operation command within the virtual machine.
+ *
+ *
Operation details:
+ *
+ *
Pops two operands from the virtual machine stack.
+ *
Performs the byte8 bitwise XOR (`^`) operation.
+ *
Pushes the result back onto the virtual machine stack.
+ *
+ */
+public class BXorCommand implements Command {
+ /**
+ * Default constructor for creating an instance of {@code BXorCommand}.
+ * This constructor is empty as no specific initialization is required.
+ */
+ public BXorCommand() {
+ // Empty constructor
+ }
+
+ /**
+ * Executes the virtual machine instruction's operation.
+ *
+ * @param parts The array of instruction parameters, which usually includes the operator and related arguments.
+ * @param currentPC The current program counter-value, indicating the address of the instruction being executed.
+ * @param operandStack The virtual machine's operand stack manager, responsible for performing stack operations.
+ * @param localVariableStore The local variable store, typically used to manage method-local variables.
+ * @param callStack The virtual machine's call stack, which keeps track of method invocations.
+ * @return The updated program counter-value, typically {@code currentPC + 1}, unless a control flow instruction is executed.
+ * @throws IllegalStateException if there are not enough operands on the stack to perform the operation.
+ */
+ @Override
+ public int execute(String[] parts, int currentPC, OperandStack operandStack, LocalVariableStore localVariableStore, CallStack callStack) {
+ // Ensure the stack has at least two operands
+ if (operandStack.size() < 2) {
+ throw new IllegalStateException("Not enough operands on the stack for BXOR operation.");
+ }
+
+ // Pop the top two operands from the stack
+ final byte b = (byte) operandStack.pop();
+ final byte a = (byte) operandStack.pop();
+
+ // Perform the byte8 bitwise XOR operation and push the result back onto the stack
+ operandStack.push(a ^ b);
+
+ return currentPC + 1;
+ }
+}
\ No newline at end of file
From 39bc4b81ae2d0b83727b23f51d64d585a9603e02 Mon Sep 17 00:00:00 2001
From: Luke
Date: Sat, 28 Jun 2025 00:17:56 +0800
Subject: [PATCH 10/15] =?UTF-8?q?feat:=20SnowVM=20=E6=94=AF=E6=8C=81=20S?=
=?UTF-8?q?=5FAND?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../commands/bitwise/short16/SAndCommand.java | 56 +++++++++++++++++++
1 file changed, 56 insertions(+)
create mode 100644 src/main/java/org/jcnc/snow/vm/commands/bitwise/short16/SAndCommand.java
diff --git a/src/main/java/org/jcnc/snow/vm/commands/bitwise/short16/SAndCommand.java b/src/main/java/org/jcnc/snow/vm/commands/bitwise/short16/SAndCommand.java
new file mode 100644
index 0000000..ea308f5
--- /dev/null
+++ b/src/main/java/org/jcnc/snow/vm/commands/bitwise/short16/SAndCommand.java
@@ -0,0 +1,56 @@
+package org.jcnc.snow.vm.commands.bitwise.short16;
+
+import org.jcnc.snow.vm.interfaces.Command;
+import org.jcnc.snow.vm.module.CallStack;
+import org.jcnc.snow.vm.module.LocalVariableStore;
+import org.jcnc.snow.vm.module.OperandStack;
+
+/**
+ * The SAndCommand class implements the {@link Command} interface and represents the short16 bitwise AND (`&`) operation command.
+ * This class performs a short16 bitwise AND operation in the virtual machine by popping the top two values from the stack,
+ * computing their short16 bitwise AND operation, and then pushing the result back onto the stack. It is a basic operation command within the virtual machine.
+ *
+ *
Specific behavior:
+ *
+ *
Pops two operands from the virtual machine stack.
+ *
Performs the short16 bitwise AND (`&`) operation.
+ *
Pushes the result back onto the virtual machine stack.
+ *
+ */
+public class SAndCommand implements Command {
+ /**
+ * Default constructor for creating an instance of {@code SAndCommand}.
+ * This constructor is empty as no specific initialization is required.
+ */
+ public SAndCommand() {
+ // Empty constructor
+ }
+
+ /**
+ * Executes the virtual machine instruction's operation.
+ *
+ * @param parts The array of instruction parameters, which usually includes the operator and related arguments.
+ * @param currentPC The current program counter-value, indicating the address of the instruction being executed.
+ * @param operandStack The virtual machine's operand stack manager, responsible for pushing and popping values.
+ * @param localVariableStore The local variable store, typically used to manage method-local variables.
+ * @param callStack The virtual machine's call stack, used for managing method calls and returns.
+ * @return The updated program counter-value, typically `currentPC + 1` unless a control flow instruction is executed.
+ * @throws IllegalStateException if there are not enough operands on the stack to perform the operation.
+ */
+ @Override
+ public int execute(String[] parts, int currentPC, OperandStack operandStack, LocalVariableStore localVariableStore, CallStack callStack) {
+ // Ensure the stack has at least two operands
+ if (operandStack.size() < 2) {
+ throw new IllegalStateException("Not enough operands on the stack for SAND operation.");
+ }
+
+ // Pop the top two operands from the stack
+ final short b = (short) operandStack.pop();
+ final short a = (short) operandStack.pop();
+
+ // Perform the short16 bitwise AND operation and push the result back onto the stack
+ operandStack.push(a & b);
+
+ return currentPC + 1;
+ }
+}
From 2205ef46bbd08f65871bcc5c49be6f83a5f2110e Mon Sep 17 00:00:00 2001
From: Luke
Date: Sat, 28 Jun 2025 00:18:01 +0800
Subject: [PATCH 11/15] =?UTF-8?q?feat:=20SnowVM=20=E6=94=AF=E6=8C=81=20S?=
=?UTF-8?q?=5FOR?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../commands/bitwise/short16/SOrCommand.java | 56 +++++++++++++++++++
1 file changed, 56 insertions(+)
create mode 100644 src/main/java/org/jcnc/snow/vm/commands/bitwise/short16/SOrCommand.java
diff --git a/src/main/java/org/jcnc/snow/vm/commands/bitwise/short16/SOrCommand.java b/src/main/java/org/jcnc/snow/vm/commands/bitwise/short16/SOrCommand.java
new file mode 100644
index 0000000..26c1331
--- /dev/null
+++ b/src/main/java/org/jcnc/snow/vm/commands/bitwise/short16/SOrCommand.java
@@ -0,0 +1,56 @@
+package org.jcnc.snow.vm.commands.bitwise.short16;
+
+import org.jcnc.snow.vm.interfaces.Command;
+import org.jcnc.snow.vm.module.CallStack;
+import org.jcnc.snow.vm.module.LocalVariableStore;
+import org.jcnc.snow.vm.module.OperandStack;
+
+/**
+ * The {@code SOrCommand} class implements the {@link Command} interface and represents the short16 bitwise OR (`|`) operation command.
+ * This class performs a short16 bitwise OR operation in the virtual machine by popping the top two values from the stack,
+ * computing their OR, and then pushing the result back onto the stack. It is a basic operation command within the virtual machine.
+ *
+ *
Operation details:
+ *
+ *
Pops two operands from the virtual machine stack.
+ *
Performs the short16 bitwise OR (`|`) operation.
+ *
Pushes the result back onto the virtual machine stack.
+ *
+ */
+public class SOrCommand implements Command {
+ /**
+ * Default constructor for creating an instance of {@code SOrCommand}.
+ * This constructor is empty as no specific initialization is required.
+ */
+ public SOrCommand() {
+ // Empty constructor
+ }
+
+ /**
+ * Executes the virtual machine instruction's operation.
+ *
+ * @param parts The array of instruction parameters, which usually includes the operator and related arguments.
+ * @param currentPC The current program counter-value, indicating the address of the instruction being executed.
+ * @param operandStack The virtual machine's operand stack manager, responsible for performing stack operations.
+ * @param localVariableStore The local variable store, typically used to manage method-local variables.
+ * @param callStack The virtual machine's call stack, which keeps track of method invocations.
+ * @return The updated program counter-value, typically {@code currentPC + 1}, unless a control flow instruction is executed.
+ * @throws IllegalStateException if there are not enough operands on the stack to perform the operation.
+ */
+ @Override
+ public int execute(String[] parts, int currentPC, OperandStack operandStack, LocalVariableStore localVariableStore, CallStack callStack) {
+ // Ensure the stack has at least two operands
+ if (operandStack.size() < 2) {
+ throw new IllegalStateException("Not enough operands on the stack for SOR operation.");
+ }
+
+ // Pop the top two operands from the stack
+ final short b = (short) operandStack.pop();
+ final short a = (short) operandStack.pop();
+
+ // Perform the short16 bitwise OR operation and push the result back onto the stack
+ operandStack.push(a | b);
+
+ return currentPC + 1;
+ }
+}
\ No newline at end of file
From de6df61960ce6a34224d845b09e047b940bbe9d9 Mon Sep 17 00:00:00 2001
From: Luke
Date: Sat, 28 Jun 2025 00:18:08 +0800
Subject: [PATCH 12/15] =?UTF-8?q?feat:=20SnowVM=20=E6=94=AF=E6=8C=81=20S?=
=?UTF-8?q?=5FXOR?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../commands/bitwise/short16/SXorCommand.java | 56 +++++++++++++++++++
1 file changed, 56 insertions(+)
create mode 100644 src/main/java/org/jcnc/snow/vm/commands/bitwise/short16/SXorCommand.java
diff --git a/src/main/java/org/jcnc/snow/vm/commands/bitwise/short16/SXorCommand.java b/src/main/java/org/jcnc/snow/vm/commands/bitwise/short16/SXorCommand.java
new file mode 100644
index 0000000..d2919fc
--- /dev/null
+++ b/src/main/java/org/jcnc/snow/vm/commands/bitwise/short16/SXorCommand.java
@@ -0,0 +1,56 @@
+package org.jcnc.snow.vm.commands.bitwise.short16;
+
+import org.jcnc.snow.vm.interfaces.Command;
+import org.jcnc.snow.vm.module.CallStack;
+import org.jcnc.snow.vm.module.LocalVariableStore;
+import org.jcnc.snow.vm.module.OperandStack;
+
+/**
+ * The {@code SXorCommand} class implements the {@link Command} interface and represents the short16 bitwise XOR (`^`) operation command.
+ * This class performs a short16 bitwise XOR operation in the virtual machine by popping the top two values from the stack,
+ * computing their XOR, and then pushing the result back onto the stack. It is a basic operation command within the virtual machine.
+ *
+ *
Operation details:
+ *
+ *
Pops two operands from the virtual machine stack.
+ *
Performs the short16 bitwise XOR (`^`) operation.
+ *
Pushes the result back onto the virtual machine stack.
+ *
+ */
+public class SXorCommand implements Command {
+ /**
+ * Default constructor for creating an instance of {@code SXorCommand}.
+ * This constructor is empty as no specific initialization is required.
+ */
+ public SXorCommand() {
+ // Empty constructor
+ }
+
+ /**
+ * Executes the virtual machine instruction's operation.
+ *
+ * @param parts The array of instruction parameters, which usually includes the operator and related arguments.
+ * @param currentPC The current program counter-value, indicating the address of the instruction being executed.
+ * @param operandStack The virtual machine's operand stack manager, responsible for performing stack operations.
+ * @param localVariableStore The local variable store, typically used to manage method-local variables.
+ * @param callStack The virtual machine's call stack, which keeps track of method invocations.
+ * @return The updated program counter-value, typically {@code currentPC + 1}, unless a control flow instruction is executed.
+ * @throws IllegalStateException if there are not enough operands on the stack to perform the operation.
+ */
+ @Override
+ public int execute(String[] parts, int currentPC, OperandStack operandStack, LocalVariableStore localVariableStore, CallStack callStack) {
+ // Ensure the stack has at least two operands
+ if (operandStack.size() < 2) {
+ throw new IllegalStateException("Not enough operands on the stack for SXOR operation.");
+ }
+
+ // Pop the top two operands from the stack
+ final short b = (short) operandStack.pop();
+ final short a = (short) operandStack.pop();
+
+ // Perform the short16 bitwise XOR operation and push the result back onto the stack
+ operandStack.push(a ^ b);
+
+ return currentPC + 1;
+ }
+}
\ No newline at end of file
From fa91550ad77d64f9ba1a024a79991e2bda9c4ff3 Mon Sep 17 00:00:00 2001
From: Luke
Date: Sat, 28 Jun 2025 00:19:27 +0800
Subject: [PATCH 13/15] =?UTF-8?q?feat:=20SnowVM=20=E6=94=AF=E6=8C=81?=
=?UTF-8?q?=E6=9B=B4=E5=A4=9A=E6=8C=87=E4=BB=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../snow/vm/factories/CommandFactory.java | 331 +++++++++++-------
1 file changed, 196 insertions(+), 135 deletions(-)
diff --git a/src/main/java/org/jcnc/snow/vm/factories/CommandFactory.java b/src/main/java/org/jcnc/snow/vm/factories/CommandFactory.java
index a548fe4..8c36413 100644
--- a/src/main/java/org/jcnc/snow/vm/factories/CommandFactory.java
+++ b/src/main/java/org/jcnc/snow/vm/factories/CommandFactory.java
@@ -1,22 +1,31 @@
package org.jcnc.snow.vm.factories;
-import org.jcnc.snow.vm.commands.arithmetic.conversion.*;
-import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.commands.arithmetic.byte8.*;
+import org.jcnc.snow.vm.commands.arithmetic.conversion.*;
import org.jcnc.snow.vm.commands.arithmetic.double64.*;
import org.jcnc.snow.vm.commands.arithmetic.float32.*;
import org.jcnc.snow.vm.commands.arithmetic.int32.*;
import org.jcnc.snow.vm.commands.arithmetic.long64.*;
import org.jcnc.snow.vm.commands.arithmetic.short16.*;
+import org.jcnc.snow.vm.commands.bitwise.byte8.BAndCommand;
+import org.jcnc.snow.vm.commands.bitwise.byte8.BOrCommand;
+import org.jcnc.snow.vm.commands.bitwise.byte8.BXorCommand;
import org.jcnc.snow.vm.commands.bitwise.int32.IAndCommand;
import org.jcnc.snow.vm.commands.bitwise.int32.IOrCommand;
import org.jcnc.snow.vm.commands.bitwise.int32.IXorCommand;
import org.jcnc.snow.vm.commands.bitwise.long64.LAndCommand;
import org.jcnc.snow.vm.commands.bitwise.long64.LOrCommand;
import org.jcnc.snow.vm.commands.bitwise.long64.LXorCommand;
+import org.jcnc.snow.vm.commands.bitwise.short16.SAndCommand;
+import org.jcnc.snow.vm.commands.bitwise.short16.SOrCommand;
+import org.jcnc.snow.vm.commands.bitwise.short16.SXorCommand;
import org.jcnc.snow.vm.commands.control.all.JumpCommand;
+import org.jcnc.snow.vm.commands.control.byte8.*;
+import org.jcnc.snow.vm.commands.control.double64.*;
+import org.jcnc.snow.vm.commands.control.float32.*;
import org.jcnc.snow.vm.commands.control.int32.*;
import org.jcnc.snow.vm.commands.control.long64.*;
+import org.jcnc.snow.vm.commands.control.short16.*;
import org.jcnc.snow.vm.commands.function.CallCommand;
import org.jcnc.snow.vm.commands.function.RetCommand;
import org.jcnc.snow.vm.commands.memory.all.MovCommand;
@@ -43,6 +52,7 @@ import org.jcnc.snow.vm.commands.stack.long64.LPushCommand;
import org.jcnc.snow.vm.commands.stack.short16.SPushCommand;
import org.jcnc.snow.vm.commands.vm.HaltCommand;
import org.jcnc.snow.vm.engine.VMOpCode;
+import org.jcnc.snow.vm.interfaces.Command;
import java.util.Optional;
@@ -52,160 +62,211 @@ import java.util.Optional;
*
This class uses an array for fast, constant-time access to corresponding command instances.
*/
public class CommandFactory {
- private static final Command[] COMMANDS = new Command[0x04FF];
+ /** Complete command table. 0x0000 – 0x04FF (inclusive). */
+ private static final Command[] COMMANDS = new Command[0x0500];
static {
- // Initialize the array with corresponding commands based on opCode values
- // 1 Arithmetic Operations (1–80)
- // 1.1 int32 (1-10)
- COMMANDS[VMOpCode.I_ADD] = new IAddCommand(); // 1
- COMMANDS[VMOpCode.I_SUB] = new ISubCommand(); // 2
- COMMANDS[VMOpCode.I_MUL] = new IMulCommand(); // 3
- COMMANDS[VMOpCode.I_DIV] = new IDivCommand(); // 4
- COMMANDS[VMOpCode.I_MOD] = new IModCommand(); // 5
- COMMANDS[VMOpCode.I_INC] = new IIncCommand(); // 6
- COMMANDS[VMOpCode.I_NEG] = new INegCommand(); // 7
- // 1.2 long64 (11-20)
- COMMANDS[VMOpCode.L_ADD] = new LAddCommand(); // 11
- COMMANDS[VMOpCode.L_SUB] = new LSubCommand(); // 12
- COMMANDS[VMOpCode.L_MUL] = new LMulCommand(); // 13
- COMMANDS[VMOpCode.L_DIV] = new LDivCommand(); // 14
- COMMANDS[VMOpCode.L_MOD] = new LModCommand(); // 15
- COMMANDS[VMOpCode.L_INC] = new LIncCommand(); // 16
- COMMANDS[VMOpCode.L_NEG] = new LNegCommand(); // 17
- // 1.3 short16 (21-30)
- COMMANDS[VMOpCode.S_ADD] = new SAddCommand(); // 21
- COMMANDS[VMOpCode.S_SUB] = new SSubCommand(); // 22
- COMMANDS[VMOpCode.S_MUL] = new SMulCommand(); // 23
- COMMANDS[VMOpCode.S_DIV] = new SDivCommand(); // 24
- COMMANDS[VMOpCode.S_MOD] = new SModCommand(); // 25
- COMMANDS[VMOpCode.S_INC] = new SIncCommand(); // 26
- COMMANDS[VMOpCode.S_NEG] = new SNegCommand(); // 27
- // 1.4 byte8 (31-40)
- COMMANDS[VMOpCode.B_ADD] = new BAddCommand(); // 31
- COMMANDS[VMOpCode.B_SUB] = new BSubCommand(); // 32
- COMMANDS[VMOpCode.B_MUL] = new BMulCommand(); // 33
- COMMANDS[VMOpCode.B_DIV] = new BDivCommand(); // 34
- COMMANDS[VMOpCode.B_MOD] = new BModCommand(); // 35
- COMMANDS[VMOpCode.B_INC] = new BIncCommand(); // 36
- COMMANDS[VMOpCode.B_NEG] = new BNegCommand(); // 37
- // 1.5 double64 (41-50)
- COMMANDS[VMOpCode.D_ADD] = new DAddCommand(); // 41
- COMMANDS[VMOpCode.D_SUB] = new DSubCommand(); // 42
- COMMANDS[VMOpCode.D_MUL] = new DMulCommand(); // 43
- COMMANDS[VMOpCode.D_DIV] = new DDivCommand(); // 44
- COMMANDS[VMOpCode.D_MOD] = new DModCommand(); // 45
- COMMANDS[VMOpCode.D_INC] = new DIncCommand(); // 46
- COMMANDS[VMOpCode.D_NEG] = new DNegCommand(); // 47
- // 1.6 float32 (51-60)
- COMMANDS[VMOpCode.F_ADD] = new FAddCommand(); // 51
- COMMANDS[VMOpCode.F_SUB] = new FSubCommand(); // 52
- COMMANDS[VMOpCode.F_MUL] = new FMulCommand(); // 53
- COMMANDS[VMOpCode.F_DIV] = new FDivCommand(); // 54
- COMMANDS[VMOpCode.F_MOD] = new FModCommand(); // 55
- COMMANDS[VMOpCode.F_INC] = new FIncCommand(); // 56
- COMMANDS[VMOpCode.F_NEG] = new FNegCommand(); // 57
+ /* =====================================================
+ * 0x0000 – 0x001F BYTE (8-bit signed)
+ * ===================================================== */
+ COMMANDS[VMOpCode.B_ADD] = new BAddCommand();
+ COMMANDS[VMOpCode.B_SUB] = new BSubCommand();
+ COMMANDS[VMOpCode.B_MUL] = new BMulCommand();
+ COMMANDS[VMOpCode.B_DIV] = new BDivCommand();
+ COMMANDS[VMOpCode.B_MOD] = new BModCommand();
+ COMMANDS[VMOpCode.B_NEG] = new BNegCommand();
+ COMMANDS[VMOpCode.B_INC] = new BIncCommand();
- // 1.7 Type Conversion (61-80)
- COMMANDS[VMOpCode.I2L] = new I2LCommand(); // 61 int -> long
- COMMANDS[VMOpCode.I2S] = new I2SCommand(); // 62 int -> short
- COMMANDS[VMOpCode.I2B] = new I2BCommand(); // 63 int -> byte
- COMMANDS[VMOpCode.I2D] = new I2DCommand(); // 64 int -> double
- COMMANDS[VMOpCode.I2F] = new I2FCommand(); // 65 int -> float
+ COMMANDS[VMOpCode.B_AND] = new BAndCommand();
+ COMMANDS[VMOpCode.B_OR] = new BOrCommand();
+ COMMANDS[VMOpCode.B_XOR] = new BXorCommand();
- COMMANDS[VMOpCode.L2I] = new L2ICommand(); // 66 long -> int
- COMMANDS[VMOpCode.L2D] = new L2DCommand(); // 67 long -> double
- COMMANDS[VMOpCode.L2F] = new L2FCommand(); // 68 long -> float
+ COMMANDS[VMOpCode.B_PUSH] = new BPushCommand();
+ COMMANDS[VMOpCode.B_LOAD] = new BLoadCommand();
+ COMMANDS[VMOpCode.B_STORE] = new BStoreCommand();
- COMMANDS[VMOpCode.F2I] = new F2ICommand(); // 69 float -> int
- COMMANDS[VMOpCode.F2L] = new F2LCommand(); // 70 float -> long
- COMMANDS[VMOpCode.F2D] = new F2DCommand(); // 71 float -> double
+ COMMANDS[VMOpCode.B_CE] = new BCECommand();
+ COMMANDS[VMOpCode.B_CNE] = new BCNECommand();
+ COMMANDS[VMOpCode.B_CG] = new BCGCommand();
+ COMMANDS[VMOpCode.B_CGE] = new BCGECommand();
+ COMMANDS[VMOpCode.B_CL] = new BCLCommand();
+ COMMANDS[VMOpCode.B_CLE] = new BCLECommand();
- COMMANDS[VMOpCode.D2I] = new D2ICommand(); // 72 double -> int
- COMMANDS[VMOpCode.D2L] = new D2LCommand(); // 73 double -> long
- COMMANDS[VMOpCode.D2F] = new D2FCommand(); // 74 double -> float
+ /* =====================================================
+ * 0x0020 – 0x003F SHORT (16-bit signed)
+ * ===================================================== */
+ COMMANDS[VMOpCode.S_ADD] = new SAddCommand();
+ COMMANDS[VMOpCode.S_SUB] = new SSubCommand();
+ COMMANDS[VMOpCode.S_MUL] = new SMulCommand();
+ COMMANDS[VMOpCode.S_DIV] = new SDivCommand();
+ COMMANDS[VMOpCode.S_MOD] = new SModCommand();
+ COMMANDS[VMOpCode.S_NEG] = new SNegCommand();
+ COMMANDS[VMOpCode.S_INC] = new SIncCommand();
- COMMANDS[VMOpCode.S2I] = new S2ICommand(); // 75 short -> int
+ COMMANDS[VMOpCode.S_AND] = new SAndCommand();
+ COMMANDS[VMOpCode.S_OR] = new SOrCommand();
+ COMMANDS[VMOpCode.S_XOR] = new SXorCommand();
- COMMANDS[VMOpCode.B2I] = new B2ICommand(); // 76 byte -> int
+ COMMANDS[VMOpCode.S_PUSH] = new SPushCommand();
+ COMMANDS[VMOpCode.S_LOAD] = new SLoadCommand();
+ COMMANDS[VMOpCode.S_STORE] = new SStoreCommand();
- // 1.8 Other (77-80)
+ COMMANDS[VMOpCode.S_CE] = new SCECommand();
+ COMMANDS[VMOpCode.S_CNE] = new SCNECommand();
+ COMMANDS[VMOpCode.S_CG] = new SCGCommand();
+ COMMANDS[VMOpCode.S_CGE] = new SCGECommand();
+ COMMANDS[VMOpCode.S_CL] = new SCLCommand();
+ COMMANDS[VMOpCode.S_CLE] = new SCLECommand();
- // 2. Bitwise Operations (81–90)
- // 2.1 int32 (81-85)
- COMMANDS[VMOpCode.I_AND] = new IAndCommand(); // 81
- COMMANDS[VMOpCode.I_OR] = new IOrCommand(); // 82
- COMMANDS[VMOpCode.I_XOR] = new IXorCommand(); // 83
- // 2.2 Long64 (86-90)
- COMMANDS[VMOpCode.L_AND] = new LAndCommand(); // 86
- COMMANDS[VMOpCode.L_OR] = new LOrCommand(); // 87
- COMMANDS[VMOpCode.L_XOR] = new LXorCommand(); // 88
+ /* =====================================================
+ * 0x0040 – 0x005F INT (32-bit signed)
+ * ===================================================== */
+ COMMANDS[VMOpCode.I_ADD] = new IAddCommand();
+ COMMANDS[VMOpCode.I_SUB] = new ISubCommand();
+ COMMANDS[VMOpCode.I_MUL] = new IMulCommand();
+ COMMANDS[VMOpCode.I_DIV] = new IDivCommand();
+ COMMANDS[VMOpCode.I_MOD] = new IModCommand();
+ COMMANDS[VMOpCode.I_NEG] = new INegCommand();
+ COMMANDS[VMOpCode.I_INC] = new IIncCommand();
- // 3. Control Flow Operations (91–110)
- // 3.1 JUMP (91-91)
- COMMANDS[VMOpCode.JUMP] = new JumpCommand(); // 91
- // 3.2 int32 (92-97)
- COMMANDS[VMOpCode.I_CE] = new ICECommand(); // 92
- COMMANDS[VMOpCode.I_CNE] = new ICNECommand(); // 93
- COMMANDS[VMOpCode.I_CG] = new ICGCommand(); // 94
- COMMANDS[VMOpCode.I_CGE] = new ICGECommand(); // 95
- COMMANDS[VMOpCode.I_CL] = new ICLCommand(); // 96
- COMMANDS[VMOpCode.I_CLE] = new ICLECommand(); // 97
- // 3.3 long64 (98-103)
- COMMANDS[VMOpCode.L_CE] = new LCECommand(); // 98
- COMMANDS[VMOpCode.L_CNE] = new LCNECommand(); // 99
- COMMANDS[VMOpCode.L_CG] = new LCGCommand(); // 100
- COMMANDS[VMOpCode.L_CGE] = new LCGECommand(); // 101
- COMMANDS[VMOpCode.L_CL] = new LCLCommand(); // 102
- COMMANDS[VMOpCode.L_CLE] = new LCLECommand(); // 103
+ COMMANDS[VMOpCode.I_AND] = new IAndCommand();
+ COMMANDS[VMOpCode.I_OR] = new IOrCommand();
+ COMMANDS[VMOpCode.I_XOR] = new IXorCommand();
- // 4. Stack Operations (111–150)
- // 4.1 PUSH (111-120)
- COMMANDS[VMOpCode.I_PUSH] = new IPushCommand(); // 111
- COMMANDS[VMOpCode.L_PUSH] = new LPushCommand(); // 112
- COMMANDS[VMOpCode.S_PUSH] = new SPushCommand(); // 113
- COMMANDS[VMOpCode.B_PUSH] = new BPushCommand(); // 114
- COMMANDS[VMOpCode.D_PUSH] = new DPushCommand(); // 115
- COMMANDS[VMOpCode.F_PUSH] = new FPushCommand(); // 116
- // 4.2 POP (121-125)
- COMMANDS[VMOpCode.POP] = new PopCommand(); // 121
- // 4.3 DUP (126-130)
- COMMANDS[VMOpCode.DUP] = new DupCommand(); // 126
- // 4.4 SWAP (131-135)
- COMMANDS[VMOpCode.SWAP] = new SwapCommand(); // 131
+ COMMANDS[VMOpCode.I_PUSH] = new IPushCommand();
+ COMMANDS[VMOpCode.I_LOAD] = new ILoadCommand();
+ COMMANDS[VMOpCode.I_STORE] = new IStoreCommand();
- // 4.5 Other (136-150)
+ COMMANDS[VMOpCode.I_CE] = new ICECommand();
+ COMMANDS[VMOpCode.I_CNE] = new ICNECommand();
+ COMMANDS[VMOpCode.I_CG] = new ICGCommand();
+ COMMANDS[VMOpCode.I_CGE] = new ICGECommand();
+ COMMANDS[VMOpCode.I_CL] = new ICLCommand();
+ COMMANDS[VMOpCode.I_CLE] = new ICLECommand();
- // 5. Memory Operations (151–200)
- // 5.1 STORE (151-160)
- COMMANDS[VMOpCode.I_STORE] = new IStoreCommand(); // 151
- COMMANDS[VMOpCode.L_STORE] = new LStoreCommand(); // 152
- COMMANDS[VMOpCode.S_STORE] = new SStoreCommand(); // 153
- COMMANDS[VMOpCode.B_STORE] = new BStoreCommand(); // 154
- COMMANDS[VMOpCode.D_STORE] = new DStoreCommand(); // 155
- COMMANDS[VMOpCode.F_STORE] = new FStoreCommand(); // 156
- // 5.2 LOAD (161-170)
- COMMANDS[VMOpCode.I_LOAD] = new ILoadCommand(); // 161
- COMMANDS[VMOpCode.L_LOAD] = new LLoadCommand(); // 162
- COMMANDS[VMOpCode.S_LOAD] = new SLoadCommand(); // 163
- COMMANDS[VMOpCode.B_LOAD] = new BLoadCommand(); // 164
- COMMANDS[VMOpCode.D_LOAD] = new DLoadCommand(); // 165
- COMMANDS[VMOpCode.F_LOAD] = new FLoadCommand(); // 166
+ /* =====================================================
+ * 0x0060 – 0x007F LONG (64-bit signed)
+ * ===================================================== */
+ COMMANDS[VMOpCode.L_ADD] = new LAddCommand();
+ COMMANDS[VMOpCode.L_SUB] = new LSubCommand();
+ COMMANDS[VMOpCode.L_MUL] = new LMulCommand();
+ COMMANDS[VMOpCode.L_DIV] = new LDivCommand();
+ COMMANDS[VMOpCode.L_MOD] = new LModCommand();
+ COMMANDS[VMOpCode.L_NEG] = new LNegCommand();
+ COMMANDS[VMOpCode.L_INC] = new LIncCommand();
- // 5.3 MOV (171-176)
- COMMANDS[VMOpCode.MOV] = new MovCommand(); // 171
+ COMMANDS[VMOpCode.L_AND] = new LAndCommand();
+ COMMANDS[VMOpCode.L_OR] = new LOrCommand();
+ COMMANDS[VMOpCode.L_XOR] = new LXorCommand();
- // 5.4 Other (176-200)
+ COMMANDS[VMOpCode.L_PUSH] = new LPushCommand();
+ COMMANDS[VMOpCode.L_LOAD] = new LLoadCommand();
+ COMMANDS[VMOpCode.L_STORE] = new LStoreCommand();
- // 6. Function Operations (201–205)
- COMMANDS[VMOpCode.CALL] = new CallCommand(); // 201
- COMMANDS[VMOpCode.RET] = new RetCommand(); // 202
+ COMMANDS[VMOpCode.L_CE] = new LCECommand();
+ COMMANDS[VMOpCode.L_CNE] = new LCNECommand();
+ COMMANDS[VMOpCode.L_CG] = new LCGCommand();
+ COMMANDS[VMOpCode.L_CGE] = new LCGECommand();
+ COMMANDS[VMOpCode.L_CL] = new LCLCommand();
+ COMMANDS[VMOpCode.L_CLE] = new LCLECommand();
- // 7. Virtual Machine Operations(241-255)
- COMMANDS[VMOpCode.HALT] = new HaltCommand(); // 255
+ /* =====================================================
+ * 0x0080 – 0x009F FLOAT (32-bit signed)
+ * ===================================================== */
+ COMMANDS[VMOpCode.F_ADD] = new FAddCommand();
+ COMMANDS[VMOpCode.F_SUB] = new FSubCommand();
+ COMMANDS[VMOpCode.F_MUL] = new FMulCommand();
+ COMMANDS[VMOpCode.F_DIV] = new FDivCommand();
+ COMMANDS[VMOpCode.F_MOD] = new FModCommand();
+ COMMANDS[VMOpCode.F_NEG] = new FNegCommand();
+ COMMANDS[VMOpCode.F_INC] = new FIncCommand();
+
+ COMMANDS[VMOpCode.F_PUSH] = new FPushCommand();
+ COMMANDS[VMOpCode.F_LOAD] = new FLoadCommand();
+ COMMANDS[VMOpCode.F_STORE] = new FStoreCommand();
+
+ COMMANDS[VMOpCode.F_CE] = new FCECommand();
+ COMMANDS[VMOpCode.F_CNE] = new FCNECommand();
+ COMMANDS[VMOpCode.F_CG] = new FCGCommand();
+ COMMANDS[VMOpCode.F_CGE] = new FCGECommand();
+ COMMANDS[VMOpCode.F_CL] = new FCLCommand();
+ COMMANDS[VMOpCode.F_CLE] = new FCLECommand();
+
+ /* =====================================================
+ * 0x00A0 – 0x00BF DOUBLE (64-bit IEEE-754)
+ * ===================================================== */
+ COMMANDS[VMOpCode.D_ADD] = new DAddCommand();
+ COMMANDS[VMOpCode.D_SUB] = new DSubCommand();
+ COMMANDS[VMOpCode.D_MUL] = new DMulCommand();
+ COMMANDS[VMOpCode.D_DIV] = new DDivCommand();
+ COMMANDS[VMOpCode.D_MOD] = new DModCommand();
+ COMMANDS[VMOpCode.D_NEG] = new DNegCommand();
+ COMMANDS[VMOpCode.D_INC] = new DIncCommand();
+
+ COMMANDS[VMOpCode.D_PUSH] = new DPushCommand();
+ COMMANDS[VMOpCode.D_LOAD] = new DLoadCommand();
+ COMMANDS[VMOpCode.D_STORE] = new DStoreCommand();
+
+ COMMANDS[VMOpCode.D_CE] = new DCECommand();
+ COMMANDS[VMOpCode.D_CNE] = new DCNECommand();
+ COMMANDS[VMOpCode.D_CG] = new DCGCommand();
+ COMMANDS[VMOpCode.D_CGE] = new DCGECommand();
+ COMMANDS[VMOpCode.D_CL] = new DCLCommand();
+ COMMANDS[VMOpCode.D_CLE] = new DCLECommand();
+
+ /* =====================================================
+ * 0x00C0 – 0x00DF TYPE CONVERSIONS
+ * ===================================================== */
+ COMMANDS[VMOpCode.I2L] = new I2LCommand();
+ COMMANDS[VMOpCode.I2S] = new I2SCommand();
+ COMMANDS[VMOpCode.I2B] = new I2BCommand();
+ COMMANDS[VMOpCode.I2D] = new I2DCommand();
+ COMMANDS[VMOpCode.I2F] = new I2FCommand();
+
+ COMMANDS[VMOpCode.L2I] = new L2ICommand();
+ COMMANDS[VMOpCode.L2D] = new L2DCommand();
+ COMMANDS[VMOpCode.L2F] = new L2FCommand();
+
+ COMMANDS[VMOpCode.F2I] = new F2ICommand();
+ COMMANDS[VMOpCode.F2L] = new F2LCommand();
+ COMMANDS[VMOpCode.F2D] = new F2DCommand();
+
+ COMMANDS[VMOpCode.D2I] = new D2ICommand();
+ COMMANDS[VMOpCode.D2L] = new D2LCommand();
+ COMMANDS[VMOpCode.D2F] = new D2FCommand();
+
+ COMMANDS[VMOpCode.S2I] = new S2ICommand();
+ COMMANDS[VMOpCode.B2I] = new B2ICommand();
+
+ /* =====================================================
+ * 0x0100 – 0x01FF GENERIC STACK OPS
+ * ===================================================== */
+ COMMANDS[VMOpCode.POP] = new PopCommand();
+ COMMANDS[VMOpCode.DUP] = new DupCommand();
+ COMMANDS[VMOpCode.SWAP] = new SwapCommand();
+
+ /* =====================================================
+ * 0x0200 – 0x02FF CONTROL FLOW | FUNCTION CALLS
+ * ===================================================== */
+ COMMANDS[VMOpCode.JUMP] = new JumpCommand();
+ COMMANDS[VMOpCode.CALL] = new CallCommand();
+ COMMANDS[VMOpCode.RET] = new RetCommand();
+
+ /* =====================================================
+ * 0x0300 – 0x03FF MEMORY / REGISTER MOVE
+ * ===================================================== */
+ COMMANDS[VMOpCode.MOV] = new MovCommand();
+
+ /* =====================================================
+ * 0x0400 – 0x04FF SYSTEM / DEBUG
+ * ===================================================== */
+ COMMANDS[VMOpCode.HALT] = new HaltCommand();
+// COMMANDS[VMOpCode.SYSCALL] = new SyscallCommand();
+// COMMANDS[VMOpCode.DEBUG_TRAP] = new DebugTrapCommand();
}
+
/**
* Default constructor for creating an instance of CommandFactory.
* This constructor is empty as no specific initialization is required.
From 5d621e06b524390eb065cb4bc0b5c3bbf11ad752 Mon Sep 17 00:00:00 2001
From: zhangxun <1958638841@qq.com>
Date: Sat, 28 Jun 2025 10:43:03 +0800
Subject: [PATCH 14/15] =?UTF-8?q?fix:=20byte=E3=80=81short=20=E4=BD=8D?=
=?UTF-8?q?=E8=BF=90=E7=AE=97=E8=BD=AC=E4=B8=BA=20int=20=E7=9A=84=E9=97=AE?=
=?UTF-8?q?=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../org/jcnc/snow/vm/commands/bitwise/byte8/BAndCommand.java | 2 +-
.../org/jcnc/snow/vm/commands/bitwise/byte8/BOrCommand.java | 2 +-
.../org/jcnc/snow/vm/commands/bitwise/byte8/BXorCommand.java | 2 +-
.../org/jcnc/snow/vm/commands/bitwise/short16/SAndCommand.java | 2 +-
.../org/jcnc/snow/vm/commands/bitwise/short16/SOrCommand.java | 2 +-
.../org/jcnc/snow/vm/commands/bitwise/short16/SXorCommand.java | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/main/java/org/jcnc/snow/vm/commands/bitwise/byte8/BAndCommand.java b/src/main/java/org/jcnc/snow/vm/commands/bitwise/byte8/BAndCommand.java
index 71ea581..574020c 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/bitwise/byte8/BAndCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/bitwise/byte8/BAndCommand.java
@@ -49,7 +49,7 @@ public class BAndCommand implements Command {
final byte a = (byte) operandStack.pop();
// Perform the byte8 bitwise AND operation and push the result back onto the stack
- operandStack.push(a & b);
+ operandStack.push((byte)(a & b));
return currentPC + 1;
}
diff --git a/src/main/java/org/jcnc/snow/vm/commands/bitwise/byte8/BOrCommand.java b/src/main/java/org/jcnc/snow/vm/commands/bitwise/byte8/BOrCommand.java
index 4902ae7..4331638 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/bitwise/byte8/BOrCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/bitwise/byte8/BOrCommand.java
@@ -49,7 +49,7 @@ public class BOrCommand implements Command {
final byte a = (byte) operandStack.pop();
// Perform the byte8 bitwise OR operation and push the result back onto the stack
- operandStack.push(a | b);
+ operandStack.push((byte)(a | b));
return currentPC + 1;
}
diff --git a/src/main/java/org/jcnc/snow/vm/commands/bitwise/byte8/BXorCommand.java b/src/main/java/org/jcnc/snow/vm/commands/bitwise/byte8/BXorCommand.java
index f597485..ffe55ab 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/bitwise/byte8/BXorCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/bitwise/byte8/BXorCommand.java
@@ -49,7 +49,7 @@ public class BXorCommand implements Command {
final byte a = (byte) operandStack.pop();
// Perform the byte8 bitwise XOR operation and push the result back onto the stack
- operandStack.push(a ^ b);
+ operandStack.push((byte)(a ^ b));
return currentPC + 1;
}
diff --git a/src/main/java/org/jcnc/snow/vm/commands/bitwise/short16/SAndCommand.java b/src/main/java/org/jcnc/snow/vm/commands/bitwise/short16/SAndCommand.java
index ea308f5..36454a8 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/bitwise/short16/SAndCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/bitwise/short16/SAndCommand.java
@@ -49,7 +49,7 @@ public class SAndCommand implements Command {
final short a = (short) operandStack.pop();
// Perform the short16 bitwise AND operation and push the result back onto the stack
- operandStack.push(a & b);
+ operandStack.push((short)(a & b));
return currentPC + 1;
}
diff --git a/src/main/java/org/jcnc/snow/vm/commands/bitwise/short16/SOrCommand.java b/src/main/java/org/jcnc/snow/vm/commands/bitwise/short16/SOrCommand.java
index 26c1331..35deeba 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/bitwise/short16/SOrCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/bitwise/short16/SOrCommand.java
@@ -49,7 +49,7 @@ public class SOrCommand implements Command {
final short a = (short) operandStack.pop();
// Perform the short16 bitwise OR operation and push the result back onto the stack
- operandStack.push(a | b);
+ operandStack.push((short)(a | b));
return currentPC + 1;
}
diff --git a/src/main/java/org/jcnc/snow/vm/commands/bitwise/short16/SXorCommand.java b/src/main/java/org/jcnc/snow/vm/commands/bitwise/short16/SXorCommand.java
index d2919fc..3da8267 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/bitwise/short16/SXorCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/bitwise/short16/SXorCommand.java
@@ -49,7 +49,7 @@ public class SXorCommand implements Command {
final short a = (short) operandStack.pop();
// Perform the short16 bitwise XOR operation and push the result back onto the stack
- operandStack.push(a ^ b);
+ operandStack.push((short)(a ^ b));
return currentPC + 1;
}
From 8ca3185bc7204722fe88b88153c8b063df9bdb76 Mon Sep 17 00:00:00 2001
From: Luke
Date: Sat, 28 Jun 2025 12:23:08 +0800
Subject: [PATCH 15/15] =?UTF-8?q?refactor:=20=E9=87=8D=E6=9E=84=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81=E7=BB=93=E6=9E=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../control}/CallCommand.java | 2 +-
.../all => flow/control}/JumpCommand.java | 2 +-
.../control}/RetCommand.java | 2 +-
.../all => register/control}/MovCommand.java | 2 +-
.../stack/{all => control}/DupCommand.java | 2 +-
.../stack/{all => control}/PopCommand.java | 2 +-
.../stack/{all => control}/SwapCommand.java | 2 +-
.../{vm => system/control}/HaltCommand.java | 2 +-
.../control}/byte8/BAddCommand.java | 2 +-
.../control}/byte8/BAndCommand.java | 2 +-
.../{ => type}/control/byte8/BCECommand.java | 2 +-
.../{ => type}/control/byte8/BCGCommand.java | 2 +-
.../{ => type}/control/byte8/BCGECommand.java | 2 +-
.../{ => type}/control/byte8/BCLCommand.java | 2 +-
.../{ => type}/control/byte8/BCLECommand.java | 2 +-
.../{ => type}/control/byte8/BCNECommand.java | 2 +-
.../control}/byte8/BDivCommand.java | 2 +-
.../control}/byte8/BIncCommand.java | 2 +-
.../control}/byte8/BLoadCommand.java | 2 +-
.../control}/byte8/BModCommand.java | 2 +-
.../control}/byte8/BMulCommand.java | 2 +-
.../control}/byte8/BNegCommand.java | 2 +-
.../control}/byte8/BOrCommand.java | 2 +-
.../control}/byte8/BPushCommand.java | 2 +-
.../control}/byte8/BStoreCommand.java | 2 +-
.../control}/byte8/BSubCommand.java | 2 +-
.../control}/byte8/BXorCommand.java | 2 +-
.../control}/double64/DAddCommand.java | 2 +-
.../control/double64/DCECommand.java | 2 +-
.../control/double64/DCGCommand.java | 2 +-
.../control/double64/DCGECommand.java | 2 +-
.../control/double64/DCLCommand.java | 2 +-
.../control/double64/DCLECommand.java | 2 +-
.../control/double64/DCNECommand.java | 2 +-
.../control}/double64/DDivCommand.java | 2 +-
.../control}/double64/DIncCommand.java | 2 +-
.../control}/double64/DLoadCommand.java | 2 +-
.../control}/double64/DModCommand.java | 2 +-
.../control}/double64/DMulCommand.java | 2 +-
.../control}/double64/DNegCommand.java | 2 +-
.../control}/double64/DPushCommand.java | 2 +-
.../control}/double64/DStoreCommand.java | 2 +-
.../control}/double64/DSubCommand.java | 2 +-
.../control}/float32/FAddCommand.java | 2 +-
.../control/float32/FCECommand.java | 2 +-
.../control/float32/FCGCommand.java | 2 +-
.../control/float32/FCGECommand.java | 2 +-
.../control/float32/FCLCommand.java | 2 +-
.../control/float32/FCLECommand.java | 2 +-
.../control/float32/FCNECommand.java | 2 +-
.../control}/float32/FDivCommand.java | 2 +-
.../control}/float32/FIncCommand.java | 2 +-
.../control}/float32/FLoadCommand.java | 2 +-
.../control}/float32/FModCommand.java | 2 +-
.../control}/float32/FMulCommand.java | 2 +-
.../control}/float32/FNegCommand.java | 2 +-
.../control}/float32/FPushCommand.java | 2 +-
.../control}/float32/FStoreCommand.java | 2 +-
.../control}/float32/FSubCommand.java | 2 +-
.../control}/int32/IAddCommand.java | 2 +-
.../control}/int32/IAndCommand.java | 2 +-
.../{ => type}/control/int32/ICECommand.java | 2 +-
.../{ => type}/control/int32/ICGCommand.java | 2 +-
.../{ => type}/control/int32/ICGECommand.java | 2 +-
.../{ => type}/control/int32/ICLCommand.java | 2 +-
.../{ => type}/control/int32/ICLECommand.java | 2 +-
.../{ => type}/control/int32/ICNECommand.java | 2 +-
.../control}/int32/IDivCommand.java | 2 +-
.../control}/int32/IIncCommand.java | 2 +-
.../control}/int32/ILoadCommand.java | 2 +-
.../control}/int32/IModCommand.java | 2 +-
.../control}/int32/IMulCommand.java | 2 +-
.../control}/int32/INegCommand.java | 2 +-
.../control}/int32/IOrCommand.java | 2 +-
.../control}/int32/IPushCommand.java | 2 +-
.../control}/int32/IStoreCommand.java | 2 +-
.../control}/int32/ISubCommand.java | 2 +-
.../control}/int32/IXorCommand.java | 2 +-
.../control}/long64/LAddCommand.java | 2 +-
.../control}/long64/LAndCommand.java | 2 +-
.../{ => type}/control/long64/LCECommand.java | 2 +-
.../{ => type}/control/long64/LCGCommand.java | 2 +-
.../control/long64/LCGECommand.java | 2 +-
.../{ => type}/control/long64/LCLCommand.java | 2 +-
.../control/long64/LCLECommand.java | 2 +-
.../control/long64/LCNECommand.java | 2 +-
.../control}/long64/LDivCommand.java | 2 +-
.../control}/long64/LIncCommand.java | 2 +-
.../control}/long64/LLoadCommand.java | 2 +-
.../control}/long64/LModCommand.java | 2 +-
.../control}/long64/LMulCommand.java | 2 +-
.../control}/long64/LNegCommand.java | 2 +-
.../control}/long64/LOrCommand.java | 2 +-
.../control}/long64/LPushCommand.java | 2 +-
.../control}/long64/LStoreCommand.java | 2 +-
.../control}/long64/LSubCommand.java | 2 +-
.../control}/long64/LXorCommand.java | 2 +-
.../control}/short16/SAddCommand.java | 2 +-
.../control}/short16/SAndCommand.java | 2 +-
.../control/short16/SCECommand.java | 2 +-
.../control/short16/SCGCommand.java | 2 +-
.../control/short16/SCGECommand.java | 2 +-
.../control/short16/SCLCommand.java | 2 +-
.../control/short16/SCLECommand.java | 2 +-
.../control/short16/SCNECommand.java | 2 +-
.../control}/short16/SDivCommand.java | 2 +-
.../control}/short16/SIncCommand.java | 2 +-
.../control}/short16/SLoadCommand.java | 2 +-
.../control}/short16/SModCommand.java | 2 +-
.../control}/short16/SMulCommand.java | 2 +-
.../control}/short16/SNegCommand.java | 2 +-
.../control}/short16/SOrCommand.java | 2 +-
.../control}/short16/SPushCommand.java | 2 +-
.../control}/short16/SStoreCommand.java | 2 +-
.../control}/short16/SSubCommand.java | 2 +-
.../control}/short16/SXorCommand.java | 2 +-
.../conversion/B2ICommand.java | 2 +-
.../conversion/D2FCommand.java | 2 +-
.../conversion/D2ICommand.java | 2 +-
.../conversion/D2LCommand.java | 2 +-
.../conversion/F2DCommand.java | 2 +-
.../conversion/F2ICommand.java | 2 +-
.../conversion/F2LCommand.java | 2 +-
.../conversion/I2BCommand.java | 2 +-
.../conversion/I2DCommand.java | 2 +-
.../conversion/I2FCommand.java | 2 +-
.../conversion/I2LCommand.java | 2 +-
.../conversion/I2SCommand.java | 2 +-
.../conversion/L2DCommand.java | 2 +-
.../conversion/L2FCommand.java | 2 +-
.../conversion/L2ICommand.java | 2 +-
.../conversion/S2ICommand.java | 2 +-
.../org/jcnc/snow/vm/engine/VMOpCode.java | 82 ++++-----
.../snow/vm/factories/CommandFactory.java | 155 ++++++++----------
134 files changed, 244 insertions(+), 257 deletions(-)
rename src/main/java/org/jcnc/snow/vm/commands/{function => flow/control}/CallCommand.java (97%)
rename src/main/java/org/jcnc/snow/vm/commands/{control/all => flow/control}/JumpCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{function => flow/control}/RetCommand.java (97%)
rename src/main/java/org/jcnc/snow/vm/commands/{memory/all => register/control}/MovCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/stack/{all => control}/DupCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/stack/{all => control}/PopCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/stack/{all => control}/SwapCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{vm => system/control}/HaltCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/byte8/BAddCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{bitwise => type/control}/byte8/BAndCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/byte8/BCECommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/byte8/BCGCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/byte8/BCGECommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/byte8/BCLCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/byte8/BCLECommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/byte8/BCNECommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/byte8/BDivCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/byte8/BIncCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{memory => type/control}/byte8/BLoadCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/byte8/BModCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/byte8/BMulCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/byte8/BNegCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{bitwise => type/control}/byte8/BOrCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{stack => type/control}/byte8/BPushCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{memory => type/control}/byte8/BStoreCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/byte8/BSubCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{bitwise => type/control}/byte8/BXorCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/double64/DAddCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/double64/DCECommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/double64/DCGCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/double64/DCGECommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/double64/DCLCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/double64/DCLECommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/double64/DCNECommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/double64/DDivCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/double64/DIncCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{memory => type/control}/double64/DLoadCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/double64/DModCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/double64/DMulCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/double64/DNegCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{stack => type/control}/double64/DPushCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{memory => type/control}/double64/DStoreCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/double64/DSubCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/float32/FAddCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/float32/FCECommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/float32/FCGCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/float32/FCGECommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/float32/FCLCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/float32/FCLECommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/float32/FCNECommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/float32/FDivCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/float32/FIncCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{memory => type/control}/float32/FLoadCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/float32/FModCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/float32/FMulCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/float32/FNegCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{stack => type/control}/float32/FPushCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{memory => type/control}/float32/FStoreCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/float32/FSubCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/int32/IAddCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{bitwise => type/control}/int32/IAndCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/int32/ICECommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/int32/ICGCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/int32/ICGECommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/int32/ICLCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/int32/ICLECommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/int32/ICNECommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/int32/IDivCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/int32/IIncCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{memory => type/control}/int32/ILoadCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/int32/IModCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/int32/IMulCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/int32/INegCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{bitwise => type/control}/int32/IOrCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{stack => type/control}/int32/IPushCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{memory => type/control}/int32/IStoreCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/int32/ISubCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{bitwise => type/control}/int32/IXorCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/long64/LAddCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{bitwise => type/control}/long64/LAndCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/long64/LCECommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/long64/LCGCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/long64/LCGECommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/long64/LCLCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/long64/LCLECommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/long64/LCNECommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/long64/LDivCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/long64/LIncCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{memory => type/control}/long64/LLoadCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/long64/LModCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/long64/LMulCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/long64/LNegCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{bitwise => type/control}/long64/LOrCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{stack => type/control}/long64/LPushCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{memory => type/control}/long64/LStoreCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/long64/LSubCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{bitwise => type/control}/long64/LXorCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/short16/SAddCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{bitwise => type/control}/short16/SAndCommand.java (97%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/short16/SCECommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/short16/SCGCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/short16/SCGECommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/short16/SCLCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/short16/SCLECommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{ => type}/control/short16/SCNECommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/short16/SDivCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/short16/SIncCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{memory => type/control}/short16/SLoadCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/short16/SModCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/short16/SMulCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/short16/SNegCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{bitwise => type/control}/short16/SOrCommand.java (97%)
rename src/main/java/org/jcnc/snow/vm/commands/{stack => type/control}/short16/SPushCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{memory => type/control}/short16/SStoreCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type/control}/short16/SSubCommand.java (98%)
rename src/main/java/org/jcnc/snow/vm/commands/{bitwise => type/control}/short16/SXorCommand.java (97%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type}/conversion/B2ICommand.java (97%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type}/conversion/D2FCommand.java (97%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type}/conversion/D2ICommand.java (97%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type}/conversion/D2LCommand.java (97%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type}/conversion/F2DCommand.java (97%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type}/conversion/F2ICommand.java (97%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type}/conversion/F2LCommand.java (97%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type}/conversion/I2BCommand.java (97%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type}/conversion/I2DCommand.java (97%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type}/conversion/I2FCommand.java (97%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type}/conversion/I2LCommand.java (97%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type}/conversion/I2SCommand.java (97%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type}/conversion/L2DCommand.java (97%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type}/conversion/L2FCommand.java (97%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type}/conversion/L2ICommand.java (97%)
rename src/main/java/org/jcnc/snow/vm/commands/{arithmetic => type}/conversion/S2ICommand.java (97%)
diff --git a/src/main/java/org/jcnc/snow/vm/commands/function/CallCommand.java b/src/main/java/org/jcnc/snow/vm/commands/flow/control/CallCommand.java
similarity index 97%
rename from src/main/java/org/jcnc/snow/vm/commands/function/CallCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/flow/control/CallCommand.java
index a384570..befbfea 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/function/CallCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/flow/control/CallCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.function;
+package org.jcnc.snow.vm.commands.flow.control;
import org.jcnc.snow.vm.engine.VMMode;
import org.jcnc.snow.vm.interfaces.Command;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/all/JumpCommand.java b/src/main/java/org/jcnc/snow/vm/commands/flow/control/JumpCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/all/JumpCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/flow/control/JumpCommand.java
index 63418da..7f53890 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/all/JumpCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/flow/control/JumpCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.all;
+package org.jcnc.snow.vm.commands.flow.control;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.utils.LoggingUtils;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/function/RetCommand.java b/src/main/java/org/jcnc/snow/vm/commands/flow/control/RetCommand.java
similarity index 97%
rename from src/main/java/org/jcnc/snow/vm/commands/function/RetCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/flow/control/RetCommand.java
index af37032..f2190fd 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/function/RetCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/flow/control/RetCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.function;
+package org.jcnc.snow.vm.commands.flow.control;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.*;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/memory/all/MovCommand.java b/src/main/java/org/jcnc/snow/vm/commands/register/control/MovCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/memory/all/MovCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/register/control/MovCommand.java
index dd0b11b..2c1e62b 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/memory/all/MovCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/register/control/MovCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.memory.all;
+package org.jcnc.snow.vm.commands.register.control;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/stack/all/DupCommand.java b/src/main/java/org/jcnc/snow/vm/commands/stack/control/DupCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/stack/all/DupCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/stack/control/DupCommand.java
index 8d0d1f8..4a45c8a 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/stack/all/DupCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/stack/control/DupCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.stack.all;
+package org.jcnc.snow.vm.commands.stack.control;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/stack/all/PopCommand.java b/src/main/java/org/jcnc/snow/vm/commands/stack/control/PopCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/stack/all/PopCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/stack/control/PopCommand.java
index fe00f9d..fbc89e7 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/stack/all/PopCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/stack/control/PopCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.stack.all;
+package org.jcnc.snow.vm.commands.stack.control;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/stack/all/SwapCommand.java b/src/main/java/org/jcnc/snow/vm/commands/stack/control/SwapCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/stack/all/SwapCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/stack/control/SwapCommand.java
index 1f27318..5d89bea 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/stack/all/SwapCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/stack/control/SwapCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.stack.all;
+package org.jcnc.snow.vm.commands.stack.control;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/vm/HaltCommand.java b/src/main/java/org/jcnc/snow/vm/commands/system/control/HaltCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/vm/HaltCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/system/control/HaltCommand.java
index 19e4d5d..06a5da4 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/vm/HaltCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/system/control/HaltCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.vm;
+package org.jcnc.snow.vm.commands.system.control;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.utils.LoggingUtils;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/byte8/BAddCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BAddCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/byte8/BAddCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BAddCommand.java
index f2a42ca..7da2644 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/byte8/BAddCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BAddCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.byte8;
+package org.jcnc.snow.vm.commands.type.control.byte8;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/bitwise/byte8/BAndCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BAndCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/bitwise/byte8/BAndCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BAndCommand.java
index 574020c..8eb94c9 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/bitwise/byte8/BAndCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BAndCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.bitwise.byte8;
+package org.jcnc.snow.vm.commands.type.control.byte8;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/byte8/BCECommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BCECommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/byte8/BCECommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BCECommand.java
index f7ccc5b..d60839f 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/byte8/BCECommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BCECommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.byte8;
+package org.jcnc.snow.vm.commands.type.control.byte8;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/byte8/BCGCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BCGCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/byte8/BCGCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BCGCommand.java
index 92fb765..bf12f76 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/byte8/BCGCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BCGCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.byte8;
+package org.jcnc.snow.vm.commands.type.control.byte8;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/byte8/BCGECommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BCGECommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/byte8/BCGECommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BCGECommand.java
index 16f468e..6173eae 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/byte8/BCGECommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BCGECommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.byte8;
+package org.jcnc.snow.vm.commands.type.control.byte8;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/byte8/BCLCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BCLCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/byte8/BCLCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BCLCommand.java
index 1753865..a7cf1cb 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/byte8/BCLCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BCLCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.byte8;
+package org.jcnc.snow.vm.commands.type.control.byte8;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/byte8/BCLECommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BCLECommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/byte8/BCLECommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BCLECommand.java
index bb90118..e4a3aa5 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/byte8/BCLECommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BCLECommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.byte8;
+package org.jcnc.snow.vm.commands.type.control.byte8;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/byte8/BCNECommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BCNECommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/byte8/BCNECommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BCNECommand.java
index a474570..497b6c4 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/byte8/BCNECommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BCNECommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.byte8;
+package org.jcnc.snow.vm.commands.type.control.byte8;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/byte8/BDivCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BDivCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/byte8/BDivCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BDivCommand.java
index 582951b..b71abb7 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/byte8/BDivCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BDivCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.byte8;
+package org.jcnc.snow.vm.commands.type.control.byte8;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/byte8/BIncCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BIncCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/byte8/BIncCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BIncCommand.java
index 8d2dd72..c7fa3e4 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/byte8/BIncCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BIncCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.byte8;
+package org.jcnc.snow.vm.commands.type.control.byte8;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/memory/byte8/BLoadCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BLoadCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/memory/byte8/BLoadCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BLoadCommand.java
index c42e645..bf93d12 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/memory/byte8/BLoadCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BLoadCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.memory.byte8;
+package org.jcnc.snow.vm.commands.type.control.byte8;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/byte8/BModCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BModCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/byte8/BModCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BModCommand.java
index dd5892f..9a4747b 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/byte8/BModCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BModCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.byte8;
+package org.jcnc.snow.vm.commands.type.control.byte8;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/byte8/BMulCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BMulCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/byte8/BMulCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BMulCommand.java
index 0c6d9c3..8f0bc7d 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/byte8/BMulCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BMulCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.byte8;
+package org.jcnc.snow.vm.commands.type.control.byte8;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/byte8/BNegCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BNegCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/byte8/BNegCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BNegCommand.java
index d6b67e2..5f41f27 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/byte8/BNegCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BNegCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.byte8;
+package org.jcnc.snow.vm.commands.type.control.byte8;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/bitwise/byte8/BOrCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BOrCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/bitwise/byte8/BOrCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BOrCommand.java
index 4331638..e29aaae 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/bitwise/byte8/BOrCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BOrCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.bitwise.byte8;
+package org.jcnc.snow.vm.commands.type.control.byte8;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/stack/byte8/BPushCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BPushCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/stack/byte8/BPushCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BPushCommand.java
index 6953ff8..c2740fe 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/stack/byte8/BPushCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BPushCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.stack.byte8;
+package org.jcnc.snow.vm.commands.type.control.byte8;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/memory/byte8/BStoreCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BStoreCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/memory/byte8/BStoreCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BStoreCommand.java
index 47211d1..b0cabfb 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/memory/byte8/BStoreCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BStoreCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.memory.byte8;
+package org.jcnc.snow.vm.commands.type.control.byte8;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/byte8/BSubCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BSubCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/byte8/BSubCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BSubCommand.java
index 4c7957e..7f3f22e 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/byte8/BSubCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BSubCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.byte8;
+package org.jcnc.snow.vm.commands.type.control.byte8;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/bitwise/byte8/BXorCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BXorCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/bitwise/byte8/BXorCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BXorCommand.java
index ffe55ab..478edb9 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/bitwise/byte8/BXorCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/byte8/BXorCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.bitwise.byte8;
+package org.jcnc.snow.vm.commands.type.control.byte8;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/double64/DAddCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DAddCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/double64/DAddCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DAddCommand.java
index 76d8b69..470689d 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/double64/DAddCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DAddCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.double64;
+package org.jcnc.snow.vm.commands.type.control.double64;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/double64/DCECommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DCECommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/double64/DCECommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DCECommand.java
index 0153626..a29d018 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/double64/DCECommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DCECommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.double64;
+package org.jcnc.snow.vm.commands.type.control.double64;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/double64/DCGCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DCGCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/double64/DCGCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DCGCommand.java
index fd48bff..6a35ce6 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/double64/DCGCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DCGCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.double64;
+package org.jcnc.snow.vm.commands.type.control.double64;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/double64/DCGECommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DCGECommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/double64/DCGECommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DCGECommand.java
index 03dad61..c965492 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/double64/DCGECommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DCGECommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.double64;
+package org.jcnc.snow.vm.commands.type.control.double64;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/double64/DCLCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DCLCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/double64/DCLCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DCLCommand.java
index 344df6c..97167de 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/double64/DCLCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DCLCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.double64;
+package org.jcnc.snow.vm.commands.type.control.double64;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/double64/DCLECommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DCLECommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/double64/DCLECommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DCLECommand.java
index 3d87f1a..b43b24a 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/double64/DCLECommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DCLECommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.double64;
+package org.jcnc.snow.vm.commands.type.control.double64;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/double64/DCNECommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DCNECommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/double64/DCNECommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DCNECommand.java
index 1da0475..ff9686e 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/double64/DCNECommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DCNECommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.double64;
+package org.jcnc.snow.vm.commands.type.control.double64;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/double64/DDivCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DDivCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/double64/DDivCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DDivCommand.java
index 1a70f9a..caeb802 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/double64/DDivCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DDivCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.double64;
+package org.jcnc.snow.vm.commands.type.control.double64;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/double64/DIncCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DIncCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/double64/DIncCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DIncCommand.java
index 3f9c672..9af16d5 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/double64/DIncCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DIncCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.double64;
+package org.jcnc.snow.vm.commands.type.control.double64;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/memory/double64/DLoadCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DLoadCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/memory/double64/DLoadCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DLoadCommand.java
index 9d34e21..bd240d9 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/memory/double64/DLoadCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DLoadCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.memory.double64;
+package org.jcnc.snow.vm.commands.type.control.double64;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/double64/DModCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DModCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/double64/DModCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DModCommand.java
index df8cbd7..a29df4c 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/double64/DModCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DModCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.double64;
+package org.jcnc.snow.vm.commands.type.control.double64;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/double64/DMulCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DMulCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/double64/DMulCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DMulCommand.java
index d5adb01..91957c0 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/double64/DMulCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DMulCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.double64;
+package org.jcnc.snow.vm.commands.type.control.double64;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/double64/DNegCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DNegCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/double64/DNegCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DNegCommand.java
index 1c36841..934f017 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/double64/DNegCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DNegCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.double64;
+package org.jcnc.snow.vm.commands.type.control.double64;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/stack/double64/DPushCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DPushCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/stack/double64/DPushCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DPushCommand.java
index 5245d08..b70a7b3 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/stack/double64/DPushCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DPushCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.stack.double64;
+package org.jcnc.snow.vm.commands.type.control.double64;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/memory/double64/DStoreCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DStoreCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/memory/double64/DStoreCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DStoreCommand.java
index 7affd8f..9798043 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/memory/double64/DStoreCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DStoreCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.memory.double64;
+package org.jcnc.snow.vm.commands.type.control.double64;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/double64/DSubCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DSubCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/double64/DSubCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DSubCommand.java
index 72d2bda..ccb8f38 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/double64/DSubCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/double64/DSubCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.double64;
+package org.jcnc.snow.vm.commands.type.control.double64;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/float32/FAddCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FAddCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/float32/FAddCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FAddCommand.java
index 3c6e3cb..14ad38f 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/float32/FAddCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FAddCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.float32;
+package org.jcnc.snow.vm.commands.type.control.float32;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/float32/FCECommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FCECommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/float32/FCECommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FCECommand.java
index 6c8620d..b59cd2e 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/float32/FCECommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FCECommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.float32;
+package org.jcnc.snow.vm.commands.type.control.float32;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/float32/FCGCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FCGCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/float32/FCGCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FCGCommand.java
index 2b9b71f..ed49fbd 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/float32/FCGCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FCGCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.float32;
+package org.jcnc.snow.vm.commands.type.control.float32;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/float32/FCGECommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FCGECommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/float32/FCGECommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FCGECommand.java
index 45d5fc1..f484bb7 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/float32/FCGECommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FCGECommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.float32;
+package org.jcnc.snow.vm.commands.type.control.float32;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/float32/FCLCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FCLCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/float32/FCLCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FCLCommand.java
index 26cc4bb..edbfa7e 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/float32/FCLCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FCLCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.float32;
+package org.jcnc.snow.vm.commands.type.control.float32;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/float32/FCLECommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FCLECommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/float32/FCLECommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FCLECommand.java
index becc5d5..ed910db 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/float32/FCLECommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FCLECommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.float32;
+package org.jcnc.snow.vm.commands.type.control.float32;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/float32/FCNECommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FCNECommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/float32/FCNECommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FCNECommand.java
index d75ac57..a02bd6a 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/float32/FCNECommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FCNECommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.float32;
+package org.jcnc.snow.vm.commands.type.control.float32;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/float32/FDivCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FDivCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/float32/FDivCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FDivCommand.java
index 5c3fbda..9e7512e 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/float32/FDivCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FDivCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.float32;
+package org.jcnc.snow.vm.commands.type.control.float32;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/float32/FIncCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FIncCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/float32/FIncCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FIncCommand.java
index 4061ebd..94c2f2f 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/float32/FIncCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FIncCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.float32;
+package org.jcnc.snow.vm.commands.type.control.float32;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/memory/float32/FLoadCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FLoadCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/memory/float32/FLoadCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FLoadCommand.java
index 7edcdb6..e0120b3 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/memory/float32/FLoadCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FLoadCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.memory.float32;
+package org.jcnc.snow.vm.commands.type.control.float32;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/float32/FModCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FModCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/float32/FModCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FModCommand.java
index fc0c537..0e35b96 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/float32/FModCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FModCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.float32;
+package org.jcnc.snow.vm.commands.type.control.float32;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/float32/FMulCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FMulCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/float32/FMulCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FMulCommand.java
index 34dfd8b..a90e951 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/float32/FMulCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FMulCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.float32;
+package org.jcnc.snow.vm.commands.type.control.float32;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/float32/FNegCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FNegCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/float32/FNegCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FNegCommand.java
index 9b28674..89dfd4f 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/float32/FNegCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FNegCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.float32;
+package org.jcnc.snow.vm.commands.type.control.float32;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/stack/float32/FPushCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FPushCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/stack/float32/FPushCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FPushCommand.java
index da6da33..cb7f6b8 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/stack/float32/FPushCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FPushCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.stack.float32;
+package org.jcnc.snow.vm.commands.type.control.float32;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/memory/float32/FStoreCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FStoreCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/memory/float32/FStoreCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FStoreCommand.java
index 4a1ae60..5476e14 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/memory/float32/FStoreCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FStoreCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.memory.float32;
+package org.jcnc.snow.vm.commands.type.control.float32;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/float32/FSubCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FSubCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/float32/FSubCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FSubCommand.java
index dd73714..508a503 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/float32/FSubCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/float32/FSubCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.float32;
+package org.jcnc.snow.vm.commands.type.control.float32;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/int32/IAddCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/IAddCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/int32/IAddCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/int32/IAddCommand.java
index 36375e3..e65c124 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/int32/IAddCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/IAddCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.int32;
+package org.jcnc.snow.vm.commands.type.control.int32;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/bitwise/int32/IAndCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/IAndCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/bitwise/int32/IAndCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/int32/IAndCommand.java
index f43b8c6..bf49e74 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/bitwise/int32/IAndCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/IAndCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.bitwise.int32;
+package org.jcnc.snow.vm.commands.type.control.int32;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/int32/ICECommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/ICECommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/int32/ICECommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/int32/ICECommand.java
index fc1636e..cf35a54 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/int32/ICECommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/ICECommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.int32;
+package org.jcnc.snow.vm.commands.type.control.int32;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.utils.LoggingUtils;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/int32/ICGCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/ICGCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/int32/ICGCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/int32/ICGCommand.java
index 574151e..12463a8 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/int32/ICGCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/ICGCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.int32;
+package org.jcnc.snow.vm.commands.type.control.int32;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.utils.LoggingUtils;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/int32/ICGECommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/ICGECommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/int32/ICGECommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/int32/ICGECommand.java
index 8f28127..a689a50 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/int32/ICGECommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/ICGECommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.int32;
+package org.jcnc.snow.vm.commands.type.control.int32;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.utils.LoggingUtils;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/int32/ICLCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/ICLCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/int32/ICLCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/int32/ICLCommand.java
index e1909e9..4a56631 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/int32/ICLCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/ICLCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.int32;
+package org.jcnc.snow.vm.commands.type.control.int32;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.utils.LoggingUtils;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/int32/ICLECommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/ICLECommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/int32/ICLECommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/int32/ICLECommand.java
index 0410d1f..6de4e40 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/int32/ICLECommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/ICLECommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.int32;
+package org.jcnc.snow.vm.commands.type.control.int32;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.utils.LoggingUtils;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/int32/ICNECommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/ICNECommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/int32/ICNECommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/int32/ICNECommand.java
index b921efc..114d75a 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/int32/ICNECommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/ICNECommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.int32;
+package org.jcnc.snow.vm.commands.type.control.int32;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.utils.LoggingUtils;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/int32/IDivCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/IDivCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/int32/IDivCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/int32/IDivCommand.java
index ea5c9cf..e6b0e0d 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/int32/IDivCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/IDivCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.int32;
+package org.jcnc.snow.vm.commands.type.control.int32;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/int32/IIncCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/IIncCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/int32/IIncCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/int32/IIncCommand.java
index ac1c150..d95f5aa 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/int32/IIncCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/IIncCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.int32;
+package org.jcnc.snow.vm.commands.type.control.int32;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/memory/int32/ILoadCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/ILoadCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/memory/int32/ILoadCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/int32/ILoadCommand.java
index 02a55fa..c4489bd 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/memory/int32/ILoadCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/ILoadCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.memory.int32;
+package org.jcnc.snow.vm.commands.type.control.int32;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/int32/IModCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/IModCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/int32/IModCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/int32/IModCommand.java
index 0cb9bd0..2692321 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/int32/IModCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/IModCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.int32;
+package org.jcnc.snow.vm.commands.type.control.int32;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/int32/IMulCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/IMulCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/int32/IMulCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/int32/IMulCommand.java
index a559759..41078d3 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/int32/IMulCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/IMulCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.int32;
+package org.jcnc.snow.vm.commands.type.control.int32;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/int32/INegCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/INegCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/int32/INegCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/int32/INegCommand.java
index 2746adb..ee7b9da 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/int32/INegCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/INegCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.int32;
+package org.jcnc.snow.vm.commands.type.control.int32;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/bitwise/int32/IOrCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/IOrCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/bitwise/int32/IOrCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/int32/IOrCommand.java
index 2fe93e3..bc4ed11 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/bitwise/int32/IOrCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/IOrCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.bitwise.int32;
+package org.jcnc.snow.vm.commands.type.control.int32;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/stack/int32/IPushCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/IPushCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/stack/int32/IPushCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/int32/IPushCommand.java
index 5515e1f..0823557 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/stack/int32/IPushCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/IPushCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.stack.int32;
+package org.jcnc.snow.vm.commands.type.control.int32;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/memory/int32/IStoreCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/IStoreCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/memory/int32/IStoreCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/int32/IStoreCommand.java
index 31dfb26..6101851 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/memory/int32/IStoreCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/IStoreCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.memory.int32;
+package org.jcnc.snow.vm.commands.type.control.int32;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/int32/ISubCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/ISubCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/int32/ISubCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/int32/ISubCommand.java
index f910e2b..530b658 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/int32/ISubCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/ISubCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.int32;
+package org.jcnc.snow.vm.commands.type.control.int32;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/bitwise/int32/IXorCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/IXorCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/bitwise/int32/IXorCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/int32/IXorCommand.java
index 0502e0a..a5017bc 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/bitwise/int32/IXorCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/int32/IXorCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.bitwise.int32;
+package org.jcnc.snow.vm.commands.type.control.int32;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/long64/LAddCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LAddCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/long64/LAddCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LAddCommand.java
index c97a6a1..f46c34d 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/long64/LAddCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LAddCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.long64;
+package org.jcnc.snow.vm.commands.type.control.long64;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/bitwise/long64/LAndCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LAndCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/bitwise/long64/LAndCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LAndCommand.java
index dd79d10..4cbf00c 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/bitwise/long64/LAndCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LAndCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.bitwise.long64;
+package org.jcnc.snow.vm.commands.type.control.long64;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/long64/LCECommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LCECommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/long64/LCECommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LCECommand.java
index 9eb73e3..12a0da9 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/long64/LCECommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LCECommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.long64;
+package org.jcnc.snow.vm.commands.type.control.long64;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/long64/LCGCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LCGCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/long64/LCGCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LCGCommand.java
index 83b99e4..03c7b72 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/long64/LCGCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LCGCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.long64;
+package org.jcnc.snow.vm.commands.type.control.long64;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/long64/LCGECommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LCGECommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/long64/LCGECommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LCGECommand.java
index 3ce9e90..c5a89d7 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/long64/LCGECommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LCGECommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.long64;
+package org.jcnc.snow.vm.commands.type.control.long64;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/long64/LCLCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LCLCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/long64/LCLCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LCLCommand.java
index b52eb64..8db616a 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/long64/LCLCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LCLCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.long64;
+package org.jcnc.snow.vm.commands.type.control.long64;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/long64/LCLECommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LCLECommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/long64/LCLECommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LCLECommand.java
index e585fd7..8b86b2b 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/long64/LCLECommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LCLECommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.long64;
+package org.jcnc.snow.vm.commands.type.control.long64;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/long64/LCNECommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LCNECommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/long64/LCNECommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LCNECommand.java
index 4031630..5bbcacd 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/long64/LCNECommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LCNECommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.long64;
+package org.jcnc.snow.vm.commands.type.control.long64;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/long64/LDivCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LDivCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/long64/LDivCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LDivCommand.java
index 7d66218..b3b1c62 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/long64/LDivCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LDivCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.long64;
+package org.jcnc.snow.vm.commands.type.control.long64;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/long64/LIncCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LIncCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/long64/LIncCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LIncCommand.java
index 18715d3..d374e19 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/long64/LIncCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LIncCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.long64;
+package org.jcnc.snow.vm.commands.type.control.long64;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/memory/long64/LLoadCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LLoadCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/memory/long64/LLoadCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LLoadCommand.java
index 411d766..f5d81e1 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/memory/long64/LLoadCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LLoadCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.memory.long64;
+package org.jcnc.snow.vm.commands.type.control.long64;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/long64/LModCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LModCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/long64/LModCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LModCommand.java
index 345c2e5..e1174cf 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/long64/LModCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LModCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.long64;
+package org.jcnc.snow.vm.commands.type.control.long64;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/long64/LMulCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LMulCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/long64/LMulCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LMulCommand.java
index b5e68aa..1d30635 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/long64/LMulCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LMulCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.long64;
+package org.jcnc.snow.vm.commands.type.control.long64;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/long64/LNegCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LNegCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/long64/LNegCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LNegCommand.java
index e93fd1d..aea11d8 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/long64/LNegCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LNegCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.long64;
+package org.jcnc.snow.vm.commands.type.control.long64;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/bitwise/long64/LOrCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LOrCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/bitwise/long64/LOrCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LOrCommand.java
index 33a9bf9..eb420d8 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/bitwise/long64/LOrCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LOrCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.bitwise.long64;
+package org.jcnc.snow.vm.commands.type.control.long64;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/stack/long64/LPushCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LPushCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/stack/long64/LPushCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LPushCommand.java
index d00b9c7..1567897 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/stack/long64/LPushCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LPushCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.stack.long64;
+package org.jcnc.snow.vm.commands.type.control.long64;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/memory/long64/LStoreCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LStoreCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/memory/long64/LStoreCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LStoreCommand.java
index f1b5e3f..28e8b13 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/memory/long64/LStoreCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LStoreCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.memory.long64;
+package org.jcnc.snow.vm.commands.type.control.long64;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/long64/LSubCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LSubCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/long64/LSubCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LSubCommand.java
index f710b10..db523e6 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/long64/LSubCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LSubCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.long64;
+package org.jcnc.snow.vm.commands.type.control.long64;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/bitwise/long64/LXorCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LXorCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/bitwise/long64/LXorCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LXorCommand.java
index dbce6ab..5aabcfd 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/bitwise/long64/LXorCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/long64/LXorCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.bitwise.long64;
+package org.jcnc.snow.vm.commands.type.control.long64;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/short16/SAddCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SAddCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/short16/SAddCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SAddCommand.java
index b4b1290..2322639 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/short16/SAddCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SAddCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.short16;
+package org.jcnc.snow.vm.commands.type.control.short16;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/bitwise/short16/SAndCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SAndCommand.java
similarity index 97%
rename from src/main/java/org/jcnc/snow/vm/commands/bitwise/short16/SAndCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SAndCommand.java
index 36454a8..e2c3d89 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/bitwise/short16/SAndCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SAndCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.bitwise.short16;
+package org.jcnc.snow.vm.commands.type.control.short16;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/short16/SCECommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SCECommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/short16/SCECommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SCECommand.java
index d1715a9..af95749 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/short16/SCECommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SCECommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.short16;
+package org.jcnc.snow.vm.commands.type.control.short16;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/short16/SCGCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SCGCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/short16/SCGCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SCGCommand.java
index 42cc70a..516247b 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/short16/SCGCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SCGCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.short16;
+package org.jcnc.snow.vm.commands.type.control.short16;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/short16/SCGECommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SCGECommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/short16/SCGECommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SCGECommand.java
index 78e8add..2e1d0f3 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/short16/SCGECommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SCGECommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.short16;
+package org.jcnc.snow.vm.commands.type.control.short16;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/short16/SCLCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SCLCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/short16/SCLCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SCLCommand.java
index 96c7a24..8f54dd9 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/short16/SCLCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SCLCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.short16;
+package org.jcnc.snow.vm.commands.type.control.short16;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/short16/SCLECommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SCLECommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/short16/SCLECommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SCLECommand.java
index 33de323..797ce8a 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/short16/SCLECommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SCLECommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.short16;
+package org.jcnc.snow.vm.commands.type.control.short16;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/control/short16/SCNECommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SCNECommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/control/short16/SCNECommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SCNECommand.java
index 9bb3f51..82d3e5e 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/control/short16/SCNECommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SCNECommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.control.short16;
+package org.jcnc.snow.vm.commands.type.control.short16;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/short16/SDivCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SDivCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/short16/SDivCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SDivCommand.java
index 9c71b8c..d8385a2 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/short16/SDivCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SDivCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.short16;
+package org.jcnc.snow.vm.commands.type.control.short16;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/short16/SIncCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SIncCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/short16/SIncCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SIncCommand.java
index 8da3133..23fc42c 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/short16/SIncCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SIncCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.short16;
+package org.jcnc.snow.vm.commands.type.control.short16;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/memory/short16/SLoadCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SLoadCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/memory/short16/SLoadCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SLoadCommand.java
index 6379837..24ddf52 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/memory/short16/SLoadCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SLoadCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.memory.short16;
+package org.jcnc.snow.vm.commands.type.control.short16;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/short16/SModCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SModCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/short16/SModCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SModCommand.java
index 105b5bc..1a78486 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/short16/SModCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SModCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.short16;
+package org.jcnc.snow.vm.commands.type.control.short16;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/short16/SMulCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SMulCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/short16/SMulCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SMulCommand.java
index f6c022d..49d34d7 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/short16/SMulCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SMulCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.short16;
+package org.jcnc.snow.vm.commands.type.control.short16;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/short16/SNegCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SNegCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/short16/SNegCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SNegCommand.java
index 1474c50..6501380 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/short16/SNegCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SNegCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.short16;
+package org.jcnc.snow.vm.commands.type.control.short16;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/bitwise/short16/SOrCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SOrCommand.java
similarity index 97%
rename from src/main/java/org/jcnc/snow/vm/commands/bitwise/short16/SOrCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SOrCommand.java
index 35deeba..72a8844 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/bitwise/short16/SOrCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SOrCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.bitwise.short16;
+package org.jcnc.snow.vm.commands.type.control.short16;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/stack/short16/SPushCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SPushCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/stack/short16/SPushCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SPushCommand.java
index b61fbe2..77af696 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/stack/short16/SPushCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SPushCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.stack.short16;
+package org.jcnc.snow.vm.commands.type.control.short16;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/memory/short16/SStoreCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SStoreCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/memory/short16/SStoreCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SStoreCommand.java
index fb5d79c..a3ea6dd 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/memory/short16/SStoreCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SStoreCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.memory.short16;
+package org.jcnc.snow.vm.commands.type.control.short16;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/short16/SSubCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SSubCommand.java
similarity index 98%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/short16/SSubCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SSubCommand.java
index 53953b3..d16d0e0 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/short16/SSubCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SSubCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.short16;
+package org.jcnc.snow.vm.commands.type.control.short16;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/bitwise/short16/SXorCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SXorCommand.java
similarity index 97%
rename from src/main/java/org/jcnc/snow/vm/commands/bitwise/short16/SXorCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SXorCommand.java
index 3da8267..dd0a8be 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/bitwise/short16/SXorCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/control/short16/SXorCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.bitwise.short16;
+package org.jcnc.snow.vm.commands.type.control.short16;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/B2ICommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/conversion/B2ICommand.java
similarity index 97%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/B2ICommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/conversion/B2ICommand.java
index 7abd324..c5c18a6 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/B2ICommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/conversion/B2ICommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.conversion;
+package org.jcnc.snow.vm.commands.type.conversion;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/D2FCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/conversion/D2FCommand.java
similarity index 97%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/D2FCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/conversion/D2FCommand.java
index 3ed687f..7f4bcc0 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/D2FCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/conversion/D2FCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.conversion;
+package org.jcnc.snow.vm.commands.type.conversion;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/D2ICommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/conversion/D2ICommand.java
similarity index 97%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/D2ICommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/conversion/D2ICommand.java
index b0c706c..903f6dc 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/D2ICommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/conversion/D2ICommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.conversion;
+package org.jcnc.snow.vm.commands.type.conversion;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/D2LCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/conversion/D2LCommand.java
similarity index 97%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/D2LCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/conversion/D2LCommand.java
index eb38865..78d558a 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/D2LCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/conversion/D2LCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.conversion;
+package org.jcnc.snow.vm.commands.type.conversion;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/F2DCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/conversion/F2DCommand.java
similarity index 97%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/F2DCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/conversion/F2DCommand.java
index e997502..7f4dba7 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/F2DCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/conversion/F2DCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.conversion;
+package org.jcnc.snow.vm.commands.type.conversion;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/F2ICommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/conversion/F2ICommand.java
similarity index 97%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/F2ICommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/conversion/F2ICommand.java
index 26cf949..24f9192 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/F2ICommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/conversion/F2ICommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.conversion;
+package org.jcnc.snow.vm.commands.type.conversion;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/F2LCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/conversion/F2LCommand.java
similarity index 97%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/F2LCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/conversion/F2LCommand.java
index 55abcbc..b4bcb6b 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/F2LCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/conversion/F2LCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.conversion;
+package org.jcnc.snow.vm.commands.type.conversion;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/I2BCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/conversion/I2BCommand.java
similarity index 97%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/I2BCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/conversion/I2BCommand.java
index 84e2e92..76ef29c 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/I2BCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/conversion/I2BCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.conversion;
+package org.jcnc.snow.vm.commands.type.conversion;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/I2DCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/conversion/I2DCommand.java
similarity index 97%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/I2DCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/conversion/I2DCommand.java
index 3653a36..0147f5b 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/I2DCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/conversion/I2DCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.conversion;
+package org.jcnc.snow.vm.commands.type.conversion;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/I2FCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/conversion/I2FCommand.java
similarity index 97%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/I2FCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/conversion/I2FCommand.java
index f21e379..22182dc 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/I2FCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/conversion/I2FCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.conversion;
+package org.jcnc.snow.vm.commands.type.conversion;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/I2LCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/conversion/I2LCommand.java
similarity index 97%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/I2LCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/conversion/I2LCommand.java
index 9198cfa..a9d1aae 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/I2LCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/conversion/I2LCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.conversion;
+package org.jcnc.snow.vm.commands.type.conversion;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/I2SCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/conversion/I2SCommand.java
similarity index 97%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/I2SCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/conversion/I2SCommand.java
index f11f119..ca5987a 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/I2SCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/conversion/I2SCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.conversion;
+package org.jcnc.snow.vm.commands.type.conversion;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/L2DCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/conversion/L2DCommand.java
similarity index 97%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/L2DCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/conversion/L2DCommand.java
index 7c551db..06426ae 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/L2DCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/conversion/L2DCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.conversion;
+package org.jcnc.snow.vm.commands.type.conversion;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/L2FCommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/conversion/L2FCommand.java
similarity index 97%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/L2FCommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/conversion/L2FCommand.java
index f2cbfc2..5cf6a67 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/L2FCommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/conversion/L2FCommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.conversion;
+package org.jcnc.snow.vm.commands.type.conversion;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/L2ICommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/conversion/L2ICommand.java
similarity index 97%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/L2ICommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/conversion/L2ICommand.java
index ee9f494..f4f4b41 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/L2ICommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/conversion/L2ICommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.conversion;
+package org.jcnc.snow.vm.commands.type.conversion;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/S2ICommand.java b/src/main/java/org/jcnc/snow/vm/commands/type/conversion/S2ICommand.java
similarity index 97%
rename from src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/S2ICommand.java
rename to src/main/java/org/jcnc/snow/vm/commands/type/conversion/S2ICommand.java
index 375f0ea..fa3ee74 100644
--- a/src/main/java/org/jcnc/snow/vm/commands/arithmetic/conversion/S2ICommand.java
+++ b/src/main/java/org/jcnc/snow/vm/commands/type/conversion/S2ICommand.java
@@ -1,4 +1,4 @@
-package org.jcnc.snow.vm.commands.arithmetic.conversion;
+package org.jcnc.snow.vm.commands.type.conversion;
import org.jcnc.snow.vm.interfaces.Command;
import org.jcnc.snow.vm.module.CallStack;
diff --git a/src/main/java/org/jcnc/snow/vm/engine/VMOpCode.java b/src/main/java/org/jcnc/snow/vm/engine/VMOpCode.java
index e707aa0..c53f511 100644
--- a/src/main/java/org/jcnc/snow/vm/engine/VMOpCode.java
+++ b/src/main/java/org/jcnc/snow/vm/engine/VMOpCode.java
@@ -1,46 +1,44 @@
package org.jcnc.snow.vm.engine;
-import org.jcnc.snow.vm.commands.arithmetic.byte8.*;
-import org.jcnc.snow.vm.commands.arithmetic.conversion.*;
-import org.jcnc.snow.vm.commands.arithmetic.double64.*;
-import org.jcnc.snow.vm.commands.arithmetic.float32.*;
-import org.jcnc.snow.vm.commands.arithmetic.int32.*;
-import org.jcnc.snow.vm.commands.arithmetic.long64.*;
-import org.jcnc.snow.vm.commands.arithmetic.short16.*;
-import org.jcnc.snow.vm.commands.bitwise.int32.IAndCommand;
-import org.jcnc.snow.vm.commands.bitwise.int32.IOrCommand;
-import org.jcnc.snow.vm.commands.bitwise.int32.IXorCommand;
-import org.jcnc.snow.vm.commands.bitwise.long64.LAndCommand;
-import org.jcnc.snow.vm.commands.bitwise.long64.LOrCommand;
-import org.jcnc.snow.vm.commands.bitwise.long64.LXorCommand;
-import org.jcnc.snow.vm.commands.control.all.JumpCommand;
-import org.jcnc.snow.vm.commands.control.int32.*;
-import org.jcnc.snow.vm.commands.control.long64.*;
-import org.jcnc.snow.vm.commands.function.CallCommand;
-import org.jcnc.snow.vm.commands.function.RetCommand;
-import org.jcnc.snow.vm.commands.memory.all.MovCommand;
-import org.jcnc.snow.vm.commands.memory.byte8.BLoadCommand;
-import org.jcnc.snow.vm.commands.memory.byte8.BStoreCommand;
-import org.jcnc.snow.vm.commands.memory.double64.DLoadCommand;
-import org.jcnc.snow.vm.commands.memory.double64.DStoreCommand;
-import org.jcnc.snow.vm.commands.memory.float32.FLoadCommand;
-import org.jcnc.snow.vm.commands.memory.float32.FStoreCommand;
-import org.jcnc.snow.vm.commands.memory.int32.ILoadCommand;
-import org.jcnc.snow.vm.commands.memory.int32.IStoreCommand;
-import org.jcnc.snow.vm.commands.memory.long64.LLoadCommand;
-import org.jcnc.snow.vm.commands.memory.long64.LStoreCommand;
-import org.jcnc.snow.vm.commands.memory.short16.SLoadCommand;
-import org.jcnc.snow.vm.commands.memory.short16.SStoreCommand;
-import org.jcnc.snow.vm.commands.stack.all.DupCommand;
-import org.jcnc.snow.vm.commands.stack.all.PopCommand;
-import org.jcnc.snow.vm.commands.stack.all.SwapCommand;
-import org.jcnc.snow.vm.commands.stack.byte8.BPushCommand;
-import org.jcnc.snow.vm.commands.stack.double64.DPushCommand;
-import org.jcnc.snow.vm.commands.stack.float32.FPushCommand;
-import org.jcnc.snow.vm.commands.stack.int32.IPushCommand;
-import org.jcnc.snow.vm.commands.stack.long64.LPushCommand;
-import org.jcnc.snow.vm.commands.stack.short16.SPushCommand;
-import org.jcnc.snow.vm.commands.vm.HaltCommand;
+import org.jcnc.snow.vm.commands.type.control.byte8.*;
+import org.jcnc.snow.vm.commands.type.control.double64.*;
+import org.jcnc.snow.vm.commands.type.control.float32.*;
+import org.jcnc.snow.vm.commands.type.control.int32.*;
+import org.jcnc.snow.vm.commands.type.control.long64.*;
+import org.jcnc.snow.vm.commands.type.control.short16.*;
+import org.jcnc.snow.vm.commands.type.control.int32.IAndCommand;
+import org.jcnc.snow.vm.commands.type.control.int32.IOrCommand;
+import org.jcnc.snow.vm.commands.type.control.int32.IXorCommand;
+import org.jcnc.snow.vm.commands.type.control.long64.LAndCommand;
+import org.jcnc.snow.vm.commands.type.control.long64.LOrCommand;
+import org.jcnc.snow.vm.commands.type.control.long64.LXorCommand;
+import org.jcnc.snow.vm.commands.flow.control.JumpCommand;
+import org.jcnc.snow.vm.commands.flow.control.CallCommand;
+import org.jcnc.snow.vm.commands.flow.control.RetCommand;
+import org.jcnc.snow.vm.commands.register.control.MovCommand;
+import org.jcnc.snow.vm.commands.type.control.byte8.BLoadCommand;
+import org.jcnc.snow.vm.commands.type.control.byte8.BStoreCommand;
+import org.jcnc.snow.vm.commands.type.control.double64.DLoadCommand;
+import org.jcnc.snow.vm.commands.type.control.double64.DStoreCommand;
+import org.jcnc.snow.vm.commands.type.control.float32.FLoadCommand;
+import org.jcnc.snow.vm.commands.type.control.float32.FStoreCommand;
+import org.jcnc.snow.vm.commands.type.control.int32.ILoadCommand;
+import org.jcnc.snow.vm.commands.type.control.int32.IStoreCommand;
+import org.jcnc.snow.vm.commands.type.control.long64.LLoadCommand;
+import org.jcnc.snow.vm.commands.type.control.long64.LStoreCommand;
+import org.jcnc.snow.vm.commands.type.control.short16.SLoadCommand;
+import org.jcnc.snow.vm.commands.type.control.short16.SStoreCommand;
+import org.jcnc.snow.vm.commands.stack.control.DupCommand;
+import org.jcnc.snow.vm.commands.stack.control.PopCommand;
+import org.jcnc.snow.vm.commands.stack.control.SwapCommand;
+import org.jcnc.snow.vm.commands.type.control.byte8.BPushCommand;
+import org.jcnc.snow.vm.commands.type.control.double64.DPushCommand;
+import org.jcnc.snow.vm.commands.type.control.float32.FPushCommand;
+import org.jcnc.snow.vm.commands.type.control.int32.IPushCommand;
+import org.jcnc.snow.vm.commands.type.control.long64.LPushCommand;
+import org.jcnc.snow.vm.commands.type.control.short16.SPushCommand;
+import org.jcnc.snow.vm.commands.type.conversion.*;
+import org.jcnc.snow.vm.commands.system.control.HaltCommand;
import org.jcnc.snow.vm.module.LocalVariableStore;
/**
@@ -49,6 +47,7 @@ import org.jcnc.snow.vm.module.LocalVariableStore;
*/
public class VMOpCode {
+ // region Type Control (0x0000-0x00BF)
// region Byte8 (0x0000-0x001F)
/**
* B_ADD Opcode: Represents the byte8 addition operation in the virtual machine.
@@ -2040,6 +2039,7 @@ public class VMOpCode {
*/
public static final int D_CLE = 0x00AF;
+ // endregion
// endregion
// region Type Conversion (0x00C0-0x00DF)
diff --git a/src/main/java/org/jcnc/snow/vm/factories/CommandFactory.java b/src/main/java/org/jcnc/snow/vm/factories/CommandFactory.java
index 8c36413..a5af00b 100644
--- a/src/main/java/org/jcnc/snow/vm/factories/CommandFactory.java
+++ b/src/main/java/org/jcnc/snow/vm/factories/CommandFactory.java
@@ -1,56 +1,50 @@
package org.jcnc.snow.vm.factories;
-import org.jcnc.snow.vm.commands.arithmetic.byte8.*;
-import org.jcnc.snow.vm.commands.arithmetic.conversion.*;
-import org.jcnc.snow.vm.commands.arithmetic.double64.*;
-import org.jcnc.snow.vm.commands.arithmetic.float32.*;
-import org.jcnc.snow.vm.commands.arithmetic.int32.*;
-import org.jcnc.snow.vm.commands.arithmetic.long64.*;
-import org.jcnc.snow.vm.commands.arithmetic.short16.*;
-import org.jcnc.snow.vm.commands.bitwise.byte8.BAndCommand;
-import org.jcnc.snow.vm.commands.bitwise.byte8.BOrCommand;
-import org.jcnc.snow.vm.commands.bitwise.byte8.BXorCommand;
-import org.jcnc.snow.vm.commands.bitwise.int32.IAndCommand;
-import org.jcnc.snow.vm.commands.bitwise.int32.IOrCommand;
-import org.jcnc.snow.vm.commands.bitwise.int32.IXorCommand;
-import org.jcnc.snow.vm.commands.bitwise.long64.LAndCommand;
-import org.jcnc.snow.vm.commands.bitwise.long64.LOrCommand;
-import org.jcnc.snow.vm.commands.bitwise.long64.LXorCommand;
-import org.jcnc.snow.vm.commands.bitwise.short16.SAndCommand;
-import org.jcnc.snow.vm.commands.bitwise.short16.SOrCommand;
-import org.jcnc.snow.vm.commands.bitwise.short16.SXorCommand;
-import org.jcnc.snow.vm.commands.control.all.JumpCommand;
-import org.jcnc.snow.vm.commands.control.byte8.*;
-import org.jcnc.snow.vm.commands.control.double64.*;
-import org.jcnc.snow.vm.commands.control.float32.*;
-import org.jcnc.snow.vm.commands.control.int32.*;
-import org.jcnc.snow.vm.commands.control.long64.*;
-import org.jcnc.snow.vm.commands.control.short16.*;
-import org.jcnc.snow.vm.commands.function.CallCommand;
-import org.jcnc.snow.vm.commands.function.RetCommand;
-import org.jcnc.snow.vm.commands.memory.all.MovCommand;
-import org.jcnc.snow.vm.commands.memory.byte8.BLoadCommand;
-import org.jcnc.snow.vm.commands.memory.byte8.BStoreCommand;
-import org.jcnc.snow.vm.commands.memory.double64.DLoadCommand;
-import org.jcnc.snow.vm.commands.memory.double64.DStoreCommand;
-import org.jcnc.snow.vm.commands.memory.float32.FLoadCommand;
-import org.jcnc.snow.vm.commands.memory.float32.FStoreCommand;
-import org.jcnc.snow.vm.commands.memory.int32.ILoadCommand;
-import org.jcnc.snow.vm.commands.memory.int32.IStoreCommand;
-import org.jcnc.snow.vm.commands.memory.long64.LLoadCommand;
-import org.jcnc.snow.vm.commands.memory.long64.LStoreCommand;
-import org.jcnc.snow.vm.commands.memory.short16.SLoadCommand;
-import org.jcnc.snow.vm.commands.memory.short16.SStoreCommand;
-import org.jcnc.snow.vm.commands.stack.all.DupCommand;
-import org.jcnc.snow.vm.commands.stack.all.PopCommand;
-import org.jcnc.snow.vm.commands.stack.all.SwapCommand;
-import org.jcnc.snow.vm.commands.stack.byte8.BPushCommand;
-import org.jcnc.snow.vm.commands.stack.double64.DPushCommand;
-import org.jcnc.snow.vm.commands.stack.float32.FPushCommand;
-import org.jcnc.snow.vm.commands.stack.int32.IPushCommand;
-import org.jcnc.snow.vm.commands.stack.long64.LPushCommand;
-import org.jcnc.snow.vm.commands.stack.short16.SPushCommand;
-import org.jcnc.snow.vm.commands.vm.HaltCommand;
+import org.jcnc.snow.vm.commands.type.control.byte8.*;
+import org.jcnc.snow.vm.commands.type.control.double64.*;
+import org.jcnc.snow.vm.commands.type.control.float32.*;
+import org.jcnc.snow.vm.commands.type.control.int32.*;
+import org.jcnc.snow.vm.commands.type.control.long64.*;
+import org.jcnc.snow.vm.commands.type.control.short16.*;
+import org.jcnc.snow.vm.commands.type.control.byte8.BAndCommand;
+import org.jcnc.snow.vm.commands.type.control.byte8.BOrCommand;
+import org.jcnc.snow.vm.commands.type.control.byte8.BXorCommand;
+import org.jcnc.snow.vm.commands.type.control.int32.IAndCommand;
+import org.jcnc.snow.vm.commands.type.control.int32.IOrCommand;
+import org.jcnc.snow.vm.commands.type.control.int32.IXorCommand;
+import org.jcnc.snow.vm.commands.type.control.long64.LAndCommand;
+import org.jcnc.snow.vm.commands.type.control.long64.LOrCommand;
+import org.jcnc.snow.vm.commands.type.control.long64.LXorCommand;
+import org.jcnc.snow.vm.commands.type.control.short16.SAndCommand;
+import org.jcnc.snow.vm.commands.type.control.short16.SOrCommand;
+import org.jcnc.snow.vm.commands.type.control.short16.SXorCommand;
+import org.jcnc.snow.vm.commands.flow.control.JumpCommand;
+import org.jcnc.snow.vm.commands.flow.control.CallCommand;
+import org.jcnc.snow.vm.commands.flow.control.RetCommand;
+import org.jcnc.snow.vm.commands.register.control.MovCommand;
+import org.jcnc.snow.vm.commands.type.control.byte8.BLoadCommand;
+import org.jcnc.snow.vm.commands.type.control.byte8.BStoreCommand;
+import org.jcnc.snow.vm.commands.type.control.double64.DLoadCommand;
+import org.jcnc.snow.vm.commands.type.control.double64.DStoreCommand;
+import org.jcnc.snow.vm.commands.type.control.float32.FLoadCommand;
+import org.jcnc.snow.vm.commands.type.control.float32.FStoreCommand;
+import org.jcnc.snow.vm.commands.type.control.int32.ILoadCommand;
+import org.jcnc.snow.vm.commands.type.control.int32.IStoreCommand;
+import org.jcnc.snow.vm.commands.type.control.long64.LLoadCommand;
+import org.jcnc.snow.vm.commands.type.control.long64.LStoreCommand;
+import org.jcnc.snow.vm.commands.type.control.short16.SLoadCommand;
+import org.jcnc.snow.vm.commands.type.control.short16.SStoreCommand;
+import org.jcnc.snow.vm.commands.stack.control.DupCommand;
+import org.jcnc.snow.vm.commands.stack.control.PopCommand;
+import org.jcnc.snow.vm.commands.stack.control.SwapCommand;
+import org.jcnc.snow.vm.commands.type.control.byte8.BPushCommand;
+import org.jcnc.snow.vm.commands.type.control.double64.DPushCommand;
+import org.jcnc.snow.vm.commands.type.control.float32.FPushCommand;
+import org.jcnc.snow.vm.commands.type.control.int32.IPushCommand;
+import org.jcnc.snow.vm.commands.type.control.long64.LPushCommand;
+import org.jcnc.snow.vm.commands.type.control.short16.SPushCommand;
+import org.jcnc.snow.vm.commands.type.conversion.*;
+import org.jcnc.snow.vm.commands.system.control.HaltCommand;
import org.jcnc.snow.vm.engine.VMOpCode;
import org.jcnc.snow.vm.interfaces.Command;
@@ -67,9 +61,8 @@ public class CommandFactory {
static {
- /* =====================================================
- * 0x0000 – 0x001F BYTE (8-bit signed)
- * ===================================================== */
+ // region Type Control (0x0000-0x00BF)
+ // region Byte8 (0x0000-0x001F)
COMMANDS[VMOpCode.B_ADD] = new BAddCommand();
COMMANDS[VMOpCode.B_SUB] = new BSubCommand();
COMMANDS[VMOpCode.B_MUL] = new BMulCommand();
@@ -93,9 +86,9 @@ public class CommandFactory {
COMMANDS[VMOpCode.B_CL] = new BCLCommand();
COMMANDS[VMOpCode.B_CLE] = new BCLECommand();
- /* =====================================================
- * 0x0020 – 0x003F SHORT (16-bit signed)
- * ===================================================== */
+ // endregion
+
+ // region Short16 (0x0020-0x003F)
COMMANDS[VMOpCode.S_ADD] = new SAddCommand();
COMMANDS[VMOpCode.S_SUB] = new SSubCommand();
COMMANDS[VMOpCode.S_MUL] = new SMulCommand();
@@ -118,10 +111,9 @@ public class CommandFactory {
COMMANDS[VMOpCode.S_CGE] = new SCGECommand();
COMMANDS[VMOpCode.S_CL] = new SCLCommand();
COMMANDS[VMOpCode.S_CLE] = new SCLECommand();
+ // endregion
- /* =====================================================
- * 0x0040 – 0x005F INT (32-bit signed)
- * ===================================================== */
+ // region Int32 (0x0040-0x005F)
COMMANDS[VMOpCode.I_ADD] = new IAddCommand();
COMMANDS[VMOpCode.I_SUB] = new ISubCommand();
COMMANDS[VMOpCode.I_MUL] = new IMulCommand();
@@ -144,10 +136,9 @@ public class CommandFactory {
COMMANDS[VMOpCode.I_CGE] = new ICGECommand();
COMMANDS[VMOpCode.I_CL] = new ICLCommand();
COMMANDS[VMOpCode.I_CLE] = new ICLECommand();
+ // endregion
- /* =====================================================
- * 0x0060 – 0x007F LONG (64-bit signed)
- * ===================================================== */
+ // region Long64 (0x0060-0x007F)
COMMANDS[VMOpCode.L_ADD] = new LAddCommand();
COMMANDS[VMOpCode.L_SUB] = new LSubCommand();
COMMANDS[VMOpCode.L_MUL] = new LMulCommand();
@@ -170,10 +161,9 @@ public class CommandFactory {
COMMANDS[VMOpCode.L_CGE] = new LCGECommand();
COMMANDS[VMOpCode.L_CL] = new LCLCommand();
COMMANDS[VMOpCode.L_CLE] = new LCLECommand();
+ // endregion
- /* =====================================================
- * 0x0080 – 0x009F FLOAT (32-bit signed)
- * ===================================================== */
+ // region Float32 (0x0080-0x009F)
COMMANDS[VMOpCode.F_ADD] = new FAddCommand();
COMMANDS[VMOpCode.F_SUB] = new FSubCommand();
COMMANDS[VMOpCode.F_MUL] = new FMulCommand();
@@ -192,10 +182,9 @@ public class CommandFactory {
COMMANDS[VMOpCode.F_CGE] = new FCGECommand();
COMMANDS[VMOpCode.F_CL] = new FCLCommand();
COMMANDS[VMOpCode.F_CLE] = new FCLECommand();
+ // endregion
- /* =====================================================
- * 0x00A0 – 0x00BF DOUBLE (64-bit IEEE-754)
- * ===================================================== */
+ // region Double64 (0x00A0-0x00BF)
COMMANDS[VMOpCode.D_ADD] = new DAddCommand();
COMMANDS[VMOpCode.D_SUB] = new DSubCommand();
COMMANDS[VMOpCode.D_MUL] = new DMulCommand();
@@ -214,10 +203,10 @@ public class CommandFactory {
COMMANDS[VMOpCode.D_CGE] = new DCGECommand();
COMMANDS[VMOpCode.D_CL] = new DCLCommand();
COMMANDS[VMOpCode.D_CLE] = new DCLECommand();
+ // endregion
+ // endregion
- /* =====================================================
- * 0x00C0 – 0x00DF TYPE CONVERSIONS
- * ===================================================== */
+ // region Type Conversion (0x00C0-0x00DF)
COMMANDS[VMOpCode.I2L] = new I2LCommand();
COMMANDS[VMOpCode.I2S] = new I2SCommand();
COMMANDS[VMOpCode.I2B] = new I2BCommand();
@@ -238,32 +227,30 @@ public class CommandFactory {
COMMANDS[VMOpCode.S2I] = new S2ICommand();
COMMANDS[VMOpCode.B2I] = new B2ICommand();
+ // endregion
- /* =====================================================
- * 0x0100 – 0x01FF GENERIC STACK OPS
- * ===================================================== */
+ // region Stack Control (0x0100-0x01FF)
COMMANDS[VMOpCode.POP] = new PopCommand();
COMMANDS[VMOpCode.DUP] = new DupCommand();
COMMANDS[VMOpCode.SWAP] = new SwapCommand();
+ // endregion
- /* =====================================================
- * 0x0200 – 0x02FF CONTROL FLOW | FUNCTION CALLS
- * ===================================================== */
+ // region Flow Control (0x0200-0x02FF)
COMMANDS[VMOpCode.JUMP] = new JumpCommand();
COMMANDS[VMOpCode.CALL] = new CallCommand();
COMMANDS[VMOpCode.RET] = new RetCommand();
+ // endregion
- /* =====================================================
- * 0x0300 – 0x03FF MEMORY / REGISTER MOVE
- * ===================================================== */
+ // region Register Control (0x0300-0x03FF)
COMMANDS[VMOpCode.MOV] = new MovCommand();
+ // endregion
- /* =====================================================
- * 0x0400 – 0x04FF SYSTEM / DEBUG
- * ===================================================== */
+ // region System Control (0x0400-0x04FF)
COMMANDS[VMOpCode.HALT] = new HaltCommand();
// COMMANDS[VMOpCode.SYSCALL] = new SyscallCommand();
// COMMANDS[VMOpCode.DEBUG_TRAP] = new DebugTrapCommand();
+ // endregion
+
}