implements cpu irq interrupt function.