diff --git a/compiler/src/prog8/compiler/target/c64/codegen/AssignmentAsmGen.kt b/compiler/src/prog8/compiler/target/c64/codegen/AssignmentAsmGen.kt index ca2c0508f..6d6963599 100644 --- a/compiler/src/prog8/compiler/target/c64/codegen/AssignmentAsmGen.kt +++ b/compiler/src/prog8/compiler/target/c64/codegen/AssignmentAsmGen.kt @@ -293,15 +293,15 @@ internal class AssignmentAsmGen(private val program: Program, private val errors val sourceName = asmgen.asmIdentifierName(assign.value as IdentifierReference) TODO("$assign") } - is AddressOf -> { - TODO("$assign") - } is DirectMemoryRead -> { - TODO("$assign") + val memory = (assign.value as DirectMemoryRead).addressExpression.constValue(program)!!.number.toHex() + asmgen.out(" lda $memory | sta $hexAddr") + return true } is ArrayIndexedExpression -> { TODO("$assign") } + is AddressOf -> throw AssemblyError("can't assign address to byte") else -> { fallbackAssignment(assign) return true