<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Thu, 16 Mar 2006 10:44:23 +0100
From   : John Kortink <kortink@...>
Subject: Re: 1MHZ SCSI/ATA board

On Thu, 16 Mar 2006 07:39:20 -0000, "David Harper" wrote:

>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?

I use it all the time in my code. It is an essential
technique, to use the stack for all transient memory
needs. Instead of (ab)using fixed locations. It does
take a lot of discipline in getting it right, since
your memory is not in a fixed location but needs to
be addressed by page 1 + offset + X all the time. A
mistake is easily made, especially having X correct
all the time can be a little tricky (you sometimes
need it for other purposes than a stack reference,
and there can be complications with called routines
that need it for both purposes, add things to the
stack which you need to account for, etc.).


John Kortink

-- 

Email    : kortink@...         
Homepage : http://www.inter.nl.net/users/J.Kortink

GoMMC, the ultimate BBC B/B+/Master storage system :
http://web.inter.nl.net/users/J.Kortink/home/hardware/gommc
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>