A2osX/SYS/KERNEL.S.GP.txt
Rémy GIBERT 6fea4ec153 Time API : Work In Progress,used in SHELL For Testing
Kernel : Dual Bank implemented
2016-09-05 18:00:11 +02:00

155 lines
3.3 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.

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