2016-06-07 06:10:18 +00:00
|
|
|
|
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
|
|
|
|
|
*--------------------------------------
|
2016-09-05 06:10:04 +00:00
|
|
|
|
A2osX.GP.Start jmp A2osX.SYSCALL1
|
2016-06-07 06:10:18 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* 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
|
2016-08-17 06:25:58 +00:00
|
|
|
|
jmp (pDrv) pDrvJmp
|
|
|
|
|
jmp (pDev) pDevJmp
|
2016-06-07 06:10:18 +00:00
|
|
|
|
.BS $BE20-*
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
GO.Reset jsr GO.AUXLC
|
2016-09-21 15:20:37 +00:00
|
|
|
|
jmp K.KernelRun
|
2016-06-07 06:10:18 +00:00
|
|
|
|
*--------------------------------------
|
2016-09-05 16:00:11 +00:00
|
|
|
|
A2osX.SYSCALL1 phx
|
|
|
|
|
bit KERNEL.SYSCALL.FLAGS,x
|
2016-09-05 06:10:04 +00:00
|
|
|
|
bmi .2
|
2016-09-05 16:00:11 +00:00
|
|
|
|
ldx #RRAMWRAMBNK1
|
|
|
|
|
.HS 2C
|
|
|
|
|
.2 ldx #RRAMWRAMBNK2
|
|
|
|
|
bit $C000,x
|
|
|
|
|
bit $C000,x
|
|
|
|
|
plx
|
2016-09-05 06:10:04 +00:00
|
|
|
|
jmp (KERNEL.SYSCALL,x)
|
|
|
|
|
*--------------------------------------
|
2016-06-07 06:10:18 +00:00
|
|
|
|
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
|
|
|
|
|
*--------------------------------------
|
2016-09-05 16:00:11 +00:00
|
|
|
|
GO.MAINLC asl RDLCBNK2 We re coming from AUXLC, saving bank...
|
|
|
|
|
ror A2osX.SaveLCBNK
|
|
|
|
|
|
|
|
|
|
php
|
2016-06-07 06:10:18 +00:00
|
|
|
|
clc
|
|
|
|
|
.HS 2C bit abs
|
|
|
|
|
|
|
|
|
|
GO.AUXLC php
|
|
|
|
|
sec
|
2016-09-05 16:00:11 +00:00
|
|
|
|
|
2016-06-07 06:10:18 +00:00
|
|
|
|
sei
|
|
|
|
|
|
|
|
|
|
sta A2osX.SaveA
|
|
|
|
|
stx A2osX.SaveX
|
|
|
|
|
sty A2osX.SaveY
|
2016-09-05 16:00:11 +00:00
|
|
|
|
|
|
|
|
|
pla Restore P in A for later
|
|
|
|
|
|
|
|
|
|
plx Get PC and add 1 for return
|
2016-06-07 06:10:18 +00:00
|
|
|
|
ply
|
|
|
|
|
inx
|
|
|
|
|
bne .1
|
|
|
|
|
iny
|
2016-09-05 16:00:11 +00:00
|
|
|
|
|
2016-06-07 06:10:18 +00:00
|
|
|
|
.1 stx GO.EXIT.JMP+1
|
|
|
|
|
sty GO.EXIT.JMP+2
|
|
|
|
|
|
|
|
|
|
ldy pStack
|
|
|
|
|
|
2016-09-05 16:00:11 +00:00
|
|
|
|
bcs .2 if CS, go AUXLC
|
|
|
|
|
|
|
|
|
|
bit RRAMWRAMBNK1 Go MAINLC (ProDOS), always BNK1
|
|
|
|
|
bit RRAMWRAMBNK1
|
|
|
|
|
|
|
|
|
|
tsx
|
2016-06-07 06:10:18 +00:00
|
|
|
|
stx A2osX.SaveSX
|
|
|
|
|
ldx A2osX.SaveSM
|
|
|
|
|
txs
|
2016-09-05 16:00:11 +00:00
|
|
|
|
sta CLRALTZP
|
2016-06-07 06:10:18 +00:00
|
|
|
|
bra GO.EXIT
|
2016-09-05 16:00:11 +00:00
|
|
|
|
|
|
|
|
|
.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
|
2016-06-07 06:10:18 +00:00
|
|
|
|
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
|
|
|
|
|
*--------------------------------------
|
2016-09-05 16:00:11 +00:00
|
|
|
|
A2osX.SaveLCBNK .BS 1
|
2016-06-07 06:10:18 +00:00
|
|
|
|
A2osX.SaveA .BS 1
|
|
|
|
|
A2osX.SaveX .BS 1
|
|
|
|
|
A2osX.SaveY .BS 1
|
|
|
|
|
*--------------------------------------
|
2016-09-05 06:10:04 +00:00
|
|
|
|
BrkHandler bra *
|
2016-06-07 06:10:18 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
IrqHandler bra *
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
A2osX.GP.End .EQ *
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* CONTROL SECTION :
|
|
|
|
|
*--------------------------------------
|
2016-09-05 06:10:04 +00:00
|
|
|
|
.DO A2osX.GP.End>$BEDF
|
2016-06-07 06:10:18 +00:00
|
|
|
|
ERROR:GP too big
|
|
|
|
|
.FIN
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
|
|
|
|
SAVE SYS/KERNEL.S.GP
|
|
|
|
|
LOAD SYS/KERNEL.S
|
|
|
|
|
ASM
|