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



In article <12mp47ilq7kab2d@xxxxxxxxxxxxxxxxxx>, grante@xxxxxxxx says...
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?
No, but you need to know where your "arguments" are and if they aren't
somehow passed by a register or a pointer in a register then you are
just talking about a global variable and that is not a function argument
in my book.


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.


.