mirror of
https://github.com/A2osX/A2osX.git
synced 2024-08-15 04:29:35 +00:00
91 lines
1.5 KiB
Plaintext
91 lines
1.5 KiB
Plaintext
NEW
|
||
PREFIX /A2OSX.BUILD
|
||
AUTO 4,1
|
||
*/--------------------------------------
|
||
* # GetDevByID
|
||
* **In:**
|
||
* A = DevID
|
||
* **Out:**
|
||
* CC = OK, CS = ERROR
|
||
* Y,A = DEVSLOT
|
||
*\--------------------------------------
|
||
K.GetDevByID cmp DevMgr.DevCnt
|
||
bcs K.GetDev.NODEV
|
||
|
||
tax
|
||
|
||
ldy FD.Table.PTRLO,x
|
||
lda FD.Table.PTRHI,x
|
||
|
||
* clc
|
||
|
||
.9 rts CC
|
||
*/--------------------------------------
|
||
* # GetDevByName
|
||
* **In:**
|
||
* Y,A = Ptr to device name (C-String)
|
||
* **Out:**
|
||
* CC = OK, CS = ERROR
|
||
* X = DEVID
|
||
* Y,A = FD
|
||
*\--------------------------------------
|
||
K.GetDevByName >STYA ZPPtr1
|
||
|
||
ldx #0
|
||
|
||
.1 ldy FD.Table.PTRLO,x
|
||
lda FD.Table.PTRHI,x
|
||
|
||
>STYA ZPPtr2
|
||
|
||
lda ZPPtr2
|
||
clc
|
||
adc #S.FD.DEV.NAME
|
||
sta ZPPtr3
|
||
|
||
lda ZPPtr2+1
|
||
adc #0
|
||
sta ZPPtr3+1
|
||
|
||
ldy #$ff
|
||
|
||
.2 iny
|
||
lda (ZPPtr1),y
|
||
cmp (ZPPtr3),y
|
||
bne .4
|
||
|
||
ora (ZPPtr3),y Both char are 0 ?
|
||
bne .2 no....loop
|
||
|
||
ldy ZPPtr2
|
||
lda ZPPtr3+1
|
||
clc
|
||
rts
|
||
|
||
.4 inx
|
||
cpx DevMgr.DevCnt
|
||
bne .1
|
||
|
||
K.GetDev.NODEV lda #MLI.E.NODEV
|
||
sec
|
||
K.GetDev.9 rts
|
||
*/--------------------------------------
|
||
* # GetDevStatus
|
||
* **In:**
|
||
* A = DevID
|
||
* **Out:**
|
||
* Y,A = S.DSTAT
|
||
*\--------------------------------------
|
||
K.GetDevStatus ldx #IOCTL.STATUS
|
||
jsr K.GetDevByID
|
||
bcs K.GetDev.9
|
||
|
||
>STYA pFD
|
||
|
||
jmp (pFD)
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE /A2OSX.SRC/SYS/KERNEL.S.DEV
|
||
LOAD /A2OSX.SRC/SYS/KERNEL.S
|
||
ASM
|