git @ Cat's Eye Technologies SixtyPical / 0c22944
Able to parse, but not yet able to analyze, other table accesses. Chris Pressey 5 years ago
3 changed file(s) with 46 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
441441 elif self.scanner.token in ("shl", "shr", "inc", "dec"):
442442 opcode = self.scanner.token
443443 self.scanner.scan()
444 dest = self.locexpr()
444 dest = self.indexed_locexpr()
445445 return SingleOp(self.scanner.line_number, opcode=opcode, dest=dest, src=None)
446446 elif self.scanner.token in ("nop",):
447447 opcode = self.scanner.token
472472 | ld a, many + x
473473 | }
474474 ? UnmeaningfulReadError: x
475
476 There are other operations you can do on tables.
477
478 | byte table[256] many
479 |
480 | routine main
481 | inputs many
482 | outputs many
483 | trashes a, x, c, n, z
484 | {
485 | ld x, 0
486 | ld a, 0
487 | st off, c
488 | add a, many + x
489 | sub a, many + x
490 | cmp a, many + x
491 | and a, many + x
492 | or a, many + x
493 | xor a, many + x
494 | shl many + x
495 | shr many + x
496 | inc many + x
497 | dec many + x
498 | }
499 = ok
475500
476501 Copying to and from a word table.
477502
172172 | }
173173 = ok
174174
175 Tables of different types.
176
177 | byte table[256] tab
178 | word table[256] wtab
179 | vector (routine trashes a) table[256] vtab
180 |
181 | routine main {
175 Tables of different types and some operations on them.
176
177 | byte table[256] many
178 | word table[256] wmany
179 | vector (routine trashes a) table[256] vmany
180 |
181 | routine main {
182 | ld x, 0
183 | ld a, 0
184 | st off, c
185 | add a, many + x
186 | sub a, many + x
187 | cmp a, many + x
188 | and a, many + x
189 | or a, many + x
190 | xor a, many + x
191 | shl many + x
192 | shr many + x
193 | inc many + x
194 | dec many + x
182195 | }
183196 = ok
184197