diff --git a/compiler/src/prog8/compiler/target/c64/codegen2/AsmGen2.kt b/compiler/src/prog8/compiler/target/c64/codegen2/AsmGen2.kt index 4f9f29b82..4cf3c2766 100644 --- a/compiler/src/prog8/compiler/target/c64/codegen2/AsmGen2.kt +++ b/compiler/src/prog8/compiler/target/c64/codegen2/AsmGen2.kt @@ -370,9 +370,11 @@ internal class AsmGen2(val program: Program, "$"+number.toString(16).padStart(2, '0') } decl.datatype== DataType.ARRAY_UW -> array.map { - val number = (it as NumericLiteralValue).number.toInt() - // TODO word array with address-references - "$"+number.toString(16).padStart(4, '0') + if(it is NumericLiteralValue) { + "$" + it.number.toInt().toString(16).padStart(4, '0') + } else { + (it as AddressOf).identifier.nameInSource.joinToString(".") + } } else -> throw AssemblyError("invalid arraysize type") }