工具链流水线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 命令、0xFFE1–0xFFE3 参数、0xFFE4 返回值)与宿主操作系统交互。支持 mmap、文件 I/O、堆分配、控制台 I/O、进程控制(SYS_EXIT=18、SYS_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, 0xFFE1–0xFFE3 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 | 动态 trace | Dynamic 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.