A2osX/SYS/KERNEL.S.DRV.txt

79 lines
1.4 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
LOMEM $A00
INC 1
AUTO 6
*--------------------------------------
* K.LoadDrvYA
* in :
* Y,A = PTR To Full Cmd Line PStrArray
* out :
* none
*--------------------------------------
K.LoadDrvYA >STYA K.LoadDrv.CmdArray
>LDYAI ENV.DRV push ENVNAME=DRV
>SYSCALL GetEnvYA get value for ENV=DRV
bcs .99
>PUSHYA Push $DRV value
>PUSHW K.LoadDrv.CmdArray (ARG[0] = DRVNAME)
jsr K.FileSearch find libname in $DRV
bcs .99
stx K.LoadDrv.hFullName
jsr K.LoadExeYA Y,A =filename full path
bcs .98
>STYA pDrv
stx K.LoadDrv.hMem
>LDYA K.LoadDrv.CmdArray Advance to ARG[1]
>STYA ZPPtr1
lda ZPPtr1
sec
adc (ZPPtr1)
sta ZPPtr1
bcc .1
inc ZPPtr1+1
.1 >LDYA ZPPtr1
jsr pDrvJmp call Dev.Detect
bcs .97
jsr BIN.InstallDRV
bcs .97
jsr .97 Cleanup...
lda #0 Make sure RC = 0 if success
clc
.99 rts
.97 pha
lda K.LoadDrv.hMem
jsr K.FreeMemA
pla
.98 pha
lda K.LoadDrv.hFullName
jsr K.FreeMemA
pla
sec
rts
*--------------------------------------
K.LoadDrv.CmdArray .BS 2
K.LoadDrv.hFullName .BS 1
K.LoadDrv.hMem .BS 1
*--------------------------------------
MAN
SAVE SYS/KERNEL.S.DRV
LOAD SYS/KERNEL.S
ASM