A2osX/SYS/KERNEL.S.DEV.txt

107 lines
1.8 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

PR#3
PREFIX /A2OSX.SRC
NEW
INC 1
AUTO 6
.LIST OFF
*/--------------------------------------
* #GetDevByIDA
* ##IN:
* A = DevID
* ##OUT:
* CC = OK, CS = ERROR
* Y,A = devslot
* note: 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
*/--------------------------------------
* #GetDevIDByNameYA
* ##IN:
* Y,A = Ptr to device name (PStr)
* ##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
*/--------------------------------------
* #GetDevInfoA
* ##IN:
* A = DevID
* ##OUT:
* CC = OK, CS = ERROR
* Y,A = Ptr to S.DEVINFO
*\--------------------------------------
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