How are registers saved in interrupts?
i reading article: http://www.uchobby.com/index.php/2007/11/24/arduino-interrupts/ where trying see how main program slows down while high-frequency interrupts running.
it seems there little overhead in addition user-supplied interrupt service routine. how possible?
one might expect plenty of stuff (program counter, status/flag registers, 32 cpu registers) has pushed popped stack main program able continue if nothing happened.
is there smarter solution implemented? are there 2 sets of cpu -registers, 1 interrupts , 1 main program?
or compiler allocate, say, 16 registers use main program , 16 interrupts don't need saved?
it seems there little overhead in addition user-supplied interrupt service routine. how possible?
one might expect plenty of stuff (program counter, status/flag registers, 32 cpu registers) has pushed popped stack main program able continue if nothing happened. is there smarter solution implemented? are there 2 sets of cpu -registers, 1 interrupts , 1 main program?
or compiler allocate, say, 16 registers use main program , 16 interrupts don't need saved?
as part of function call/return code overhead, compiler generates code save , restore registers function uses.
more compiler magic.
-j
more compiler magic.

-j
Arduino Forum > Forum 2005-2010 (read only) > Software > Development > How are registers saved in interrupts?
arduino
Comments
Post a Comment