Not counting the STP (stop) and WAI (wait) instructions which the original 6502 and even early 65c02's didn't have, you don't normally stop it. When a routine ends, it's usually with an RTS (ReTurn from Subroutine) instruction which takes the address off the stack to know where to go back to, that is, to resume execution with the next instruction in the routine that called it, or if it was the startup routine, it might go into an infinite loop where it's just watching for an instruction or condition that will tell it what to do next. When I was in that initial 6502 class in 1982, we used AIM-65 computers in the lab class, and we were instructed to use the built-in monitor program. We were to end our little programs with the BRK (BReaK) instruction which went back to the monitor. I have never used BRK since then though.
_________________ http://WilsonMinesCo.com/ lots of 6502 resources The "second front page" is http://wilsonminesco.com/links.html . What's an additional VIA among friends, anyhow?
|