A2osX/SYS/KERNEL.S.DEV.txt

100 lines
1.6 KiB
Plaintext
Raw Normal View History

2015-03-14 21:48:35 +00:00
PR#3
2015-06-03 18:30:57 +00:00
PREFIX /A2OSX.SRC
2015-03-14 21:48:35 +00:00
NEW
INC 1
AUTO 6
.LIST OFF
*--------------------------------------
2016-09-21 15:20:37 +00:00
* K.GetDevByIDA
2015-03-14 21:48:35 +00:00
* IN:
* A = DevID
* OUT:
* CC = OK, CS = ERROR
* Y,A = devslot
* X Unmodified
*--------------------------------------
2016-09-21 15:20:37 +00:00
K.GetDevByIDA cmp DevMgr.LastDevID
2015-06-03 18:30:57 +00:00
beq .1
2016-09-21 15:20:37 +00:00
bcs K.GetDevDNF
2015-06-03 18:30:57 +00:00
2016-09-29 15:30:15 +00:00
.1 pha save ID
2015-06-03 18:30:57 +00:00
asl
asl
asl
asl
adc #DevMgr.Table
tay
2016-09-29 15:30:15 +00:00
pla
php
lsr
lsr
lsr
lsr
plp
2015-06-03 18:30:57 +00:00
adc /DevMgr.Table
rts CC
2015-03-14 21:48:35 +00:00
*--------------------------------------
* GetDevIDByNameA
* IN:
* A = hPStr
* OUT:
* CC = OK, CS = ERROR
2015-06-03 18:30:57 +00:00
* X = DEVID
* Y,A = pDev
2015-03-14 21:48:35 +00:00
*--------------------------------------
2016-09-21 15:20:37 +00:00
K.GetDevByNameYA
2015-03-14 21:48:35 +00:00
>STYA ZPQuickPtr1
2015-06-03 18:30:57 +00:00
>LDYAI DevMgr.Table+S.DEV.NAME
>STYA ZPQuickPtr2
2015-03-14 21:48:35 +00:00
2015-06-03 18:30:57 +00:00
ldx #0
2016-10-07 20:48:49 +00:00
.1 lda (ZPQuickPtr1)
cmp (ZPQuickPtr2)
bne .3
tay
2015-03-14 21:48:35 +00:00
.2 lda (ZPQuickPtr1),y
cmp (ZPQuickPtr2),y
bne .3
2015-06-03 18:30:57 +00:00
2016-10-07 20:48:49 +00:00
dey
2015-03-14 21:48:35 +00:00
bne .2
2015-06-03 18:30:57 +00:00
lda ZPQuickPtr2
sec
sbc #S.DEV.NAME
tay
lda ZPQuickPtr2+1
sbc /S.DEV.NAME
2015-03-14 21:48:35 +00:00
clc
rts
2015-06-03 18:30:57 +00:00
.3 lda ZPQuickPtr2
2015-03-14 21:48:35 +00:00
clc
adc #S.DEV
2015-06-03 18:30:57 +00:00
sta ZPQuickPtr2
bcc .4
inc ZPQuickPtr2+1
.4 cpx DevMgr.LastDevID
inx
bcc .1
2016-09-21 15:20:37 +00:00
K.GetDevDNF lda #DEVMGR.ERRDNF
2015-03-14 21:48:35 +00:00
rts
*--------------------------------------
2016-09-21 15:20:37 +00:00
K.GetDevInfoA jsr K.GetDevByIDA
bcs K.GetDevDNF
2016-02-24 19:52:24 +00:00
>STYA ZPQuickPtr1
ldx #DEVMGR.GETINFO
jmp (ZPQuickPtr1)
2016-02-24 19:52:24 +00:00
*--------------------------------------
2015-03-14 21:48:35 +00:00
MAN
SAVE SYS/KERNEL.S.DEV
LOAD SYS/KERNEL.S
ASM