BSSHIGHRAM_END more clearly defined (to be inclusive)

This commit is contained in:
Irmen de Jong 2023-12-23 19:05:06 +01:00
parent 4cd9bb8f99
commit 0e0fac8c4b
5 changed files with 14 additions and 7 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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 ....
...