A tiny custom virtual machine and assembly-like language written in C.
This project is a great example of a small interpreter pipeline:
- read
.pvbsource files - tokenize instructions with a lexer
- convert them into
Instructionobjects - execute them in a simulated machine with registers, flags, and a stack
- support low-level syscall-like behavior
It blends ideas from:
- assembly language
- virtual machines
- interpreters
- low-level systems programming
- CPU-style control flow and branching
_start:
mov $5, rax
mov $7, rbx
add rbx, rax
push rax
print
exitThis moves values into registers, adds them, pushes the result onto the stack, prints the stack, and exits.
The full guide lives here:
docs/language-guide.md
It includes:
- instruction references
- syscall documentation
- beginner-friendly explanations
- recruiter-friendly summaries
- examples you can run in the repo
src/lexer.c- parsing and tokenizationsrc/inst.h- instruction and syscall definitionssrc/inst.c- execution logic and VM runtimeexamples/- sample programsdocs/- language notes and reference material
./build.shThis compiles the VM and runs it against file.pvb.

