Commit Graph

857 Commits

Author SHA1 Message Date
Irmen de Jong
5cb8998fd3 Merge branch 'master' into next_compositetypes
# Conflicts:
#	compiler/src/prog8/compiler/astprocessing/BeforeAsmAstChanger.kt
#	compiler/src/prog8/compiler/astprocessing/StatementReorderer.kt
#	compiler/test/TestMemory.kt
#	compiler/test/codegeneration/TestAsmGenSymbols.kt
#	compilerAst/src/prog8/ast/Program.kt
2024-11-08 22:23:24 +01:00
Irmen de Jong
50343a18af Merge branch 'master' into next_compositetypes
# Conflicts:
#	codeGenCpu6502/src/prog8/codegen/cpu6502/IfElseAsmGen.kt
2024-11-08 19:06:44 +01:00
Irmen de Jong
f89f1a84d0 @initonce variable tag to skip variable reinitialization 2024-11-08 19:03:48 +01:00
Irmen de Jong
b88f550c5b todo 2024-11-07 00:48:13 +01:00
Irmen de Jong
9864abd393 romsub keyword is now extsub 2024-11-06 22:14:53 +01:00
Irmen de Jong
c702c4a6df internal rename of romsub to extsub 2024-11-06 21:42:16 +01:00
Irmen de Jong
4152f7e88c Merge branch 'master' into next_compositetypes
# Conflicts:
#	codeGenCpu6502/src/prog8/codegen/cpu6502/IfElseAsmGen.kt
#	compilerAst/src/prog8/ast/expressions/AstExpressions.kt
2024-11-06 01:43:57 +01:00
Irmen de Jong
491e5dbcfb move the program startup and cleanup machinery to the front of the program to keep it in system ram 2024-11-05 22:12:25 +01:00
Irmen de Jong
e514eeba17 added c64.banks() and c64.getbanks() and c64 banking example 2024-11-04 20:14:30 +01:00
Irmen de Jong
9f84aa5fb2 fix double %option merge problem where it deleted all of the blocks 2024-11-03 13:36:14 +01:00
Irmen de Jong
b14012c9bc Merge branch 'master' into next_compositetypes
# Conflicts:
#	codeGenCpu6502/src/prog8/codegen/cpu6502/assignment/AssignmentAsmGen.kt
#	codeGenCpu6502/src/prog8/codegen/cpu6502/assignment/AugmentableAssignmentAsmGen.kt
#	codeGenIntermediate/src/prog8/codegen/intermediate/AssignmentGen.kt
#	codeGenIntermediate/src/prog8/codegen/intermediate/IRCodeGen.kt
#	compiler/src/prog8/compiler/astprocessing/AstPreprocessor.kt
#	compiler/test/TestZeropage.kt
#	compilerAst/src/prog8/ast/statements/AstStatements.kt
#	virtualmachine/src/prog8/vm/VirtualMachine.kt
2024-11-02 04:57:28 +01:00
Irmen de Jong
3b798097b9 added memtop to machine definition and asm source code check
added %memtop directive
2024-11-02 00:59:07 +01:00
Irmen de Jong
6fb05bdefc replaced deprecated cx16 ZSOUND example by new ZSMKIT examples 2024-11-01 23:17:23 +01:00
Irmen de Jong
89425088ce taking address of a split word array is no longer a fatal error but a warning and the array is turned back into a normal word array. 2024-11-01 20:18:31 +01:00
Irmen de Jong
4b23b1dc86 don't always import math automatically anymore 2024-11-01 03:39:52 +01:00
Irmen de Jong
4ce130dc8b split up cx16.gfx2 module into gfx_lores and gfx_hires4 modules 2024-10-30 22:21:07 +01:00
Irmen de Jong
eeeb8d81f4 merge now also allows monkeypatching if signature is 100% identical 2024-10-30 01:15:56 +01:00
Irmen de Jong
bbba4b3d60 new block merge semantics and implementation 2024-10-29 22:57:54 +01:00
Irmen de Jong
ea3b30a8e8 Merge branch 'master' into next_compositetypes 2024-10-28 21:45:05 +01:00
Irmen de Jong
76b05cb5fd fix chained aliasing 2024-10-28 18:35:23 +01:00
Irmen de Jong
a82f211f9a added alias statement 2024-10-28 00:36:10 +01:00
Irmen de Jong
c8b090a98b Merge branch 'master' into next_compositetypes 2024-10-27 13:52:17 +01:00
Irmen de Jong
4b4af9b527 no longer silently add RTS to asmsubs that don't have one 2024-10-27 13:49:00 +01:00
Irmen de Jong
a7a5dda378 merge master 2024-10-26 22:01:56 +02:00
Irmen de Jong
c9535049c8 %align directive and @align64 2024-10-26 20:58:35 +02:00
Irmen de Jong
1cd754f05d adding @alignword/page on individual variables 2024-10-26 17:00:38 +02:00
Irmen de Jong
47c1bba41d Merge branch 'master' into next_compositetypes
# Conflicts:
#	codeGenCpu6502/src/prog8/codegen/cpu6502/assignment/AssignmentAsmGen.kt
#	compiler/src/prog8/compiler/astprocessing/IntermediateAstPostprocess.kt
#	compiler/test/ast/TestVariousCompilerAst.kt
2024-10-23 00:29:38 +02:00
Irmen de Jong
326eab3dd1 unit test for defer, describe defer and if expression in docs 2024-10-22 22:19:49 +02:00
Irmen de Jong
0247fb0d84 some ast2 var tweaks 2024-10-21 00:20:54 +02:00
Irmen de Jong
db0c77c09e rename 2024-10-19 23:01:41 +02:00
Irmen de Jong
af7cc9c761 Merge branch 'master' into next_compositetypes
# Conflicts:
#	codeCore/src/prog8/code/ast/AstExpressions.kt
#	codeCore/src/prog8/code/core/BuiltinFunctions.kt
#	codeGenCpu6502/src/prog8/codegen/cpu6502/AsmGen.kt
#	codeGenCpu6502/src/prog8/codegen/cpu6502/BuiltinFunctionsAsmGen.kt
#	compiler/test/ast/TestIntermediateAst.kt
2024-10-19 22:45:39 +02:00
Irmen de Jong
a0cf1889a3 omit more redundant 0-initializations ("stz's") 2024-10-17 22:51:39 +02:00
Irmen de Jong
c218234efe Merge branch 'master' into next_compositetypes
# Conflicts:
#	codeCore/src/prog8/code/SymbolTable.kt
#	codeGenCpu6502/src/prog8/codegen/cpu6502/ProgramAndVarsGen.kt
#	compiler/test/TestSymbolTable.kt
#	examples/test.p8
#	intermediate/src/prog8/intermediate/IRFileReader.kt
#	intermediate/src/prog8/intermediate/IRSymbolTable.kt
#	intermediate/src/prog8/intermediate/Utils.kt
#	virtualmachine/src/prog8/vm/VmProgramLoader.kt
2024-10-16 22:40:45 +02:00
Irmen de Jong
38ef394e15 IR codegen: global vars with numeric initialization value are now also put into the VARIABLESWITHINIT section rather than requiring explicit code instructions to initialize them in INITGLOBALS.
Note that something similar, such as putting those variables inline in the program initialized with their value and all, cannot be done for the 6502 codegen: the program needs a mechanism to reset ALL variables when it runs a second time.
2024-10-16 22:15:51 +02:00
Irmen de Jong
abbf7c7cb0 compiler name change: prog8c (was p8compile)
fat jar file also changed:  prog8c-X.Y-all.jar    (was: prog8compiler-X.Y-all.jar)
2024-10-16 18:36:19 +02:00
Irmen de Jong
ca5f7ae32f global (block-level) variables that get initialized with an array index expression now get a constant value as well if possible. This reduces the number of instructions in the init globals code block 2024-10-16 02:14:19 +02:00
Irmen de Jong
0f72bdb4a2 Merge branch 'master' into next_compositetypes
# Conflicts:
#	codeCore/src/prog8/code/core/BuiltinFunctions.kt
#	codeGenCpu6502/src/prog8/codegen/cpu6502/BuiltinFunctionsAsmGen.kt
#	codeGenIntermediate/src/prog8/codegen/intermediate/BuiltinFuncGen.kt
#	codeOptimizers/src/prog8/optimizer/ConstantIdentifierReplacer.kt
#	compiler/src/prog8/compiler/astprocessing/AstChecker.kt
#	compiler/src/prog8/compiler/astprocessing/LiteralsToAutoVars.kt
#	compiler/test/ast/TestAstChecks.kt
2024-10-13 21:48:33 +02:00
Irmen de Jong
e9edffa9f0 remove support for array-to-array assignments (other than initialization of variable declaration)
Just use an explicit sys.memcopy(src, dest, sizeof(dest))  or assign array members individually.
2024-10-13 20:02:43 +02:00
Irmen de Jong
aef211e5f3 stricter array literal element type handling (number,bool,address-of).
More consistent implicit address-of handling if array literals contain by-ref identifiers (such as subroutine names)
2024-10-13 17:46:41 +02:00
Irmen de Jong
66829203d8 New [x]*42 syntax to create array literals with repeated values (like "abc"*10 already exists for strings)
Should be used in place of array initializer expressions that contain only a single numeric value to initialize the whole array with. That isn't supported anymore.
2024-10-13 05:16:08 +02:00
Irmen de Jong
7a0eaf3148 Remove array initialization by single value.
New compiler and kotlin version.
2024-10-13 04:31:56 +02:00
Irmen de Jong
03412cacba added examples/cx16/balloonflight.p8 2024-10-13 00:51:07 +02:00
Irmen de Jong
ba6db8f905 Merge branch 'master' into next_compositetypes
# Conflicts:
#	compiler/src/prog8/compiler/astprocessing/AstChecker.kt
#	compiler/src/prog8/compiler/astprocessing/StatementReorderer.kt
#	compiler/src/prog8/compiler/astprocessing/VariousCleanups.kt
#	compiler/test/TestSubroutines.kt
2024-10-12 13:40:39 +02:00
Irmen de Jong
8d9bc2f5ff fixing all sorts of things about assigning arrays to arrays 2024-10-12 12:33:46 +02:00
Irmen de Jong
1a6b95b388 house cleaning 2024-10-10 20:46:18 +02:00
Irmen de Jong
3d76240c84 Merge branch 'master' into next_compositetypes
# Conflicts:
#	compiler/test/TestNumericLiteral.kt
#	compilerAst/src/prog8/ast/expressions/AstExpressions.kt
#	docs/source/todo.rst
2024-10-09 23:33:42 +02:00
Irmen de Jong
ed09dd4e9e improve automatic type conversions for return values, fixes #155 2024-10-09 20:04:05 +02:00
Irmen de Jong
7afd716fab Merge branch 'master' into next_compositetypes
# Conflicts:
#	codeCore/src/prog8/code/core/BuiltinFunctions.kt
#	compiler/src/prog8/compiler/astprocessing/AstChecker.kt
#	examples/test.p8
2024-10-08 22:58:26 +02:00
Irmen de Jong
7c69d38588 scan all asmsubs to see if another subroutine is referenced. Fixes #153 2024-10-07 20:39:49 +02:00
Irmen de Jong
d1ddf05e38 check that block address leaves room for program startup logic 2024-10-03 22:30:06 +02:00