From 66d5490702b31305ebbd5cbbf39efc12d5c2fe57 Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Fri, 26 Nov 2021 21:34:00 +0100 Subject: [PATCH] just added missing FAC2 assign possibility --- .../src/prog8/compiler/target/cpu6502/codegen/AsmGen.kt | 2 +- .../target/cpu6502/codegen/assignment/AssignmentAsmGen.kt | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/codeGeneration/src/prog8/compiler/target/cpu6502/codegen/AsmGen.kt b/codeGeneration/src/prog8/compiler/target/cpu6502/codegen/AsmGen.kt index 7a50550b9..bd3858608 100644 --- a/codeGeneration/src/prog8/compiler/target/cpu6502/codegen/AsmGen.kt +++ b/codeGeneration/src/prog8/compiler/target/cpu6502/codegen/AsmGen.kt @@ -879,7 +879,7 @@ class AsmGen(private val program: Program, RegisterOrPair.XY, in Cx16VirtualRegisters -> assignmentAsmGen.assignRegisterpairWord(target, reg) RegisterOrPair.FAC1 -> assignmentAsmGen.assignFAC1float(target) - RegisterOrPair.FAC2 -> TODO("no support yet to assign FAC2 directly to something") + RegisterOrPair.FAC2 -> assignmentAsmGen.assignFAC2float(target) else -> throw AssemblyError("invalid register") } } diff --git a/codeGeneration/src/prog8/compiler/target/cpu6502/codegen/assignment/AssignmentAsmGen.kt b/codeGeneration/src/prog8/compiler/target/cpu6502/codegen/assignment/AssignmentAsmGen.kt index c023af335..ae2e92cfd 100644 --- a/codeGeneration/src/prog8/compiler/target/cpu6502/codegen/assignment/AssignmentAsmGen.kt +++ b/codeGeneration/src/prog8/compiler/target/cpu6502/codegen/assignment/AssignmentAsmGen.kt @@ -1101,6 +1101,11 @@ internal class AssignmentAsmGen(private val program: Program, private val asmgen } } + internal fun assignFAC2float(target: AsmAssignTarget) { + asmgen.out(" jsr floats.MOVFA") // fac2 -> fac1 + assignFAC1float(target) + } + internal fun assignFAC1float(target: AsmAssignTarget) { when(target.kind) { TargetStorageKind.VARIABLE -> {