PLASMA: A programming language for the 6502

I thought this may be of interest. PLASMA is a programming language for the 6502, implemented on the Apple I, Apple II, and Apple III, which means it’s basically portable to any 6502 system.

It compiles to a virtual machine which runs on the 6502. By using a byte code, the compiler code can be simple enough to self-host on the 6502 machine. The byte code interpreter implements a stack based VM closely matched to the 6502, using the 6502 hardware stack. There are versions of the compiler and VM that compile on UNIX (or cygwin) for a portable development environment, and bootstrap system.

The language feels like and algol-derivative like PASCAL or C,

I think the initial intention was to have options to compile to byte code, native code, or threaded code, but the author went with the byte code initially for simplicity. This seems like a great substrate for compiler experiments.

Dave

2 Likes

Cool!

It can do

A quick way to swap variables could be written:

a, b = b, a

just like Python…