This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Get an address of function

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.

Parents Reply Children
  • Sounds like a task better accomplished in assembler, with a clear understanding about what's on the stack, and the implications of calling/returning on the processor context.

    For call back examples, look at qsort(), pointers to functions, calling back with parameters.

  • So essentially you want the handler of a high-priority interrupt to trigger a low-priority interrupt so that its handler would complete the processing? Why don't you do just that, assuming your MCU supports multiple interrupt priorities?

    a well known technique.
    I know of no '51 derivative that does not have, at least, 2 priorities