From 18d820da94c1d397cc459295166c14bae6e72d2b Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Sat, 6 Nov 2021 18:52:54 +0100 Subject: [PATCH] correct assignment type --- .../cpu6502/codegen/BuiltinFunctionsAsmGen.kt | 4 +- examples/test.p8 | 47 ++++++------------- 2 files changed, 16 insertions(+), 35 deletions(-) diff --git a/codeGeneration/src/prog8/compiler/target/cpu6502/codegen/BuiltinFunctionsAsmGen.kt b/codeGeneration/src/prog8/compiler/target/cpu6502/codegen/BuiltinFunctionsAsmGen.kt index 5fc1b713e..7cf89c7e5 100644 --- a/codeGeneration/src/prog8/compiler/target/cpu6502/codegen/BuiltinFunctionsAsmGen.kt +++ b/codeGeneration/src/prog8/compiler/target/cpu6502/codegen/BuiltinFunctionsAsmGen.kt @@ -882,14 +882,14 @@ internal class BuiltinFunctionsAsmGen(private val program: Program, private val AsmAssignment( AsmAssignSource(SourceStorageKind.REGISTER, program, asmgen, datatype, register = RegisterOrPair.FAC1), targetFromExpr(first, datatype), - true, program.memsizer, first.position + false, program.memsizer, first.position ) ) asmgen.translateNormalAssignment( AsmAssignment( AsmAssignSource(SourceStorageKind.VARIABLE, program, asmgen, datatype, "floats.tempvar_swap_float"), targetFromExpr(second, datatype), - true, program.memsizer, second.position + false, program.memsizer, second.position ) ) } diff --git a/examples/test.p8 b/examples/test.p8 index 897a909ed..c88742b95 100644 --- a/examples/test.p8 +++ b/examples/test.p8 @@ -4,42 +4,23 @@ main { sub start() { - ubyte xx=$20 - - if not xx { - xx++ - } - - if ~xx { - xx++ - } - - byte yy=3 - - if -yy { - xx++ - } - - + uword xx= $2000 + ubyte yy=$30 + ubyte zz=9 + sys.memset(xx+200, yy*2, ~yy) + @($c030) = 10 @(~xx) *= 2 + txt.print_ub(@($c030)) -; ubyte yy=$30 -; ubyte zz=9 -; sys.memset(xx+200, yy*2, ~yy) -; -; @($c030) = 10 -; @(~xx) *= 2 -; txt.print_ub(@($c030)) -; -; float f1 = 1111.11 -; float f2 = 2222.22 -; float[] fa = [2222.22, 3333.33] -; -; swap(f1, fa[1]) -; floats.print_f(f1) -; txt.nl() -; floats.print_f(fa[1]) + float f1 = 1111.11 + float f2 = 2222.22 + float[] fa = [2222.22, 3333.33] + + swap(f1, fa[1]) + floats.print_f(f1) + txt.nl() + floats.print_f(fa[1]) } }