1
0
mirror of https://github.com/catseye/SixtyPical.git synced 2024-06-01 12:41:30 +00:00
Commit Graph

105 Commits

Author SHA1 Message Date
Chris Pressey
5f8802b305 Arrange license info in repo to follow REUSE 3.0 convention. 2024-02-02 12:10:23 +00:00
Chris Pressey
92b1cfeefb Implement tail-call optimization. 2019-10-22 12:23:15 +01:00
Chris Pressey
78a1f2910c Simplify and improve Emitter abstraction. 2019-10-22 11:55:21 +01:00
Chris Pressey
44d97c33a2 Better generation of code at tail of routines. 2019-10-22 11:37:00 +01:00
Chris Pressey
b9df1482c6 Pass next routine to each routine being compiled. 2019-10-22 10:32:14 +01:00
Chris Pressey
3f666f4385 Add reset instruction; much refactoring. 2019-05-14 08:56:35 +01:00
Chris Pressey
dd29b6fd4a Implement local locations that aren't statically initialized. 2019-05-13 12:32:18 +01:00
Chris Pressey
a0328b8840 Store type information in SymbolTable shared across phases. 2019-04-10 08:48:33 +01:00
Chris Pressey
4615d8d054 Distinct AST nodes for call and goto instructions. 2019-04-08 16:26:51 +01:00
Chris Pressey
b19267d3ba Checkpoint import of changes for version 0.19. 2019-04-08 11:50:54 +01:00
Chris Pressey
35a1053439 Support more modes on add and sub. 2018-12-12 10:34:25 +00:00
Chris Pressey
d1a29709f2 Add example test program for cmp-against-literal-word. Fix it. 2018-12-12 09:09:45 +00:00
Chris Pressey
97e6e619ff cmp can compare against a literal word. 2018-12-12 09:01:46 +00:00
Chris Pressey
94ee042a1e Fix order of operands in word-sized cmp. 2018-11-27 13:12:55 +00:00
Chris Pressey
dcc944d732 If add and sub can work on words, then cmp can work on words too. 2018-11-23 23:00:41 +00:00
Chris Pressey
e74c7f2b31 Initial attempt at 16-bit compare. Not super well tested yet. 2018-11-23 22:09:28 +00:00
Chris Pressey
19461bc205 Support save X, Y, Z {} as a shortcut syntax for nested saves. 2018-09-07 11:27:42 +01:00
Chris Pressey
0b6a66fdbb pyflakes. 2018-09-06 18:26:30 +01:00
Chris Pressey
c11869f322 Not making any promises, but reduce the errors under Python 3. 2018-09-05 21:45:58 +01:00
Chris Pressey
4986454733 Support save'ing user-defined locations. 2018-04-25 13:27:47 +01:00
Chris Pressey
07541d7913 Compile code for saving a, x, or y on the stack. 2018-04-25 13:15:53 +01:00
Chris Pressey
bc91ef1602 Compile byte-table add, sub, cmp, and, or, xor, shl, shr, inc, dec. 2018-04-18 16:32:12 +01:00
Chris Pressey
e565234d28 Support for shl foo and shr foo where foo is a byte storage. 2018-04-18 12:01:53 +01:00
Chris Pressey
3c7d95a724 Support for copy [ptra]+y, [ptrb]+y to indirect LDA indirect STA 2018-04-18 10:57:57 +01:00
Chris Pressey
70247e0e44 Generate zero-page code for and, or, and xor, when possible. 2018-04-17 17:58:26 +01:00
Chris Pressey
27df0d27db Optimize away RTS and JMP when possible. Fallthru stuff done. 2018-04-05 14:10:04 +01:00
Chris Pressey
2ca843ece7 Begin hooking the fallthru analysis up to the compilation phase. 2018-04-05 10:52:14 +01:00
Chris Pressey
fa1b0cfae1 Support branching and looping on the n flag. 2018-03-29 14:45:28 +01:00
Chris Pressey
ebe53f540c Fix bug when zero page address was $00. 2018-03-29 11:46:56 +01:00
Chris Pressey
eadf1eb4ae A byte or word table can be initialized with a list of constants. 2018-03-29 11:09:02 +01:00
Chris Pressey
2f513f7291 Initial support for initializing byte tables with list of bytes. 2018-03-29 10:45:18 +01:00
Chris Pressey
9b912de17c Accessing zero-page with ld and st generates zero-page opcodes. 2018-03-29 10:31:42 +01:00
Chris Pressey
1f992f8dbd Support of NOP opcode. 2018-03-28 14:52:16 +01:00
Chris Pressey
96fbe03ce7 Make compilation tests pass. 2018-03-14 16:27:33 +00:00
Chris Pressey
adb53f7a04 Almost compile for loops correctly. 2018-03-14 15:33:11 +00:00
Chris Pressey
9ad34ed34f Refine the AST classes even more. 2018-03-06 10:43:23 +00:00
Chris Pressey
8a7e3aaebb Flatten more. 2018-03-05 15:32:08 +00:00
Chris Pressey
1180d2fe2a Attempt to flatten the code for generating code for copy. 2018-03-05 15:22:47 +00:00
Chris Pressey
c194808e64 Label the various cases for compiling a copy instruction. 2018-03-05 13:23:09 +00:00
Chris Pressey
c85159a9c0 Start trying to clean up the code for compiling copy. 2018-03-05 12:34:24 +00:00
Chris Pressey
0a83d90515 Tighten structure of AST more. 2018-03-05 12:13:15 +00:00
Chris Pressey
5fa8c69bd2 Don't fudge the name of IndexRefs; dig in to find the ref's name. 2018-02-13 17:17:27 +00:00
Chris Pressey
7a024f3062 Compile static storage location access. 2018-02-09 16:13:09 +00:00
Chris Pressey
52fb1dc6b9 Inch toward compiling statics. 2018-02-09 14:44:41 +00:00
Chris Pressey
71cded0297 Move compiler towards being able to compile access to statics. 2018-02-09 14:13:39 +00:00
Chris Pressey
ca1c877a60 Support indirect refs in st, e.g. st a, [ptr] + y. 2018-02-09 11:23:18 +00:00
Chris Pressey
f92e1f15bf Tired: copy [ptr]+y, a. Wired: ld a, [ptr]+y. 2018-02-08 11:58:24 +00:00
Chris Pressey
34daad0e56 Make ld parse to a IndexedRef or IndirectRef (latter still todo.) 2018-02-08 11:04:11 +00:00
Chris Pressey
7c8f113c07 Properly store address (not contents) of routine into vector table. 2018-02-07 13:56:17 +00:00
Chris Pressey
6c1c1cb153 Include final RTS when emitting trampolines for indirect calls. 2018-02-07 11:11:14 +00:00