diff --git a/compiler/src/prog8/CompilerMain.kt b/compiler/src/prog8/CompilerMain.kt index fba0caaf2..213f33882 100644 --- a/compiler/src/prog8/CompilerMain.kt +++ b/compiler/src/prog8/CompilerMain.kt @@ -38,13 +38,10 @@ fun main(args: Array) { private fun compileMain(args: Array) { var startEmu = false - var asmTrace = false var moduleFile = "" for (arg in args) { if(arg=="--emu") startEmu = true - else if(arg=="--asmtrace") - asmTrace = true else if(!arg.startsWith("--")) moduleFile = arg } @@ -117,7 +114,7 @@ private fun compileMain(args: Array) { stackvmFile.close() println("StackVM program code written to '$stackVmFilename'") - val assembly = AsmGen(compilerOptions, intermediate, heap, asmTrace).compileToAssembly() + val assembly = AsmGen(compilerOptions, intermediate, heap).compileToAssembly() assembly.assemble(compilerOptions) programname = assembly.name } @@ -188,7 +185,6 @@ fun determineCompilationOptions(moduleAst: Module): CompilationOptions { private fun usage() { System.err.println("Missing argument(s):") System.err.println(" [--emu] auto-start the C64 emulator after successful compilation") - System.err.println(" [--asmtrace] print trace output of the AsmGen for debugging purposes") System.err.println(" [--vm] launch the prog8 virtual machine instead of the compiler") System.err.println(" modulefile main module file to compile") exitProcess(1) diff --git a/compiler/src/prog8/compiler/target/c64/AsmGen.kt b/compiler/src/prog8/compiler/target/c64/AsmGen.kt index 6073ef2b4..3b845969f 100644 --- a/compiler/src/prog8/compiler/target/c64/AsmGen.kt +++ b/compiler/src/prog8/compiler/target/c64/AsmGen.kt @@ -17,7 +17,7 @@ import kotlin.math.abs class AssemblyError(msg: String) : RuntimeException(msg) -class AsmGen(val options: CompilationOptions, val program: IntermediateProgram, val heap: HeapValues, val trace: Boolean) { +class AsmGen(val options: CompilationOptions, val program: IntermediateProgram, val heap: HeapValues) { private val globalFloatConsts = mutableMapOf() private val assemblyLines = mutableListOf() private lateinit var block: IntermediateProgram.ProgramBlock @@ -198,9 +198,7 @@ class AsmGen(val options: CompilationOptions, val program: IntermediateProgram, val instructionPatternWindowSize = 8 // increase once patterns occur longer than this. var processed = 0 - if(trace) println("BLOCK: ${block.scopedname} ${block.address ?: ""}") for (ins in block.instructions.windowed(instructionPatternWindowSize, partialWindows = true)) { - if(trace) println("\t${ins[0].toString().trim()}") if (processed == 0) { processed = instr2asm(ins) if (processed == 0) { @@ -210,7 +208,6 @@ class AsmGen(val options: CompilationOptions, val program: IntermediateProgram, } processed-- } - if (trace) println("END BLOCK: ${block.scopedname}") if(!blk.force_output) out("\n\t.pend\n") }