Date : Thu, 16 Mar 2006 07:39:20 -0000
From : "David Harper" <dl.harper@...>
Subject: Re: 1MHZ SCSI/ATA board
David Hunt wrote:
> TSX - Transfer Stack to X register - the 6502 isn't all that orthogonal,
> there isn't a TSY,TAS or TSA.
It is the only instruction you have for accessing the stack pointer (and TXS
is the only one for writing it) but it is not something you need to do very
often. If you are only going to have one instruction to read the stack
pointer, then it makes sense for it to be read into X, because then you can
index into the stack.
Having said this, indexing into the stack seems to be a far less common
technique in 6502 programming than in 80x86 programming. In the latter it is
standard, using stack structures indexed with BP, but I don't recall ever
having come across it to any significant extent in 6502 programs.
How much have you good folk used the idea when writing 6502 code?
David Harper