Skip to content

crystarm/module68

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

module68

module68 is a small virtual machine and assembler written in ALGOL 68. It runs .m68 text images and includes a minimal assembler for simple legacy .asm programs.

Requirements

  • Algol68G (a68g)
  • POSIX shell for scripts and tests

On Ubuntu/Debian:

sudo apt-get install algol68g

Usage

Run an existing .m68 image:

a68g src/module68_vm.a68 -- examples/hi.m68

Assemble a legacy .asm file:

chmod +x scripts/build-asm.sh
scripts/build-asm.sh input.asm output.m68

Enable VM tracing when needed:

a68g src/module68_vm.a68 -- --trace examples/hi.m68

The current assembler supports a small instruction set and does not resolve labels or jumps:

mov r0, 72
sys 1
halt

Tests

Run the shell testbench:

chmod +x tests/testbench.sh
tests/testbench.sh

Project layout

  • src/module68_vm.a68 — virtual machine implementation
  • src/module68_asm.a68 — minimal assembler
  • examples/ — sample assembly and .m68 images
  • tests/testbench.sh — automated VM/assembler testbench

About

ALGOL 68 sandbox where I build a tiny virtual CPU from scratch.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors