In case of a function call the arguments,local variables and
return address is stored in the stack where as in case of an
ISR, after executing the current instruction the context is
saved with no return value.
isr will be executed only when the system is interrupted
whereas the function call meant for any operations to
perform eventhough when there is no interrupt
Simply, an ISR (interrupt service routine) can be defined
as a hardware function call. Generally, a CPU must
immediately pay attention to a hardware interrupt call. An
ISR is always given higher priority than a normal function
call.
this is with reference to ARM7. The function call is made
when cpu is in User mode(non-priveleged).
But an ISR is called from an Interrupt handler and cpu is
in one of the priveleged modes. Whenever an interrupt
occurs the control moves to a particular address in vector
table.
regards
Achal
Here are some of the differences:
1. Fuction call has no inputs and return args
2. ISR is triggered by external events
3. ISR may need special interrupt handling upon entry and
exit.
i.e. IRQs masking to enable or disable interupts,
4. Function call and ISR stack frame are different
5. ISR returns with an interupt return (IRET) to
restored not only call stack context but also
interrupt level.
dont u think isr is define in particular sector of memory
with return and all task are suspended at this time but
function call is user define with the main program with
return value.?
ISR is interrupt service routine. it is seperate code
written some where in the memory. if any interrupt comes
mp checks the priority of the interrupt and service it
meanwhile the content of the progaram counter value is
written in stack after executing isr ,execution transferred
to main program.
FUNCTION CALL is seperate thing. function call is seperate
code that has to be written at the end of function . for
example, in some programs we want to perform one operation
repeatedly at that time we perform that operation by
calling that function instead of writting many times.
adding to d ans-11 i wud say that....an interrupt has no
relation with the current program or task being performed
by the microcontroller....it is an independent task or
program that is executed whenever the interrupt is invoked.
however, a function is a part of the program that is being
currently executed by the microcontroller, hence it is
local.it can be called only when the microcontroller is
executing the program in which it is contained..or is a
part of.
ISR has priority associate whereas function call doesn't
because of this stack structure of them are different.
If we look assembly code : function call has RET and ISR have
IRET.
Suppose you have a combinational circuit between two
registers driven by a clock. What will you do if the delay
of the combinational circuit is greater than your clock signal?
Where can i find the sample ASSEMBLY LANGUAGE programs?????
plz tell me the site or forum......anything which can have
the sample codes/programs of assembly language????