Version 0.21|See also:Bubble Escape 2K∘SITU-SOL
NOTE: Having met the majority of its goals, the SixtyPical projectmight not undergo much more development going forward. SeeFuture directions for SixtyPicalfor more information.
SixtyPical brings advanced static analysis to the6502.
SixtyPical is alow-level programming languagesupporting some advancedstatic analysis methods.Its reference compiler can generateefficient code forseveral 6502-basedtarget platforms while catching manycommon mistakes at compile-time, reducing the time spent in debugging.
Make sure you have Python (2.7 or 3.5+) installed. Thenclone this repository and put itsbin directory on yourexecutable search path. Then you can run:
sixtypicalIf you have theVICE emulator suite installed, you can run
sixtypical --run-on=x64 eg/c64/hearts.60pand it will compile thehearts.60p source code andautomatically start it in thex64 emulator, and you should see:
You can trysixtypical --run-on on other sources in theeg directorytree, which contains more extensive examples, including an entiregame(-like program); seeeg/README.md for a listing.
SixtyPical aims to fill this niche:
SixtyPical gives the programmer a coding regimen on par with assemblylanguage in terms of size and hands-on-ness, but also able to catchmany ridiculous silly errors at compile time.
Many of SixtyPical's primitive instructions resemble those of theMOS Technology 6502 — it is in fact intended to be compiled to 6502machine code. However, it also provides some "higher-level" operationsbased on common 8-bit machine-language programming idioms, including
While a programmer will find these constructs convenient, theirinclusion in the language is primarily to make programs easier to analyze.
The SixtyPical language defines aneffect system, and the referencecompilerabstractly interprets the input program in the manner offlow typing to confirm that it does not violate it. This can detectcommon mistakes such as
Unlike most conventional languages, in SixtyPical the programmer must managememory very explicitly, selecting the registers and memory locations to storeeach piece of data in. So, unlike a C compiler such ascc65, a SixtyPicalcompiler doesn't need to generate code to handlecalling conventions orregister allocation. This results in smaller (and thus faster) programs.
The flagship demo, a minigame for the Commodore 64, compiles toa930-byte.PRG file.
The reference implementation can analyze and compile SixtyPical programs to6502 machine code formats which can run on several 6502-based 8-bit architectures:
For example programs for each of these, seeeg/README.md.
SixtyPical is defined by a specification document, a set of test cases,and a reference implementation written in Python.
There are over 400 test cases, written inFalderal format for readability.In order to run the tests for compilation,dcc6502 needs to be installed.