A2osX/ProDOS.FX/ProDOS.S.IRQ.txt

86 lines
1.7 KiB
Plaintext
Raw Normal View History

2019-10-16 06:09:13 +00:00
NEW
AUTO 3,1
*--------------------------------------
* this routine handles interrupts and is coded to reach 'lreset' precisely at
* address $FFCB (ROM rts opcode) for rom switching to function.
* $2D9B-2DFF moved to $FF9B-FFFF
*--------------------------------------
2019-11-01 20:06:04 +00:00
IRQ.START
2019-11-04 07:21:40 +00:00
XDOS.IRQV ldx #$FA save 6 bytes of page 0
.2 lda $00,x
sta svzerop-$FA,x
inx
bne .2
ldx #0
.3 stx irqXindex
lda inttbl+1,x test for a valid routine.
beq .4 branch if no routine.
jsr gointX execute
bcc irqdone
.4 ldx irqXindex
inx
inx
cpx #10
bne .3
inc irqcount allow 255 unclaimed interrupts
bne irqdone before system death.
lda #$01 bad irq so
jsr sysdeath kill the system.
2019-10-19 18:35:30 +00:00
.LIST ON
IRQ.FREE1 .EQ $ffc8-*
.LIST OFF
.BS IRQ.FREE1
2019-10-16 06:09:13 +00:00
gorom sta RROMBNK2 hits ROM rts at $FFCB
* 'lreset' address must = $FFCB for rom switch i/o to work
2019-10-19 18:35:30 +00:00
lreset lda /resetv-1
2019-10-16 06:09:13 +00:00
pha
2019-10-19 18:35:30 +00:00
lda #resetv-1
2019-10-16 06:09:13 +00:00
pha
jmp gorom
2019-11-04 07:21:40 +00:00
irqdone ldx #$FA
2019-10-16 06:09:13 +00:00
2019-11-04 07:21:40 +00:00
.1 lda svzerop-$FA,x restore the zero page
sta $00,x
inx
bne .1
rti
2019-10-16 06:09:13 +00:00
2019-11-04 07:21:40 +00:00
gointX jmp (inttbl,x) interrupt routine x
2019-10-16 06:09:13 +00:00
2019-11-04 07:21:40 +00:00
irqcount .HS 00 # of unclaimed interrupts.
irqXindex .HS 00
svzerop .HS 000000000000
2019-10-19 18:35:30 +00:00
.LIST ON
IRQ.FREE2 .EQ $fffa-*
.LIST OFF
.BS IRQ.FREE2
2019-10-16 06:09:13 +00:00
.DA nmivect nmi handler
.DA lreset reset handler
2019-10-19 18:35:30 +00:00
irqv .DA * PATCHED with ROM vector by LDR
.LIST OFF
2019-10-16 06:09:13 +00:00
*--------------------------------------
2019-11-01 20:06:04 +00:00
IRQ.LEN .EQ *-IRQ.START
2019-10-16 06:09:13 +00:00
MAN
SAVE USR/SRC/PRODOS.FX/PRODOS.S.IRQ
LOAD USR/SRC/PRODOS.FX/PRODOS.S
ASM