??? 10/23/06 09:27 Read: times |
#126893 - No lock IRQ Responding to: ???'s previous message |
I don't see the need for locking the IRQ.
The mov instruction should not push but just load the register. When an lcall or ljmp is executed the current bank should be pushed to the separate stack and this register selected as the new current bank. When an acall is executed the current bank should be pushed on the separate stack. When a ret is executed the current bank must be popped from the separate stack. When an interrupt is serviced the current bank must be pushed and bank 0 activated regardless of the contents of this sfr. When a reti is executed the bank is popped again. Reading the sfr should give the current bank. To be able to implement an indirect call you need to be able to push and pop this stack. I think a second sfr is best for this use. Writing it pushes, reading it pops. Since legacy indirect calls/jumps will not work with this scheme en/disabling the automatic bankswitching is preferred. |