To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcxOpen lugnet.robotics.rcx in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / 2371
2370  |  2372
Subject: 
RE: [long] Interrupt programming, buggy code
Newsgroups: 
lugnet.robotics.rcx
Date: 
Tue, 2 Mar 2004 18:30:05 GMT
Reply-To: 
<rhempel@bmts%nomorespam%.com>
Viewed: 
3272 times
  
Much better and more accurate answer from Mark - who knows
a lot more about GCC that I do :-)

I should stick to commenting on assembly language stuff.

Ralph

When you declare your ISR as an interrupt_handler, GCC terminates the function
with an "rte" instead of an "rts".  The ROM code that dispatches the interrupt
to your function is already doing the rte so your function should not.  Here's
the ROM dispatch code:

04cc: mov.w  r6,@-e7
04ce: mov.w  @0xfda2:16,r6
04d2: jsr    @r6
04d4: mov.w  @r7+,r6
04d6: rte

Instead, you could remove the interrupt_handler attribute and preserve the
scratch registers like so:

<snippage>



Message is in Reply To:
  Re: [long] Interrupt programming, buggy code
 
Hi Benjamin, When you declare your ISR as an interrupt_handler, GCC terminates the function with an "rte" instead of an "rts". The ROM code that dispatches the interrupt to your function is already doing the rte so your function should not. Here's (...) (21 years ago, 2-Mar-04, to lugnet.robotics.rcx)

7 Messages in This Thread:





Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR