Lyrical Nanoha wrote:
On Mon, 28 Nov 2005, Michael J. Mahon wrote:Trace it carefully, and you will see that it constructs a return address on the stack than then RTSs to it.Eek.
It's actually quite common to synthesize a branch address on the stack for RTSing to. The Monitor is an example. It is very frequently done when vectoring to one of several routines. ROM (unmodifiable) code is one reason to do so, and the relatively poor complement of 6502 indirect jump instructions is another. -michael Music synthesis for 8-bit Apple II's! Home page: http://members.aol.com/MJMahon/ "The wastebasket is our most important design tool--and it is seriously underused."