]> git.sur5r.net Git - cc65/blobdiff - libsrc/runtime/callirq.s
Added SER_ prefix. Whitespace cleanup
[cc65] / libsrc / runtime / callirq.s
index 618f80f8db81268d745cdfb5bef2991b13f7ae6f..74a12c4db4f5f58b9e42f5a7534e948bea9cd90a 100644 (file)
 ; entries.
 ;
 
-               .export callirq
-        .export callirq_y       ; Same but with Y preloaded
-                                                            
-        .export __CALLIRQ__: absolute = 1
-               .import __INTERRUPTOR_TABLE__, __INTERRUPTOR_COUNT__
+        .export         callirq
+        .export         callirq_y       ; Same but with Y preloaded
+        .export         __CALLIRQ__ : absolute = 1
+        .constructor    irq_init, 10
+        .destructor     irq_done, 10
 
-.code
+        .import         __INTERRUPTOR_TABLE__, __INTERRUPTOR_COUNT__
+        .import         initirq
+        .import         doneirq
+
+        irq_init :=     initirq
+        irq_done :=     doneirq
 
 ; --------------------------------------------------------------------------
 ; Call all IRQ routines. The function needs to use self modifying code and
@@ -51,14 +56,12 @@ callirq_y:
 loop:   dey
         lda     __INTERRUPTOR_TABLE__,y
         sta     jmpvec+2                ; Modify code below
-       dey
+        dey
         lda     __INTERRUPTOR_TABLE__,y
         sta     jmpvec+1                ; Modify code below
-               sty     index+1                 ; Modify code below
-jmpvec: jsr            $FFFF                   ; Patched at runtime
+        sty     index+1                 ; Modify code below
+jmpvec: jsr     $FFFF                   ; Patched at runtime
         bcs     done                    ; Bail out if interrupt handled
-index:         ldy     #$FF                    ; Patched at runtime
-               bne     loop
+index:  ldy     #$FF                    ; Patched at runtime
+        bne     loop
 done:   rts
-
-