Commit Graph

66 Commits

Author SHA1 Message Date
Irmen de Jong
ebf1f12e97 inferred type for len() is now more precise 2022-01-23 17:24:39 +01:00
Irmen de Jong
4bf4771f08 fix @requirezp in astToSource. Fix sometimes allocating zeropage variables in normal ram. 2022-01-23 13:42:52 +01:00
Irmen de Jong
0e87db9eb7 fix invalid size copied when initializing arrays in Zeropage 2022-01-23 13:00:01 +01:00
Irmen de Jong
3d1b0eb843 fixed compiler crash when using cx16.r0H as function call argument 2022-01-23 01:28:16 +01:00
Irmen de Jong
674295e800 improve error reporting from string encoders 2022-01-19 21:21:33 +01:00
Irmen de Jong
3b59592110 generalize string encoding flag into enum 2022-01-18 21:21:49 +01:00
Irmen de Jong
d916027e75 labels no longer start with '_' fixes #62 2022-01-17 22:03:53 +01:00
Irmen de Jong
a3b5c2ad71 fix zp address output and adjust vars datastructure 2022-01-16 17:20:36 +01:00
Irmen de Jong
fe51698579 tweak how zp varnames are stored 2022-01-16 17:20:36 +01:00
Irmen de Jong
a798fe72d3 cx16 reserved zp vars (virtual registers) 2022-01-16 17:20:36 +01:00
Irmen de Jong
7dd2517f67 fix Zp allocation issues 2022-01-16 17:20:36 +01:00
Irmen de Jong
641477d6f6 add @requirezp and allow str/array to be on zp (with warning) 2022-01-16 17:20:32 +01:00
Irmen de Jong
69f0c80cd7 added pokemon() function 2022-01-15 19:04:04 +01:00
Irmen de Jong
7dd7e562bc pipes also as expressions, cleanup codegen, fix various typecasting issues 2022-01-08 13:45:19 +01:00
Irmen de Jong
749ad700d8 naming consistency for some expression classes 2022-01-07 21:02:55 +01:00
Irmen de Jong
8f3df3039a added pipe operator `|>` 2022-01-06 22:54:18 +01:00
Irmen de Jong
74257163b1 fix that memory("name", ...) also allocates a STR variable for the name 2022-01-02 17:07:04 +01:00
Irmen de Jong
a23281afab added experimental -noreinit option 2022-01-01 16:35:36 +01:00
Irmen de Jong
9b91c427a1 add porting guide
sizeof(pointer) is hardcoded as 2 now
2021-12-31 00:16:23 +01:00
Irmen de Jong
d8f7feb672 cleanup code style 2021-12-30 18:47:38 +01:00
Irmen de Jong
c15a75556d Merge branch 'master' into c128target
# Conflicts:
#	compiler/src/prog8/CompilerMain.kt
#	examples/test.p8
2021-12-30 18:22:05 +01:00
Irmen de Jong
5267e06969 added -asmlist cli option to produce assembler listing output 2021-12-30 14:42:09 +01:00
Irmen de Jong
05a1ddad05 Merge branch 'master' into c128target
# Conflicts:
#	examples/test.p8
2021-12-29 18:14:24 +01:00
Irmen de Jong
de6ce4a46e add "X in [1,2,3]" expression (efficient containment check) 2021-12-29 17:26:00 +01:00
Irmen de Jong
56d21de001 Merge branch 'master' into c128target
# Conflicts:
#	examples/test.p8
2021-12-28 13:57:27 +01:00
Irmen de Jong
7b54aa0c7d more consistent naming of the statement classes 2021-12-28 13:56:47 +01:00
Irmen de Jong
6e11b8ada1 GoSub no longer inherits from Jump node, fixes subtle ast/codegen bugs related to jsrs 2021-12-28 01:55:13 +01:00
Irmen de Jong
6da83e2bd7 first steps to add C128 compiler target 2021-12-21 19:08:33 +01:00
Irmen de Jong
7bccfc0006 proper position in recursion warning 2021-12-17 21:04:41 +01:00
Irmen de Jong
84f75f4156 tweaked some more .getOrElse 2021-12-06 21:22:00 +01:00
Irmen de Jong
b6fe40ada4 fix: cx16.r0 now properly treated as zeropage var on cx16 so @(cx16.r0) won't copy it to temp var anymore 2021-12-05 21:21:41 +01:00
Irmen de Jong
c92f914081 gradle build settings tweak to avoid jdk version conflict 2021-12-04 18:36:47 +01:00
Irmen de Jong
0498444ef2 moved all unit tests into single project to avoid dependency issues 2021-12-04 18:20:22 +01:00
Irmen de Jong
7748c261da rsave/rrestore moved from sys to builtin function to solve the stack related problem when calling it as a regular subroutine 2021-11-29 23:13:04 +01:00
Irmen de Jong
a2db44f80c also consider Y register for clobber check for functioncall arguments 2021-11-29 22:09:05 +01:00
Irmen de Jong
b438d8aec0 fix invalid range size check when stepval is not a positive integer 2021-11-29 02:01:19 +01:00
Irmen de Jong
e8f4686430 undid failed attempt of using sys.push/sys.pop for stack args - now using new push(), pushw(), pop(), popw() builtin functions 2021-11-28 01:22:40 +01:00
Irmen de Jong
c838821615 refactor fuction arguments codegen a bit 2021-11-27 21:14:21 +01:00
Irmen de Jong
e8e25c6fd6 added sys.push() and sys.pop() to put values on cpu stack. Added missing builtin functions to syntax-files. 2021-11-27 18:09:15 +01:00
Irmen de Jong
e4648e2138 proper rounding of builtin functions that return int from float 2021-11-26 20:32:12 +01:00
Irmen de Jong
b292124f3c replaced many short/int values by unsigned types if appropriate 2021-11-21 00:55:56 +01:00
Irmen de Jong
c0035ba1a2 char encodings now use UByte type instead of short 2021-11-21 00:07:17 +01:00
Irmen de Jong
b334d89715 refactor and fix the way memory addresses are checked to be in IO space or regular ram 2021-11-18 22:47:58 +01:00
Irmen de Jong
f48d6ca9f8 simplified NumericLiteral to always just contain a Double instead of a Number for the value 2021-11-16 23:52:54 +01:00
Irmen de Jong
53e1729e2f introduce option to use internal scratch variables via prog8_lib definitions (ony for compiler, not for user code!) 2021-11-14 16:01:54 +01:00
Irmen de Jong
53ac11983b better unused variable removal 2021-11-11 03:03:21 +01:00
Irmen de Jong
8df3da11e3 add cosr8, sinr8, cosr16 and sinr16 builtin functions that take a degree 0..179 (= 0..358 in 2 degree steps)
to more easily scale halves/quarters etc of a circle than possible with the ones that take 0..255 'degrees'.
2021-11-09 23:39:26 +01:00
Irmen de Jong
7780d94de1 discovered crash related to float typecasting in asm assignment codegen 2021-11-09 03:45:07 +01:00
Irmen de Jong
613efcacc7 converting compiler module's testcases to kotest (ongoing) 2021-11-08 15:08:48 +01:00
Irmen de Jong
1fbbed7e23 remove unittest machinery from modules that don't have tests 2021-11-07 17:34:14 +01:00