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

100 lines
2.0 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
*--------------------------------------
2023-11-04 14:42:28 +00:00
IRQ.START .PH IRQ
IRQ.START1 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-22 18:59:02 +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
.3 lda GP.IRQVs+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 #8
2019-11-04 07:21:40 +00:00
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
2023-11-04 14:42: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
2023-11-04 14:42:28 +00:00
IRQ.ToRomRTS sta IO.RROMBNK2
2021-06-11 17:20:35 +00:00
.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
2023-11-04 14:42:28 +00:00
* lda IO.CLRC8ROM
2021-06-11 17:20:35 +00:00
2021-06-22 18:59:02 +00:00
*IRQ.DoneCn lda $C100 SELF MODIFIED
* lda IRQ.DoneCn+2
* sta mslot
2021-06-11 17:20:35 +00:00
2019-11-04 07:21:40 +00:00
rti
2021-06-11 17:20:35 +00:00
*--------------------------------------
IRQ.GoX jmp (GP.IRQVs,x) interrupt routine x
2019-10-16 06:09:13 +00:00
2023-11-04 14:42:28 +00:00
IRQ.Reset lda /ROM.RESETV-1
2021-06-11 17:20:35 +00:00
pha
2023-11-04 14:42:28 +00:00
lda #ROM.RESETV-1
2021-06-11 17:20:35 +00:00
pha
2023-11-04 14:42:28 +00:00
bra IRQ.ToRomRTS
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
2023-11-04 14:42:28 +00:00
.DA ROM.NMIJMP 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
*--------------------------------------
2023-11-04 14:42:28 +00:00
.EP
*--------------------------------------
IRQ.LEN .EQ *-IRQ.START
2021-06-11 17:20:35 +00:00
*--------------------------------------
2019-10-16 06:09:13 +00:00
MAN
SAVE usr/src/prodos.fx/prodos.s.irq
LOAD usr/src/prodos.fx/prodos.s
2019-10-16 06:09:13 +00:00
ASM