BINGO!!! Nice catch. I owe you a beer for that.
I guess I never caught that before, because it would probably exit the previous run with the correct value of zero. Anyway, I added an instruction to clear that register on entry, adjusted the cycle count, and now everything is correct.
I guess I never caught that before, because it would probably exit the previous run with the correct value of zero. Anyway, I added an instruction to clear that register on entry, adjusted the cycle count, and now everything is correct.