mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-10 12:06:02 +00:00
120 lines
2.0 KiB
Plaintext
120 lines
2.0 KiB
Plaintext
NEW
|
||
PREFIX /A2OSX.BUILD
|
||
AUTO 4,1
|
||
*/--------------------------------------
|
||
* # 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
|
||
tay
|
||
|
||
lda /Dev.Table
|
||
adc #0
|
||
rts CC
|
||
*/--------------------------------------
|
||
* # GetDevByName.YA
|
||
* ## IN:
|
||
* Y,A = Ptr to device name (C-String)
|
||
* ## OUT:
|
||
* CC = OK, CS = ERROR
|
||
* X = DEVID
|
||
* Y,A = DEVSLOT
|
||
*\--------------------------------------
|
||
K.GetDevByName.YA
|
||
>STYA ZPPtr1
|
||
>LDYAI Dev.Table+S.DEV.NAME
|
||
>STYA ZPPtr2
|
||
|
||
ldx #0
|
||
|
||
.1 ldy #$ff
|
||
|
||
.2 iny
|
||
lda (ZPPtr1),y
|
||
cmp (ZPPtr2),y
|
||
bne .3
|
||
|
||
ora (ZPPtr2),y Both char are 0 ?
|
||
bne .2 no....loop
|
||
|
||
lda ZPPtr2
|
||
and #$F0
|
||
tay
|
||
lda ZPPtr2+1
|
||
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.E.NODEV CS from cpx/beq
|
||
rts
|
||
*/--------------------------------------
|
||
* # K.GetDevStatus.A
|
||
* ## IN:
|
||
* A = DevID
|
||
* ## OUT:
|
||
* Y,A = S.DSTAT
|
||
*\--------------------------------------
|
||
K.GetDevStatus.A
|
||
jsr K.GetDevByID.A
|
||
bcs .9
|
||
|
||
>STYA pDev
|
||
|
||
ldx #DEVMGR.STATUS
|
||
jmp (pDev)
|
||
.9 rts
|
||
*/--------------------------------------
|
||
* # K.DevIOCTL
|
||
* ## IN:
|
||
* PUSHB = DevID
|
||
* PUSHB = Operation
|
||
* PUSHW = Param Block
|
||
* ## OUT:
|
||
* Y,A = ...
|
||
*\--------------------------------------
|
||
K.DevIOCTL >PULLB .1+1
|
||
>PULLB .2+1
|
||
|
||
>PULLA
|
||
tax
|
||
|
||
>PULLA
|
||
jsr K.GetDevByID.A
|
||
bcs .9
|
||
|
||
>STYA pDev
|
||
|
||
.1 ldy #$ff SELF MODIFIED
|
||
.2 lda #$ff SELF MODIFIED
|
||
|
||
jmp (pDev)
|
||
|
||
.9 rts
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE /A2OSX.SRC/SYS/KERNEL.S.DEV
|
||
LOAD /A2OSX.SRC/SYS/KERNEL.S
|
||
ASM
|