Pascal compiler(s) and runtime library targeting the COR24 p-code VM.
compiler/ Pascal compiler (C, compiled by tc24r, runs on COR24)
runtime/ Runtime library (written in Pascal)
scripts/ Build and utility scripts
.pas -> p24p (compiler/) -> .spc
|
runtime/runtime.spc -------------+
v
pl24r (linker)
|
v
pa24r (assembler) -> .p24 bytecode
|
v
pvm.s (COR24 VM)
unit.pas -> p24p -> unit.spc + unit.spi
main.pas -> p24p (with SPI) -> main.spc
pa24r unit.spc -> unit.p24
pa24r main.spc -> main.p24
p24-load main.p24 unit.p24 p24p_rt.p24 -> image.p24m
pvm.s image.p24m
- Integer, boolean, char types
- Arrays, records (including array fields), pointer types (
^T) new/disposefor heap allocation- Procedures and functions (nested, forward-declared, pointer return types)
- User-defined units (
unit/interface/implementation) with cross-unit procedure calls - Control flow: if/else, while, for, repeat/until, case, exit
- Standard I/O: read, readln, write, writeln
- 128 string literals (packed pool)
- Up to 256 symbols, 128 procedures, 32 KB source input
Sibling repos (cloned under ~/github/sw-embed/):
sw-cor24-pcode— p-code assembler (pa24r), linker (pl24r), VM (pvm.s)sw-cor24-emulator— COR24 emulator (cor24-run)
# Build p-code tools
./scripts/build.sh
# Run a Pascal program
./compiler/scripts/run-pascal.sh compiler/tests/t01_factorial.pas
# Run a multi-unit program
./compiler/scripts/run-multi-unit.sh compiler/tests/t37_multi_mathlib.pas compiler/tests/t37_mathlib.pas
# Run all regression tests
./compiler/scripts/test-all.sh- sw-cor24-basic — 1970s-terminal-inspired "Time Sharing" BASIC interpreter for COR24 ISA hardware and emulator.
runtime/— the Pascal runtime library in this repo is itself written in Pascal.
- Blog: Software Wrighter Lab
- Discord: Join the community
- YouTube: Software Wrighter
Copyright (c) 2026 Michael A Wright. MIT-licensed; see LICENSE.