Date : Wed, 25 Nov 2009 02:24:39 +0100
From : rick@... (Rick Murray)
Subject: Quine
Mick Champion wrote:
> Oh right. So you couldn't PLA from within a subroutine when you had
> PHA'd from the outside it, unless you pulled it twice amd remembered to
> push the 1st byte back?
Messing with the stack out-of-sequence can be useful if you are writing
a custom interrupt handler with dispatching. It can be easier to toss
stuff off the stack and RTI than to go through a chain of RTSing.
However it is Hairy (with a capital H). If you're writing your own OS,
go for it. If you're writing your own single-tasking highly-specific
program, go for it. If you plan to co-exist with anything else (this
includes the factory-fitted MOS), you'd better not...
> TSX // take RTS address out of the stack
^ Addresses are 16 bit, remember.
And, um... don't have my booklet to hand, but doesn't TSX copy the stack
POINTER to X, not actually pull anything?
> Never touched the stack.
Stack's good. Needs discipline though.
Best wishes,
Rick.
--
Rick Murray, eeePC901 & ADSL WiFI'd into it, all ETLAs!
BBC B: DNFS, 2 x 5.25" floppies, EPROM prog, Acorn TTX
E01S FileStore, A3000/A5000/RiscPC/various PCs/blahblah...
>> TO PRIVATE MAIL ME, REMOVE [BBC-Micro] FROM SUBJECT <<