fix regression for goto array[idx] on 6502 cpu which doesn't have jmp (ptr,x)

This commit is contained in:
Irmen de Jong 2025-04-23 02:56:10 +02:00
parent 84026b105f
commit 2cb183c6d8
3 changed files with 3 additions and 4 deletions

View File

@ -1084,9 +1084,9 @@ $repeatLabel""")
else {
if(evaluateAddressExpression) {
val arrayIdx = jump.target as? PtArrayIndexer
if(arrayIdx!=null && !arrayIdx.splitWords) {
if(isTargetCpu(CpuType.CPU65C02) && arrayIdx!=null && !arrayIdx.splitWords) {
// if the jump target is an address in a non-split array (like a jump table of only pointers),
// more optimal assembly can be generated using JMP address,X
// on the 65c02, more optimal assembly can be generated using JMP address,X
assignExpressionToRegister(arrayIdx.index, RegisterOrPair.A)
out(" asl a | tax")
return JumpTarget(asmSymbolName(arrayIdx.variable), true, true, false)

View File

@ -1,5 +1,4 @@
%import textio
%import diskio
%zeropage basicsafe
%option no_sysinit

View File

@ -3,4 +3,4 @@ org.gradle.console=rich
org.gradle.parallel=true
org.gradle.daemon=true
kotlin.code.style=official
version=11.3
version=11.3.1-SNAPSHOT