[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] SIGNAL and INTERRUPT overhead

From: James A.R. Koehler
Subject: [avr-gcc-list] SIGNAL and INTERRUPT overhead
Date: Sat, 20 Aug 2005 18:43:08 +0000

I have to agree with the complaint about the excessive prolog for
interrupts.  Many times an interrupt service routine just consists of
setting or clearing bits in a port.  In those cases, there is no
justification or need for pushing all those registers onto the stack and
then popping them off afterwards.  It wastes both time and flash space.

My background is in embedded programming and I've been doing it for
almost thirty years using a lot of different microprocessors along the
way.  In most programming languages I've used, the responsibility for
pushing the status register, etc. belongs to the programmer; it is not
built into the compiler.  I prefer it that way.

If the consensus is that we need to be protected against ourselves by
having all the existing prolog in the two existing interrupt service
methods, perhaps the solution is to have a third category of interrupt
service routine in which nothing is pushed onto the stack and the
programmer takes full responsibility for making sure the machine is
returned to the same state it was before the interrupt.



What difference does it make to the dead, the orphans and the homeless,
whether the mad destruction is wrought under the name of totalitarianism
or the holy name of liberty or democracy?  -  Mahatma Gandhi

reply via email to

[Prev in Thread] Current Thread [Next in Thread]