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
  • Alan,

    You will no doubt receive a number of responses shortly prompting you to read the manuals for the C51 compiler thoroughly, and that will be good advice. That being said, here's some information:

    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.

    In your case, Keil makes it easy to locate ISRs in the appropriate place by using the "interrupt" keyword. Each ISR has an interrupt "number" that really just represents the address where keil will place the entry point for that function. Search on the "interrupt" keyword in the manual and you'll quickly find out how to do what you're looking for.

    -Jay Daniel

Reply
  • Alan,

    You will no doubt receive a number of responses shortly prompting you to read the manuals for the C51 compiler thoroughly, and that will be good advice. That being said, here's some information:

    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.

    In your case, Keil makes it easy to locate ISRs in the appropriate place by using the "interrupt" keyword. Each ISR has an interrupt "number" that really just represents the address where keil will place the entry point for that function. Search on the "interrupt" keyword in the manual and you'll quickly find out how to do what you're looking for.

    -Jay Daniel

Children