Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] IAR C and FIQ isr

2005-05-06 by Robert Adsett

At 03:45 PM 5/5/05 -0700, Richard wrote:
>At 06:31 AM 5/5/2005, Robert Adsett wrote:
> >...
> > >But fiq has own shadow registers r8-r15.
> > >Why compiler saves this registers in stack?
> > >I think, that this is not necessary and make undesirable overhead.
> > >Can I avoid this somehow?
> >
> >Never trust the compiler for this sort of work.  Do it in assembler.  I've
> >run into too many compilers with either poor or outright broken code
> >generation in this area to ever rely on it.
> >
> >Robert
>
>That's kind of sad statement to make.

Maybe I've just worked with too many compilers, but experience leads me to 
distrust them more the further they get from the core language.  I'm wary 
of any non-standard keyword.  Mind you that's not the only reason I do the 
epilogue and prologue in assembler.  It is also one of the best ways of 
forcing oneself to get to understand the minutia of what happens during an 
interrupt.  I do consider that important knowledge for anyone doing any 
serious work on a micro if interrupts are involved.  Besides, it's not as 
if an interrupt epilogue and prologue are difficult to write.  Anyone doing 
embedded work should have sufficient proficiency with assembly language to 
do that.

I am quite happy with the body of the interrupt being in C in many cases 
although I have run into cases where the body could not be done in C.

Robert

" 'Freedom' has no meaning of itself.  There are always restrictions,   be 
they legal, genetic, or physical.  If you don't believe me, try to chew a 
radio signal. "  -- Kelvin Throop, III
http://www.aeolusdevelopment.com/

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.