[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
65816's Stack Pointer
I understand that Stack Pointer can only be restricted at Page One in
both 6502 and 65C02. It still can restrict maximum of 256 byte space. You
mentioned that 65816 can handle maximum of 65536 byte space for Stack
Pointer. I don't think that it is true because it still restricts the 256
byte space.
If you want to use 512 byte space or 1024 byte space, you will have to
use PCS (Push Accumulator Stack Pointer) PCS and PSC allow me to switch one
Stack Pointer between Page to Page. For example, I set $4000 for Stack Page
1, $4100 for Stack Page 2, $4200 for Stack Page 3, and $4300 for Stack Page
4. Only one problem is that we can't be certain if Stack Page 1 will be
full before we tell Stack Pointer to redirect to Stack Page 2.
I use PHP instruction that will return one byte. If it tells: $FF, it
means to be available for 256 bytes. If it tells: $7F, it appears to be
half full. If it tells $00, it appears to be complete FULL. BEQ
instruction will be executed to tell Stack Pointer to redirect to Stack Page
2. It can be very difficult.
It is the same example for Direct Page Pointer that it can move between
$0000-$FFFF. If Direct Page One is full, it will have to create Direct Page
Two before it can switch back and forth.
--
Yours Truly,
Bryan Parkoff
BParkoff@satx.rr.com