Re: NewQ: Difference between an isr and a subroutine is that an isr has no arguments
- From: "Wilco Dijkstra" <Wilco_dot_Dijkstra@xxxxxxxxxxxx>
- Date: Tue, 28 Nov 2006 22:10:50 GMT
"Grant Edwards" <grante@xxxxxxxx> wrote in message
news:12mp47ilq7kab2d@xxxxxxxxxxxxxxxxxxxxx
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?
Absolutely, if you have a decent set of registers it is the most
efficient way of passing arguments.
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.
The hardware could set up a few registers and the compiler
would assign parameters to those registers on functions marked
as interrupts - very easy to implement. You could ignore them if
you didn't support them.
Wilco
.
- Follow-Ups:
- References:
- Differences between interrupt service routine (ISR) and a subroutine
- From: 2005
- Re: Differences between interrupt service routine (ISR) and a subroutine
- From: Tom Lucas
- NewQ: Difference between an isr and a subroutine is that an isr has no arguments
- From: 2005
- Re: NewQ: Difference between an isr and a subroutine is that an isr has no arguments
- From: James Beck
- Re: NewQ: Difference between an isr and a subroutine is that an isr has no arguments
- From: Wilco Dijkstra
- Re: NewQ: Difference between an isr and a subroutine is that an isr has no arguments
- From: Grant Edwards
- Differences between interrupt service routine (ISR) and a subroutine
- Prev by Date: Re: NewQ: Difference between an isr and a subroutine is that an isr has no arguments
- Next by Date: Re: XCHG instruction: load register AX with a 1
- Previous by thread: Re: NewQ: Difference between an isr and a subroutine is that an isr has no arguments
- Next by thread: Re: NewQ: Difference between an isr and a subroutine is that an isr has no arguments
- Index(es):
Relevant Pages
|