mirror of
https://github.com/irmen/prog8.git
synced 2024-11-25 19:31:36 +00:00
fix faulty word[x]-- , fix invalid stz addressing modes
This commit is contained in:
parent
38a6c6a866
commit
80e3a11268
@ -105,7 +105,7 @@ internal class PostIncrDecrAsmGen(private val program: Program, private val asmg
|
|||||||
lda $asmArrayvarname,x
|
lda $asmArrayvarname,x
|
||||||
bne +
|
bne +
|
||||||
dec $asmArrayvarname+1,x
|
dec $asmArrayvarname+1,x
|
||||||
+ dec $asmArrayvarname
|
+ dec $asmArrayvarname,x
|
||||||
""")
|
""")
|
||||||
}
|
}
|
||||||
DataType.FLOAT -> {
|
DataType.FLOAT -> {
|
||||||
|
@ -1267,11 +1267,12 @@ internal class AssignmentAsmGen(private val program: Program, private val asmgen
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
asmgen.loadScaledArrayIndexIntoRegister(wordtarget.array!!, wordtarget.datatype, CpuRegister.Y)
|
asmgen.loadScaledArrayIndexIntoRegister(wordtarget.array!!, wordtarget.datatype, CpuRegister.Y)
|
||||||
asmgen.out(" lda $sourceName | sta ${wordtarget.asmVarname},y | iny")
|
asmgen.out("""
|
||||||
if(CompilationTarget.instance.machine.cpu == CpuType.CPU65c02)
|
lda $sourceName
|
||||||
asmgen.out(" stz ${wordtarget.asmVarname},y")
|
sta ${wordtarget.asmVarname},y
|
||||||
else
|
iny
|
||||||
asmgen.out(" lda #0 | sta ${wordtarget.asmVarname},y")
|
lda #0
|
||||||
|
sta ${wordtarget.asmVarname},y""")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TargetStorageKind.REGISTER -> {
|
TargetStorageKind.REGISTER -> {
|
||||||
@ -1680,7 +1681,7 @@ internal class AssignmentAsmGen(private val program: Program, private val asmgen
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
asmgen.loadScaledArrayIndexIntoRegister(target.array!!, DataType.UBYTE, CpuRegister.Y)
|
asmgen.loadScaledArrayIndexIntoRegister(target.array!!, DataType.UBYTE, CpuRegister.Y)
|
||||||
asmgen.out(" stz ${target.asmVarname},y")
|
asmgen.out(" lda #0 | sta ${target.asmVarname},y")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TargetStorageKind.REGISTER -> when(target.register!!) {
|
TargetStorageKind.REGISTER -> when(target.register!!) {
|
||||||
|
@ -1652,10 +1652,7 @@ internal class AugmentableAssignmentAsmGen(private val program: Program,
|
|||||||
}
|
}
|
||||||
TargetStorageKind.ARRAY -> {
|
TargetStorageKind.ARRAY -> {
|
||||||
asmgen.loadScaledArrayIndexIntoRegister(target.array!!, target.datatype, CpuRegister.Y, true)
|
asmgen.loadScaledArrayIndexIntoRegister(target.array!!, target.datatype, CpuRegister.Y, true)
|
||||||
if(CompilationTarget.instance.machine.cpu == CpuType.CPU65c02)
|
asmgen.out(" lda #0 | sta ${target.asmVarname},y")
|
||||||
asmgen.out(" stz ${target.asmVarname},y")
|
|
||||||
else
|
|
||||||
asmgen.out(" lda #0 | sta ${target.asmVarname},y")
|
|
||||||
}
|
}
|
||||||
TargetStorageKind.STACK -> {
|
TargetStorageKind.STACK -> {
|
||||||
if(CompilationTarget.instance.machine.cpu == CpuType.CPU65c02)
|
if(CompilationTarget.instance.machine.cpu == CpuType.CPU65c02)
|
||||||
|
Loading…
Reference in New Issue
Block a user