[Contents] [Commodore] [New] [Search] [Home]

Commodore 1571 firmware
Interrupt routine

        .page  
	.subttl 'irq1541.src'   
irq	pha
	txa
	pha
	tya
	pha

	lda  icr
	and  #8
	beq  1$		; fast serial request

	bit  lock	; locked ?
	bmi  1$

	lda  pota1	; change to 2 Mhz
	ora  #$20
	sta  pota1
        lda  #<jirq
	sta  irqjmp
        lda  #>jirq
	sta  irqjmp+1	; re-vector irq

	lda  #tim2	; 8 ms irq's at 2 Mhz - controller irq's
	sta  t1hl2
	sta  t1hc2	; adjust timers for 2 Mhz 
	lda  #0
	sta  nxtst	; not a vector
	jmp  irq_0

1$	lda  ifr1
        and  #2          
        beq  2$		;  not atn

        jsr  atnirq     ;  handle atn request

2$	lda  ifr2       ;  test if timer
        asl  a   
        bpl  3$		;  not timer

        jsr  lcc        ;  goto controller

3$ 	tsx
	lda  $0104,x	; check processor break flag
	and  #$10
	beq  4$

	jsr  lcc

4$	pla     	; restore .y, .x, .a
        tay      
        pla      
        tax      
        pla      
        rti

[Contents] [Commodore] [New] [Search] [Home]
This page has been created by Sami Rautiainen.
Read the small print. Last updated September 05, 2020.