2015-03-14 21:48:35 +00:00
|
|
|
|
PR#3
|
2017-03-29 15:48:15 +00:00
|
|
|
|
PREFIX /A2OSX.BUILD
|
2017-03-15 16:44:15 +00:00
|
|
|
|
LOMEM $A00
|
2015-03-14 21:48:35 +00:00
|
|
|
|
INC 1
|
|
|
|
|
AUTO 6
|
2016-10-26 20:51:06 +00:00
|
|
|
|
*/--------------------------------------
|
2017-08-25 06:37:21 +00:00
|
|
|
|
* # GetDevByID.A
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* ## IN:
|
2015-03-14 21:48:35 +00:00
|
|
|
|
* A = DevID
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* ## OUT:
|
2015-03-14 21:48:35 +00:00
|
|
|
|
* CC = OK, CS = ERROR
|
2016-12-09 16:36:24 +00:00
|
|
|
|
* Y,A = DEVSLOT
|
2016-10-26 20:51:06 +00:00
|
|
|
|
* note: X Unmodified
|
|
|
|
|
*\--------------------------------------
|
2017-08-25 06:37:21 +00:00
|
|
|
|
K.GetDevByID.A cmp DevMgr.Count
|
2016-09-21 15:20:37 +00:00
|
|
|
|
bcs K.GetDevDNF
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
|
|
|
|
asl
|
|
|
|
|
asl
|
|
|
|
|
asl
|
2017-03-15 16:44:15 +00:00
|
|
|
|
asl
|
|
|
|
|
php
|
|
|
|
|
clc
|
2015-06-03 18:30:57 +00:00
|
|
|
|
adc #DevMgr.Table
|
|
|
|
|
tay
|
2017-01-12 17:43:45 +00:00
|
|
|
|
|
2016-09-29 15:30:15 +00:00
|
|
|
|
plp
|
2017-03-15 16:44:15 +00:00
|
|
|
|
lda #0
|
2015-06-03 18:30:57 +00:00
|
|
|
|
adc /DevMgr.Table
|
|
|
|
|
rts CC
|
2016-10-26 20:51:06 +00:00
|
|
|
|
*/--------------------------------------
|
2017-08-25 06:37:21 +00:00
|
|
|
|
* # GetDevByName.YA
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* ## IN:
|
2017-09-14 15:21:06 +00:00
|
|
|
|
* Y,A = Ptr to device name (C-String)
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* ## OUT:
|
2015-03-14 21:48:35 +00:00
|
|
|
|
* CC = OK, CS = ERROR
|
2015-06-03 18:30:57 +00:00
|
|
|
|
* X = DEVID
|
2016-12-09 16:36:24 +00:00
|
|
|
|
* Y,A = DEVSLOT
|
2016-10-26 20:51:06 +00:00
|
|
|
|
*\--------------------------------------
|
2017-08-25 06:37:21 +00:00
|
|
|
|
K.GetDevByName.YA
|
2017-01-12 17:43:45 +00:00
|
|
|
|
>STYA ZPPtr1
|
2017-03-15 16:44:15 +00:00
|
|
|
|
>LDYAI DevMgr.Table+S.DEV.NAME
|
2017-01-12 17:43:45 +00:00
|
|
|
|
>STYA ZPPtr2
|
2015-03-14 21:48:35 +00:00
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
ldx #0
|
|
|
|
|
|
2017-09-14 15:21:06 +00:00
|
|
|
|
.1 ldy #$ff
|
2016-10-07 20:48:49 +00:00
|
|
|
|
|
2017-09-14 15:21:06 +00:00
|
|
|
|
.2 iny
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
ora (ZPPtr2),y
|
|
|
|
|
bne .3 Both char are 0, match!
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
lda ZPPtr2
|
2015-06-03 18:30:57 +00:00
|
|
|
|
sec
|
2017-03-15 16:44:15 +00:00
|
|
|
|
sbc #S.DEV.NAME
|
2015-06-03 18:30:57 +00:00
|
|
|
|
tay
|
2017-01-12 17:43:45 +00:00
|
|
|
|
lda ZPPtr2+1
|
2017-03-15 16:44:15 +00:00
|
|
|
|
sbc /S.DEV.NAME
|
2015-03-14 21:48:35 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2017-09-14 15:21:06 +00:00
|
|
|
|
.3 lda (ZPPtr1),y
|
|
|
|
|
cmp (ZPPtr2),y
|
|
|
|
|
beq .2
|
|
|
|
|
|
|
|
|
|
lda ZPPtr2
|
2015-03-14 21:48:35 +00:00
|
|
|
|
clc
|
2016-10-03 15:59:36 +00:00
|
|
|
|
adc #S.DEV
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta ZPPtr2
|
2015-06-03 18:30:57 +00:00
|
|
|
|
bcc .4
|
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
inc ZPPtr2+1
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.4 inx
|
|
|
|
|
cpx DevMgr.Count
|
|
|
|
|
bne .1
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
K.GetDevDNF lda #MLI.ERR.NODEV CS from cpx/beq
|
2015-03-14 21:48:35 +00:00
|
|
|
|
rts
|
2016-10-26 20:51:06 +00:00
|
|
|
|
*/--------------------------------------
|
2017-08-25 06:37:21 +00:00
|
|
|
|
* # GetDevStatus.A
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* ## IN:
|
2016-10-26 20:51:06 +00:00
|
|
|
|
* A = DevID
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* ## OUT:
|
2016-10-26 20:51:06 +00:00
|
|
|
|
* CC = OK, CS = ERROR
|
|
|
|
|
* Y,A = Ptr to S.DEVINFO
|
|
|
|
|
*\--------------------------------------
|
2017-08-25 06:37:21 +00:00
|
|
|
|
K.GetDevStatus.A
|
|
|
|
|
jsr K.GetDevByID.A
|
2016-09-21 15:20:37 +00:00
|
|
|
|
bcs K.GetDevDNF
|
2017-01-12 17:43:45 +00:00
|
|
|
|
>STYA ZPPtr1
|
|
|
|
|
ldx #DEVMGR.STATUS
|
|
|
|
|
jmp (ZPPtr1)
|
2016-02-24 19:52:24 +00:00
|
|
|
|
*--------------------------------------
|
2015-03-14 21:48:35 +00:00
|
|
|
|
MAN
|
2017-03-29 15:48:15 +00:00
|
|
|
|
SAVE /A2OSX.SRC/SYS/KERNEL.S.DEV
|
|
|
|
|
LOAD /A2OSX.SRC/SYS/KERNEL.S
|
2015-03-14 21:48:35 +00:00
|
|
|
|
ASM
|