2016-06-07 06:10:18 +00:00
|
|
|
|
PR#3
|
|
|
|
|
PREFIX /A2OSX.SRC
|
2017-03-15 16:44:15 +00:00
|
|
|
|
LOMEM $A00
|
2016-06-07 06:10:18 +00:00
|
|
|
|
INC 1
|
|
|
|
|
AUTO 6
|
|
|
|
|
*--------------------------------------
|
2016-09-26 16:00:52 +00:00
|
|
|
|
* SYSCALL (AUXLC to AUXLC)
|
|
|
|
|
* Used by user & kernel for inter bank Calls
|
2016-06-07 06:10:18 +00:00
|
|
|
|
* In:
|
|
|
|
|
* X = SYSfnc.Index
|
|
|
|
|
* Y,A = free for Inline param
|
|
|
|
|
*--------------------------------------
|
2016-09-26 16:00:52 +00:00
|
|
|
|
jmp A2osX.SYSCALL1
|
2016-06-07 06:10:18 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* LIBCALL (AUXLC to AUXLC)
|
2016-09-26 16:00:52 +00:00
|
|
|
|
* Used by user
|
2016-06-07 06:10:18 +00:00
|
|
|
|
* In:
|
|
|
|
|
* Y = LIB.ID
|
|
|
|
|
* X = LIBfnc.Index
|
|
|
|
|
* A = free for Inline param
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
jmp A2osX.LIBCALL1
|
|
|
|
|
*--------------------------------------
|
2016-09-26 16:00:52 +00:00
|
|
|
|
* MLICALL (AUXLC to MAINLC)
|
|
|
|
|
* Used by Kernel
|
2016-06-07 06:10:18 +00:00
|
|
|
|
* In:
|
|
|
|
|
* X = MLI Function
|
|
|
|
|
* A = Param Count
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
jmp A2osX.MLICALL1
|
2016-11-24 17:00:03 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* BLKCALL (AUXLC to MAINLC)
|
|
|
|
|
* Used by Kernel
|
|
|
|
|
* In:
|
|
|
|
|
* Y,A = Ptr To Param Block
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
jmp A2osX.BLKCALL1
|
2016-06-07 06:10:18 +00:00
|
|
|
|
*--------------------------------------
|
2016-11-25 16:20:28 +00:00
|
|
|
|
* PRTCALL (AUXLC to MAINLC)
|
|
|
|
|
* Used by Kernel
|
|
|
|
|
* In:
|
|
|
|
|
* Y,A = Ptr To Param Block
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
jmp A2osX.PRTCALL1
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.BS $BD10-*
|
2016-06-07 06:10:18 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
jmp (pCode) pCodeJmp
|
|
|
|
|
jmp (pLib) pLibJmp
|
2016-08-17 06:25:58 +00:00
|
|
|
|
jmp (pDrv) pDrvJmp
|
|
|
|
|
jmp (pDev) pDevJmp
|
2016-11-25 16:20:28 +00:00
|
|
|
|
.BS $BD20-*
|
2016-06-07 06:10:18 +00:00
|
|
|
|
*--------------------------------------
|
2016-09-26 16:00:52 +00:00
|
|
|
|
GO.Reset jsr GO.A2osX
|
2016-09-21 15:20:37 +00:00
|
|
|
|
jmp K.KernelRun
|
2016-06-07 06:10:18 +00:00
|
|
|
|
*--------------------------------------
|
2016-09-26 16:00:52 +00:00
|
|
|
|
* *** MUST BE REINTRANT ***
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
A2osX.SYSCALL1 bit KERNEL.SYSCALL.FLAGS,x
|
|
|
|
|
bpl .8 in $E000, no BNK change
|
|
|
|
|
|
|
|
|
|
sta .7+1 save A (Func Arg)
|
|
|
|
|
|
|
|
|
|
lda KERNEL.SYSCALL.FLAGS+1,x Get Target BNK
|
|
|
|
|
|
|
|
|
|
cmp $D000 #RRAMWRAMBNK1 or #RRAMWRAMBNK2
|
|
|
|
|
beq .7 same as actual BNK...go restore A and JMP
|
|
|
|
|
|
|
|
|
|
stx .6+1 save X (Func ID)
|
|
|
|
|
|
|
|
|
|
tax set Target BNK in x
|
|
|
|
|
lda $D000 get source BNK
|
|
|
|
|
bit $C000,x switch to Target BNK
|
|
|
|
|
bit $C000,x
|
|
|
|
|
pha
|
|
|
|
|
|
2016-09-29 06:26:54 +00:00
|
|
|
|
jsr .6 go to kernel.....
|
2016-09-26 16:00:52 +00:00
|
|
|
|
|
|
|
|
|
stx .5+1 save X
|
|
|
|
|
plx get back Source BNK
|
2016-09-05 16:00:11 +00:00
|
|
|
|
bit $C000,x
|
|
|
|
|
bit $C000,x
|
2016-09-26 16:00:52 +00:00
|
|
|
|
.5 ldx #$FF Self Modified
|
|
|
|
|
rts Unmodified Carry
|
|
|
|
|
|
|
|
|
|
.6 ldx #$FF Self Modified
|
|
|
|
|
.7 lda #$FF Self Modified
|
|
|
|
|
.8 jmp (KERNEL.SYSCALL,x)
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
A2osX.LIBCALL1 pha No need to save X, K.GetMemPtrA will leave it unmodified
|
|
|
|
|
tya Get LIB hMem in A
|
|
|
|
|
jsr K.GetMemPtrA Get LIB Code Segment (MemMgr in $E000, no BNK change)
|
|
|
|
|
>STYA pLib
|
2016-06-07 06:10:18 +00:00
|
|
|
|
pla
|
2016-09-26 16:00:52 +00:00
|
|
|
|
jmp (pLib)
|
2016-06-07 06:10:18 +00:00
|
|
|
|
*--------------------------------------
|
2016-09-26 16:00:52 +00:00
|
|
|
|
A2osX.MLICALL1 stx .1
|
2016-06-07 06:10:18 +00:00
|
|
|
|
sta MLICALL.PARAMS
|
2016-09-26 16:00:52 +00:00
|
|
|
|
jsr GO.ProDOS
|
2016-06-07 06:10:18 +00:00
|
|
|
|
jsr MLI
|
|
|
|
|
.1 .BS 1
|
|
|
|
|
.DA MLICALL.PARAMS
|
2016-09-26 16:00:52 +00:00
|
|
|
|
jsr GO.A2osX
|
2016-06-07 06:10:18 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-03-14 16:47:02 +00:00
|
|
|
|
* BLKCALL.PARAMS
|
|
|
|
|
* (To be moved to MainZP/LC For DII)
|
2016-11-25 16:20:28 +00:00
|
|
|
|
* $42 Command Number
|
|
|
|
|
* $43 Unit Number
|
|
|
|
|
* $44-$45 Buffer Pointer
|
|
|
|
|
* $46-$47 Block Number
|
2017-03-14 16:47:02 +00:00
|
|
|
|
* X = DEVMGR.cmd
|
|
|
|
|
* pDev -> Dev Header
|
2016-11-25 16:20:28 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
A2osX.BLKCALL1 >STYA .2+1 setup device entry point $Cnxx
|
2017-03-14 16:47:02 +00:00
|
|
|
|
|
2016-11-25 16:20:28 +00:00
|
|
|
|
jsr GO.ProDOS
|
|
|
|
|
|
|
|
|
|
ldx #5
|
|
|
|
|
|
|
|
|
|
.1 lda BLKCALL.PARAMS,x
|
2017-03-14 16:47:02 +00:00
|
|
|
|
sta $42,x setup ZP in main memory for this block device call
|
2016-11-25 16:20:28 +00:00
|
|
|
|
dex
|
|
|
|
|
bpl .1
|
|
|
|
|
|
|
|
|
|
.2 jsr $ffff
|
|
|
|
|
|
|
|
|
|
jsr GO.A2osX
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-03-14 16:47:02 +00:00
|
|
|
|
A2osX.DIIDrv txa Status ?
|
|
|
|
|
beq .2
|
|
|
|
|
|
|
|
|
|
jsr GO.ProDOS
|
|
|
|
|
|
|
|
|
|
asl
|
|
|
|
|
sta $42
|
|
|
|
|
|
|
|
|
|
ldx #5
|
|
|
|
|
|
|
|
|
|
.1 lda BLKCALL.PARAMS,x
|
|
|
|
|
sta $42,x setup ZP in main memory for this block device call
|
|
|
|
|
dex
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
jsr $D000
|
|
|
|
|
jsr GO.A2osX
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.2 >LDYAI A2osx.DIIStat
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
A2osx.DIIStat .DA #S.DEVSTAT.S.BLOCK+S.DEVSTAT.S.WRITE+S.DEVSTAT.S.READ
|
|
|
|
|
.DA 280
|
|
|
|
|
.DA #0
|
|
|
|
|
>PSTR "DISK II 5.25"
|
|
|
|
|
.BS 4
|
|
|
|
|
.DA #S.DEVSTAT.TYPE.5.25
|
|
|
|
|
.DA #0
|
|
|
|
|
.DA #0,#9
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
A2osx.GenStat .DA #S.DEVSTAT.S.BLOCK+S.DEVSTAT.S.WRITE+S.DEVSTAT.S.READ
|
|
|
|
|
.BS 3
|
|
|
|
|
>PSTR "Generic Blk Dev"
|
|
|
|
|
.BS 1
|
|
|
|
|
.DA #S.DEVSTAT.TYPE.HD
|
|
|
|
|
.DA #0
|
|
|
|
|
.DA #0,#9
|
|
|
|
|
*--------------------------------------
|
2016-11-25 16:20:28 +00:00
|
|
|
|
* Smartport Call
|
|
|
|
|
*--------------------------------------
|
2017-01-12 17:43:45 +00:00
|
|
|
|
A2osX.PRTCALL1 >STYA .1+1
|
|
|
|
|
txa
|
|
|
|
|
lsr
|
|
|
|
|
sta .2
|
|
|
|
|
tax
|
|
|
|
|
lda A2osX.PRTCALL.Cnt,x
|
|
|
|
|
sta PRTCALL.PARAMS
|
|
|
|
|
.1 jsr $ffff
|
|
|
|
|
.2 .BS 1 CMD
|
|
|
|
|
.DA PRTCALL.PARAMS
|
2016-11-25 16:20:28 +00:00
|
|
|
|
rts
|
2017-01-12 17:43:45 +00:00
|
|
|
|
A2osX.PRTCALL.Cnt
|
|
|
|
|
.HS 03030301030101010404
|
2016-11-24 17:00:03 +00:00
|
|
|
|
*--------------------------------------
|
2016-09-26 16:00:52 +00:00
|
|
|
|
GO.ProDOS lda $D000 We re coming from AUXLC, saving bank...
|
|
|
|
|
sta GO.A2osX.BNK+1
|
2016-09-05 16:00:11 +00:00
|
|
|
|
|
|
|
|
|
php
|
2016-06-07 06:10:18 +00:00
|
|
|
|
clc
|
|
|
|
|
.HS 2C bit abs
|
|
|
|
|
|
2016-09-26 16:00:52 +00:00
|
|
|
|
GO.A2osX php
|
2016-06-07 06:10:18 +00:00
|
|
|
|
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-26 16:00:52 +00:00
|
|
|
|
bcs GO.A2osX.BNK if CS, go AUXLC
|
2016-09-05 16:00:11 +00:00
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2016-09-28 15:34:15 +00:00
|
|
|
|
GO.A2osX.BNK ldx #RRAMWRAMBNK1 Self Modified, initialized to BNK1 for INIT3
|
2016-09-05 16:00:11 +00:00
|
|
|
|
|
|
|
|
|
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
|
2016-09-26 16:00:52 +00:00
|
|
|
|
GO.EXIT.JMP jmp $FFFF Self Modified
|
2016-06-07 06:10:18 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
A2osX.SaveA .BS 1
|
|
|
|
|
A2osX.SaveX .BS 1
|
|
|
|
|
A2osX.SaveY .BS 1
|
|
|
|
|
*--------------------------------------
|
2017-01-25 16:18:35 +00:00
|
|
|
|
* Called for ProDOS IRQ Manager (LCBNK1)
|
|
|
|
|
* A,X,Y, $FA->$FF Already Saved
|
|
|
|
|
* Main RAM,ZP/LC selected
|
|
|
|
|
* must begin with CLD
|
|
|
|
|
* must exit with RTS
|
|
|
|
|
* - CC if IRQ cleared, CS if NOT
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
ProDOS.INTNUM .BS 1
|
2016-06-07 06:10:18 +00:00
|
|
|
|
*--------------------------------------
|
2017-01-25 16:18:35 +00:00
|
|
|
|
IrqHandler cld
|
2017-02-08 16:42:32 +00:00
|
|
|
|
lda RDALTZP
|
|
|
|
|
sta .2+1
|
2017-01-25 16:18:35 +00:00
|
|
|
|
|
2017-03-02 22:14:04 +00:00
|
|
|
|
bmi .1 we are already in AuxZP/LC
|
|
|
|
|
|
|
|
|
|
sta SETALTZP coming from MainLC, switch to aux
|
2017-01-25 16:18:35 +00:00
|
|
|
|
tsx
|
|
|
|
|
stx A2osX.SaveSM
|
|
|
|
|
ldx A2osX.SaveSX
|
|
|
|
|
txs
|
2017-02-06 17:04:03 +00:00
|
|
|
|
|
2017-02-08 16:42:32 +00:00
|
|
|
|
.1 jsr K.IrqHandler
|
|
|
|
|
|
2017-03-02 22:14:04 +00:00
|
|
|
|
.2 lda #$ff get back ZP status when called
|
|
|
|
|
bmi .3 we were coming from AuxZP/LC
|
2017-01-25 16:18:35 +00:00
|
|
|
|
|
2017-03-02 22:14:04 +00:00
|
|
|
|
tsx go back to Main
|
2017-01-25 16:18:35 +00:00
|
|
|
|
stx A2osX.SaveSX
|
|
|
|
|
ldx A2osX.SaveSM
|
|
|
|
|
txs
|
|
|
|
|
sta CLRALTZP
|
|
|
|
|
|
2017-02-08 16:42:32 +00:00
|
|
|
|
.3 rts
|
2017-01-25 16:18:35 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
BrkHandler bra *
|
2016-06-07 06:10:18 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
|
|
|
|
SAVE SYS/KERNEL.S.GP
|
|
|
|
|
LOAD SYS/KERNEL.S
|
|
|
|
|
ASM
|