 lib environment
 opt nol
 lib inttab
 opt lis
 data
 sttl Device Interrupt Handlers
 pag
 name inthan.gimix
 global irqhan,frqhan,idle_tsk,swi3han

*
* irqhan
*
* The irg interrupt handler is called after initial
* system setup to process an irq type interrupt.
*

irqhan lda #CLKMSK get clock mask
 bita CLKSEL check clock int
 beq irqha0 no - try something else
00 ldd CLKLAT reset interrupt
 jmp clkint go handle clock interrupt
irqha0 lda DMFINT get dma status
 bita #%01000000 check int status
 lbne dmfint go service disk
 ldu CDSdev check CDS drive 0
 lda CDSFLG,u is it marksman?
 lbmi cdsint
irqha1 ldx #inttab point to table
 lda 0,x+ get count
irqha2 ldb inmask,x get mask
 andb [instat,x] check status
 bne irqha4
irqha3 leax INTSIZ,x get to next entry
 deca dec the count
 bne irqha2 repeat til done
 bra irqha5
irqha4 ldd indev,x get device number
 jmp [inhand,x] goto routine
irqha5
 jmp dmfint must be disk

 pag

*
* frqhan
*
* Handle the firq interrupt.  Works like irq.
*

frqhan ldx #fnttab point to table
frqha2 ldb inmask,x get mask
 andb instat,x check status
 beq frqha3 jump if no interrupt
 pshs x
 ldd indev,x pick up device #
 jsr [inhand,x] call interrupt handler
 puls x
frqha3 leax INTSIZ,x next entry
 cmpx #fntend end of table?
 bne frqha2 loop til done
 rts return

*
* idle_tsk - System Idle task - called when UniFLEX
* has nothing else to do.
*
idle_tsk pshs d,x,y,u save registers
99 puls d,x,y,u,pc return to UniFLEX scheduler

*
* SWI3 Handler
*   -- Just pass along to "syscl" (UniFLEX system call handler)
*
swi3han jmp syscl
