mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-23 07:35:19 +00:00
102 lines
1.7 KiB
Plaintext
102 lines
1.7 KiB
Plaintext
PR#3
|
||
PREFIX /A2OSX.BUILD
|
||
LOMEM $A00
|
||
INC 1
|
||
AUTO 6
|
||
*/--------------------------------------
|
||
* # GetDevByID.A
|
||
* ## IN:
|
||
* A = DevID
|
||
* ## OUT:
|
||
* CC = OK, CS = ERROR
|
||
* Y,A = DEVSLOT
|
||
* note: X Unmodified
|
||
*\--------------------------------------
|
||
K.GetDevByID.A cmp DevMgr.Count
|
||
bcs K.GetDevDNF
|
||
|
||
asl
|
||
asl
|
||
asl
|
||
asl
|
||
php
|
||
clc
|
||
adc #DevMgr.Table
|
||
tay
|
||
|
||
plp
|
||
lda #0
|
||
adc /DevMgr.Table
|
||
rts CC
|
||
*/--------------------------------------
|
||
* # GetDevByName.YA
|
||
* ## IN:
|
||
* Y,A = Ptr to device name (PStr)
|
||
* ## OUT:
|
||
* CC = OK, CS = ERROR
|
||
* X = DEVID
|
||
* Y,A = DEVSLOT
|
||
*\--------------------------------------
|
||
K.GetDevByName.YA
|
||
>STYA ZPPtr1
|
||
>LDYAI DevMgr.Table+S.DEV.NAME
|
||
>STYA ZPPtr2
|
||
|
||
ldx #0
|
||
|
||
.1 lda (ZPPtr2)
|
||
cmp (ZPPtr1)
|
||
bne .3
|
||
|
||
tay
|
||
|
||
.2 lda (ZPPtr1),y
|
||
cmp (ZPPtr2),y
|
||
bne .3
|
||
|
||
dey
|
||
bne .2
|
||
|
||
lda ZPPtr2
|
||
sec
|
||
sbc #S.DEV.NAME
|
||
tay
|
||
lda ZPPtr2+1
|
||
sbc /S.DEV.NAME
|
||
clc
|
||
rts
|
||
|
||
.3 lda ZPPtr2
|
||
clc
|
||
adc #S.DEV
|
||
sta ZPPtr2
|
||
bcc .4
|
||
|
||
inc ZPPtr2+1
|
||
|
||
.4 inx
|
||
cpx DevMgr.Count
|
||
bne .1
|
||
|
||
K.GetDevDNF lda #MLI.ERR.NODEV CS from cpx/beq
|
||
rts
|
||
*/--------------------------------------
|
||
* # GetDevStatus.A
|
||
* ## IN:
|
||
* A = DevID
|
||
* ## OUT:
|
||
* CC = OK, CS = ERROR
|
||
* Y,A = Ptr to S.DEVINFO
|
||
*\--------------------------------------
|
||
K.GetDevStatus.A
|
||
jsr K.GetDevByID.A
|
||
bcs K.GetDevDNF
|
||
>STYA ZPPtr1
|
||
ldx #DEVMGR.STATUS
|
||
jmp (ZPPtr1)
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE /A2OSX.SRC/SYS/KERNEL.S.DEV
|
||
LOAD /A2OSX.SRC/SYS/KERNEL.S
|
||
ASM
|