Skip to content
neilsfPublic

About

A BASIC cross compiler for MOS 6502-based machines

Resources

Stars

66 stars

Watchers

4 watching

Forks

Repository files navigation

XC=BASIC 3

XC=BASIC is a cross compiled, modern BASIC programming language for MOS 65xx based targets. The supported targets are:

  • Commodore-64
  • Commodore VIC-20
  • Commodore-16
  • Commodore Plus/4
  • Commodore PET series
  • Commodore-128

XC=BASIC compiles BASIC source code to fast machine code. Although not 100% compatible, its syntax was designed to be similar to that of QuickBASIC and CBM BASIC.

Documentation

You can find the documentation (including installation instructions) at xc-basic.net.

Compiling from source

You can find pre-compiled binaries for Windows (x86_64), Linux (x86_64, ARM) and macOS (x86_64) in the bin/ dir. If you run a different operating system, you have to compile the program from source.

XC=BASIC was written in the D programming language. To compile it, you need

If you install DUB using a package manager, it will most likely install DMD as a dependency. When you have both installed, just cd to the XC=BASIC directory and issue the command:

make

This Makefile-based build first checks that dub is available in PATH, then does the full project build (including grammar generation) and places the executable at:

bin/$OSTYPE/xcbasic3

That's it, you can now run XC=BASIC.

Testing

The tests/functional directory contains a test harness with a growing set of test suites as .bas files. The harness compiles all suites, runs them in the Vice Emulator and compares memory dumps with the predefined golden data set.

To run the entire harness, issue the command:

./tests/functional/test.sh

To run a specific suite only:

./tests/functional/test.sh arith/bytes.bas

To run all suites in a directory:

./tests/functional/test.sh strings

About

A BASIC cross compiler for MOS 6502-based machines

Resources

Stars

66 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages