Skip to content

no-defun-allowed/lc3-in-lc3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Metacircular LC-3 implementation

This is a joke gone way too far. Unfortunately it allows you to run LC3 programs in a VM written in LC-3. I don't know of any practical uses for this.

The macro-assembler directory has the macro assembler, which roughly brings up a LC-3 assembler (I tested with laser) to nasm-ish standards. The vm directory has a VM implementation based on this guide, specifically the C++ template part. However, as code density is important with LC-3 and its tiny PC-relative ranges, we instead have each "part" be compiled exactly once, with threaded "microcode" sequencing parts.

We also handle the problem of fitting one 64 kiloword memory space into another with a simple virtual memory system, which pages into the host only when a page is written to. There is also a translation lookaside buffer with only one entry, which avoids calling ldb most of the time.

About

A metacircular LC3 implementation

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published