RosettaCodeData/Task/Loops-Do-while/6502-Assembly/loops-do-while.6502
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07:00

18 lines
314 B
Text

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