I am using 89v51RD2. my question is how to push an address of a function on to stack in C?? For the same how do I get address of a function?? Plz Help.
>>> on to the stack instead of address from where ISR got called.
Do you really want to modify(!) the return address on the stack? The return address back to "somewhere" in the main application? Because you write "instead" and not "in addition".
I would have understood if you wrote: "Want to push the address of an additional function, to which the RETI will jump, and the RET of that function will then return to the main application that was interrupted before".
Even this is not a good programming style, a stack overflow may occur.
It occur relatively frequent that someone believes that letting an interrupt return to some other place than where it happened will solve some problem.
WRONG
But having the ISR return to somewhere else is basically what an RTOS does. But it does it by switching to another stack at the same time.