diff --git a/compiler/res/prog8lib/c64utils.p8 b/compiler/res/prog8lib/c64utils.p8 index 0d28c53b9..a523478fb 100644 --- a/compiler/res/prog8lib/c64utils.p8 +++ b/compiler/res/prog8lib/c64utils.p8 @@ -346,7 +346,7 @@ memcopy16_up .proc inc dest+1 ; increment hi byte of dest + dex ; decrement X (lo byte counter) bne - ; if X<>0 then move another byte - dec length ; weve moved 255 bytes, dec length + dec length ; we've moved 255 bytes, dec length bpl - ; if length is still positive go back and move more rts ; done .pend diff --git a/compiler/src/prog8/ast/AST.kt b/compiler/src/prog8/ast/AST.kt index e56114917..e726aab01 100644 --- a/compiler/src/prog8/ast/AST.kt +++ b/compiler/src/prog8/ast/AST.kt @@ -376,10 +376,10 @@ interface INameScope { } fun getLabelOrVariable(name: String): IStatement? { - // TODO this call is relatively slow.... cache it? make statement list non-mutable and update the cache when it is explicitly updated? + // this is called A LOT and could perhaps be optimized a bit more, but adding a cache didn't make much of a practical runtime difference for (stmt in statements) { if (stmt is VarDecl && stmt.name==name) return stmt - else if (stmt is Label && stmt.name==name) return stmt + if (stmt is Label && stmt.name==name) return stmt } return null } diff --git a/compiler/src/prog8/compiler/target/c64/AsmOptimizer.kt b/compiler/src/prog8/compiler/target/c64/AsmOptimizer.kt index a76f190f1..677d01910 100644 --- a/compiler/src/prog8/compiler/target/c64/AsmOptimizer.kt +++ b/compiler/src/prog8/compiler/target/c64/AsmOptimizer.kt @@ -30,8 +30,6 @@ fun optimizeAssembly(lines: MutableList): Int { numberOfOptimizations++ } - - println("ASM OPTIMIZATIONS: $numberOfOptimizations") // TODO weg return numberOfOptimizations } diff --git a/compiler/src/prog8/compiler/target/c64/AssemblyProgram.kt b/compiler/src/prog8/compiler/target/c64/AssemblyProgram.kt index 3456f5749..6e64ad1a6 100644 --- a/compiler/src/prog8/compiler/target/c64/AssemblyProgram.kt +++ b/compiler/src/prog8/compiler/target/c64/AssemblyProgram.kt @@ -10,7 +10,8 @@ class AssemblyProgram(val name: String) { private val viceMonListFile = "$name.vice-mon-list" fun assemble(options: CompilationOptions) { - val command = mutableListOf("64tass", "--ascii", "--case-sensitive", "--long-branch", "-Wall", "-Wno-strict-bool", "-Wlong-branch", + // add "-Wlong-branch" to see warnings about conversion of branch instructions to jumps + val command = mutableListOf("64tass", "--ascii", "--case-sensitive", "--long-branch", "-Wall", "-Wno-strict-bool", "-Werror", "-Wno-error=long-branch", "--dump-labels", "--vice-labels", "-l", viceMonListFile, "--no-monitor") val outFile = when(options.output) {