I would like to change the order that some of the registers are stored on the stack when an interrupt occurs. Ideally I would like to store the IE register first. Does anyone know if it is possible to stop the C51 compiler from pushing and poping registers from the stack automatically in an interrupt routine, so that I can do this manually, in the order I would like?
"This would result in me having an all C interrupt routine which would make it easier and quicker for me to add and debug any changes I make." I don't really understand. If you write the ISR in 'C', you don't know what needs to be stacked, the compiler does, and it only preserves registers that it destroys in the ISR. Why would you want to interfere with that mechanism? Why would you want to push/pop IE anyway? You can specify a register bank for an ISR with the 'using' directive which may reduce the amount of stuff that gets stacked. Could you explain why you are trying to do this?
Why would you want to push/pop IE anyway? Well, since I do it I'll tell you why
OLD local U8 saveIE; SaveIE = IE; EA = FALSE; .... IE = save IE; NEW: Push(IE); EA = FALSE; .... Pop(IE);