# HG changeset patch # User Paul Boddie # Date 1439754557 -7200 # Node ID 4f0db3c7456514a9558f8134f9668be46f824dfb # Parent c3c68373ee6d07f24ca24687c058dd9934fa32af Added a subroutine to restore the previous interrupt handler. diff -r c3c68373ee6d -r 4f0db3c74565 switcher.oph --- a/switcher.oph Sun Jun 28 23:30:02 2015 +0200 +++ b/switcher.oph Sun Aug 16 21:49:17 2015 +0200 @@ -96,6 +96,7 @@ ; return here with the initial main program stack main_end: + jsr restore_handler rts @@ -125,6 +126,18 @@ +; restore the old interrupt handler address to IRQ1V +; +; affects: A + +restore_handler: + sei + .invoke mov16 old_handler, IRQ1V + cli + rts + + + ; handle interrupts ; ; affects: (temporary stack usage)