2016-03-18 07:26:49 +00:00
|
|
|
|
NEW
|
2020-08-25 14:54:30 +00:00
|
|
|
|
AUTO 3,1
|
2016-03-18 07:26:49 +00:00
|
|
|
|
.LIST OFF
|
|
|
|
|
.OP 65C02
|
|
|
|
|
.OR $2000
|
2020-08-25 14:54:30 +00:00
|
|
|
|
.TF drv/pic.drv
|
2016-03-18 07:26:49 +00:00
|
|
|
|
*--------------------------------------
|
2020-08-25 14:54:30 +00:00
|
|
|
|
.INB inc/macros.i
|
|
|
|
|
.INB inc/a2osx.i
|
|
|
|
|
.INB inc/mli.e.i
|
2016-03-18 07:26:49 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
ZPTmpPtr1 .EQ ZPDRV
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* File Header (16 Bytes)
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.START cld
|
|
|
|
|
jmp Dev.Detect cld,jmp abs=DRV
|
|
|
|
|
.DA #$61 6502,Level 1 (65c02)
|
|
|
|
|
.DA #1 DRV Layout Version 1
|
|
|
|
|
.DA 0
|
|
|
|
|
.DA CS.END-CS.START Code Length
|
2020-08-25 14:54:30 +00:00
|
|
|
|
.DA 0
|
|
|
|
|
.DA #32 SS
|
|
|
|
|
.DA #2 ZP
|
|
|
|
|
.DA 0
|
2016-03-18 07:26:49 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Relocation Table
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
L.MSG.DETECT .DA MSG.DETECT
|
|
|
|
|
L.MSG.DETECT.OK .DA MSG.DETECT.OK
|
|
|
|
|
L.MSG.DETECT.KO .DA MSG.DETECT.KO
|
2020-08-25 14:54:30 +00:00
|
|
|
|
L.DRV.CS.START .DA DRV.CS.START
|
|
|
|
|
L.FD.DEV .DA FD.DEV
|
|
|
|
|
L.FD.DEV.NAME .DA FD.DEV.NAME
|
2016-03-18 07:26:49 +00:00
|
|
|
|
.DA 0 End Of Reloc Table
|
|
|
|
|
*--------------------------------------
|
2017-04-14 15:04:39 +00:00
|
|
|
|
Dev.Detect >STYA ARGS
|
2020-08-25 14:54:30 +00:00
|
|
|
|
|
2017-04-14 15:04:39 +00:00
|
|
|
|
>LDYA L.MSG.DETECT
|
2020-08-25 14:54:30 +00:00
|
|
|
|
>SYSCALL PutS
|
|
|
|
|
|
2016-10-17 15:47:50 +00:00
|
|
|
|
stz ZPTmpPtr1
|
2016-03-18 07:26:49 +00:00
|
|
|
|
lda #$C1
|
|
|
|
|
sta ZPTmpPtr1+1
|
2020-08-25 14:54:30 +00:00
|
|
|
|
|
2017-04-14 15:04:39 +00:00
|
|
|
|
.1 and #$0f
|
|
|
|
|
tay
|
2017-10-19 15:27:38 +00:00
|
|
|
|
lda A2osX.S,y
|
2017-04-14 15:04:39 +00:00
|
|
|
|
bne .3
|
2016-03-18 07:26:49 +00:00
|
|
|
|
|
2017-04-14 15:04:39 +00:00
|
|
|
|
ldx #DEVSIG.Length-1
|
|
|
|
|
|
|
|
|
|
.2 ldy DEVSIG.Offset,x
|
|
|
|
|
lda (ZPTmpPtr1),y
|
|
|
|
|
cmp DEVSIG.Value,x
|
|
|
|
|
bne .3
|
2020-08-25 14:54:30 +00:00
|
|
|
|
|
2017-04-14 15:04:39 +00:00
|
|
|
|
dex
|
|
|
|
|
bpl .2
|
2020-08-25 14:54:30 +00:00
|
|
|
|
|
2017-04-14 15:04:39 +00:00
|
|
|
|
bra .4
|
2020-08-25 14:54:30 +00:00
|
|
|
|
|
|
|
|
|
.3 inc FD.DEV.NAME+3
|
|
|
|
|
inc ZPTmpPtr1+1 no match, try next slot....
|
2016-03-18 07:26:49 +00:00
|
|
|
|
lda ZPTmpPtr1+1
|
|
|
|
|
cmp #$C8
|
|
|
|
|
bne .1
|
2020-08-25 14:54:30 +00:00
|
|
|
|
|
2016-03-18 07:26:49 +00:00
|
|
|
|
>LDYA L.MSG.DETECT.KO
|
2020-08-25 14:54:30 +00:00
|
|
|
|
>SYSCALL PutS
|
2016-03-18 07:26:49 +00:00
|
|
|
|
|
2017-10-26 16:01:54 +00:00
|
|
|
|
lda #MLI.E.NODEV Not Found in any slot, exiting
|
2016-03-18 07:26:49 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
2017-04-14 15:04:39 +00:00
|
|
|
|
|
|
|
|
|
.4 lda ZPTmpPtr1+1
|
2016-03-18 07:26:49 +00:00
|
|
|
|
and #$0F
|
2017-04-14 15:04:39 +00:00
|
|
|
|
pha
|
|
|
|
|
tay
|
2017-10-19 15:27:38 +00:00
|
|
|
|
lda #A2osX.S.COM
|
|
|
|
|
sta A2osX.S,y
|
2017-04-14 15:04:39 +00:00
|
|
|
|
pla
|
2016-03-18 07:26:49 +00:00
|
|
|
|
asl
|
|
|
|
|
asl
|
|
|
|
|
asl
|
|
|
|
|
asl
|
|
|
|
|
sta DEVSLOTn0
|
2017-04-14 15:04:39 +00:00
|
|
|
|
|
2020-08-25 14:54:30 +00:00
|
|
|
|
.8 >PUSHW L.MSG.DETECT.OK
|
|
|
|
|
>PUSHW L.FD.DEV.NAME
|
|
|
|
|
>PUSHBI 2
|
2020-02-28 07:21:46 +00:00
|
|
|
|
>SYSCALL PrintF
|
2020-08-25 14:54:30 +00:00
|
|
|
|
|
|
|
|
|
>PUSHWI DRV.END
|
|
|
|
|
>PUSHWI DRV.CS.END-DRV.CS.START
|
|
|
|
|
>PUSHWI DRV.CS.START
|
|
|
|
|
>LDYA L.DRV.CS.START
|
|
|
|
|
>SYSCALL InsDrv
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>STYA FD.DEV+S.FD.DEV.DRVPTR
|
|
|
|
|
|
|
|
|
|
>PUSHW L.FD.DEV
|
|
|
|
|
>PUSHW L.FD.DEV.NAME
|
|
|
|
|
>SYSCALL MKDev
|
|
|
|
|
|
|
|
|
|
.9 rts
|
2016-03-18 07:26:49 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.END
|
2017-04-14 15:04:39 +00:00
|
|
|
|
DEVSIG.Offset .HS 0507
|
|
|
|
|
DEVSIG.Value .HS 4848
|
|
|
|
|
DEVSIG.Length .EQ DEVSIG.Value-DEVSIG.Offset
|
2018-04-11 15:35:51 +00:00
|
|
|
|
MSG.DETECT .AZ "Apple PIC (Parallel Interface Card).\r\n"
|
|
|
|
|
MSG.DETECT.OK .AZ "PIC Installed As Device : %S\r\n"
|
|
|
|
|
MSG.DETECT.KO .AZ "No PIC Found.\r\n"
|
2017-04-14 15:04:39 +00:00
|
|
|
|
ARGS .BS 2
|
2016-03-18 07:26:49 +00:00
|
|
|
|
*--------------------------------------
|
2020-08-25 14:54:30 +00:00
|
|
|
|
FD.DEV .DA #S.FD.T.CDEV
|
|
|
|
|
.DA #0 HANDLER
|
|
|
|
|
.DA #0 BUSID
|
|
|
|
|
.DA #0 DEVID
|
|
|
|
|
.DA 0 BUSPTR
|
|
|
|
|
.BS 2 DRVPTR
|
|
|
|
|
.DA 0 DCBPTR
|
|
|
|
|
.DA 0 BUFPTR
|
|
|
|
|
FD.DEV.NAME .AZ "lpt1"
|
2016-03-18 07:26:49 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Driver Code
|
|
|
|
|
*--------------------------------------
|
2020-08-25 14:54:30 +00:00
|
|
|
|
DRV.CS.START cld
|
|
|
|
|
jmp (.1,x)
|
|
|
|
|
.1 .DA STATUS
|
2017-07-06 15:30:40 +00:00
|
|
|
|
.DA A2osX.BADCALL
|
|
|
|
|
.DA A2osX.BADCALL
|
|
|
|
|
.DA A2osX.BADCALL
|
2017-04-14 15:04:39 +00:00
|
|
|
|
.DA CONTROL
|
2017-07-06 15:30:40 +00:00
|
|
|
|
.DA A2osX.BADCALL
|
2017-04-14 15:04:39 +00:00
|
|
|
|
.DA OPEN
|
2016-03-18 07:26:49 +00:00
|
|
|
|
.DA CLOSE
|
2017-07-06 15:30:40 +00:00
|
|
|
|
.DA A2osX.BADCALL
|
2017-04-14 15:04:39 +00:00
|
|
|
|
.DA WRITE
|
|
|
|
|
L.STAT .DA STAT
|
2016-03-18 07:26:49 +00:00
|
|
|
|
.DA 0 end or relocation
|
|
|
|
|
*--------------------------------------
|
2017-04-14 15:04:39 +00:00
|
|
|
|
STATUS >LDYA L.STAT
|
|
|
|
|
clc
|
2016-03-18 07:26:49 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-04-14 15:04:39 +00:00
|
|
|
|
CONTROL
|
|
|
|
|
clc
|
2016-03-18 07:26:49 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-04-14 15:04:39 +00:00
|
|
|
|
OPEN
|
|
|
|
|
clc
|
2016-03-18 07:26:49 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-04-14 15:04:39 +00:00
|
|
|
|
CLOSE
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
WRITE
|
|
|
|
|
clc
|
2016-03-18 07:26:49 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
DRV.CS.END
|
|
|
|
|
DEVSLOT0n .BS 1
|
|
|
|
|
DEVSLOTCn .BS 1
|
|
|
|
|
DEVSLOTn0 .BS 1
|
2017-04-14 15:04:39 +00:00
|
|
|
|
*--------------------------------------
|
2018-07-19 15:33:55 +00:00
|
|
|
|
STAT .DA #S.DIB.S.WRITE
|
2017-04-14 15:04:39 +00:00
|
|
|
|
.DA #0,#0,#0
|
|
|
|
|
>PSTR "Parallel Card"
|
|
|
|
|
.DA #0,#0,#0
|
2018-07-19 15:33:55 +00:00
|
|
|
|
.DA #S.DIB.T.CHAR
|
2016-03-18 07:26:49 +00:00
|
|
|
|
.DA #0
|
2017-04-14 15:04:39 +00:00
|
|
|
|
.DA $0900
|
2016-03-18 07:26:49 +00:00
|
|
|
|
*--------------------------------------
|
2020-08-25 14:54:30 +00:00
|
|
|
|
DIB .DA #S.DIB.S.WRITE
|
|
|
|
|
.DA #0,#0,#0
|
|
|
|
|
>PSTR "Serial Card/Port"
|
|
|
|
|
.DA #S.DIB.T.CHAR
|
|
|
|
|
.DA #0
|
|
|
|
|
.DA K.VER
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
DCB .DA #S.DCB.T.COM
|
|
|
|
|
.DA #0 FLAGS
|
|
|
|
|
.DA 0
|
|
|
|
|
.DA #0
|
|
|
|
|
.DA #0
|
|
|
|
|
.DA #0
|
|
|
|
|
.DA #0
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
DRV.END
|
2016-03-18 07:26:49 +00:00
|
|
|
|
MAN
|
2020-08-25 14:54:30 +00:00
|
|
|
|
SAVE usr/src/drv/pic.drv.s
|
2016-03-18 07:26:49 +00:00
|
|
|
|
ASM
|