If you were following the code, you would see the errors. I was trying to do it from the top of my head Here is the corrected version LDY #PAGE ;PAGE=$20, $40, or $60 STY PTR+1 LDY #0 STY PTR LDX #$1F a LDA #0 b STA (PTR),Y INY BNE b INC PTR+1 DEX TXA AND #3 CMP #3 BNE a LDA #0 c STA (PTR),Y INY CPY #F8 BCC c INC PTR+1 DEX BPL b d RTS