diff --git a/codeCore/src/prog8/code/target/c64/C64MachineDefinition.kt b/codeCore/src/prog8/code/target/c64/C64MachineDefinition.kt index ace08c556..4a8e31e35 100644 --- a/codeCore/src/prog8/code/target/c64/C64MachineDefinition.kt +++ b/codeCore/src/prog8/code/target/c64/C64MachineDefinition.kt @@ -17,7 +17,7 @@ class C64MachineDefinition: IMachineDefinition { override val PROGRAM_LOAD_ADDRESS = 0x0801u override val BSSHIGHRAM_START = 0xc000u - override val BSSHIGHRAM_END = 0xd000u + override val BSSHIGHRAM_END = 0xcfffu override lateinit var zeropage: Zeropage override lateinit var golden: GoldenRam diff --git a/codeCore/src/prog8/code/target/cx16/CX16MachineDefinition.kt b/codeCore/src/prog8/code/target/cx16/CX16MachineDefinition.kt index 33acf4480..fec9e8498 100644 --- a/codeCore/src/prog8/code/target/cx16/CX16MachineDefinition.kt +++ b/codeCore/src/prog8/code/target/cx16/CX16MachineDefinition.kt @@ -16,7 +16,7 @@ class CX16MachineDefinition: IMachineDefinition { override val PROGRAM_LOAD_ADDRESS = 0x0801u override val BSSHIGHRAM_START = 0xa000u // hiram bank 1, 8Kb, assumed to be active - override val BSSHIGHRAM_END = 0xc000u // rom starts here. + override val BSSHIGHRAM_END = 0xbfffu // Rom starts at $c000 override lateinit var zeropage: Zeropage override lateinit var golden: GoldenRam diff --git a/codeCore/src/prog8/code/target/pet/PETMachineDefinition.kt b/codeCore/src/prog8/code/target/pet/PETMachineDefinition.kt index 963f10ad6..469613847 100644 --- a/codeCore/src/prog8/code/target/pet/PETMachineDefinition.kt +++ b/codeCore/src/prog8/code/target/pet/PETMachineDefinition.kt @@ -15,8 +15,8 @@ class PETMachineDefinition: IMachineDefinition { override val FLOAT_MEM_SIZE = Mflpt5.FLOAT_MEM_SIZE override val PROGRAM_LOAD_ADDRESS = 0x0401u - override val BSSHIGHRAM_START = 0xffffu - override val BSSHIGHRAM_END = 0xffffu + override val BSSHIGHRAM_START = 0u + override val BSSHIGHRAM_END = 0u override lateinit var zeropage: Zeropage override lateinit var golden: GoldenRam diff --git a/codeGenCpu6502/src/prog8/codegen/cpu6502/ProgramAndVarsGen.kt b/codeGenCpu6502/src/prog8/codegen/cpu6502/ProgramAndVarsGen.kt index 74a151fc7..ae8c50925 100644 --- a/codeGenCpu6502/src/prog8/codegen/cpu6502/ProgramAndVarsGen.kt +++ b/codeGenCpu6502/src/prog8/codegen/cpu6502/ProgramAndVarsGen.kt @@ -176,8 +176,10 @@ internal class ProgramAndVarsGen( asmgen.out("; bss sections") asmgen.out("PROG8_VARSHIGH_RAMBANK = ${options.varsHighBank ?: 1}") if(options.varsHighBank!=null) { - if(options.compTarget.machine.BSSHIGHRAM_START == 0u || options.compTarget.machine.BSSHIGHRAM_END==0u) { - throw AssemblyError("current compilation target hasn't got the high ram area properly defined") + if(options.compTarget.machine.BSSHIGHRAM_START == 0u || + options.compTarget.machine.BSSHIGHRAM_END == 0u || + options.compTarget.machine.BSSHIGHRAM_END <= options.compTarget.machine.BSSHIGHRAM_START) { + throw AssemblyError("current compilation target hasn't got the high ram area properly defined or it is simply not available") } // BSS vars in high ram area, memory() slabs just concatenated at the end of the program. if(symboltable.allMemorySlabs.isNotEmpty()) { @@ -187,7 +189,7 @@ internal class ProgramAndVarsGen( asmgen.out(" * = ${options.compTarget.machine.BSSHIGHRAM_START.toHex()}") asmgen.out("prog8_bss_section_start") asmgen.out(" .dsection BSS") - asmgen.out(" .cerror * >= ${options.compTarget.machine.BSSHIGHRAM_END.toHex()}, \"too many variables for BSS section\"") + asmgen.out(" .cerror * > ${options.compTarget.machine.BSSHIGHRAM_END.toHex()}, \"too many variables for BSS section\"") asmgen.out("prog8_bss_section_size = * - prog8_bss_section_start") } else { // BSS vars followed by memory() slabs, concatenated at the end of the program. diff --git a/docs/source/todo.rst b/docs/source/todo.rst index b6ed95eb0..ac15710be 100644 --- a/docs/source/todo.rst +++ b/docs/source/todo.rst @@ -2,6 +2,11 @@ TODO ==== +- add -varsgold to put BSS vars into golden ram at $0400 (cx16 only) rather than in high memory. Make sure the 64tass .cerror check still works to guard against overflow +- add -slabshigh and -slabsgold to also put the memory() slabs into these memory areas (they're now still always part of the prg itself) +- add -nowarnunused, or %option ignore_unused (module scope), to suppress all warnings about unused symbols. Useful in libraries. + put this in all library code, like %option no_symbol_prefixing, and get rid of the "trick" it uses currently to suppress unused symbol warnings for library modules. + - [on branch: shortcircuit] investigate McCarthy evaluation again? this may also reduce code size perhaps for things like if a>4 or a<2 .... ...