From 59aef0c6616e8963e090444355c6393b62009213 Mon Sep 17 00:00:00 2001 From: Luke Date: Thu, 17 Jul 2025 17:05:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=20SYSCALL=20?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E7=A0=81=E7=9A=84=E8=AF=A6=E7=BB=86=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E5=B9=B6=E7=A7=BB=E9=99=A4=E6=9C=AA=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E7=9A=84=20DEBUG=5FTRAP=20=E6=93=8D=E4=BD=9C=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 为 SYSCALL 操作码添加了详细的注释,说明了其执行步骤和实现类- 注释掉了未使用的 DEBUG_TRAP 操作码 - 引入了 SyscallCommand 类以实现 SYSCALL 操作码的功能 --- src/main/java/org/jcnc/snow/vm/engine/VMOpCode.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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 73d8ed5..8e1a880 100644 --- a/src/main/java/org/jcnc/snow/vm/engine/VMOpCode.java +++ b/src/main/java/org/jcnc/snow/vm/engine/VMOpCode.java @@ -1,5 +1,6 @@ package org.jcnc.snow.vm.engine; +import org.jcnc.snow.vm.commands.system.control.SyscallCommand; 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.*; @@ -2646,8 +2647,18 @@ public class VMOpCode { * */ public static final int HALT = 0x0400; + /** + * SYSCALL Opcode: Represents a system call operation that invokes a system-level function or service. + *

This opcode is implemented by the {@link SyscallCommand} class, which defines its specific execution logic.

+ * + *

Execution Steps:

+ *
    + *
  1. Parses the system call identifier from the instruction parameters.
  2. + *
  3. Invokes the corresponding system-level function or service based on the system call identifier.
  4. + *
  5. Returns the result of the system call operation.
  6. + */ public static final int SYSCALL = 0x0401; - public static final int DEBUG_TRAP = 0x0402; +// public static final int DEBUG_TRAP = 0x0402; // endregion /**