]> git.sur5r.net Git - cc65/blobdiff - libsrc/runtime/callirq.s
atari5200: name conio constructor 'initconio'
[cc65] / libsrc / runtime / callirq.s
index 5f2c2d6161b59e8c861a6fde31d31f21e49e7fb1..74a12c4db4f5f58b9e42f5a7534e948bea9cd90a 100644 (file)
 ; entries.
 ;
 
-               .export callirq
-        .export callirq_y       ; Same but with Y preloaded
+        .export         callirq
+        .export         callirq_y       ; Same but with Y preloaded
+        .export         __CALLIRQ__ : absolute = 1
+        .constructor    irq_init, 10
+        .destructor     irq_done, 10
 
-               .import __INTERRUPTOR_TABLE__, __INTERRUPTOR_COUNT__
+        .import         __INTERRUPTOR_TABLE__, __INTERRUPTOR_COUNT__
+        .import         initirq
+        .import         doneirq
 
-.code
+        irq_init :=     initirq
+        irq_done :=     doneirq
 
 ; --------------------------------------------------------------------------
 ; Call all IRQ routines. The function needs to use self modifying code and
@@ -50,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
-
-