⚠️ 本网站已停止维护,文档已迁移至 GitHub docs/ 目录 | ⚠️ This website is no longer maintained. Docs moved to GitHub docs/

工具链流水线Toolchain Pipeline

JVAV 工具链包含四个核心组件,从高级语言到执行一次到位。

The JVAV toolchain consists of four core components, taking you from high-level source to execution.

JVL 源码 .jvlJVL Source .jvl

↓  jvlc  前端编译器↓  jvlc  Frontend Compiler

JVAV 汇编 .jvavJVAV Assembly .jvav

↓  jvavc  后端汇编器/链接器↓  jvavc  Backend Assembler / Linker

128-bit 二进制 .bin128-bit Binary .bin

↓  jvm  虚拟机↓  jvm  Virtual Machine

运行结果Execution Result

stdout / exit code

jvlc — 前端编译器jvlc — Frontend Compiler

将 JVL 高级语言编译为 JVAV 汇编。支持模块化导入、类型推断、MimiWorld 所有权检查。

Compiles JVL high-level language to JVAV assembly. Supports modular imports, type inference, and MimiWorld ownership checking.

Command说明Description
jvlc -v显示版本号Show version
jvlc a.jvl a.jvav编译为汇编Compile to assembly
jvlc --run a.jvl一键编译并运行Compile and run
jvlc --run a.jvl -o out.bin保留二进制输出Keep binary output

jvavc — 后端汇编器jvavc — Backend Assembler

将 JVAV 汇编编码为 128-bit 二进制。支持多文件链接、标签解析、EQU 定义,以及 .syscall 伪指令自动生成系统调用包装器。

Encodes JVAV assembly into 128-bit binary. Supports multi-file linking, label resolution, EQU definitions, and the .syscall pseudo-instruction for auto-generating syscall wrappers.

Command说明Description
jvavc -v显示版本号Show version
jvavc a.jvav out.bin单文件汇编Single-file assemble
jvavc a.jvav b.jvav -o out.bin多文件链接Multi-file link
    .syscall putint, 15, 1   ; name, cmd_id, arg_count

jvm — 虚拟机jvm — Virtual Machine

128-bit 字寻址虚拟机,C99 实现。执行 JVAV 二进制文件。通过系统调用邮箱(0xFFE0 命令、0xFFE10xFFE3 参数、0xFFE4 返回值)与宿主操作系统交互。支持 mmap、文件 I/O、堆分配、控制台 I/O、进程控制(SYS_EXIT=18SYS_PUTSTR=19)以及休眠(SYS_SLEEP=20)。

128-bit word-addressable virtual machine, implemented in C99. Executes JVAV binary files. Interacts with the host OS via a syscall mailbox (0xFFE0 command, 0xFFE10xFFE3 arguments, 0xFFE4 return value). Supports mmap, file I/O, heap allocation, console I/O, process control (SYS_EXIT=18, SYS_PUTSTR=19), and sleep (SYS_SLEEP=20).

Command说明Description
jvm -v显示版本号Show version
jvm program.bin执行二进制Run binary

disasm — 反汇编器disasm — Disassembler

静态反汇编与动态 trace 模式。用于调试 JVAV 二进制。

Static disassembly and dynamic trace mode. Used for debugging JVAV binaries.

Command说明Description
disasm -v显示版本号Show version
disasm file.bin静态反汇编Static disassembly
disasm -t file.bin动态 traceDynamic trace

构建与安装Build & Install

cmake -S . -B build
cmake --build build

构建完成后,可执行文件位于 build/bin/,标准库位于 std/

After building, executables are in build/bin/ and the standard library is in std/.

安装 / 打包Install / Package

cmake -S . -B build -DCMAKE_INSTALL_PREFIX=install
cmake --build build --config Release
cmake --install build --config Release

所有二进制均为静态链接,解压后即可运行,无需额外依赖。 安装目录内 bin/std/ 同级,将 bin/ 加入 PATH 即可全局使用。

All binaries are statically linked — extract and run, no extra dependencies. std/ sits alongside bin/ in the install directory; add bin/ to PATH for global access.