A2osX/SYS/KERNEL.S.IRQ.txt
2020-09-04 17:21:15 +02:00

140 lines
2.8 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
*--------------------------------------
* called directly by IRQ Vector $FFFE in AuxLC
* Must keep:
* A,X,Y
* SETREADAUX
* if we are here, Aux ZP/Stack already On
* Exit with RTI
* if A2osX Drivers cannot clear IRQ,
* must call regular System Handler
*--------------------------------------
MSLOT .EQ $7f8
*--------------------------------------
K.IrqHAuxLC.BRK jmp K.IrqHAuxLC.6
*--------------------------------------
K.IrqHAuxLC cld
sta K.IrqHAuxLC.6+1
pla
pha
and #$10 BRK?
* bne K.IrqHAuxLC.BRK
bne *
stx K.IrqHAuxLC.5+1
sty K.IrqHAuxLC.4+1
lda RDPAGE2
pha
sta CLRPAGE2
lda RD80STORE
pha
lda RDREADAUX
pha
sta CLRREADAUX Make sure we can access FD.Table
lda RDWRITEAUX
pha
sta CLRWRITEAUX Driver may R/W in screen holes
lda MSLOT Save MSLOT
pha
lda RDCXROM
pha
sta CLRCXROM Enable access to slot C800 space
K.IrqHAuxLC.JSR jsr K.IrqH.DEV SELF MODIFIED
ldx #CLRCXROM
pla Get CXROM State
bpl .3
inx
.3 sta $C000,x
pla Get back MSLOT
sta MSLOT
sta K.IrqHAuxLC.2+2
and #$F0
eor #$C0 ....mmm...not looking like Cn....
bne K.IrqHAuxLC.3
sta $CFFF Release $C800
K.IrqHAuxLC.2 lda $ff00 SELF MODIFIED
K.IrqHAuxLC.3 pla Must keep Carry
bpl .1
sta SETWRITEAUX
clv coming for AUX.....cancel switch
.1 pla
bpl .2
sta SETREADAUX
clv coming for AUX.....cancel switch
.2 pla
bpl .3
sta SET80STORE
.3 pla
bpl .30
sta SETPAGE2
.30 bvc K.IrqHAuxLC.4 if not V, skip task switching
tsx Check Stack if before "dec IRQ.InKernel"
cpx #$fc $1ff-PChi-PClo-P = $1fc
bcs .8 in CORE.Run or CORE.Dispatch
lda $103,x
cmp /A2osX.SYSCALL
bcs .8 we are in kernel GP or LC
php
php make room for 2 additional bytes
tsx
lda $104,x get RTI PC LO
bne .4
dec $105,x adjust RTI PC HI
.4 dec $104,x back one byte, to make it a "RTS" return adddress
lda $103,x get IRQ pushed P
sta $101,x down 2 bytes
lda #A2osX.SLEEP make a RTI like "jsr A2osX.SLEEP"
sta $102,x
lda /A2osX.SLEEP with RTS=PC IRQ-1
sta $103,x
.5 lda #$60+'S'
eor SYS.BASL0+39
sta SYS.BASL0+39
.8 clc
K.IrqHAuxLC.4 ldy #$ff Self Modified
K.IrqHAuxLC.5 ldx #$ff Self Modified
K.IrqHAuxLC.6 lda #$ff Self Modified
bcc K.IrqHAuxLC.8
dec IRQ.SkipA2osX Make regular ProDOS IRQ manager skip A2osX
K.IrqHAuxLC.JMP jmp $FFFF SELF MODIFIED Not handled, pass to ProDOS
K.IrqHAuxLC.8 rti
*--------------------------------------
MAN
SAVE USR/SRC/SYS/KERNEL.S.IRQ
LOAD USR/SRC/SYS/KERNEL.S
ASM