From 3f5dd92af982a3d78af6d453d3ed564bb8979517 Mon Sep 17 00:00:00 2001
From: Luke Each opcode represents a specific operation executed by the virtual machine. This opcode is implemented by the {@link IAddCommand} class, which defines its specific execution logic. This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
* primarily used to handle basic int32 addition tasks. This opcode is implemented by the {@link ISubCommand} class, which defines its specific execution logic. This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
* primarily used to handle basic int32 subtraction tasks. This opcode is implemented by the {@link IMulCommand} class, which defines its specific execution logic. This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
* primarily used to handle basic int32 multiplication tasks. This opcode is implemented by the {@link IDivCommand} class, which defines its specific execution logic. This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
* primarily used to handle basic int32 division tasks. This opcode is implemented by the {@link IModCommand} class, which defines its specific execution logic. This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
* primarily used to handle basic int32 modulus (remainder) tasks. This opcode is implemented by the {@link IIncCommand} class, which defines its specific execution logic. 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 implemented by the {@link INegCommand} class, which defines its specific execution logic. 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 implemented by the {@link LAddCommand} class, which defines its specific execution logic. This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
* primarily used to handle basic long64 addition tasks. This opcode is implemented by the {@link LSubCommand} class, which defines its specific execution logic. This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
* primarily used to handle basic long64 subtraction tasks. This opcode is implemented by the {@link LMulCommand} class, which defines its specific execution logic. This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
* primarily used to handle basic long64 multiplication tasks. This opcode is implemented by the {@link LDivCommand} class, which defines its specific execution logic. This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
* primarily used to handle basic long64 division tasks. This opcode is implemented by the {@link LModCommand} class, which defines its specific execution logic. This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
* primarily used to handle basic long64 modulus (remainder) tasks. This opcode is implemented by the {@link LIncCommand} class, which defines its specific execution logic. This opcode is particularly useful for optimizing scenarios where a local `long64` variable, such as a counter or loop index, is frequently incremented. This opcode is implemented by the {@link LNegCommand} class, which defines its specific execution logic. This opcode is typically used to negate a long64 value, making it a fundamental operation for arithmetic logic within the virtual machine. This opcode is implemented by the {@link SAddCommand} class, which defines its specific execution logic. This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
* primarily used to handle basic short16 addition tasks. This opcode is implemented by the {@link SSubCommand} class, which defines its specific execution logic. This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
* primarily used to handle basic short16 subtraction tasks. This opcode is implemented by the {@link SMulCommand} class, which defines its specific execution logic. This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
* primarily used to handle basic short16 multiplication tasks. This opcode is implemented by the {@link SDivCommand} class, which defines its specific execution logic. This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
* primarily used to handle basic short16 division tasks. This opcode is implemented by the {@link SModCommand} class, which defines its specific execution logic. This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
* primarily used to handle basic short16 modulus (remainder) tasks. This opcode is implemented by the {@link SIncCommand} class, which defines its specific execution logic. 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. This opcode is implemented by the {@link SNegCommand} class, which defines its specific execution logic. This opcode is typically used to negate a short16 value, making it a fundamental operation for arithmetic logic within 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 { *This opcode is implemented by the {@link DupCommand} class, which defines its specific execution logic.
@@ -1547,9 +1516,11 @@ public class VMOpCode { *This opcode is implemented by the {@link SwapCommand} class, which defines its specific execution logic.
@@ -1569,12 +1540,9 @@ public class VMOpCode { *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.