diff --git a/codeGenCpu6502/src/prog8/codegen/cpu6502/AsmGen.kt b/codeGenCpu6502/src/prog8/codegen/cpu6502/AsmGen.kt index dfcc44f43..4e76c43e7 100644 --- a/codeGenCpu6502/src/prog8/codegen/cpu6502/AsmGen.kt +++ b/codeGenCpu6502/src/prog8/codegen/cpu6502/AsmGen.kt @@ -766,9 +766,9 @@ $repeatLabel lda $counterVar } val isNested = parent is PtRepeatLoop - if(!isNested) { + if(!isNested && !options.useRPN) { // we can re-use a counter var from the subroutine if it already has one for that datatype - val existingVar = asmInfo.extraVars.firstOrNull { it.first==dt } + val existingVar = asmInfo.extraVars.firstOrNull { it.first==dt && it.second.endsWith("counter") } if(existingVar!=null) { if(!preferZeropage || existingVar.third!=null) return existingVar.second diff --git a/docs/source/todo.rst b/docs/source/todo.rst index 0f0ad61de..dfcd71c79 100644 --- a/docs/source/todo.rst +++ b/docs/source/todo.rst @@ -1,6 +1,5 @@ TODO ==== -RPN: examples/line-circle-txt crashes RPN: examples/turtlegfx crashes RPN: examples/maze crashes RPN: examples/bsieve,charset compilation crash (bit shift expression)