mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-20 03:31:42 +00:00
6fea4ec153
Kernel : Dual Bank implemented
155 lines
3.3 KiB
Plaintext
155 lines
3.3 KiB
Plaintext
PR#3
|
||
PREFIX /A2OSX.SRC
|
||
NEW
|
||
INC 1
|
||
AUTO 6
|
||
.LIST OFF
|
||
*--------------------------------------
|
||
* A2osX.SYSCALL (AUXLC to AUXLC)
|
||
* In:
|
||
* X = SYSfnc.Index
|
||
* Y,A = free for Inline param
|
||
*--------------------------------------
|
||
A2osX.GP.Start jmp A2osX.SYSCALL1
|
||
*--------------------------------------
|
||
* LIBCALL (AUXLC to AUXLC)
|
||
* In:
|
||
* Y = LIB.ID
|
||
* X = LIBfnc.Index
|
||
* A = free for Inline param
|
||
*--------------------------------------
|
||
jmp A2osX.LIBCALL1
|
||
*--------------------------------------
|
||
* Kernel.MLICALL (AUXLC to MAINLC)
|
||
* In:
|
||
* X = MLI Function
|
||
* A = Param Count
|
||
*--------------------------------------
|
||
jmp A2osX.MLICALL1
|
||
*--------------------------------------
|
||
.BS $BE10-*
|
||
*--------------------------------------
|
||
jmp (pCode) pCodeJmp
|
||
jmp (pLib) pLibJmp
|
||
jmp (pDrv) pDrvJmp
|
||
jmp (pDev) pDevJmp
|
||
.BS $BE20-*
|
||
*--------------------------------------
|
||
GO.Reset jsr GO.AUXLC
|
||
jmp S.KernelRun
|
||
*--------------------------------------
|
||
A2osX.SYSCALL1 phx
|
||
bit KERNEL.SYSCALL.FLAGS,x
|
||
bmi .2
|
||
ldx #RRAMWRAMBNK1
|
||
.HS 2C
|
||
.2 ldx #RRAMWRAMBNK2
|
||
bit $C000,x
|
||
bit $C000,x
|
||
plx
|
||
jmp (KERNEL.SYSCALL,x)
|
||
*--------------------------------------
|
||
A2osX.LIBCALL1 pha
|
||
phx
|
||
tya
|
||
>SYSCALL SYS.GetMemPtrA
|
||
>STYA .1+1
|
||
plx
|
||
pla
|
||
.1 jmp $FFFF
|
||
*--------------------------------------
|
||
A2osX.MLICALL1 jsr GO.MAINLC
|
||
stx .1
|
||
sta MLICALL.PARAMS
|
||
jsr MLI
|
||
.1 .BS 1
|
||
.DA MLICALL.PARAMS
|
||
jsr GO.AUXLC
|
||
rts
|
||
*--------------------------------------
|
||
GO.MAINLC asl RDLCBNK2 We re coming from AUXLC, saving bank...
|
||
ror A2osX.SaveLCBNK
|
||
|
||
php
|
||
clc
|
||
.HS 2C bit abs
|
||
|
||
GO.AUXLC php
|
||
sec
|
||
|
||
sei
|
||
|
||
sta A2osX.SaveA
|
||
stx A2osX.SaveX
|
||
sty A2osX.SaveY
|
||
|
||
pla Restore P in A for later
|
||
|
||
plx Get PC and add 1 for return
|
||
ply
|
||
inx
|
||
bne .1
|
||
iny
|
||
|
||
.1 stx GO.EXIT.JMP+1
|
||
sty GO.EXIT.JMP+2
|
||
|
||
ldy pStack
|
||
|
||
bcs .2 if CS, go AUXLC
|
||
|
||
bit RRAMWRAMBNK1 Go MAINLC (ProDOS), always BNK1
|
||
bit RRAMWRAMBNK1
|
||
|
||
tsx
|
||
stx A2osX.SaveSX
|
||
ldx A2osX.SaveSM
|
||
txs
|
||
sta CLRALTZP
|
||
bra GO.EXIT
|
||
|
||
.2 bit A2osX.SaveLCBNK Go AUXLC....Previous Go MAINLC Coming from BNK2 ?
|
||
bmi .3
|
||
ldx #RRAMWRAMBNK1
|
||
.HS 2C bit abs
|
||
.3 ldx #RRAMWRAMBNK2
|
||
|
||
bit $C000,x
|
||
bit $C000,x
|
||
|
||
sta SETALTZP
|
||
tsx
|
||
stx A2osX.SaveSM
|
||
ldx A2osX.SaveSX
|
||
txs
|
||
*--------------------------------------
|
||
GO.EXIT sty pStack
|
||
pha push P on stack
|
||
ldy A2osX.SaveY
|
||
ldx A2osX.SaveX
|
||
lda A2osX.SaveA
|
||
plp
|
||
GO.EXIT.JMP jmp $FFFF
|
||
*--------------------------------------
|
||
A2osX.SaveLCBNK .BS 1
|
||
A2osX.SaveA .BS 1
|
||
A2osX.SaveX .BS 1
|
||
A2osX.SaveY .BS 1
|
||
*--------------------------------------
|
||
BrkHandler bra *
|
||
*--------------------------------------
|
||
IrqHandler bra *
|
||
*--------------------------------------
|
||
A2osX.GP.End .EQ *
|
||
*--------------------------------------
|
||
* CONTROL SECTION :
|
||
*--------------------------------------
|
||
.DO A2osX.GP.End>$BEDF
|
||
ERROR:GP too big
|
||
.FIN
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE SYS/KERNEL.S.GP
|
||
LOAD SYS/KERNEL.S
|
||
ASM
|