git @ Cat's Eye Technologies SixtyPical / 15e1fa5
Update documentation. Chris Pressey 7 years ago
3 changed file(s) with 23 addition(s) and 19 deletion(s). Raw diff Collapse all Expand all
55
66 * Each table has a specified size now (although, bounds checking is not performed.)
77 * Initialized `byte table` values need not have all 256 bytes initialized.
8 * Constraints for `vector` type come immediately after the type, not the variable.
9 * `vector table` storage, and ability to copy vectors in and out of same.
8 * Syntax for types has changed. `routine` (with constraints) is a type, while
9 `vector` is now a type constructor (taking `routine`s only) and `table` is
10 also a type constructor. This permits a new `vector table` type.
1011 * Added `typedef`, allowing the user to define type aliases for readability.
1112 * Added `define name routine {...}` syntax; `routine name {...}` is now legacy.
13 * Ability to copy vectors and routines into vector tables, and vectors out of same.
1214 * Removed the evaluator. The reference implementation only analyzes and compiles.
1315 * Fixed bug where index register wasn't required to be initialized before table access.
1416 * Fixed bug where trampolines for indirect calls weren't including a final `RTS`.
3737
3838 TODO
3939 ----
40
41 ### Demo game
42
43 Finish the little demo "game" where you can move a block around the screen with
44 the joystick (i.e. bring it up to par with the original demo game that was written
45 for SixtyPical)
4640
4741 ### `low` and `high` address operators
4842
1414 Types
1515 -----
1616
17 There are six *primitive types* in SixtyPical:
17 There are five *primitive types* in SixtyPical:
1818
1919 * bit (2 possible values)
2020 * byte (256 possible values)
2121 * word (65536 possible values)
2222 * routine (code stored somewhere in memory, read-only)
23 * vector (address of a routine)
2423 * pointer (address of a byte in a buffer)
2524
26 There are also two *type constructors*:
27
28 * T table (up to 256 entries, each holding a value of type T, where T is
29 either `byte` or `word`)
25 There are also three *type constructors*:
26
27 * T table[N] (N is a power of 2, 1 ≤ N ≤ 256; each entry holds a value
28 of type T, where T is `byte`, `word`, or `vector`)
3029 * buffer[N] (N entries; each entry is a byte; N is a power of 2, ≤ 64K)
30 * vector T (address of a value of type T; T must be a routine type)
31
32 ### User-defined ###
33
34 A program may define its own types using the `typedef` feature. Typedefs
35 must occur before everything else in the program. A typedef takes a
36 type expression and an identifier which has not previously been used in
37 the program. It associates that identifer with that type. This is merely
38 a type alias; two types with different names will compare as equal.
3139
3240 Memory locations
3341 ----------------
110118 of routines which are compatible. (Meaning, the routine's inputs (resp. outputs,
111119 trashes) must be a subset of the vector's inputs (resp. outputs, trashes.))
112120
113 vector actor_logic
114 inputs a, score
115 outputs x
116 trashes y
117 @ $c000
121 vector routine
122 inputs a, score
123 outputs x
124 trashes y
125 actor_logic @ $c000
118126
119127 Note that in the code of a routine, if a memory location is named by a
120128 user-defined symbol, it is an address in memory, and can be read and written.