Irmen de Jong
|
1bdc427d73
|
multi var declarations ubyte x,y,z
|
2023-12-08 22:18:21 +01:00 |
|
Irmen de Jong
|
6a639ce533
|
chained assignments x=y=z=42
|
2023-12-08 01:07:16 +01:00 |
|
Irmen de Jong
|
8e4319cd5a
|
module directive %encoding to set the text encoding for that whole file (iso, petscii, etc.)
|
2023-12-06 23:54:08 +01:00 |
|
Irmen de Jong
|
ee782e92ac
|
fix cast error and vm float parsing
|
2023-12-05 22:51:15 +01:00 |
|
Irmen de Jong
|
b09e0a05bf
|
some tweaks to errors about long integer literals
|
2023-12-03 02:45:26 +01:00 |
|
Irmen de Jong
|
c609e982fe
|
allow const expression intermediate values to be 32 bits integers to avoid needless overflow errors.
|
2023-12-03 01:48:12 +01:00 |
|
Irmen de Jong
|
c45fbe6310
|
continue stmt added
|
2023-11-25 01:14:35 +01:00 |
|
Irmen de Jong
|
62d3f01948
|
fix name check in inline asm
this no longer removes a subroutine that is otherwise only called from inlined asm.
|
2023-11-21 01:26:50 +01:00 |
|
Irmen de Jong
|
7e3b8c2c59
|
fix compiler crash on certain subroutine inlining attempts.
|
2023-11-09 21:16:12 +01:00 |
|
Irmen de Jong
|
3b0d7ea960
|
better const-evaluation of addressOf a memory mapped variable
|
2023-11-08 22:04:41 +01:00 |
|
Irmen de Jong
|
ee2888e744
|
verafx.mult/muls now return upper 16 bits of the result in r0
|
2023-11-06 21:55:58 +01:00 |
|
Irmen de Jong
|
0904712a00
|
remove last trace of getTempVar (arry index expression)
tiny optimization
|
2023-10-27 21:41:52 +02:00 |
|
Irmen de Jong
|
880c0a5da8
|
allow taking address of array element
|
2023-09-18 04:37:41 +02:00 |
|
Irmen de Jong
|
00b0ec58b4
|
update to Antlr 4.13.1
|
2023-09-14 21:11:55 +02:00 |
|
Irmen de Jong
|
6afdd4e6fd
|
preparing next version
|
2023-09-12 21:53:49 +02:00 |
|
Irmen de Jong
|
c15c10a94e
|
fixed 'unroll CONSTANTEXPR' compiler errors
|
2023-09-05 01:03:35 +02:00 |
|
Irmen de Jong
|
525a9b5036
|
prepare parser to allow chained array indexing later
|
2023-09-03 19:06:47 +02:00 |
|
Irmen de Jong
|
66857ca477
|
prepare parser to be more flexible with array indexed expressions
|
2023-08-15 13:07:01 +02:00 |
|
Irmen de Jong
|
f98ee326b4
|
error when doing txt.print('@') where "@" was intended (byte for string parameter)
|
2023-08-14 19:25:31 +02:00 |
|
Irmen de Jong
|
2c9e50873c
|
use math.square for optimized X*X calculation (words only).
Added IR SQUARE instruction.
|
2023-08-14 01:05:17 +02:00 |
|
Irmen de Jong
|
7c0bde7310
|
parser: allow curly brace on next line for asmsub too
downgrade antlr4 one version again to what is used in IntelliJ's antlr plugin, to avoid potential version conflicts
|
2023-08-09 20:01:12 +02:00 |
|
Irmen de Jong
|
c223702ea0
|
code cleanups
|
2023-07-30 18:42:45 +02:00 |
|
Irmen de Jong
|
70c9ab9074
|
upgrade libraries
|
2023-07-06 23:33:58 +02:00 |
|
Irmen de Jong
|
6d1fdf1ba6
|
upgrade to Kotlin 1.9.0
|
2023-07-06 23:03:47 +02:00 |
|
Irmen de Jong
|
0db141eeac
|
todo
|
2023-07-02 21:19:33 +02:00 |
|
Irmen de Jong
|
c544b7f5ba
|
fixing up p8_ prefixing
|
2023-07-02 21:15:05 +02:00 |
|
Irmen de Jong
|
bb95484c8a
|
uniform symbol prefixing with p8_
|
2023-07-02 06:15:09 +02:00 |
|
Irmen de Jong
|
cad18b8a3a
|
uniform symbol prefixing with p8_
|
2023-07-02 06:15:02 +02:00 |
|
Irmen de Jong
|
e7b631b087
|
allow comment lines inside array initializer value
|
2023-06-27 23:30:37 +02:00 |
|
Irmen de Jong
|
bb35a80177
|
%option splitarrays now also at module level
|
2023-05-31 21:50:41 +02:00 |
|
Irmen de Jong
|
bb9d29b061
|
fix an array literal assignment type error for word arrays
|
2023-05-30 22:46:37 +02:00 |
|
Irmen de Jong
|
52a77db60f
|
adding split array type
|
2023-05-26 19:11:07 +02:00 |
|
Irmen de Jong
|
91e1643627
|
update 3rd party libraries
|
2023-05-18 11:47:30 +02:00 |
|
Irmen de Jong
|
1fa2e2e37d
|
3rd party library versions upgrades
|
2023-03-26 21:36:21 +02:00 |
|
Irmen de Jong
|
6218c1c00b
|
fix too greedy expression simplification
could cause problems when variables occur multiple times in the same expression.
Fixes #101
|
2023-03-22 18:25:28 +01:00 |
|
Irmen de Jong
|
1152191f48
|
add optimization: replace simple for loops by repeat loop
|
2023-03-15 21:11:37 +01:00 |
|
Irmen de Jong
|
af1b07ad44
|
add more referencesIdentifier() on ast nodes
|
2023-03-15 20:44:24 +01:00 |
|
Irmen de Jong
|
ff6948cf2d
|
syntax defs for unroll
|
2023-03-14 23:52:07 +01:00 |
|
Irmen de Jong
|
fd25e85d59
|
added unroll loop construct
|
2023-03-14 23:37:49 +01:00 |
|
Irmen de Jong
|
f20ca06f85
|
give correct error when using memory mapped var as array pointer
|
2023-03-11 00:26:19 +01:00 |
|
Irmen de Jong
|
25199dfb43
|
change tokenizer so that A,X,Y now are parsed correctly as identifiers as well
|
2023-03-08 22:57:19 +01:00 |
|
Irmen de Jong
|
fc253237c9
|
fix issues with reporting inlined subroutines as unused
|
2023-03-07 23:47:14 +01:00 |
|
Irmen de Jong
|
b3b380964c
|
remove searchParameter() from lookups
it shouldn't be needed to look up subroutine parameters by scoped name
|
2023-03-04 13:24:33 +01:00 |
|
Irmen de Jong
|
b6e5dbd06c
|
optimized away VarDecl.subroutineParameter
|
2023-02-12 23:19:35 +01:00 |
|
Irmen de Jong
|
6aabbffc62
|
some cleanups
|
2023-02-09 02:34:18 +01:00 |
|
Irmen de Jong
|
f117805129
|
order
|
2023-02-05 12:36:32 +01:00 |
|
Irmen de Jong
|
2f5bed36b3
|
remove bool to ubyte typecasts
|
2023-01-31 01:25:44 +01:00 |
|
Irmen de Jong
|
117d848466
|
consolidate builtin function definitions into codeCore
|
2023-01-25 00:23:00 +01:00 |
|
Irmen de Jong
|
b2cb125bd4
|
more 6502 codegen on new Pt-AST.
|
2023-01-22 17:10:52 +01:00 |
|
Irmen de Jong
|
5e8f767642
|
6502 codegen on new Pt-AST.
|
2023-01-22 17:10:52 +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
|
81bd5c784e
|
don't remove consecutive assigns to IO space location
|
2022-12-24 18:01:54 +01:00 |
|
Irmen de Jong
|
1860f66de5
|
allow "x not in array" as equivalent to "not x in array"
update antlr parsing lib
|
2022-12-23 17:59:56 +01:00 |
|
Irmen de Jong
|
bf0604133c
|
fix error in IR for inline asm and BSS vars.
|
2022-12-04 16:48:44 +01:00 |
|
Irmen de Jong
|
add3491c57
|
fix possible vardecl issue for prefixed params
|
2022-11-30 22:56:54 +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
|
cfa7258ff4
|
various
|
2022-10-25 23:18:42 +02:00 |
|
Irmen de Jong
|
76428b16f0
|
Merge branch 'master' into labeledchunks
# Conflicts:
# codeGenIntermediate/src/prog8/codegen/intermediate/BuiltinFuncGen.kt
# docs/source/todo.rst
# examples/test.p8
# virtualmachine/src/prog8/vm/VirtualMachine.kt
|
2022-10-23 12:19:02 +02:00 |
|
Irmen de Jong
|
e94bf4c63c
|
replace rnd()/rndw() builtin functions by regular routines in math module
|
2022-10-22 17:02:43 +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
|
c26e116f0e
|
vm: fix crashes when array contains pointers/strings
|
2022-09-24 14:42:07 +02:00 |
|
Irmen de Jong
|
68abda1219
|
fix a few small compiler errors (removing functioncall, removing block, assigning virtual register return value)
|
2022-08-09 23:38:29 +02:00 |
|
Irmen de Jong
|
93ce74eeb1
|
removed problematic expression "simplifications" (that introduced arbitrary r9 temp register usage)
|
2022-08-07 12:26:11 +02:00 |
|
Irmen de Jong
|
f718f4251b
|
working on better encoding of romsub in new ast/vmtarget
|
2022-08-07 12:21:10 +02:00 |
|
Irmen de Jong
|
4644c9b621
|
got rid of GoSub ast node and codegen complexity related to that.
sometimes programs get smaller, sometimes bigger.
|
2022-08-07 03:24:20 +02:00 |
|
Irmen de Jong
|
05f935b598
|
simplify & fix recursion detector
|
2022-07-22 22:22:43 +02:00 |
|
Irmen de Jong
|
35af53828a
|
fix endless loop in optimizer, fix cx16 register clobbering in psg interrupt handler, fix crash on certain arrays, fix undefined symbol when it's in another imported module
|
2022-07-13 18:42:06 +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
|
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
|
92eb3b0bf6
|
bool logical testcase
|
2022-07-09 22:29:38 +02:00 |
|
Irmen de Jong
|
211e2bb37a
|
improved bool type checking
|
2022-07-08 22:29:13 +02:00 |
|
Irmen de Jong
|
81b3d2db4f
|
fix compiler crash
|
2022-07-08 21:50:06 +02:00 |
|
Irmen de Jong
|
1dfa8ee7d8
|
add ARRAY_BOOL array type
|
2022-07-07 23:07:30 +02:00 |
|
Irmen de Jong
|
1163543a98
|
fix bool param lookup problem
|
2022-07-07 22:23:56 +02:00 |
|
Irmen de Jong
|
bdb7de34be
|
added several compiler checks against weird boolean type use in expressions
|
2022-07-07 22:23:56 +02:00 |
|
Irmen de Jong
|
9500fc11ac
|
document new bool datatype and removal of boolean() conversion function
|
2022-07-07 22:23:56 +02:00 |
|
Irmen de Jong
|
41f4e22a17
|
introduce BOOL type
|
2022-07-07 22:23:56 +02:00 |
|
Irmen de Jong
|
25aad8d7be
|
improve const-evaluation of builtin expressions
|
2022-07-02 16:29:01 +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
|
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
|
435d6f6f3f
|
vm: and/or/xor/not are all bitwise operations again
|
2022-06-28 03:17:51 +02:00 |
|
Irmen de Jong
|
ef92451d1a
|
fix logical expressions on arbitrary values, for now with boolean() around the operands
|
2022-06-28 01:18:36 +02:00 |
|
Irmen de Jong
|
af98d01053
|
failed attempt at McCarthy shortcut evaluation
|
2022-06-27 21:40:48 +02:00 |
|
Irmen de Jong
|
bb1cda0916
|
fix: boolean values of terms in logical expressions are now properly evaluated
|
2022-06-26 23:55:34 +02:00 |
|
Irmen de Jong
|
eea09f4de5
|
fix invalid asm label sometimes generated for multiple loops in same subroutine
|
2022-06-24 02:26:45 +02:00 |
|
Irmen de Jong
|
cc174b7b85
|
added boolean() builtin function and use it to get rid of !=0 comparisons
|
2022-06-14 23:34:45 +02:00 |
|
Irmen de Jong
|
bf9d120081
|
logical operators now always return a boolean byte result, instead of sometimes word type as well
(preparing for codegen simplifications for these)
|
2022-06-13 01:37:16 +02:00 |
|
Irmen de Jong
|
775c85fc18
|
don't swap operands that would change function evaluation order + vm: fix label casing error
|
2022-06-13 00:25:45 +02:00 |
|
Irmen de Jong
|
5a756aaed9
|
Pipe expression "|>" removed from the language
|
2022-06-12 18:41:42 +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
|
b042b7705e
|
fix invalid removal of repeated assignments.
|
2022-06-06 17:27:06 +02:00 |
|
Irmen de Jong
|
3054a1d32d
|
api change: removed swap() builtin function (too complex in codegen for little used function)
|
2022-06-06 16:01:11 +02:00 |
|
Irmen de Jong
|
46ca0ac10d
|
properly optimize X - -1 and X + -1, this also fixes type change of ubyte - 2 + 10
|
2022-06-05 15:35:29 +02:00 |
|
Irmen de Jong
|
031f647952
|
allow casting negative numbers to unsigned, result = 2's complement
|
2022-06-05 14:21:10 +02:00 |
|
Irmen de Jong
|
7f69517fd4
|
preparing optimizing pointer indexing
|
2022-06-04 16:18:27 +02:00 |
|
Irmen de Jong
|
ba614801ee
|
cleanup
|
2022-05-22 23:11:22 +02:00 |
|
Irmen de Jong
|
fd6eb47e68
|
added inlining certain trivial non-asm subroutine calls
|
2022-05-22 20:22:09 +02:00 |
|
Irmen de Jong
|
627aa61184
|
clean up subroutine inlining, basis for new try
|
2022-05-09 15:42:58 +02:00 |
|
Irmen de Jong
|
942c5cc04b
|
fix crash when optimizing pipe expression too aggressively
|
2022-05-07 17:29:36 +02:00 |
|
Irmen de Jong
|
b32641db87
|
remove syscall() builtin functions
vm code can do this via inline assembly
|
2022-05-01 00:41:30 +02:00 |
|
Irmen de Jong
|
7844ace934
|
vm: implementing floating-point
|
2022-04-29 22:27:02 +02:00 |
|
Irmen de Jong
|
6471c0c536
|
upgrade antlr to 4.10.1
|
2022-04-24 23:29:15 +02:00 |
|
Irmen de Jong
|
7eea97d741
|
- floats: remove all floating point builtin functions and move them to the floats module instead
|
2022-04-22 00:45:54 +02:00 |
|
Irmen de Jong
|
7dbff5b9e6
|
abs: remove support for floats. Use floats.fabs() instead.
this solves: can't use abs() etc in pipe expression because return type depends on argument type
|
2022-04-14 00:38:31 +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
|
ab1766a559
|
moved all *integer* builtin trig functions (sin8u, cos8u etc) as regular asmsubs in math module
|
2022-04-13 00:27:35 +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
|
a8cf9f5cc4
|
vm: syscalls can now return value
|
2022-04-05 20:46:34 +02:00 |
|
Irmen de Jong
|
036d9dbe59
|
got rid of unnecessary cast of boolean expressions by making their type dynamically adjust to byte or word
|
2022-04-04 23:43:55 +02:00 |
|
Irmen de Jong
|
ae45ce517e
|
cleanups
|
2022-04-03 17:33:50 +02:00 |
|
Irmen de Jong
|
20d06d9f9d
|
fix return type error for asmsubs with >1 result values
|
2022-04-01 22:30:15 +02:00 |
|
Irmen de Jong
|
e2886e5303
|
x16 r39: update vtui lib and example
|
2022-04-01 21:09:40 +02:00 |
|
Irmen de Jong
|
3b6e7eccdd
|
simplified containment check, only possible on string and arrays (as per the docs)
|
2022-03-27 16:59:55 +02:00 |
|
Irmen de Jong
|
ed30108961
|
removed '**' power-operator. Use floats.pow() instead.
|
2022-03-27 13:16:34 +02:00 |
|
Irmen de Jong
|
7b27d270a2
|
gosub only uses an identifier
|
2022-03-22 20:53:06 +01:00 |
|
Irmen de Jong
|
ff57c5e9d3
|
working on vm and new ast
|
2022-03-21 01:36:11 +01:00 |
|
Irmen de Jong
|
a99e77093f
|
added syscall() builtin functions (only useful for experimental code gen)
|
2022-03-17 01:19:58 +01:00 |
|
Irmen de Jong
|
92737bb695
|
better handling of loadAddress
|
2022-03-13 16:21:02 +01:00 |
|
Irmen de Jong
|
40e9fba312
|
working on new Ast and XML export to test it
|
2022-03-12 22:38:16 +01:00 |
|
Irmen de Jong
|
e227cc92ff
|
new ast: regular subroutine has just 0 or 1 return type
|
2022-03-12 14:12:06 +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 |
|
Irmen de Jong
|
abcdd331db
|
started with a simulator
|
2022-03-10 21:23:00 +01:00 |
|
Irmen de Jong
|
179a7a2792
|
reducing dependencies
|
2022-03-10 02:17:06 +01:00 |
|
Irmen de Jong
|
251b6fcf70
|
reducing dependencies
|
2022-03-10 02:09:34 +01:00 |
|
Irmen de Jong
|
ab1fffb721
|
reducing dependencies
|
2022-03-10 01:41:42 +01:00 |
|
Irmen de Jong
|
da352a322c
|
reducing dependencies
|
2022-03-10 01:27:27 +01:00 |
|
Irmen de Jong
|
f7aa0c45df
|
optimize imports
|
2022-03-05 15:54:42 +01:00 |
|
Irmen de Jong
|
a72d58cdf9
|
updated 3rd party library versions
|
2022-03-05 15:28:22 +01:00 |
|
Irmen de Jong
|
fc1c3c6808
|
working on altered pipe syntax
|
2022-03-02 20:58:38 +01:00 |
|
Irmen de Jong
|
96ba895b84
|
working on altered Pipe syntax
|
2022-02-27 02:42:28 +01:00 |
|
Irmen de Jong
|
c5504c6657
|
added ATASCII encoding table for atari
|
2022-02-25 23:48:39 +01:00 |
|
Irmen de Jong
|
6a0551cea1
|
added 'atari' compiler target beginnings (Atari 800 XL)
also default char and string encoding now taken from compiler target
|
2022-02-22 00:52:35 +01:00 |
|
Irmen de Jong
|
064a8e785c
|
cleanups
|
2022-02-21 03:26:17 +01:00 |
|
Irmen de Jong
|
60b2c44a44
|
fix returntype handling of builtinfunctions, fix errors in pipe expressions
|
2022-02-21 01:44:29 +01:00 |
|
Irmen de Jong
|
c4fe3ecc0a
|
refactor
|
2022-02-20 22:04:18 +01:00 |
|
Irmen de Jong
|
2f18a8f6d0
|
introduced BuiltinFunctionCall (expression) node for codegen
|
2022-02-20 02:48:27 +01:00 |
|
Irmen de Jong
|
7a2164b4d0
|
introduced BuiltinFunctionCallStatement node for codegen
|
2022-02-18 23:27:11 +01:00 |
|
Irmen de Jong
|
41fece4643
|
slight tweaks related to builtin functions in the ast
|
2022-02-17 01:25:13 +01:00 |
|
Irmen de Jong
|
af0e7f7187
|
searching names in inlined assembly now ignores source comments
|
2022-02-13 13:41:12 +01:00 |
|
Irmen de Jong
|
c8cd6e9460
|
removed old @"screencodes" string encoding syntax (use sc:"hello" instead)
|
2022-02-11 22:07:14 +01:00 |
|
Irmen de Jong
|
0cd27d6129
|
fix empty lines in subroutine ast printing
|
2022-02-11 21:44:38 +01:00 |
|