Re: [stella] Stack pointer. Some questions

Subject: Re: [stella] Stack pointer. Some questions
From: "Eric Ball" <ericball@xxxxxxxxxxxx>
Date: Sun, 9 May 2004 08:07:07 -0400
The stack pointer is a 6502 register.  The only way to access it is via the
TXS and TSX instructions.  It is an 8 bit value which points to the next
byte to be used on the stack, which is at memory address $01SS.  The stack
pointer is post-decrememted when items are added (via either PHP, PHA, JSR
and BRK instructions or when an interrupt occurs).  However, on the 2600 the
128 bytes of RAM are used for both the zero-page and stack, so effectively
the stack is at $00SS.  (The 2600 doesn't have interrupts ethier so you
don't have to worry about those.)  How much RAM you allocate for the stack
typically depends on the depth of subroutine calls in your code.  (Typically
no more than a level or two, i.e. 4 bytes).


----------------------------------------------------------------------------------------------
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/


Current Thread