git @ Cat's Eye Technologies SixtyPical / a12a44e
Re-enable disabled test and fix it and add a few related tests. Chris Pressey 6 years ago
4 changed file(s) with 40 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
00 History of SixtyPical
11 =====================
2
3 0.6-PRE
4 -------
5
6 * Added `routine` and `vector` types, and `copy` instruction.
27
38 0.5
49 ---
3333 For 0.6:
3434
3535 * `interrupt` routines.
36 * `vector` type.
37 * `with sei` blocks.
38 * `copy` instruction.
36 * `goto` (tail call).
37 * `vector` type... with declared `inputs` `outputs` `trashes`?
38 * `copy` instruction... that can copy a constant to a user-def mem loc.
3939 * A more involved demo for the C64 — one that sets up an interrupt.
4040
4141 For 0.7:
4242
4343 * `word` type.
4444 * `trash` instruction.
45 * zero-page memory locations.
4546 * indirect addressing.
4647
4748 At some point...
247247 self.scanner.scan()
248248 name = self.scanner.token
249249 self.scanner.scan()
250 # TODO: check that is has been defined
250 if name not in self.symbols:
251 raise SyntaxError('Undefined routine "%s"' % name)
252 if self.symbols[name].model.type != TYPE_ROUTINE:
253 raise SyntaxError('Illegal call of non-routine "%s"' % name)
251254 return Instr(opcode=opcode, name=name, dest=None, src=None)
252255 elif self.scanner.token in ("copy",):
253256 opcode = self.scanner.token
162162 | }
163163 ? SyntaxError
164164
165 > Can't call routine that hasn;t been defined.
166 >
167 > | routine main {
168 > | ld x, 0
169 > | ld y, 1
170 > | call up
171 > | call up
172 > | }
173 > ? SyntaxError
165 Can't call routine that hasn't been defined.
166
167 | routine main {
168 | ld x, 0
169 | ld y, 1
170 | call up
171 | call up
172 | }
173 ? SyntaxError
174
175 And you can't call a non-routine.
176
177 | byte up
178 |
179 | routine main {
180 | ld x, 0
181 | ld y, 1
182 | call up
183 | }
184 ? SyntaxError
185
186 | routine main {
187 | ld x, 0
188 | ld y, 1
189 | call x
190 | }
191 ? SyntaxError
174192
175193 Can't define two routines with the same name.
176194