diff --git a/codeCore/src/prog8/code/target/atari/AtariZeropage.kt b/codeCore/src/prog8/code/target/atari/AtariZeropage.kt index 6beacc6c8..688ad8876 100644 --- a/codeCore/src/prog8/code/target/atari/AtariZeropage.kt +++ b/codeCore/src/prog8/code/target/atari/AtariZeropage.kt @@ -13,6 +13,10 @@ class AtariZeropage(options: CompilationOptions) : Zeropage(options) { override val SCRATCH_W2 = 0xcfu // temp storage 2 for a word $cf+$d0 TODO is $d0 okay to use? init { + if (options.floats) { + throw InternalCompilerException("Atari target doesn't yet support floating point routines") + } + if (options.floats && options.zeropage !in arrayOf( ZeropageType.FLOATSAFE, ZeropageType.BASICSAFE, diff --git a/codeCore/src/prog8/code/target/c128/C128Zeropage.kt b/codeCore/src/prog8/code/target/c128/C128Zeropage.kt index 2baaafe12..de6b0f139 100644 --- a/codeCore/src/prog8/code/target/c128/C128Zeropage.kt +++ b/codeCore/src/prog8/code/target/c128/C128Zeropage.kt @@ -16,6 +16,10 @@ class C128Zeropage(options: CompilationOptions) : Zeropage(options) { override val SCRATCH_W2 = 0xfdu // temp storage 2 for a word $fd+$fe init { + if (options.floats) { + throw InternalCompilerException("C128 target doesn't yet support floating point routines") + } + if (options.floats && options.zeropage !in arrayOf( ZeropageType.FLOATSAFE, ZeropageType.BASICSAFE, @@ -45,13 +49,13 @@ class C128Zeropage(options: CompilationOptions) : Zeropage(options) { 0xb0u, 0xb1u, 0xb4u, 0xb5u, 0xb6u )) - if(options.zeropage==ZeropageType.BASICSAFE) { - // can also clobber the FP locations + // if(options.zeropage==ZeropageType.BASICSAFE) { + // can also clobber the FP locations (unconditionally, because the C128 target doesn't support floating point calculations in prog8 at this time0 free.addAll(listOf(0x14u, 0x28u, 0x29u, 0x2au, 0x2bu, 0x2cu, 0x50u, 0x51u, 0x52u, 0x53u, 0x54u, 0x59u, 0x5au, 0x5bu, 0x5cu, 0x5du, 0x5eu, 0x5fu, 0x60u, 0x61u, 0x62u, 0x63u, 0x64u, 0x65u, 0x66u, 0x67u, 0x68u, 0x6au, 0x6bu, 0x6cu, 0x6du, 0x6eu, 0x6fu, 0x71u)) - } + // } } ZeropageType.DONTUSE -> { free.clear() // don't use zeropage at all diff --git a/compiler/res/prog8lib/c128/floats.p8 b/compiler/res/prog8lib/c128/floats.p8 index 53aa00c0d..c04033df9 100644 --- a/compiler/res/prog8lib/c128/floats.p8 +++ b/compiler/res/prog8lib/c128/floats.p8 @@ -1,7 +1,10 @@ ; Prog8 definitions for floating point handling on the Commodore 128 -%option enable_floats -%import floats_functions +; NOTE: it can't currently be used at all because the float variables +; on the c128 have to be stored in memory bank 1 (separate bank) +; and prog8 can't do that now (it just inlines everything) + +%option enable_floats ; this is here to trigger the compiler error. floats { ; ---- this block contains C-128 compatible floating point related functions ----