As part of a future project to build a portable LC-3 simulator, I have written an almost complete LC-3 interpreter for the Parallax Propeller. LC-3 is a 16-bit word-addressable assembly language designed for the LC-3 micro computing system. The LC-3 system was designed for educational purposes and is designed so that it can conceivably be manually written as binary machine code. Wikipedia has a good description of the history of the system and the general purpose of it. In addition, there is a complete ISA available for download for LC-3. The object I’ve written has a few minor exceptions to the ISA which are described in the comments of the object.
The code is written in PASM and runs in a single cog. This was to allow you to write the LC-3 program over the HUB RAM without fear of overwriting existing SPIN code. This was my first “serious” coding project in PASM, so it took a bit longer than it should have taken getting around the learning curve of PASM. The finished source code can be DOWNLOADED HERE.
Thanks for reading!