Documentation
Everything you need to write, compile, and execute Turbo programs — from source code to silicon.
What is Turbo?
Turbo is a statically-typed programming language with a C-like syntax. The Turbo toolchain compiles .turbo source files through two stages:
- Compilation — the compiler parses source code, builds an AST, type-checks it, allocates registers, and emits Turbo assembly (
.asm). - Assembly — the assembler resolves labels, encodes instructions into the Turbo binary format (
.bin), and produces an executable.
The resulting binary can be run on the software simulator (included in the toolchain) or loaded onto the Turbo Processor, a hardware CPU written in SystemVerilog that implements the same 32-bit RISC instruction set.
Quick Start
# Install the CLI (requires Rust/Cargo)
cargo install turbo-lang
# Write your first program
echo 'fn main() -> int { return 42; }' > hello.turbo
# Compile and run in one step
turbo run hello.turbo
# → 42
# Step through interactively
turbo sim hello.turbo --debugCLI Commands
| Command | Description |
|---|---|
turbo run <file.turbo> | Compile and execute in the simulator |
turbo build <file.turbo> | Compile to a .bin binary |
turbo asm <file.asm> | Assemble a Turbo assembly file |
turbo disasm <file.bin> | Disassemble a binary back to readable assembly |
turbo sim <file.bin> | Run a binary in the simulator |
References
ISA Reference
Complete specification of the 32-bit RISC instruction set — 28 opcodes, 16 registers, 4 instruction formats, and the binary file layout.
Language Spec
The Turbo language grammar, type system, operators, control flow, and example programs.
Processor
Hardware architecture docs — single-cycle and pipelined datapaths, forwarding, hazards, and SystemVerilog module breakdown.