A2osX/ProDOS.FX/ProDOS.S.IRQ.txt
2021-06-11 19:20:35 +02:00

96 lines
1.9 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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.
* $FF9B
*--------------------------------------
IRQ ldx #$FA save 6 bytes of page 0
.2 lda $00,x
sta IRQ.ZPSave-$FA,x
inx
bne .2
lda mslot
sta IRQ.DoneCn+2
* ldx #0
.3 lda inttbl+1,x test for a valid routine.
beq .4 branch if no routine.
phx
jsr IRQ.GoX
plx
bcc IRQ.Done
.4 inx
inx
cpx #10
bne .3
inc IRQ.Cnt allow 255 unclaimed interrupts
bne IRQ.Done before system death.
lda #$01 bad irq so
jsr GP.SysDeath kill the system.
*--------------------------------------
.LIST ON
IRQ.FREE1 .EQ $ffc8-*
.LIST OFF
.BS IRQ.FREE1
IRQ.Reset1 sta RROMBNK2
.DO *=$FFCB
* hits ROM rts at $FFCB
.ELSE
ERROR
.FIN
*--------------------------------------
IRQ.Done ldx #$FA
.1 lda IRQ.ZPSave-$FA,x restore the zero page
sta $00,x
inx
bne .1
lda CLRC8ROM
IRQ.DoneCn lda $C100 SELF MODIFIED
lda IRQ.DoneCn+2
sta mslot
rti
*--------------------------------------
IRQ.GoX jmp (inttbl,x) interrupt routine x
IRQ.Reset lda /resetv-1
pha
lda #resetv-1
pha
bra IRQ.Reset1
IRQ.Cnt .HS 00 # of unclaimed interrupts.
IRQ.ZPSave .HS 000000000000 6 bytes
.LIST ON
IRQ.FREE2 .EQ $fffa-*
.LIST OFF
.BS IRQ.FREE2
.DA nmivect nmi handler
.DA IRQ.Reset reset handler
irqv .DA * PATCHED with ROM vector by LDR
.LIST OFF
*--------------------------------------
IRQ.LEN .EQ *-IRQ
*--------------------------------------
MAN
SAVE USR/SRC/PRODOS.FX/PRODOS.S.IRQ
LOAD USR/SRC/PRODOS.FX/PRODOS.S
ASM