Tweaks to README.
Cat's Eye Technologies
8 years ago
6 | 6 | It is a **work in progress**, currently at the **proof-of-concept** stage. |
7 | 7 | |
8 | 8 | It is expected that a common use case for SixtyPical would be retroprogramming |
9 | for the Commodore 64 and other 6502-based computers such as the VIC-20. | |
9 | for the Commodore 64 and other 6502-based computers such as the VIC-20, the | |
10 | Apple ][+, and the NES. | |
10 | 11 | |
11 | 12 | Many SixtyPical instructions map precisely to 6502 opcodes. However, SixtyPical |
12 | 13 | is not an assembly language: the programmer does not have total control over |
28 | 29 | If you have `ghc`, Ophis, and VICE 2.4 installed, clone this repo, `cd` into it, |
29 | 30 | and run |
30 | 31 | |
31 | ./loadngo.sh eg/demo.60p | |
32 | ./loadngo.sh eg/game.60p | |
32 | 33 | |
33 | 34 | The Big Idea(s) |
34 | 35 | --------------- |
44 | 45 | reserve byte lives |
45 | 46 | reserve word score |
46 | 47 | routine do_it { |
47 | lda score ; no! can't treat word as if it were a byte | |
48 | lda lives, x ; no! can't treat a byte as if it were a table | |
48 | lda score // no! can't treat word as if it were a byte | |
49 | lda lives, x // no! can't treat a byte as if it were a table | |
49 | 50 | } |
50 | 51 | |
51 | 52 | ### Abstract Interpretation ### |
59 | 60 | routine do_it { |
60 | 61 | lda #0 |
61 | 62 | jsr update_score |
62 | sta vic_border_colour ; uh... what do we know about reg A here? | |
63 | sta vic_border_colour // uh... what do we know about reg A here? | |
63 | 64 | } |
64 | 65 | |
65 | 66 | ...is illegal *unless* one of the following is true: |
66 | 67 | |
67 | 68 | * the A register is declared to be a meaningful output of `update_score` |
68 | * `update_score` was determined to not change the value of the A register | |
69 | * `update_score` was analyzed and determined to not change the value of the | |
70 | A register | |
69 | 71 | |
70 | 72 | The first case must be done with an explicit declaration on `update_score`. |
71 | 73 | The second case will be be inferred using abstract interpretation of the code |
151 | 153 | -------------------- |
152 | 154 | |
153 | 155 | For more information, see the docs (which are written in the form of |
154 | Falderal literate test suites. If you have Falderal installed, you can run | |
155 | the tests with `./test.sh`.) | |
156 | [Falderal](http://catseye.tc/node/Falderal) literate test suites. If you | |
157 | have `falderal` on your executable search path, you can run the tests with | |
158 | `./test.sh`.) | |
156 | 159 | |
157 | 160 | * [Checking](https://github.com/catseye/SixtyPical/blob/master/doc/Checking.markdown) |
158 | 161 | * [Analyzing](https://github.com/catseye/SixtyPical/blob/master/doc/Analyzing.markdown) |
163 | 166 | --------- |
164 | 167 | |
165 | 168 | Some (OK, a lot) of the Haskell code is kind of gross and non-idiomatic. |
166 | The parser, in particular, would not be described as "elegant". There | |
169 | The parser, in particular, could not be described as "elegant". There | |
167 | 170 | could definitely be more higher-order functions defined and used. At the |
168 | 171 | same time, I'm really not a fan of pointless style — I prefer it when things |
169 | 172 | are written out explicitly and pedantically. Still, there are places where |
173 | 176 | are translated into an intermediate representation which is arguably CISC-like. |
174 | 177 | For example, `lda`, `sta`, `ldx`, and `tax` all become kinds of `COPY` |
175 | 178 | internally. This internal instruction set is much smaller than the 6502's, |
176 | and thus is usually easier to analyze. | |
179 | and thus is usually easier to analyze. It would also be easier to adapt to | |
180 | other instruction sets, such as the Z80 or the 8086. | |
177 | 181 | |
178 | 182 | Notes |
179 | 183 | ----- |
213 | 217 | * Addressing modes — indexed mode on more instructions |
214 | 218 | * Rename and lift temporaries in nested blocks |
215 | 219 | * Tail-recursion optimization |
220 | * `word 100` to promote an otherwise 8-bit literal to a 16-bit value | |
216 | 221 | * `jmp routine` |
217 | 222 | * Enforce that `jmp`s come at ends of blocks(?) |
218 | 223 | * `outputs` on externals |