DoWhileSub: PHA TYA PHA ;push accumulator and Y register onto stack LDY #0 DoWhileLoop: INY JSR DisplayValue ;routine not implemented TYA SEC Modulus: SBC #6 BCS Modulus ADC #6 BNE DoWhileLoop PLA TAY PLA ;restore Y register and accumulator from stack RTS ;return from subroutine