PR#3
PREFIX /A2OSX.SRC
NEW
INC 1
AUTO 6
				.LIST OFF
*--------------------------------------
* K.GetDevByIDA
* IN: 
*  A = DevID
* OUT:
*  CC = OK, CS = ERROR
*  Y,A = devslot
*  X Unmodified
*--------------------------------------
K.GetDevByIDA	cmp DevMgr.LastDevID
				beq .1
				bcs K.GetDevDNF

.1				pha						save ID

				asl
				asl
				asl
				asl
				adc	#DevMgr.Table
				tay
				pla
				php
				lsr
				lsr
				lsr
				lsr
				plp
				adc /DevMgr.Table
				rts						CC		
*--------------------------------------
* GetDevIDByNameA
* IN: 
*  A = hPStr
* OUT:
*  CC = OK, CS = ERROR
*  X = DEVID
*  Y,A = pDev
*--------------------------------------
K.GetDevByNameYA
				>STYA ZPQuickPtr1
				>LDYAI DevMgr.Table+S.DEV.NAME
				>STYA ZPQuickPtr2
				
				ldx #0
				
.1				lda (ZPQuickPtr1)
				cmp (ZPQuickPtr2)
				bne .3
				
				tay
				
.2				lda (ZPQuickPtr1),y
				cmp (ZPQuickPtr2),y
				bne .3
				
				dey
				bne .2
				
				lda ZPQuickPtr2
				sec
				sbc #S.DEV.NAME
				tay
				lda ZPQuickPtr2+1
				sbc /S.DEV.NAME
				clc
				rts
				
.3				lda ZPQuickPtr2
				clc
				adc #S.DEV
				sta ZPQuickPtr2
				bcc .4
				
				inc ZPQuickPtr2+1
				
.4				cpx DevMgr.LastDevID
				inx
				bcc .1

K.GetDevDNF		lda #DEVMGR.ERRDNF
				rts
*--------------------------------------
K.GetDevInfoA	jsr K.GetDevByIDA
				bcs K.GetDevDNF
				>STYA ZPQuickPtr1
				ldx #DEVMGR.GETINFO
				jmp (ZPQuickPtr1)		
*--------------------------------------
MAN
SAVE SYS/KERNEL.S.DEV
LOAD SYS/KERNEL.S
ASM
