A2osX/SYS/KERNEL.S.GP.txt
2016-08-17 08:25:58 +02:00

143 lines
3.0 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 (KERNEL.SYSCALL,x)
*--------------------------------------
* 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
*--------------------------------------
jmp A2osX.ROMCALL1
*--------------------------------------
jmp BrkHandler
.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.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
*--------------------------------------
A2osX.ROMCALL1 plx
stx .1+1
plx
stx .1+2
ldx RROMBNK1
jsr .1
ldx RRAMWRAMBNK1
ldx RRAMWRAMBNK1
rts
.1 jmp $FFFF
*--------------------------------------
GO.MAINLC php
clc
.HS 2C bit abs
GO.AUXLC php
sec
sei
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
ldx RRAMWRAMBNK1
ldx RRAMWRAMBNK1
ldy pStack
bcs GO.AUXLC1
GO.MAINLC1 tsx
stx A2osX.SaveSX
ldx A2osX.SaveSM
txs
stx CLRALTZP
bra GO.EXIT
*--------------------------------------
GO.AUXLC1 stx 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.SaveA .BS 1
A2osX.SaveX .BS 1
A2osX.SaveY .BS 1
*--------------------------------------
BrkHandler sta SETPAGE2
bra *
*--------------------------------------
IrqHandler bra *
*--------------------------------------
A2osX.GP.End .EQ *
*--------------------------------------
* CONTROL SECTION :
*--------------------------------------
.DO A2osX.GP.End>$BEBF
ERROR:GP too big
.FIN
*--------------------------------------
.BS A2osX.GP.START+$100-*
*--------------------------------------
MAN
SAVE SYS/KERNEL.S.GP
LOAD SYS/KERNEL.S
ASM