crustyBASIC

I have written a BASIC cross-compiler in Rust for 80s era computers and consoles. It takes BASIC source and generates native machine code for the target machine instead of leaving everything to the original interpreter.

Targets include Apple II, Atari 8-bit, Atari 5200, Atari 2600, Commodore 64, VIC-20, TRS-80 Color Computer, and the NES. Plus/4, DOS 16-bit, IBM PCjr, and Tandy 1000 support is coming very soon. The 6502 machines were the original itch, but I also wanted the Color Computer in there because the 6809 deserves some attention too.

The compiler can stop at assembly if you want to poke around, or it can call the target assembler and build a runnable program or cartridge image. It also has compatibility dialects for old BASIC listings and a detokenizer for pulling source back out of tokenized programs.

C64 graphics example Color Computer character dungeon example DOS 16-bit VGA burst example
Plus/4 TED palette example NES snake example Atari 2600 sprite example

Quick example:

@OPTION TARGET "c64"

CLS
POSITION 0, 0
PRINT "HELLO, WORLD!"

Build it into a C64 .prg like this:

crustybasic build hello.cbs -o hello.prg

Latest version 1.1.0 : Released 06/07/26

  GitHub source

  Windows, macOS, and Linux binaries

  itch.io page

  Usage guide

  Language reference

  More screenshots