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 dad55af..40ff6f3 100644
--- a/src/main/java/org/jcnc/snow/vm/engine/VMOpCode.java
+++ b/src/main/java/org/jcnc/snow/vm/engine/VMOpCode.java
@@ -1,7 +1,7 @@
package org.jcnc.snow.vm.engine;
import org.jcnc.snow.vm.commands.arithmetic.byte8.*;
-import org.jcnc.snow.vm.commands.arithmetic.conversion.I2LCommand;
+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.*;
@@ -18,7 +18,18 @@ import org.jcnc.snow.vm.commands.control.int32.*;
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;
@@ -507,7 +518,7 @@ public class VMOpCode {
*
*
*
This opcode is a fundamental arithmetic operation within the virtual machine's instruction set,
- * primarily used to handle basic double precision floating-point addition tasks.
+ * primarily used to handle basic double64 precision floating-point addition tasks.
*/
public static final int D_ADD = 41;
@@ -517,13 +528,13 @@ public class VMOpCode {
*
* Execution Steps:
*
- * - Pops the top two double values from the operand stack (the first value popped is the subtrahend, and the second value popped is the minuend).
- * - Performs the double precision floating-point subtraction operation by subtracting the subtrahend from the minuend (i.e.,
minuend - subtrahend).
+ * - 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 double precision floating-point subtraction tasks.
+ * primarily used to handle basic double64 precision floating-point subtraction tasks.
*/
public static final int D_SUB = 42;
@@ -1412,126 +1423,132 @@ public class VMOpCode {
// 5. Memory Operations (151–)
/**
- * I_STORE 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.
+ * I_STORE Opcode: Represents a store operation that saves an int32 value from the operand stack into the local variable store.
+ *
+ * This opcode is implemented by the {@link IStoreCommand} 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 later operations.
+ * - Pops the int32 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 later 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 results of computations or intermediate values into local variables.
+ * - Preserving state across instructions or method calls by saving values to the local frame.
+ * - Transferring values from the operand stack to the method-local scope.
*
*/
public static final int I_STORE = 151;
+
+
/**
- * L_STORE 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 ILoadCommand} 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 later 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 later 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 L_STORE = 152;
+
/**
- * 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 ILoadCommand} class, which defines its specific execution logic.
+ * 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.
- * - Retrieves the corresponding value from the local variable store of the current method frame.
- * - Pushes the retrieved value onto the operand stack for later operations.
+ * - 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:
*
- * - Loading local variables onto the operand stack for further operations or computations.
- * - Retrieving stored values that are needed for later 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 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 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 ILoadCommand} class, which defines its specific execution logic.
+ * 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.
- * - Retrieves the corresponding value from the local variable store of the current method frame.
- * - Pushes the retrieved value onto the operand stack for later operations.
+ * - 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:
*
- * - Loading local variables onto the operand stack for further operations or computations.
- * - Retrieving stored values that are needed for later 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.
+ * - 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 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 ILoadCommand} class, which defines its specific execution logic.
+ * 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.
- * - Retrieves the corresponding value from the local variable store of the current method frame.
- * - Pushes the retrieved value onto the operand stack for later operations.
+ * - 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:
*
- * - Loading local variables onto the operand stack for further operations or computations.
- * - Retrieving stored values that are needed for later 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.
+ * - 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 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 ILoadCommand} 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:
*
* - 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 later operations.
+ * - 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:
*
- * - Loading local variables onto the operand stack for further operations or computations.
- * - Retrieving stored values that are needed for later 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.
+ * - 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;
@@ -1559,7 +1576,7 @@ public class VMOpCode {
public static final int I_LOAD = 161;
/**
* 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 ILoadCommand} class, which defines its specific execution logic.
+ * This opcode is implemented by the {@link LLoadCommand} class, which defines its specific execution logic.
*
* Execution Steps:
*
@@ -1579,7 +1596,7 @@ public class VMOpCode {
public static final int L_LOAD = 162;
/**
* 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 ILoadCommand} class, which defines its specific execution logic.
+ * This opcode is implemented by the {@link SLoadCommand} class, which defines its specific execution logic.
*
* Execution Steps:
*
@@ -1599,7 +1616,7 @@ public class VMOpCode {
public static final int S_LOAD = 163;
/**
* 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 ILoadCommand} class, which defines its specific execution logic.
+ * This opcode is implemented by the {@link BLoadCommand} class, which defines its specific execution logic.
*
* Execution Steps:
*
@@ -1619,7 +1636,7 @@ public class VMOpCode {
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 ILoadCommand} class, which defines its specific execution logic.
+ * This opcode is implemented by the {@link DLoadCommand} class, which defines its specific execution logic.
*
* Execution Steps:
*
@@ -1639,7 +1656,7 @@ public class VMOpCode {
public static final int D_LOAD = 165;
/**
* 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 ILoadCommand} class, which defines its specific execution logic.
+ * This opcode is implemented by the {@link FLoadCommand} class, which defines its specific execution logic.
*
* Execution Steps:
*
diff --git a/test b/test
index 2d4c5b3..f1f4d9f 100644
--- a/test
+++ b/test
@@ -3,10 +3,11 @@ module: CommonTasks
parameter:
declare num1: int
declare num2: int
- return_type:void
+ return_type:int
body:
num1 = 10
+ return num1
end body
end function
end module