Commit Graph

68 Commits

Author SHA1 Message Date
Irmen de Jong
6ee270d9d8 make name a var in new ast to allow cheap renames 2023-01-22 17:10:04 +01:00
Irmen de Jong
3718b9d768 less joins 2023-01-02 02:10:38 +01:00
Irmen de Jong
c25eb088ec redo 8e730ef93d to avoid larger code generated 2023-01-01 23:43:33 +01:00
Irmen de Jong
3feb3e52f8 optimizing scoped names in zeropage 2022-12-31 03:57:51 +01:00
Irmen de Jong
8e730ef93d optimizing scoped names more and fix scoping of identifier names in arrays (pointers) in SymbolTable 2022-12-31 03:20:20 +01:00
Irmen de Jong
e0913a39ab optimizing 2022-12-30 18:50:45 +01:00
Irmen de Jong
d1d0115aed removed unused option 'keepIR' 2022-12-09 18:44:44 +01:00
Irmen de Jong
17bedac96c vm: memory is randomized on start instead of 0. P8ir file now has BSS segment. Vm clears BSS vars to 0. 2022-12-03 17:46:06 +01:00
Irmen de Jong
4831fad27a x16 emulators are now launched with PULSE_LATENCY_MSEC=10 env setting to mitigate static noise 2022-12-03 16:19:26 +01:00
Irmen de Jong
5e896cf582 preparing to add Golden RAM 2022-12-03 00:21:31 +01:00
Irmen de Jong
f470576822 it's now possible to use symbols that are the same name as 6502 instructions
because these are now prefixed internally before generating assembly.
2022-11-30 18:39:56 +01:00
Irmen de Jong
b8fb391022 - ir codegen now allows subroutine having the same name as its block
this is not possible for the 6502 codegen due to 64tass scoping limitation
2022-11-28 21:54:33 +01:00
Irmen de Jong
9d7b9771c2 p8ir file format is now valid XML 2022-11-11 23:35:52 +01:00
Irmen de Jong
30ee65fd14 ir: ensure that block and sub labels are also on the first chunk in said block/sub 2022-10-23 18:54:08 +02:00
Irmen de Jong
6fc89607d3 ir: moving to labeled chunks, no more IRLabel nodes 2022-10-07 00:34:56 +02:00
Irmen de Jong
af6be44676 ir: adding register usage inspections
fix compiler problems with untrimmed inlined asm, and when only a single return statement is present in a subroutine
2022-09-30 20:25:00 +02:00
Irmen de Jong
0d4dd385b8 added '%ir' to write inline IR code, '%asm' is now only for real 6502 assembly.
(%ir is probably only used in the library modules for the virtual machine target)
2022-09-30 15:12:26 +02:00
Irmen de Jong
7c1bdfe713 ir: uninitialized vars remain empty, bss section classifier (unused for now as there are no segements yet) 2022-09-28 16:56:50 +02:00
Irmen de Jong
7ea7e63f44 use require() more often 2022-09-27 18:27:55 +02:00
Irmen de Jong
0da117efd2 vm: get rid of .p8virt file and cruft 2022-09-26 19:28:40 +02:00
Irmen de Jong
1d65d63bd9 ir: making sure all names are scoped properly. textelite now runs in vm 2022-09-25 18:02:35 +02:00
Irmen de Jong
0e1886e6bd vm: fix nested label prefixing 2022-09-24 16:00:25 +02:00
Irmen de Jong
c26e116f0e vm: fix crashes when array contains pointers/strings 2022-09-24 14:42:07 +02:00
Irmen de Jong
ca2fb6cef3 IR no longer depends on VM syscalls but has its own syscall list for the few builtin functions that still require it 2022-09-23 14:27:51 +02:00
Irmen de Jong
fb22f78fb3 added '-keepIR' option to save the IR file if it's generated. 2022-09-20 12:30:22 +02:00
Irmen de Jong
d6393cdbe5 '-vm' option now also reads .p8ir files 2022-09-20 12:14:33 +02:00
Irmen de Jong
d07d00fa41 Join codeAst and codeCore modules 2022-09-19 17:28:18 +02:00
Irmen de Jong
0aa0ec5abd fix c64 zeropage locations of cx16 virtual registers 2022-08-13 00:14:19 +02:00
Irmen de Jong
666d62dd7a fix cx16.r0 base address to be $04 on the C-64, and fix zeropage duplicate free addresses 2022-08-12 17:49:31 +02:00
Irmen de Jong
4b7b1379d9 also binexpr split on and,or,xor if appropriate 2022-08-08 00:09:18 +02:00
Irmen de Jong
00b717cde8 tweak 2022-08-04 18:35:10 +02:00
Irmen de Jong
f531daa872 on C64, the cx16.r0...cx16.r15 virtual regs are now in zeropage as well when using kernalsafe or full 2022-07-28 19:13:33 +02:00
Irmen de Jong
5189eaca36 move the vm unit tests to codeGenVirtual module and remove virtualmachine dependency in the compiler module 2022-07-17 12:56:22 +02:00
Irmen de Jong
cfb31377fc c64 zeropage: added a few more locations to Kernalsafe free list that should be safe
this makes $02-$21 inclusive, available for use later (x16 virtual registers are placed here on x16...)
2022-07-17 12:12:47 +02:00
Irmen de Jong
edf12bec71 improve bool params typecasting, fix compiler crash on abs(floatvar) 2022-07-12 17:52:37 +02:00
Irmen de Jong
6181b12ab8 added -esa option to override the evalstack location, and shift cx16.r0-r15 accordingly 2022-07-11 19:29:04 +02:00
Irmen de Jong
88cbb6913d tweak bool type handling 2022-07-11 14:55:50 +02:00
Irmen de Jong
7a26646e1b tweak bool type handling 2022-07-11 02:08:12 +02:00
Irmen de Jong
1dfa8ee7d8 add ARRAY_BOOL array type 2022-07-07 23:07:30 +02:00
Irmen de Jong
41f4e22a17 introduce BOOL type 2022-07-07 22:23:56 +02:00
Irmen de Jong
b41779bd02 added -D command line option to define symbols in the assembly file 2022-07-06 23:40:36 +02:00
Irmen de Jong
965340ff90 logical and/or/xor/not all replaced by bitwise &,|,^,~ (ast, codegens)
this also fixed some invalid outcomes of logical expressions!
2022-07-02 00:38:17 +02:00
Irmen de Jong
2eb41a8caf temporary workaround for code problem around 'not' 2022-07-01 00:38:19 +02:00
Irmen de Jong
7901ec2a64 "not" no longer in LogicalOperators because it makes assembler generate invalid code somehow 2022-06-30 22:49:27 +02:00
Irmen de Jong
97cb0cbd08 tweak "not" removal/rewriting 2022-06-30 02:16:30 +02:00
Irmen de Jong
4b358abbb7 "not" operator removed from ast and codegen (it's been replaced with x==0 as equivalent) 2022-06-29 01:13:08 +02:00
Irmen de Jong
c6e92ecac4 some code cleanup 2022-06-12 16:15:08 +02:00
Irmen de Jong
710f27afa9 bump library versions 2022-06-09 22:44:17 +02:00
Irmen de Jong
926fdecd13 fix problematic path handling on windows in error messages 2022-06-05 11:54:19 +02:00
Irmen de Jong
af2ca7a67e fix problematic characters that cause path errors on Windows 2022-06-05 11:46:37 +02:00