git @ Cat's Eye Technologies SixtyPical / 6cf8b5f
Spec and tests for initial values of locations. Chris Pressey 5 years ago
3 changed file(s) with 28 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
4343
4444 For 0.7:
4545
46 * always analyze before executing or compiling, unless told not to
46 * initialized `byte` memory locations
47 * initialized `byte table` memory locations
4748 * `word` type.
4849 * `word table` type.
4950
5253 * zero-page memory locations.
5354 * indirect addressing.
5455
56 For 0.9
57
58 * save registers on stack or in memory (the preserves them = not trashed)
59
5560 At some point...
5661
62 * always analyze before executing or compiling, unless told not to
5763 * `trash` instruction.
5864 * `interrupt` routines.
5965 * 6502-mnemonic aliases (`sec`, `clc`)
6167 * have `copy` instruction able to copy a constant to a user-def mem loc, etc.
6268 * add absolute addressing in shl/shr, absolute-indexed for add, sub, etc.
6369 * check and disallow recursion.
70 * automatic tail-call optimization (could be tricky, w/constraints?)
71 * re-order routines and optimize tail-calls to fallthroughs
00 SixtyPical
11 ==========
22
3 This document describes the SixtyPical programming language version 0.6,
3 This document describes the SixtyPical programming language version 0.7-PRE,
44 both its execution aspect and its static analysis aspect (even though
55 these are, technically speaking, separate concepts.)
66
7878
7979 byte pos
8080
81 A location in memory may be given explicitly on a user-defined memory location.
81 An address in memory may be given explicitly on a user-defined memory location.
8282
8383 byte table screen @ 1024
84
85 Or, a user-defined memory location may be given an initial value. But in this
86 case, an explicit address in memory cannot be given.
87
88 byte pos = 0
89 byte table scores = [1, 3, 8, 17, 26, 100]
8490
8591 A user-defined vector memory location is decorated with READS and WRITES lists
8692 like a routine (see below), and it may only hold addresses of routines which
122122 | }
123123 = ok
124124
125 Extern memory locations
125 Extern memory locations.
126126
127127 | byte screen @ 1024
128128 |
129129 | routine main {
130130 | ld a, 100
131131 | st a, screen
132 | }
133 = ok
134
135 Initialized memory locations.
136
137 | byte lives = 3
138 |
139 | routine main {
140 | ld a, lives
141 | st a, lives
132142 | }
133143 = ok
134144