Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/18/03 04:24
Read: times


 
#41752 - RE: Over Run Interrupt Memory space Using C
Responding to: ???'s previous message
In assembly language, to keep from overrunning the interrupt vectors, you can place jumps at the vector addresses. For example,

org 8003h (use your vector address here)
jmp int1isr (use a descriptive name)

The program counter automatically jumps to the interrupt vector when an interrupt is triggered, this code causes it to jump to some interrupt subroutine that will end with "RETI"...so you avoid overrunning the next interrupt vector (at x00Bh, I think?)

int1isr:
blah
blah
blah
RETI

I am sure there is some variant for this in the C language...perhaps a call to the subroutine rather than a jump? I am familiar with C++ but I have never used it for a microcontroller.

So the final answer is: no compiler that I am aware of will automatically compensate for your vector addresses, it is up to you to know that your routine will overrun its boundaries and compensate for that yourself. That is the beauty (and the beast, for that matter) of the microcontroller.

Hope this helps!

List of 8 messages in thread
TopicAuthorDate
Over Run Interrupt Memory space Using C            01/01/70 00:00      
   RE: Over Run Interrupt Memory space Using C            01/01/70 00:00      
      RE: Over Run Interrupt Memory space Using C            01/01/70 00:00      
         RE: Over Run Interrupt Memory space Using C            01/01/70 00:00      
   RE: Over Run Interrupt Memory space Using C            01/01/70 00:00      
      RE: Over Run Interrupt Memory space Using C            01/01/70 00:00      
   RE: Over Run Interrupt Memory space Using C            01/01/70 00:00      
      RE: Over Run Interrupt Memory space Using C            01/01/70 00:00      

Back to Subject List