Re: NewQ: Difference between an isr and a subroutine is that an isr has no arguments



On 2006-11-28, Wilco Dijkstra <Wilco_dot_Dijkstra@xxxxxxxxxxxx> wrote:

Since you don't know what is in the resisters when the ISR is
jumped to the idea of function arguments is meaningless.

The unstated assumption seems to be that function arguments are
passed in registers?

Well I can see some good uses for interrupts with arguments,
making interrupt routines even easier to write in C. I'm sure
someone has patented the idea already as it is quite obvious...

Obvious but impossible (in general). The hardware designer has
no way of knowing how the ISR is going to expect arguments to
be passed. If varies from one language to the next, from one
compiler to the next, and even from one build to the next when
compiler flags are changed.

--
Grant Edwards grante Yow! My life is a patio
at of fun!
visi.com
.