2016-06-07 08:10:18 +02:00
|
|
|
|
PR#3
|
2017-03-29 17:48:15 +02:00
|
|
|
|
PREFIX /A2OSX.BUILD
|
2017-03-15 17:44:15 +01:00
|
|
|
|
LOMEM $A00
|
2016-06-07 08:10:18 +02:00
|
|
|
|
INC 1
|
|
|
|
|
AUTO 6
|
|
|
|
|
*--------------------------------------
|
2016-09-26 18:00:52 +02:00
|
|
|
|
* SYSCALL (AUXLC to AUXLC)
|
|
|
|
|
* Used by user & kernel for inter bank Calls
|
2016-06-07 08:10:18 +02:00
|
|
|
|
* In:
|
|
|
|
|
* X = SYSfnc.Index
|
|
|
|
|
* Y,A = free for Inline param
|
|
|
|
|
*--------------------------------------
|
2017-10-27 16:56:46 +02:00
|
|
|
|
jmp GP.SysCall
|
2016-06-07 08:10:18 +02:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* LIBCALL (AUXLC to AUXLC)
|
2016-09-26 18:00:52 +02:00
|
|
|
|
* Used by user
|
2016-06-07 08:10:18 +02:00
|
|
|
|
* In:
|
|
|
|
|
* Y = LIB.ID
|
|
|
|
|
* X = LIBfnc.Index
|
|
|
|
|
* A = free for Inline param
|
|
|
|
|
*--------------------------------------
|
2017-10-27 16:56:46 +02:00
|
|
|
|
jmp GP.LibCall
|
2016-06-07 08:10:18 +02:00
|
|
|
|
*--------------------------------------
|
2017-11-05 22:23:21 +01:00
|
|
|
|
* AppleTalk MLICALL (AUXLC to MAINLC)
|
|
|
|
|
* Used by user
|
2016-06-07 08:10:18 +02:00
|
|
|
|
* In:
|
2017-11-05 22:23:21 +01:00
|
|
|
|
* Y,A = Params
|
2016-06-07 08:10:18 +02:00
|
|
|
|
*--------------------------------------
|
2017-11-05 22:23:21 +01:00
|
|
|
|
jmp GP.AtkCall
|
2016-11-25 17:20:28 +01:00
|
|
|
|
*--------------------------------------
|
2017-08-31 17:35:15 +02:00
|
|
|
|
* MLICALL (AUXLC to MAINLC)
|
|
|
|
|
* Used by Kernel
|
|
|
|
|
* In:
|
|
|
|
|
* X = MLI Function
|
|
|
|
|
* A = Param Count
|
|
|
|
|
*--------------------------------------
|
2017-10-27 16:56:46 +02:00
|
|
|
|
jmp GP.ROMCall
|
2017-07-01 15:44:40 +02:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* BADCALL
|
|
|
|
|
*--------------------------------------
|
2017-10-26 18:01:54 +02:00
|
|
|
|
lda #MLI.E.BADCALL
|
2017-07-01 15:44:40 +02:00
|
|
|
|
sec
|
|
|
|
|
rts
|
2016-06-07 08:10:18 +02:00
|
|
|
|
*--------------------------------------
|
2016-08-17 08:25:58 +02:00
|
|
|
|
jmp (pDev) pDevJmp
|
2017-11-22 17:27:50 +01:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* SLEEP
|
2017-11-17 17:16:05 +01:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
pla get PC LO
|
|
|
|
|
sec
|
|
|
|
|
sbc pCode
|
|
|
|
|
ldy #S.PS.PC
|
|
|
|
|
sta (pPs),y
|
|
|
|
|
|
|
|
|
|
pla get PC HI
|
|
|
|
|
sbc pCode+1
|
|
|
|
|
iny
|
|
|
|
|
sta (pPs),y
|
|
|
|
|
|
|
|
|
|
lda (pPs)
|
|
|
|
|
ora #S.PS.F.SLEEP
|
|
|
|
|
sta (pPs)
|
|
|
|
|
clc
|
|
|
|
|
rts
|
2016-06-07 08:10:18 +02:00
|
|
|
|
*--------------------------------------
|
2016-09-26 18:00:52 +02:00
|
|
|
|
* *** MUST BE REINTRANT ***
|
|
|
|
|
*--------------------------------------
|
2017-10-27 16:56:46 +02:00
|
|
|
|
GP.SysCall bit K.SYSCALL.BANK,x
|
2016-09-26 18:00:52 +02:00
|
|
|
|
bpl .8 in $E000, no BNK change
|
|
|
|
|
|
|
|
|
|
sta .7+1 save A (Func Arg)
|
|
|
|
|
|
2017-08-25 17:02:16 +02:00
|
|
|
|
lda K.SYSCALL.BANK,x Get Target BNK
|
2016-09-26 18:00:52 +02:00
|
|
|
|
|
|
|
|
|
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 08:26:54 +02:00
|
|
|
|
jsr .6 go to kernel.....
|
2016-09-26 18:00:52 +02:00
|
|
|
|
|
|
|
|
|
stx .5+1 save X
|
|
|
|
|
plx get back Source BNK
|
2016-09-05 18:00:11 +02:00
|
|
|
|
bit $C000,x
|
|
|
|
|
bit $C000,x
|
2016-09-26 18:00:52 +02:00
|
|
|
|
.5 ldx #$FF Self Modified
|
|
|
|
|
rts Unmodified Carry
|
|
|
|
|
|
|
|
|
|
.6 ldx #$FF Self Modified
|
|
|
|
|
.7 lda #$FF Self Modified
|
2017-07-01 15:44:40 +02:00
|
|
|
|
.8 jmp (K.SYSCALL.JMP,x)
|
2016-09-26 18:00:52 +02:00
|
|
|
|
*--------------------------------------
|
2017-10-27 16:56:46 +02:00
|
|
|
|
GP.LibCall pha No need to save X, K.GetMemPtr.A will leave it unmodified
|
2016-09-26 18:00:52 +02:00
|
|
|
|
tya Get LIB hMem in A
|
2017-08-25 08:37:21 +02:00
|
|
|
|
jsr K.GetMemPtr.A Get LIB Code Segment (MemMgr in $E000, no BNK change)
|
2017-03-27 17:32:30 +02:00
|
|
|
|
>STYA .1+1
|
2016-06-07 08:10:18 +02:00
|
|
|
|
pla
|
2017-11-05 22:23:21 +01:00
|
|
|
|
.1 jmp *
|
2016-06-07 08:10:18 +02:00
|
|
|
|
*--------------------------------------
|
2017-11-05 22:23:21 +01:00
|
|
|
|
GP.AtkCall >STYA .1
|
2016-09-26 18:00:52 +02:00
|
|
|
|
jsr GO.ProDOS
|
2016-06-07 08:10:18 +02:00
|
|
|
|
jsr MLI
|
2017-11-05 22:23:21 +01:00
|
|
|
|
.DA #MLIATALK
|
|
|
|
|
.1 .DA *
|
2016-09-26 18:00:52 +02:00
|
|
|
|
jsr GO.A2osX
|
2016-06-07 08:10:18 +02:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-10-27 16:56:46 +02:00
|
|
|
|
GP.ROMCall phx
|
2017-10-16 17:41:48 +02:00
|
|
|
|
ldx $D000
|
|
|
|
|
stx .8+1
|
|
|
|
|
|
|
|
|
|
bit RROMBNK1
|
|
|
|
|
|
|
|
|
|
plx
|
|
|
|
|
jsr .1
|
|
|
|
|
|
|
|
|
|
.8 ldx #$ff
|
|
|
|
|
bit $C000,x
|
|
|
|
|
bit $C000,x
|
|
|
|
|
rts
|
2017-10-26 18:01:54 +02:00
|
|
|
|
|
2017-10-16 17:41:48 +02:00
|
|
|
|
.1 jmp (.2,x)
|
2017-10-26 18:01:54 +02:00
|
|
|
|
|
|
|
|
|
* http://www.txbobsc.com/scsc/scdocumentor/E7A0.html
|
|
|
|
|
|
2017-10-30 17:11:07 +01:00
|
|
|
|
.2 .DA $E7AA FSUBT
|
|
|
|
|
.DA $E7C1 FADDT
|
2017-10-27 08:36:46 +02:00
|
|
|
|
.DA $E82E NORMALIZE.FAC.2 (L->F)
|
2017-10-18 17:32:56 +02:00
|
|
|
|
.DA $E941 LOG
|
2017-10-30 17:11:07 +01:00
|
|
|
|
.DA $E987 FMULTT.1
|
2017-10-27 16:56:46 +02:00
|
|
|
|
.DA $E9E7 LOAD.ARG.FROM.INDEX
|
2017-10-30 17:11:07 +01:00
|
|
|
|
.DA $EA6B FDIVT+2
|
2017-10-27 16:56:46 +02:00
|
|
|
|
.DA $EAFD LOAD.FAC.FROM.INDEX
|
2017-10-27 08:36:46 +02:00
|
|
|
|
|
2017-11-05 22:23:21 +01:00
|
|
|
|
.DA $EB27 SETFOR (GETFAC)
|
2017-10-27 08:36:46 +02:00
|
|
|
|
.DA $EBB2 FCOMP
|
|
|
|
|
.DA $EBF2 QINT (F->L)
|
2017-10-27 16:56:46 +02:00
|
|
|
|
.DA $EC4A FIN StrToF
|
|
|
|
|
.DA $ED36 FOUT.1 PrintF
|
2017-10-18 17:32:56 +02:00
|
|
|
|
.DA $EE8D SQR
|
|
|
|
|
.DA $EE97 FPWRT
|
|
|
|
|
.DA $EF09 EXP
|
2017-10-27 08:36:46 +02:00
|
|
|
|
|
2017-10-18 17:32:56 +02:00
|
|
|
|
.DA $EFEA COS
|
|
|
|
|
.DA $EFF1 SIN
|
|
|
|
|
.DA $F03A TAN
|
|
|
|
|
.DA $F09E ATN
|
|
|
|
|
*--------------------------------------
|
2017-11-05 22:23:21 +01:00
|
|
|
|
GP.MLICall stx .1
|
|
|
|
|
sta K.MLI.PARAMS
|
|
|
|
|
jsr GO.ProDOS
|
|
|
|
|
jsr MLI
|
|
|
|
|
.1 .BS 1
|
|
|
|
|
.DA K.MLI.PARAMS
|
|
|
|
|
jsr GO.A2osX
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-03-31 17:24:42 +02:00
|
|
|
|
GO.ProDOS pha
|
|
|
|
|
lda $D000 We re coming from AUXLC, saving bank...
|
2016-09-26 18:00:52 +02:00
|
|
|
|
sta GO.A2osX.BNK+1
|
2017-03-31 17:24:42 +02:00
|
|
|
|
pla
|
2016-09-05 18:00:11 +02:00
|
|
|
|
php
|
2016-06-07 08:10:18 +02:00
|
|
|
|
clc
|
|
|
|
|
.HS 2C bit abs
|
|
|
|
|
|
2016-09-26 18:00:52 +02:00
|
|
|
|
GO.A2osX php
|
2016-06-07 08:10:18 +02:00
|
|
|
|
sec
|
2016-09-05 18:00:11 +02:00
|
|
|
|
|
2016-06-07 08:10:18 +02:00
|
|
|
|
sei
|
|
|
|
|
|
2017-05-03 17:40:02 +02:00
|
|
|
|
sta GO.EXIT.SaveA+1
|
|
|
|
|
stx GO.EXIT.SaveX+1
|
|
|
|
|
sty GO.EXIT.SaveY+1
|
2016-09-05 18:00:11 +02:00
|
|
|
|
|
|
|
|
|
pla Restore P in A for later
|
|
|
|
|
|
|
|
|
|
plx Get PC and add 1 for return
|
2016-06-07 08:10:18 +02:00
|
|
|
|
ply
|
|
|
|
|
inx
|
|
|
|
|
bne .1
|
|
|
|
|
iny
|
2016-09-05 18:00:11 +02:00
|
|
|
|
|
2016-06-07 08:10:18 +02:00
|
|
|
|
.1 stx GO.EXIT.JMP+1
|
|
|
|
|
sty GO.EXIT.JMP+2
|
|
|
|
|
|
2016-09-26 18:00:52 +02:00
|
|
|
|
bcs GO.A2osX.BNK if CS, go AUXLC
|
2016-09-05 18:00:11 +02:00
|
|
|
|
|
|
|
|
|
bit RRAMWRAMBNK1 Go MAINLC (ProDOS), always BNK1
|
|
|
|
|
bit RRAMWRAMBNK1
|
|
|
|
|
|
|
|
|
|
tsx
|
2016-06-07 08:10:18 +02:00
|
|
|
|
stx A2osX.SaveSX
|
|
|
|
|
ldx A2osX.SaveSM
|
|
|
|
|
txs
|
2016-09-05 18:00:11 +02:00
|
|
|
|
sta CLRALTZP
|
2016-06-07 08:10:18 +02:00
|
|
|
|
bra GO.EXIT
|
2016-09-05 18:00:11 +02:00
|
|
|
|
|
2016-09-28 17:34:15 +02:00
|
|
|
|
GO.A2osX.BNK ldx #RRAMWRAMBNK1 Self Modified, initialized to BNK1 for INIT3
|
2016-09-05 18:00:11 +02:00
|
|
|
|
|
|
|
|
|
bit $C000,x
|
|
|
|
|
bit $C000,x
|
|
|
|
|
|
|
|
|
|
sta SETALTZP
|
2016-06-07 08:10:18 +02:00
|
|
|
|
tsx
|
|
|
|
|
stx A2osX.SaveSM
|
|
|
|
|
ldx A2osX.SaveSX
|
|
|
|
|
txs
|
|
|
|
|
*--------------------------------------
|
2017-09-12 17:24:36 +02:00
|
|
|
|
GO.EXIT pha push P on stack
|
2017-05-03 17:40:02 +02:00
|
|
|
|
GO.EXIT.SaveY ldy #$ff
|
|
|
|
|
GO.EXIT.SaveX ldx #$ff
|
|
|
|
|
GO.EXIT.SaveA lda #$ff
|
2016-06-07 08:10:18 +02:00
|
|
|
|
plp
|
2016-09-26 18:00:52 +02:00
|
|
|
|
GO.EXIT.JMP jmp $FFFF Self Modified
|
2016-06-07 08:10:18 +02:00
|
|
|
|
*--------------------------------------
|
2017-11-23 17:51:52 +01:00
|
|
|
|
* Called from ProDOS IRQ Manager (LCBNK1)
|
2017-01-25 17:18:35 +01:00
|
|
|
|
* 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
|
|
|
|
|
*--------------------------------------
|
2017-10-27 16:56:46 +02:00
|
|
|
|
GP.IrqH cld
|
2017-02-08 17:42:32 +01:00
|
|
|
|
lda RDALTZP
|
|
|
|
|
sta .2+1
|
2017-01-25 17:18:35 +01:00
|
|
|
|
|
2017-03-02 23:14:04 +01:00
|
|
|
|
bmi .1 we are already in AuxZP/LC
|
|
|
|
|
|
|
|
|
|
sta SETALTZP coming from MainLC, switch to aux
|
2017-01-25 17:18:35 +01:00
|
|
|
|
tsx
|
|
|
|
|
stx A2osX.SaveSM
|
|
|
|
|
ldx A2osX.SaveSX
|
|
|
|
|
txs
|
2017-02-06 18:04:03 +01:00
|
|
|
|
|
2017-10-27 16:56:46 +02:00
|
|
|
|
.1 jsr K.IrqH
|
2017-02-08 17:42:32 +01:00
|
|
|
|
|
2017-03-02 23:14:04 +01:00
|
|
|
|
.2 lda #$ff get back ZP status when called
|
|
|
|
|
bmi .3 we were coming from AuxZP/LC
|
2017-01-25 17:18:35 +01:00
|
|
|
|
|
2017-03-02 23:14:04 +01:00
|
|
|
|
tsx go back to Main
|
2017-01-25 17:18:35 +01:00
|
|
|
|
stx A2osX.SaveSX
|
|
|
|
|
ldx A2osX.SaveSM
|
|
|
|
|
txs
|
|
|
|
|
sta CLRALTZP
|
|
|
|
|
|
2017-02-08 17:42:32 +01:00
|
|
|
|
.3 rts
|
2017-01-25 17:18:35 +01:00
|
|
|
|
*--------------------------------------
|
2017-10-18 17:32:56 +02:00
|
|
|
|
*GO.Reset jsr GO.A2osX
|
|
|
|
|
* jmp CORE.Run
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
*BrkHandler bra *
|
2017-05-03 17:40:02 +02:00
|
|
|
|
*--------------------------------------
|
2017-10-18 17:32:56 +02:00
|
|
|
|
.BS $BEE0-*
|
2017-10-27 16:56:46 +02:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* $BEE0->$BEEF : Public Variables
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.BS 16
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* $BEF0->$BEFF : Kernel Config Block
|
2017-05-03 17:40:02 +02:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.DA #6 60hz
|
|
|
|
|
.BS 7
|
|
|
|
|
.DA #0 ChRoot Disabled
|
|
|
|
|
.BS 7 All Slots marked as "Free"
|
2016-06-07 08:10:18 +02:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
2017-03-29 17:48:15 +02:00
|
|
|
|
SAVE /A2OSX.SRC/SYS/KERNEL.S.GP
|
|
|
|
|
LOAD /A2OSX.SRC/SYS/KERNEL.S
|
2016-06-07 08:10:18 +02:00
|
|
|
|
ASM
|