A2osX/SYS/KERNEL.S.DRV.txt

91 lines
1.6 KiB
Plaintext
Raw Normal View History

2015-06-03 18:30:57 +00:00
PR#3
PREFIX /A2OSX.SRC
NEW
INC 1
AUTO 6
.LIST OFF
*--------------------------------------
2016-08-17 06:25:58 +00:00
* S.LoadDrvYA
2015-06-03 18:30:57 +00:00
* in :
2016-08-17 06:25:58 +00:00
* Y,A = PTR To Full Cmd Line PStrArray
2015-06-03 18:30:57 +00:00
* out :
* none
*--------------------------------------
2016-08-17 06:25:58 +00:00
S.LoadDrvYA >STYA S.LoadDrv.CmdArray
>LDYAI ENV.DRV push ENVNAME=DRV
2016-08-17 06:25:58 +00:00
jsr S.GetEnvYA get value for ENV=DRV
bcs .99
2016-08-17 06:25:58 +00:00
>PUSHYA Push $DRV value
>PUSHW S.LoadDrv.CmdArray (ARG[0] = DRVNAME)
2016-06-07 06:10:18 +00:00
2016-08-17 06:25:58 +00:00
jsr S.FileSearch find libname in $DRV
bcs .99
stx S.LoadDrv.hFullName
2016-08-17 06:25:58 +00:00
jsr S.LoadBinYA Y,A =filename full path
bcs .98
2015-06-03 18:30:57 +00:00
>STYA pDrv
2016-06-07 06:10:18 +00:00
stx S.LoadDrv.hMem
2016-08-17 06:25:58 +00:00
>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
2015-06-03 18:30:57 +00:00
2016-08-17 06:25:58 +00:00
bcs .97
2015-06-03 18:30:57 +00:00
bit RRAMWRAMBNK2
bit RRAMWRAMBNK2
2015-06-03 18:30:57 +00:00
jsr S.InsDrv
bit RRAMWRAMBNK1
bit RRAMWRAMBNK1
2016-08-17 06:25:58 +00:00
bcs .97
2015-06-03 18:30:57 +00:00
ldy #S.DEV.F
lda (pDev),y
ora #S.DEV.F.INUSE
sta (pDev),y
2016-08-17 06:25:58 +00:00
jsr .97 Cleanup...
2015-06-03 18:30:57 +00:00
2016-08-17 06:25:58 +00:00
lda #0 Make sure RC = 0 if success
clc
.99 rts
2016-08-17 06:25:58 +00:00
.97 pha
lda S.LoadDrv.hMem
2015-06-03 18:30:57 +00:00
jsr S.FreeMemA
pla
2016-08-17 06:25:58 +00:00
.98 pha
lda S.LoadDrv.hFullName
2015-06-03 18:30:57 +00:00
jsr S.FreeMemA
pla
2016-08-17 06:25:58 +00:00
sec
2015-06-03 18:30:57 +00:00
rts
*--------------------------------------
2016-06-07 06:10:18 +00:00
ENV.DRV >PSTRING "DRV"
2016-08-17 06:25:58 +00:00
S.LoadDrv.CmdArray .BS 2
S.LoadDrv.hFullName .BS 1
S.LoadDrv.hMem .BS 1
2015-06-03 18:30:57 +00:00
*--------------------------------------
MAN
SAVE SYS/KERNEL.S.DRV
LOAD SYS/KERNEL.S
ASM