mirror of
https://github.com/irmen/prog8.git
synced 2024-12-27 05:29:38 +00:00
fix array indexer bug
This commit is contained in:
parent
8aeb8a9bb7
commit
b9706a180b
@ -540,7 +540,7 @@ internal class AssignmentAsmGen(private val program: Program, private val asmgen
|
|||||||
// TODO("array[var] ${target.constArrayIndexValue}")
|
// TODO("array[var] ${target.constArrayIndexValue}")
|
||||||
// }
|
// }
|
||||||
asmgen.out(" lda #<$sourceName | ldy #>$sourceName | jsr floats.push_float")
|
asmgen.out(" lda #<$sourceName | ldy #>$sourceName | jsr floats.push_float")
|
||||||
asmgen.translateExpression(target.array!!)
|
asmgen.translateExpression(target.array!!.indexer)
|
||||||
asmgen.out(" lda #<${target.asmVarname} | ldy #>${target.asmVarname} | jsr floats.pop_float_to_indexed_var")
|
asmgen.out(" lda #<${target.asmVarname} | ldy #>${target.asmVarname} | jsr floats.pop_float_to_indexed_var")
|
||||||
}
|
}
|
||||||
TargetStorageKind.MEMORY -> throw AssemblyError("can't assign float to mem byte")
|
TargetStorageKind.MEMORY -> throw AssemblyError("can't assign float to mem byte")
|
||||||
@ -834,7 +834,7 @@ internal class AssignmentAsmGen(private val program: Program, private val asmgen
|
|||||||
// } else if(target.array!!.arrayspec.index is IdentifierReference) {
|
// } else if(target.array!!.arrayspec.index is IdentifierReference) {
|
||||||
// TODO("array[var] ${target.constArrayIndexValue}")
|
// TODO("array[var] ${target.constArrayIndexValue}")
|
||||||
// }
|
// }
|
||||||
asmgen.translateExpression(target.array!!)
|
asmgen.translateExpression(target.array!!.indexer)
|
||||||
asmgen.out("""
|
asmgen.out("""
|
||||||
inx
|
inx
|
||||||
lda P8ESTACK_LO,x
|
lda P8ESTACK_LO,x
|
||||||
|
Loading…
Reference in New Issue
Block a user