A2osX/DRV/PPIC.DRV.S.txt

109 lines
1.9 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
.OP 65C02
.OR $2000
.TF DRV/PPIC.DRV
*--------------------------------------
.INB INC/MACROS.I
.INB INC/A2OSX.I
.INB INC/ZP.I
*--------------------------------------
ZPTmpPtr1 .EQ ZPDRV
*--------------------------------------
SIG.05 .EQ $48
SIG.07 .EQ $48
*--------------------------------------
* Main DRV entry point
* input :
* X = CMD
* 0 : OPEN
* 2 : GETEVENT
* 4 : SELECT
* 6 : RELEASE
* 8 : OUT
* 10 : CLOSE
*--------------------------------------
* CLD $D8
* JMP (*,x) $7C
* #JMPTABLE
* /JMPTABLE
*--------------------------------------
CS.START cld
jmp (.1,x)
.1 .DA OPEN
.DA GETEVENT
.DA SELECT
.DA RELEASE
.DA OUT
.DA CLOSE
.DA 0 end or relocation
.DA CS.END-CS.START
*--------------------------------------
OPEN stz ZPTmpPtr1
lda #$C1
sta ZPTmpPtr1+1
.1 ldy #5
lda (ZPTmpPtr1),y
cmp #SIG.05
bne .2
ldy #7
lda (ZPTmpPtr1),y
cmp #SIG.07
beq .3
.2 inc ZPTmpPtr1+1
lda ZPTmpPtr1+1
cmp #$C8
bne .1
beq .99
.3 lda ZPTmpPtr1+1
and #$0F
sta DEVSLOT
ora #$30
sta DEVNAME+4
lda #S.DEV.F.CHAR+S.DEV.F.OUT
2015-06-03 18:30:57 +00:00
sta (pDev)
2015-03-14 21:48:35 +00:00
ldy #S.DEV.NAME
ldx #0
.7 lda DEVNAME,x
2015-06-03 18:30:57 +00:00
sta (pDev),y
2015-03-14 21:48:35 +00:00
cpx DEVNAME
beq .8
inx
iny
bne .7
.8 clc
rts
.99 lda #DEVMGR.ERRNOHW
sec
rts
*--------------------------------------
GETEVENT lda #0
sec
rts
*--------------------------------------
SELECT
RELEASE
*--------------------------------------
OUT clc
rts
*--------------------------------------
CLOSE clc
rts
*--------------------------------------
CS.END
DEVNAME >PSTRING "LPT0"
DEVSLOT .BS 1
*--------------------------------------
MAN
SAVE DRV/PPIC.DRV.S
ASM