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?   :o  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


Arduino Forum > Forum 2005-2010 (read only) > Software > Development > How are registers saved in interrupts?


arduino

Comments

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums