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