50 | 50 |
|
51 | 51 |
Many of SixtyPical's primitive instructions resemble those of the
|
52 | 52 |
[MOS Technology 6502][] — it is in fact intended to be compiled to 6502
|
53 | |
machine code. However, it also does provide some "higher-level" operations
|
|
53 |
machine code. However, it also provides some "higher-level" operations
|
54 | 54 |
based on common 8-bit machine-language programming idioms, including
|
55 | 55 |
|
56 | 56 |
* copying values from one register to another (via a third register when
|
|
64 | 64 |
|
65 | 65 |
### Static analysis
|
66 | 66 |
|
67 | |
The language defines an [effect system][], and the reference
|
|
67 |
The SixtyPical language defines an [effect system][], and the reference
|
68 | 68 |
compiler [abstractly interprets][] the input program to check that
|
69 | 69 |
it conforms to it. It can detect common mistakes such as
|
70 | 70 |
|
|
76 | 76 |
|
77 | 77 |
### Efficient code
|
78 | 78 |
|
79 | |
Unlike most languages, in SixtyPical the programmer must manage memory very
|
80 | |
explicitly, selecting the registers and memory locations to store all data in.
|
81 | |
So, unlike a C compiler such as [cc65][], a SixtyPical compiler doesn't need
|
82 | |
to generate code to handle [calling conventions][] or [register allocation][].
|
83 | |
This results in smaller (and thus faster) programs.
|
|
79 |
Unlike most conventional languages, in SixtyPical the programmer must manage
|
|
80 |
memory very explicitly, selecting the registers and memory locations to store
|
|
81 |
each piece of data in. So, unlike a C compiler such as [cc65][], a SixtyPical
|
|
82 |
compiler doesn't need to generate code to handle [calling conventions][] or
|
|
83 |
[register allocation][]. This results in smaller (and thus faster) programs.
|
84 | 84 |
|
85 | 85 |
The flagship demo, a minigame for the Commodore 64, compiles to
|
86 | 86 |
a **930**-byte `.PRG` file.
|
|
97 | 97 |
|
98 | 98 |
For example programs for each of these, see [eg/README.md](eg/README.md).
|
99 | 99 |
|
100 | |
Documentation
|
|
100 |
Specification
|
101 | 101 |
-------------
|
102 | 102 |
|
103 | 103 |
SixtyPical is defined by a specification document, a set of test cases,
|
104 | 104 |
and a reference implementation written in Python.
|
105 | 105 |
|
106 | |
* [Design Goals](doc/Design%20Goals.md)
|
|
106 |
There are over 400 test cases, written in [Falderal][] format for readability.
|
|
107 |
In order to run the tests for compilation, [dcc6502][] needs to be installed.
|
|
108 |
|
107 | 109 |
* [SixtyPical specification](doc/SixtyPical.md)
|
108 | |
* [SixtyPical revision history](HISTORY.md)
|
109 | 110 |
* [Literate test suite for SixtyPical syntax](tests/SixtyPical%20Syntax.md)
|
110 | 111 |
* [Literate test suite for SixtyPical analysis](tests/SixtyPical%20Analysis.md)
|
111 | 112 |
* [Literate test suite for SixtyPical compilation](tests/SixtyPical%20Compilation.md)
|
112 | 113 |
* [Literate test suite for SixtyPical fallthru optimization](tests/SixtyPical%20Fallthru.md)
|
|
114 |
|
|
115 |
Documentation
|
|
116 |
-------------
|
|
117 |
|
|
118 |
* [Design Goals](doc/Design%20Goals.md)
|
|
119 |
* [SixtyPical revision history](HISTORY.md)
|
113 | 120 |
* [6502 Opcodes used/not used in SixtyPical](doc/6502%20Opcodes.md)
|
114 | 121 |
* [Output formats supported by `sixtypical`](doc/Output%20Formats.md)
|
115 | 122 |
* [TODO](TODO.md)
|
|
125 | 132 |
[Commodore VIC-20]: https://en.wikipedia.org/wiki/Commodore_VIC-20
|
126 | 133 |
[Atari 2600]: https://en.wikipedia.org/wiki/Atari_2600
|
127 | 134 |
[Apple II series]: https://en.wikipedia.org/wiki/Apple_II_series
|
|
135 |
[Falderal]: https://catseye.tc/node/Falderal
|
|
136 |
[dcc6502]: https://github.com/tcarmelveilleux/dcc6502
|