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

Writing to a Specific Program Memory Location in C for an ISR

I'm attempting to use the timer 1 ISR for the ADuC814. In assembly I easily use the ORG directive to write to the address that the PC jumps to when the interupt is set. How do I do the equivalent in C? Any help would be appreciated.

Parents
  • You can locate any function to a specific location in code space by placing it in its own module and then telling the linker where to locate that module. It's a cumbersome and often unnecessary process, however.

    and would not work for an ISR (as this thread is about)
    writing an ISR as a function and linker locate it would make the compiler exit the function with 'ret' instead of 'reti'

    Erik

    PS do not fall for whatever "interrupt number" the datasheet for your derivative may state, for C purposes the interrupt number is (vector address -3)/8

Reply
  • You can locate any function to a specific location in code space by placing it in its own module and then telling the linker where to locate that module. It's a cumbersome and often unnecessary process, however.

    and would not work for an ISR (as this thread is about)
    writing an ISR as a function and linker locate it would make the compiler exit the function with 'ret' instead of 'reti'

    Erik

    PS do not fall for whatever "interrupt number" the datasheet for your derivative may state, for C purposes the interrupt number is (vector address -3)/8

Children