mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-22 00:32:44 +00:00
142 lines
2.9 KiB
Plaintext
142 lines
2.9 KiB
Plaintext
PR#3
|
||
PREFIX /A2OSX.SRC
|
||
NEW
|
||
INC 1
|
||
AUTO 6
|
||
.LIST OFF
|
||
.OP 65C02
|
||
*--------------------------------------
|
||
* **** START OF A2osX Global Page ****
|
||
*--------------------------------------
|
||
A2osX.GP.B.start
|
||
.PH $BE00
|
||
*--------------------------------------
|
||
A2osX.GP.Start bra A2osX.SYSCALL1
|
||
bra A2osX.LIBCALL1
|
||
bra A2osX.SLEEP1
|
||
bra A2osX.MLICALL1
|
||
*--------------------------------------
|
||
* A2osX.SYSCALL (MAINLC to AUXLC)
|
||
* In:
|
||
* X = SYSfnc.Index
|
||
* Y,A = free for Inline param
|
||
*--------------------------------------
|
||
A2osX.SYSCALL1 jmp KERNEL.SYSCALL
|
||
*--------------------------------------
|
||
* LIBCALL (MAINLC to MAINLC)
|
||
* In:
|
||
* Y = LIB.ID
|
||
* X = LIBfnc.Index
|
||
* A = free for Inline param
|
||
*--------------------------------------
|
||
A2osX.LIBCALL1 pha
|
||
phx
|
||
tya
|
||
>SYSCALL SYS.GetMemPtrA
|
||
>STYA .1+1
|
||
plx
|
||
pla
|
||
.1 jmp $FFFF
|
||
*--------------------------------------
|
||
* SLEEP (MAINLC to AUXLC)
|
||
* In:
|
||
*--------------------------------------
|
||
A2osX.SLEEP1 ldy #S.PS.hCS
|
||
lda (pPs),y
|
||
>SYSCALL SYS.GetMemPtrA
|
||
>STYA A2osX.SaveCS
|
||
ldy #S.PS.PC
|
||
pla get PC LO
|
||
plx get PC HI
|
||
inc Advance PC one Byte
|
||
bne .1
|
||
inx
|
||
|
||
.1 sec
|
||
sbc A2osX.SaveCS
|
||
sta (pPs),y
|
||
iny
|
||
txa
|
||
sbc A2osX.SaveCS+1
|
||
sta (pPs),y
|
||
clc No error,
|
||
rts back to Kernel
|
||
*--------------------------------------
|
||
* Kernel.MLICALL (AUXLC to MAINLC)
|
||
* In:
|
||
* X = MLI Function
|
||
* A = Param Count
|
||
*--------------------------------------
|
||
A2osX.MLICALL1 jsr GO.MAINLC
|
||
stx .1
|
||
sta MLICALL.PARAMS
|
||
jsr MLI
|
||
.1 .BS 1
|
||
.DA MLICALL.PARAMS
|
||
jsr GO.AUXLC
|
||
rts
|
||
*--------------------------------------
|
||
GO.MAINLC php
|
||
clc
|
||
bra GO.SAVE.REG
|
||
|
||
GO.AUXLC php
|
||
sec
|
||
|
||
GO.SAVE.REG sta A2osX.SaveA
|
||
pla keep P in A for later
|
||
stx A2osX.SaveX
|
||
sty A2osX.SaveY
|
||
plx
|
||
ply
|
||
inx
|
||
bne .1
|
||
iny
|
||
.1 stx GO.EXIT.JMP+1
|
||
sty GO.EXIT.JMP+2
|
||
sei
|
||
ldy pStack
|
||
bcs GO.AUXLC1
|
||
|
||
GO.MAINLC1 tsx
|
||
stx A2osX.SaveSX
|
||
ldx A2osX.SaveSM
|
||
txs
|
||
stx CLRALTZP
|
||
ldx RROMBNK1
|
||
bra GO.EXIT
|
||
*--------------------------------------
|
||
GO.AUXLC1 stx SETALTZP
|
||
tsx
|
||
stx A2osX.SaveSM
|
||
ldx A2osX.SaveSX
|
||
txs
|
||
ldx RRAMWRAMBNK1
|
||
ldx RRAMWRAMBNK1
|
||
*--------------------------------------
|
||
GO.EXIT sty pStack
|
||
pha push P on stack
|
||
ldy A2osX.SaveY
|
||
ldx A2osX.SaveX
|
||
lda A2osX.SaveA
|
||
plp
|
||
GO.EXIT.JMP jmp $FFFF
|
||
*--------------------------------------
|
||
GO.Reset jsr GO.AUXLC
|
||
jmp KERNEL.COLDBOOT
|
||
*--------------------------------------
|
||
A2osX.SaveCS .BS 2
|
||
A2osX.SaveA .BS 1
|
||
A2osX.SaveX .BS 1
|
||
A2osX.SaveY .BS 1
|
||
*--------------------------------------
|
||
A2osX.GP.End .EQ *
|
||
A2osX.GP.SIZE .EQ A2osX.GP.END-A2osX.GP.START
|
||
.BS A2osX.GP.START+$100-*
|
||
.EP
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE A2OSX.S.GP
|
||
LOAD A2OSX.S
|
||
ASM
|