Currently aligned VM version: f7cf3534eed81454ed3f5db0a9097ed72920533d
This is the development toolchain for lampvm.
The built-in C compiler (
cc) is deprecated. Please use the LLVM backend for new projects. Theccpath is kept only for compatibility and may be removed in a future release.
This project is written in Rust, so you can compile it easily using cargo:
cargo build --releaseFor assemble:
./bin asm --input program.asm --output program.binFor compile C code (deprecated):
./bin cc main.cDetailed information for the deprecated C compiler is in document.
The assembler requires a config.yml file to be present in the current working directory.
By default, the configuration should look like this:
reg_count: 32
reg_prefix: "r"
macros:
MEM_SIZE: 4194304
IO_SIZE: 256
IVT_SIZE: 256
CALL_STACK_SIZE: 256
DATA_STACK_SIZE: 256
ISR_STACK_SIZE: 256
IVT_BASE: 0x0000
CALL_STACK_BASE: 0x800
DATA_STACK_BASE: 0x1000
PROGRAM_BASE: 0x201C
FB_WIDTH: 640
FB_HEIGHT: 480
FB_BPP: 4
FB_SIZE: 1228800
FB_BASE: 0x400000These settings are consistent with the VM's default configuration. In most cases, you do not need to change them. However, if you have a customized VM, please update this file to match your modifications.
The toolchain now emits a single binary file. The file layout is:
- Header: 6 little‑endian
u32valuesTEXT_BASETEXT_SIZE(bytes)DATA_BASEDATA_SIZE(bytes)BSS_BASEBSS_SIZE(bytes)
- Text section: instruction stream,
u64little‑endian - Data section: raw bytes
No separate .data or .layout files are produced.
✅ Support all instructions in lampVM
✅ Support labels
Support a subset of C