Quote:
Wouldn't you do a PHP as well as pushing, the accumulator, X and Y registers?
PHP is automatically included in the interrupt sequence, kind of like the CMP#0 being automatically included in instructions that affect A, X, or Y.
The article mentions having a different stack area for the ISR's use, but I can't think of any reason for that. It won't step on anything, because that's part of a stack's function-- that wherever you are, it leaves it alone and builds past it then when it's done it removes anything it has added without affecting anything that was there previously. My zero-overhead system of servicing interrupts in Forth takes advantage of that. Before I did it, people said it could not be done without the overhead of setting up another pair of stacks. If either the background program or the ISR need a lot of stack space for local variables and environments, recursion, etc., the best use of stack space will be gained by having one large continuous stack space with one large free area at the end, as opposed to fragmenting it and having dead zones between the fragments.
I forgot about saving the banks, since my use of the '816 has been limited to bank zero only. (You still get a ton of benefits.) The bank pushes and pulls are always 8-bit though. The direct-page register is 16-bit, so pushing and pulling it are always 16-bit regardless of status bits.