Differences between interrupt service routine (ISR) and a subroutine

Nov 28, 2006 5 Replies

Hi



What are the differences between ISR and a subroutine in embedded systems, how about the following:



- interrupts are disabled by the microprocessor prior to calling the isr



- isr's are always smaller



- an isr cannot be written in C



- a subroutine always has arguments



- the CPU flags are stored on the stack in addition to the return address



Thanks



Not always true.

not true

definitely just wrong

nope

Depends on the CPU

No problem

Sounds like a homework question, you want somebody else to answer for you.

Hint see if you can find a difference between interupts and functions on NON embedded systems.

Well I suggest you go back and read the book again, as these appear to be badly copied from a text book.

Paul Carpenter | paul@pcserviceselectronics.co.uk PC Services GNU H8 & mailing list info For those web sites you hate

Stick it up your ass, cheat.

pete

pete@fenelon.com "he just stuck to buying beer and pointing at other stuff"

It's the same in embedded systems as in every other system: an ISR is called by the processor after it has received a hardware signal, whereas a subroutine is called by software.

--=20 Fredrik =D6stman

This sounds like homework ?....

The key difference is that an isr must always store the processor status on entry, then restore it on exit. A subrouting function call doesn't necessarily need to. Both save the current program counter on entry and restore on exit

To get an idea why, look at something like the 68000 programmers reference manual - it's in pdf on the Freescale website. Chapter 5, exception processing...

Chris

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required