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

91 lines
1.6 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.LoadDrvYA
* in :
* Y,A = PTR To Full Cmd Line PStrArray
* out :
* none
*--------------------------------------
S.LoadDrvYA >STYA S.LoadDrv.CmdArray
>LDYAI ENV.DRV push ENVNAME=DRV
jsr S.GetEnvYA get value for ENV=DRV
bcs .99
>PUSHYA Push $DRV value
>PUSHW S.LoadDrv.CmdArray (ARG[0] = DRVNAME)
jsr S.FileSearch find libname in $DRV
bcs .99
stx S.LoadDrv.hFullName
jsr S.LoadBinYA Y,A =filename full path
bcs .98
>STYA pDrv
stx S.LoadDrv.hMem
>LDYA S.LoadDrv.CmdArray Advance to ARG[1]
>STYA ZPQuickPtr1
lda ZPQuickPtr1
sec
adc (ZPQuickPtr1)
sta ZPQuickPtr1
bcc .1
inc ZPQuickPtr1+1
.1 >LDYA ZPQuickPtr1
jsr pDrvJmp call Dev.Detect
bcs .97
bit RRAMWRAMBNK2
bit RRAMWRAMBNK2
jsr S.InsDrv
bit RRAMWRAMBNK1
bit RRAMWRAMBNK1
bcs .97
ldy #S.DEV.F
lda (pDev),y
ora #S.DEV.F.INUSE
sta (pDev),y
jsr .97 Cleanup...
lda #0 Make sure RC = 0 if success
clc
.99 rts
.97 pha
lda S.LoadDrv.hMem
jsr S.FreeMemA
pla
.98 pha
lda S.LoadDrv.hFullName
jsr S.FreeMemA
pla
sec
rts
*--------------------------------------
ENV.DRV >PSTRING "DRV"
S.LoadDrv.CmdArray .BS 2
S.LoadDrv.hFullName .BS 1
S.LoadDrv.hMem .BS 1
*--------------------------------------
MAN
SAVE SYS/KERNEL.S.DRV
LOAD SYS/KERNEL.S
ASM