A2osX/SYS/KERNEL.S.DRV.txt
2016-06-23 17:56:13 +02:00

105 lines
1.9 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
*--------------------------------------
* S.LoadDrvA
* in :
* A = hMem To Full Cmd Line
* out :
* none
*--------------------------------------
S.LoadDrvA >PUSHA push Cmd Line for S.PStrGetTkn
>PUSHBI $20 Push SEP=' '
>PUSHBI 0 Push 0 for getting CMD And ARGS
jsr S.PStrGetTkn
bcc .1
rts
.1 sta S.LoadDrv.Name
stx S.LoadDrv.Args
>LDYAI ENV.DRV push ENVNAME=DRV
jsr S.GetEnvVarYA get value for ENV=$DRV
bcs .98
sta S.LoadDrv.Srch
>PUSHB S.LoadDrv.Name push CMD for S.FileSearch
>PUSHB S.LoadDrv.Srch
jsr S.FileSearch find File in $DRV
bcs .97 not Found
sta S.LoadDrv.FullName
jsr S.LoadBinA
bcs .96
>STYA pDrv
stx S.LoadDrv.hMem
lda S.LoadDrv.Args
jsr S.LoadDrvA.Jmp call Dev.Detect
bcs .95
bit RRAMWRAMBNK2
bit RRAMWRAMBNK2
jsr S.InsDrv
bit RRAMWRAMBNK1
bit RRAMWRAMBNK1
bcs .95
jsr .95
ldy #S.DEV.F
lda (pDev),y
ora #S.DEV.F.INUSE
sta (pDev),y
clc
rts
.95 pha
lda S.LoadDrv.hMem
jsr S.FreeMemA
pla
.96 pha
lda S.LoadDrv.FullName
jsr S.FreeMemA
pla
.97 pha
lda S.LoadDrv.Srch
jsr S.FreeMemA
pla
.98 pha
lda S.LoadDrv.Args
jsr S.FreeMemA
lda S.LoadDrv.Name
jsr S.FreeMemA
pla
.99 sec
rts
*--------------------------------------
S.LoadDrvA.Jmp jmp (pDrv)
*--------------------------------------
S.LoadDrv.Name .BS 1
S.LoadDrv.Args .BS 1
S.LoadDrv.Srch .BS 1
S.LoadDrv.FullName .BS 1
S.LoadDrv.hMem .BS 1
*--------------------------------------
ENV.DRV >PSTRING "DRV"
*--------------------------------------
MAN
SAVE SYS/KERNEL.S.DRV
LOAD SYS/KERNEL.S
ASM