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

96 lines
1.9 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.
2021-06-11 17:20:35 +00:00
* $FF9B
2019-10-16 06:09:13 +00:00
*--------------------------------------
2021-06-11 17:20:35 +00:00
IRQ ldx #$FA save 6 bytes of page 0
2019-11-04 07:21:40 +00:00
.2 lda $00,x
2021-06-11 17:20:35 +00:00
sta IRQ.ZPSave-$FA,x
2019-11-04 07:21:40 +00:00
inx
bne .2
2021-06-11 17:20:35 +00:00
lda mslot
sta IRQ.DoneCn+2
2019-11-04 07:21:40 +00:00
2021-06-11 17:20:35 +00:00
* ldx #0
2019-11-04 07:21:40 +00:00
2021-06-11 17:20:35 +00:00
.3 lda inttbl+1,x test for a valid routine.
2019-11-04 07:21:40 +00:00
beq .4 branch if no routine.
2021-06-11 17:20:35 +00:00
phx
jsr IRQ.GoX
plx
2019-11-04 07:21:40 +00:00
2021-06-11 17:20:35 +00:00
bcc IRQ.Done
2019-11-04 07:21:40 +00:00
2021-06-11 17:20:35 +00:00
.4 inx
2019-11-04 07:21:40 +00:00
inx
cpx #10
bne .3
2021-06-11 17:20:35 +00:00
inc IRQ.Cnt allow 255 unclaimed interrupts
bne IRQ.Done before system death.
2019-11-04 07:21:40 +00:00
lda #$01 bad irq so
2020-09-19 16:48:28 +00:00
jsr GP.SysDeath kill the system.
2021-06-11 17:20:35 +00:00
*--------------------------------------
2019-10-19 18:35:30 +00:00
.LIST ON
IRQ.FREE1 .EQ $ffc8-*
.LIST OFF
2019-10-16 06:09:13 +00:00
2021-06-11 17:20:35 +00:00
.BS IRQ.FREE1
2019-10-16 06:09:13 +00:00
2021-06-11 17:20:35 +00:00
IRQ.Reset1 sta RROMBNK2
.DO *=$FFCB
* hits ROM rts at $FFCB
.ELSE
ERROR
.FIN
*--------------------------------------
IRQ.Done ldx #$FA
2019-10-16 06:09:13 +00:00
2021-06-11 17:20:35 +00:00
.1 lda IRQ.ZPSave-$FA,x restore the zero page
2019-11-04 07:21:40 +00:00
sta $00,x
inx
bne .1
2021-06-11 17:20:35 +00:00
lda CLRC8ROM
IRQ.DoneCn lda $C100 SELF MODIFIED
lda IRQ.DoneCn+2
sta mslot
2019-11-04 07:21:40 +00:00
rti
2021-06-11 17:20:35 +00:00
*--------------------------------------
IRQ.GoX jmp (inttbl,x) interrupt routine x
2019-10-16 06:09:13 +00:00
2021-06-11 17:20:35 +00:00
IRQ.Reset lda /resetv-1
pha
lda #resetv-1
pha
bra IRQ.Reset1
2019-10-16 06:09:13 +00:00
2021-06-11 17:20:35 +00:00
IRQ.Cnt .HS 00 # of unclaimed interrupts.
IRQ.ZPSave .HS 000000000000 6 bytes
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
2021-06-11 17:20:35 +00:00
.DA IRQ.Reset 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
*--------------------------------------
2021-06-11 17:20:35 +00:00
IRQ.LEN .EQ *-IRQ
*--------------------------------------
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