Commit Graph

258 Commits

Author SHA1 Message Date
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
Irmen de Jong
625d5b2313 vm: some preparations for floating point 2022-04-26 21:08:32 +02:00
Irmen de Jong
ee36d47c27 vm: added cmp() and most of the status-branch instructions 2022-04-18 19:59:48 +02:00
Irmen de Jong
220246278a removed sum(), max(), min(). abs() now always returns uword type.
This greatly simplifies internal handling of builtin functions by always having one fixed return type.
2022-04-14 00:21:16 +02:00
Irmen de Jong
51bf33040a vm: add many builtin functions 2022-04-11 22:39:33 +02:00
Irmen de Jong
b6eb343234 moving string escaping out of antlr project 2022-04-10 17:31:30 +02:00
Irmen de Jong
207a7e5160 move operator lists 2022-04-10 13:24:17 +02:00
Irmen de Jong
d1b14b68fa x16 r39: more free ZP registers possible by enabling floatsafe option 2022-03-31 18:30:26 +02:00
Irmen de Jong
3e44620966 add unit test for the string encoders special handling of 0x0000 and 0x8000-0x80ff 2022-03-25 18:26:23 +01:00
Irmen de Jong
b5331d821c fix string encoding for escaped characters 2022-03-25 00:17:41 +01:00
Irmen de Jong
27f6d47efa working on vm codegen 2022-03-24 23:26:57 +01:00
Irmen de Jong
ff57c5e9d3 working on vm and new ast 2022-03-21 01:36:11 +01:00
Irmen de Jong
9b16d7c786 working on vm 2022-03-20 15:06:29 +01:00
Irmen de Jong
7d2bf892b1 added start of virtual machine compilation target 2022-03-19 00:57:35 +01:00
Irmen de Jong
92737bb695 better handling of loadAddress 2022-03-13 16:21:02 +01:00
Irmen de Jong
3961f26635 consolidating modules 2022-03-11 20:45:39 +01:00
Irmen de Jong
e51c274a18 reducing dependencies 2022-03-11 20:32:35 +01:00
Irmen de Jong
e75d0c58a9 reducing dependencies 2022-03-10 23:46:43 +01:00
Irmen de Jong
9a798360f4 introduced codeAst and codeCore modules to reduce dependencies 2022-03-10 22:38:16 +01:00