2 ; Ullrich von Bassewitz, 28.09.1998
4 ; IRQ routine for the 510.
7 .export irq, nmi, k_irq, k_nmi
8 .import SCNKEY, UDTIM, k_rs232
10 .import __IRQFUNC_TABLE__, __IRQFUNC_COUNT__
16 ; -------------------------------------------------------------------------
17 ; This is the mapping of the active irq register of the 6525 (tpi1):
21 ; | | | ^ SRQ IEEE 488
23 ; | ^ cia1 IRQB ext. Port
28 ; -------------------------------------------------------------------------
39 lda $104,x ; Get the flags from the stack
40 and #$10 ; Test break flag
47 ; -------------------------------------------------------------------------
57 ; -------------------------------------------------------------------------
58 ; Kernal irq entry point. The IRQvec points here (usually).
61 lda IndReg ; Ind. Segment retten
67 lda (tpi1),y ; Interrupt Register 6525
70 ; -------------------------------------------------------------------------
73 cmp #%00000001 ; ticker irq?
76 ; Call user IRQ handlers if we have any
78 ldy #<(__IRQFUNC_COUNT__*2)
80 lda #<__IRQFUNC_TABLE__
81 ldx #>__IRQFUNC_TABLE__
82 jsr condes ; Call the functions
84 ; Call replacement kernal IRQ routines
86 @L1: jsr SCNKEY ; Poll the keyboard
87 jsr UDTIM ; Bump the time
89 ; -------------------------------------------------------------------------
92 irq1: cmp #%00010000 ; interrupt from uart?
94 jsr k_rs232 ; Read character from uart
96 ; -------------------------------------------------------------------------
99 irqend: ldy #tpiActIntReg
100 sta (tpi1),y ; Clear interrupt