2017-12-22 21:24:30 +00:00
|
|
|
|
NEW
|
2017-03-29 15:48:15 +00:00
|
|
|
|
PREFIX /A2OSX.BUILD
|
2017-12-22 21:24:30 +00:00
|
|
|
|
AUTO 4,1
|
2016-04-18 20:15:34 +00:00
|
|
|
|
.LIST OFF
|
2015-03-14 21:48:35 +00:00
|
|
|
|
.OP 65C02
|
|
|
|
|
.OR $2000
|
2018-07-23 06:28:47 +00:00
|
|
|
|
.TF DRV/UTHERNET.DRV
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2018-07-23 06:28:47 +00:00
|
|
|
|
.INB INC/MACROS.I
|
|
|
|
|
.INB INC/A2OSX.I
|
|
|
|
|
.INB INC/MLI.ERR.I
|
|
|
|
|
.INB INC/NIC.I
|
|
|
|
|
.INB INC/NIC.8900A.I
|
|
|
|
|
.INB INC/ETH.I
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2018-07-23 06:28:47 +00:00
|
|
|
|
ZPArgPtr .EQ ZPDRV
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2015-06-03 18:30:57 +00:00
|
|
|
|
* File Header (16 Bytes)
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.START cld
|
2015-06-03 18:30:57 +00:00
|
|
|
|
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
|
2018-07-23 06:28:47 +00:00
|
|
|
|
.DA 0
|
|
|
|
|
.DA 0
|
|
|
|
|
.DA 0
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2015-06-03 18:30:57 +00:00
|
|
|
|
* Relocation Table
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
L.MSG.DETECT .DA MSG.DETECT
|
2015-11-22 22:30:06 +00:00
|
|
|
|
L.MSG.DETECT.OK .DA MSG.DETECT.OK
|
|
|
|
|
L.MSG.DETECT.KO .DA MSG.DETECT.KO
|
2018-07-23 06:28:47 +00:00
|
|
|
|
L.DRV.CS.START .DA DRV.CS.START
|
|
|
|
|
L.FD.DEV .DA FD.DEV
|
|
|
|
|
L.FD.DEV.NAME .DA FD.DEV.NAME
|
|
|
|
|
L.SSCANF.MAC .DA SSCANF.MAC
|
|
|
|
|
L.MAC0 .DA DCB+S.DCB.NIC.MAC
|
|
|
|
|
L.MAC1 .DA DCB+S.DCB.NIC.MAC+1
|
|
|
|
|
L.MAC2 .DA DCB+S.DCB.NIC.MAC+2
|
|
|
|
|
L.MAC3 .DA DCB+S.DCB.NIC.MAC+3
|
|
|
|
|
L.MAC4 .DA DCB+S.DCB.NIC.MAC+4
|
|
|
|
|
L.MAC5 .DA DCB+S.DCB.NIC.MAC+5
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.DA 0 End Of Reloc Table
|
|
|
|
|
*--------------------------------------
|
2016-08-17 06:25:58 +00:00
|
|
|
|
Dev.Detect >STYA ARGS
|
2018-07-23 06:28:47 +00:00
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
>LDYA L.MSG.DETECT
|
2018-08-23 15:16:20 +00:00
|
|
|
|
>SYSCALL puts
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2017-01-12 22:04:44 +00:00
|
|
|
|
ldx #$70
|
2017-04-27 20:08:12 +00:00
|
|
|
|
ldy #7
|
2017-01-12 22:04:44 +00:00
|
|
|
|
|
2017-10-19 15:27:38 +00:00
|
|
|
|
.1 lda A2osX.S,y IO based detection, avoid scanning in Disk Controller IO!!!!
|
2017-01-12 22:04:44 +00:00
|
|
|
|
bne .2
|
|
|
|
|
|
2017-03-16 16:59:24 +00:00
|
|
|
|
lda /PP.ID
|
|
|
|
|
sta PacketPagePTR+1,x
|
2017-03-17 07:22:37 +00:00
|
|
|
|
lda #PP.ID
|
|
|
|
|
sta PacketPagePTR,x
|
2017-03-16 16:59:24 +00:00
|
|
|
|
|
2017-03-17 16:50:32 +00:00
|
|
|
|
lda PacketPageDATA+1,x
|
2015-03-14 21:48:35 +00:00
|
|
|
|
cmp /DEVID
|
2017-03-16 16:59:24 +00:00
|
|
|
|
bne .2
|
|
|
|
|
|
2017-04-27 20:09:33 +00:00
|
|
|
|
lda PacketPageDATA,x
|
|
|
|
|
cmp #DEVID
|
2015-03-14 21:48:35 +00:00
|
|
|
|
beq .3
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2018-07-23 06:28:47 +00:00
|
|
|
|
.2 dec FD.DEV.NAME+3
|
2015-03-14 21:48:35 +00:00
|
|
|
|
txa
|
2017-01-12 22:04:44 +00:00
|
|
|
|
sec
|
|
|
|
|
sbc #$10
|
2015-03-14 21:48:35 +00:00
|
|
|
|
tax
|
2017-04-27 20:08:12 +00:00
|
|
|
|
dey
|
2015-03-14 21:48:35 +00:00
|
|
|
|
bne .1
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2015-11-22 22:30:06 +00:00
|
|
|
|
>LDYA L.MSG.DETECT.KO
|
2018-08-22 15:23:27 +00:00
|
|
|
|
>SYSCALL puts
|
2015-11-22 22:30:06 +00:00
|
|
|
|
|
2017-10-26 16:01:54 +00:00
|
|
|
|
lda #MLI.E.NODEV
|
2015-03-14 21:48:35 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2016-01-10 22:16:07 +00:00
|
|
|
|
.3 stx DEVSLOTx0
|
2017-10-19 15:27:38 +00:00
|
|
|
|
lda #A2osX.S.NIC
|
|
|
|
|
sta A2osX.S,y
|
2016-01-10 22:16:07 +00:00
|
|
|
|
|
2017-03-17 16:50:32 +00:00
|
|
|
|
lda /PP.REVISION Get Revision# of ths chip...
|
2017-03-16 16:59:24 +00:00
|
|
|
|
sta PacketPagePTR+1,x
|
2017-03-17 16:50:32 +00:00
|
|
|
|
lda #PP.REVISION
|
2017-03-17 07:22:37 +00:00
|
|
|
|
sta PacketPagePTR,x
|
2017-03-16 16:59:24 +00:00
|
|
|
|
|
|
|
|
|
lda PacketPageDATA+1,x
|
2018-07-23 06:28:47 +00:00
|
|
|
|
sta DIB+S.DIB.VERSION+1 set Hardware version
|
2017-03-17 16:50:32 +00:00
|
|
|
|
lda PacketPageDATA,x
|
2018-07-23 06:28:47 +00:00
|
|
|
|
sta DIB+S.DIB.VERSION
|
|
|
|
|
|
|
|
|
|
jsr Dev.ParseArgs
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
.8 >PUSHW L.FD.DEV.NAME
|
2018-08-22 15:23:27 +00:00
|
|
|
|
>PUSHBI 2
|
2018-07-23 06:28:47 +00:00
|
|
|
|
>LDYA L.MSG.DETECT.OK
|
2018-08-22 15:23:27 +00:00
|
|
|
|
>SYSCALL printf
|
2018-07-23 06:28:47 +00:00
|
|
|
|
|
|
|
|
|
>PUSHWI DRV.END
|
|
|
|
|
>PUSHWI DRV.CS.END
|
|
|
|
|
>PUSHWI DRV.CS.START
|
|
|
|
|
>LDYA L.DRV.CS.START
|
|
|
|
|
>SYSCALL InsDrv
|
|
|
|
|
bcs .9
|
|
|
|
|
>STYA FD.DEV+S.FD.DEV.DRVPTR
|
2017-01-12 22:04:44 +00:00
|
|
|
|
|
2018-07-23 06:28:47 +00:00
|
|
|
|
>LDYA L.FD.DEV
|
|
|
|
|
>SYSCALL MKDEV
|
2018-01-17 06:56:16 +00:00
|
|
|
|
|
2018-07-23 06:28:47 +00:00
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
Dev.ParseArgs >LDYA ARGS
|
|
|
|
|
>STYA ZPArgPTR
|
|
|
|
|
lda (ZPArgPTR)
|
|
|
|
|
bne .1
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
2016-04-18 20:15:34 +00:00
|
|
|
|
lda A2osX.RANDOM16
|
|
|
|
|
eor A2osX.TIMER16
|
2018-07-23 06:28:47 +00:00
|
|
|
|
sta DCB+S.DCB.NIC.MAC+3
|
2016-04-18 20:15:34 +00:00
|
|
|
|
eor A2osX.RANDOM16+1
|
2018-07-23 06:28:47 +00:00
|
|
|
|
sta DCB+S.DCB.NIC.MAC+4
|
2016-04-18 20:15:34 +00:00
|
|
|
|
eor A2osX.TIMER16+1
|
2018-07-23 06:28:47 +00:00
|
|
|
|
sta DCB+S.DCB.NIC.MAC+5
|
|
|
|
|
clc
|
|
|
|
|
rts
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2018-07-23 06:28:47 +00:00
|
|
|
|
.1 >PUSHW L.MAC5
|
|
|
|
|
>PUSHW L.MAC4
|
|
|
|
|
>PUSHW L.MAC3
|
|
|
|
|
>PUSHW L.MAC2
|
|
|
|
|
>PUSHW L.MAC1
|
|
|
|
|
>PUSHW L.MAC0
|
|
|
|
|
>PUSHBI 12 6 x byte PTRs
|
|
|
|
|
>PUSHW L.SSCANF.MAC
|
|
|
|
|
>LDYA ZPArgPtr
|
|
|
|
|
>SYSCALL sscanf
|
2016-04-18 20:15:34 +00:00
|
|
|
|
bcc .8
|
2018-07-23 06:28:47 +00:00
|
|
|
|
|
2017-10-26 16:01:54 +00:00
|
|
|
|
lda #K.E.SYN
|
2015-03-14 21:48:35 +00:00
|
|
|
|
sec
|
2018-07-23 06:28:47 +00:00
|
|
|
|
.8 rts
|
2015-06-03 18:30:57 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.END
|
2018-07-23 06:28:47 +00:00
|
|
|
|
ARGS .BS 2
|
2018-08-22 15:23:27 +00:00
|
|
|
|
MSG.DETECT .AZ "UtherNet/CS8900A Driver."
|
2018-04-11 15:35:51 +00:00
|
|
|
|
MSG.DETECT.OK .AZ "UtherNet/CS8900A Installed As Device : %s\r\n"
|
2018-08-22 15:23:27 +00:00
|
|
|
|
MSG.DETECT.KO .AZ "Hardware Not Found."
|
2018-07-23 06:28:47 +00:00
|
|
|
|
SSCANF.MAC .AZ "%h:%h:%h:%h:%h:%h"
|
2015-06-03 18:30:57 +00:00
|
|
|
|
*--------------------------------------
|
2018-07-23 06:28:47 +00:00
|
|
|
|
FD.DEV .DA #S.FD.T.CDEV
|
|
|
|
|
.DA #0 HANDLER
|
|
|
|
|
.DA #0 BUSID
|
|
|
|
|
.DA #0 DEVID
|
|
|
|
|
.DA 0 BUSPTR
|
|
|
|
|
.BS 2 DRVPTR
|
|
|
|
|
FD.DEV.NAME .AZ "ETH7" NAME
|
|
|
|
|
.HS 000000
|
2015-06-03 18:30:57 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Driver Code
|
|
|
|
|
*--------------------------------------
|
2018-07-23 06:28:47 +00:00
|
|
|
|
ZPIOCTL .EQ ZPDRV
|
|
|
|
|
ZPBufPtr .EQ ZPDRV+2
|
2018-08-08 15:13:37 +00:00
|
|
|
|
Counter .EQ ZPDRV+4
|
2018-07-23 06:28:47 +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
|
2018-07-23 06:28:47 +00:00
|
|
|
|
.DA CONTROL
|
|
|
|
|
.DA A2osX.BADCALL
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.DA OPEN
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.DA CLOSE
|
2018-07-23 06:28:47 +00:00
|
|
|
|
.DA READ
|
|
|
|
|
.DA WRITE
|
|
|
|
|
.DA A2osX.BADCALL IRQ
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.DA 0 end or relocation
|
|
|
|
|
*--------------------------------------
|
2018-07-23 06:28:47 +00:00
|
|
|
|
STATUS >STYA ZPIOCTL
|
|
|
|
|
|
|
|
|
|
ldy #S.IOCTL.STATCODE
|
|
|
|
|
lda (ZPIOCTL),y
|
|
|
|
|
beq .1
|
|
|
|
|
|
|
|
|
|
cmp #S.IOCTL.STATCODE.GETDIB
|
|
|
|
|
bne STATUS.DCB
|
|
|
|
|
|
|
|
|
|
ldx #S.DIB-1
|
|
|
|
|
.HS 2C bit abs
|
|
|
|
|
.1 ldx #3
|
|
|
|
|
|
|
|
|
|
ldy #S.IOCTL.BUFPTR
|
|
|
|
|
lda (ZPIOCTL),y
|
|
|
|
|
sta .3+1
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPIOCTL),y
|
|
|
|
|
sta .3+2
|
|
|
|
|
|
|
|
|
|
.2 lda DIB,x
|
|
|
|
|
.3 sta $ffff,x SELF MODIFIED
|
|
|
|
|
dex
|
|
|
|
|
bpl .2
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
2015-03-14 21:48:35 +00:00
|
|
|
|
|
2018-07-23 06:28:47 +00:00
|
|
|
|
STATUS.DCB cmp #S.IOCTL.STATCODE.GETDCB
|
|
|
|
|
bne STATUS.9
|
|
|
|
|
lda #S.DCB.NIC.SPEED.10
|
|
|
|
|
sta DCB+S.DCB.NIC.SPEED
|
|
|
|
|
stz DCB+S.DCB.NIC.LINK
|
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
ldx DEVSLOTx0
|
2017-03-17 07:22:37 +00:00
|
|
|
|
|
|
|
|
|
lda /PP.LineST
|
|
|
|
|
sta PacketPagePTR+1,x
|
|
|
|
|
lda #PP.LineST
|
|
|
|
|
sta PacketPagePTR,x
|
|
|
|
|
|
2017-03-17 16:50:32 +00:00
|
|
|
|
lda PacketPageDATA+1,x
|
2017-03-17 07:22:37 +00:00
|
|
|
|
lda PacketPageDATA,x
|
2017-01-12 17:43:45 +00:00
|
|
|
|
and #PP.LineST.LinkOK
|
2017-03-17 07:22:37 +00:00
|
|
|
|
beq .1
|
|
|
|
|
|
2018-07-23 06:28:47 +00:00
|
|
|
|
lda #S.DCB.NIC.LINK.OK
|
|
|
|
|
tsb DCB+S.DCB.NIC.LINK
|
2017-01-12 17:43:45 +00:00
|
|
|
|
|
2018-07-23 06:28:47 +00:00
|
|
|
|
lda /PP.TestCTL
|
2017-03-17 07:22:37 +00:00
|
|
|
|
sta PacketPagePTR+1,x
|
|
|
|
|
lda #PP.TestCTL
|
|
|
|
|
sta PacketPagePTR,x
|
|
|
|
|
|
|
|
|
|
lda PacketPageDATA+1,x
|
2017-03-17 16:50:32 +00:00
|
|
|
|
ldy PacketPageDATA,x
|
2017-01-12 17:43:45 +00:00
|
|
|
|
and /PP.TestCTL.FDX
|
2018-07-23 06:28:47 +00:00
|
|
|
|
beq .1
|
|
|
|
|
|
|
|
|
|
lda #S.DCB.NIC.LINK.FD
|
|
|
|
|
tsb DCB+S.DCB.NIC.LINK
|
|
|
|
|
|
|
|
|
|
.1 ldy #S.IOCTL.BUFPTR
|
|
|
|
|
lda (ZPIOCTL),y
|
|
|
|
|
sta .3+1
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPIOCTL),y
|
|
|
|
|
sta .3+2
|
|
|
|
|
|
|
|
|
|
ldx #S.DCB.NIC-1
|
|
|
|
|
|
|
|
|
|
.2 lda DCB,x
|
|
|
|
|
.3 sta $ffff,x SELF MODIFIED
|
|
|
|
|
dex
|
|
|
|
|
bpl .2
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
STATUS.9 lda #MLI.E.BADCTL
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CONTROL >STYA ZPIOCTL
|
|
|
|
|
|
|
|
|
|
ldy #S.IOCTL.CTRLCODE
|
|
|
|
|
lda (ZPIOCTL),y
|
|
|
|
|
cmp #S.IOCTL.CTRLCODE.SETDCB
|
|
|
|
|
bne STATUS.9
|
|
|
|
|
|
|
|
|
|
.1 ldy #S.IOCTL.BUFPTR
|
|
|
|
|
lda (ZPIOCTL),y
|
|
|
|
|
sta .2+1
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPIOCTL),y
|
|
|
|
|
sta .2+2
|
|
|
|
|
|
|
|
|
|
ldx #S.DCB.NIC-1
|
|
|
|
|
|
|
|
|
|
.2 lda $ffff,x SELF MODIFIED
|
|
|
|
|
sta DCB,x
|
|
|
|
|
dex
|
|
|
|
|
bpl .2
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
OPEN jsr CLOSE
|
|
|
|
|
|
|
|
|
|
lda /PP.RxCTL
|
|
|
|
|
sta PacketPagePTR+1,x
|
|
|
|
|
lda #PP.RxCTL
|
|
|
|
|
sta PacketPagePTR,x
|
|
|
|
|
|
|
|
|
|
lda /PP.RxCTL.LID+PP.RxCTL.RxOKA+PP.RxCTL.IA+PP.RxCTL.BroadcastA+PP.RxCTL.RuntA
|
|
|
|
|
sta PacketPageDATA+1,x
|
|
|
|
|
lda #PP.RxCTL.LID+PP.RxCTL.RxOKA+PP.RxCTL.IA+PP.RxCTL.BroadcastA+PP.RxCTL.RuntA
|
|
|
|
|
sta PacketPageDATA,x
|
|
|
|
|
|
|
|
|
|
lda /PP.MAC
|
|
|
|
|
sta PacketPagePTR+1,x
|
|
|
|
|
lda #PP.MAC
|
|
|
|
|
sta PacketPagePTR,x
|
|
|
|
|
|
|
|
|
|
>LDYA DCB+S.DCB.NIC.MAC
|
|
|
|
|
>STYA PacketPageDATA,x
|
|
|
|
|
>LDYAI PP.MAC+2
|
|
|
|
|
>STYA PacketPagePTR,x
|
|
|
|
|
>LDYA DCB+S.DCB.NIC.MAC+2
|
|
|
|
|
>STYA PacketPageDATA,x
|
|
|
|
|
>LDYAI PP.MAC+4
|
|
|
|
|
>STYA PacketPagePTR,x
|
|
|
|
|
>LDYA DCB+S.DCB.NIC.MAC+4
|
|
|
|
|
>STYA PacketPageDATA,x
|
|
|
|
|
|
|
|
|
|
lda /PP.LineCTL
|
|
|
|
|
sta PacketPagePTR+1,x
|
|
|
|
|
lda #PP.LineCTL
|
|
|
|
|
sta PacketPagePTR,x
|
|
|
|
|
|
|
|
|
|
lda /PP.LineCTL.LID+PP.LineCTL.SerRxOn+PP.LineCTL.SerTxOn+PP.LineCTL.10BaseT
|
|
|
|
|
sta PacketPageDATA+1,x
|
|
|
|
|
lda #PP.LineCTL.LID+PP.LineCTL.SerRxOn+PP.LineCTL.SerTxOn+PP.LineCTL.10BaseT
|
|
|
|
|
sta PacketPageDATA,x
|
|
|
|
|
|
|
|
|
|
lda #S.DIB.S.OPENED
|
|
|
|
|
tsb DIB+S.DIB.S
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CLOSE ldx DEVSLOTx0
|
|
|
|
|
|
|
|
|
|
lda /PP.SelfCTL
|
|
|
|
|
sta PacketPagePTR+1,x
|
|
|
|
|
lda #PP.SelfCTL
|
|
|
|
|
sta PacketPagePTR,x
|
|
|
|
|
|
|
|
|
|
lda /PP.SelfCTL.LID+PP.SelfCTL.RESET
|
|
|
|
|
sta PacketPageDATA+1,x
|
|
|
|
|
|
|
|
|
|
lda #PP.SelfCTL.LID+PP.SelfCTL.RESET
|
|
|
|
|
sta PacketPageDATA,x
|
2017-03-17 07:22:37 +00:00
|
|
|
|
|
2018-07-23 06:28:47 +00:00
|
|
|
|
lda /PP.SelfST
|
|
|
|
|
sta PacketPagePTR+1,x
|
|
|
|
|
lda #PP.SelfST
|
|
|
|
|
sta PacketPagePTR,x
|
|
|
|
|
|
|
|
|
|
ldy #0
|
|
|
|
|
|
|
|
|
|
.1 lda PacketPageDATA+1,x
|
|
|
|
|
lda PacketPageDATA,x
|
|
|
|
|
and #PP.SelfST.InitDone
|
|
|
|
|
|
|
|
|
|
bne .8
|
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
.8 lda #S.DIB.S.OPENED
|
|
|
|
|
trb DIB+S.DIB.S
|
2015-03-14 21:48:35 +00:00
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
clc
|
2015-03-14 21:48:35 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2018-08-25 11:23:59 +00:00
|
|
|
|
READ php
|
2017-03-17 07:22:37 +00:00
|
|
|
|
sei
|
2016-03-13 22:07:01 +00:00
|
|
|
|
|
2018-08-25 11:23:59 +00:00
|
|
|
|
>STYA ZPIOCTL
|
|
|
|
|
|
2017-03-17 07:22:37 +00:00
|
|
|
|
ldx DEVSLOTx0
|
2017-01-26 21:57:35 +00:00
|
|
|
|
|
2017-03-17 07:22:37 +00:00
|
|
|
|
lda /PP.RxEvent
|
|
|
|
|
sta PacketPagePTR+1,x
|
|
|
|
|
lda #PP.RxEvent
|
|
|
|
|
sta PacketPagePTR,x
|
|
|
|
|
|
|
|
|
|
lda PacketPageDATA+1,x
|
2017-03-17 16:50:32 +00:00
|
|
|
|
ldy PacketPageDATA,x
|
|
|
|
|
and /PP.RxEvent.RxOK+PP.RxEvent.IA+PP.RxEvent.Brdcast+PP.RxEvent.Runt
|
2017-03-19 21:47:54 +00:00
|
|
|
|
bne .1
|
|
|
|
|
|
2018-07-23 06:28:47 +00:00
|
|
|
|
lda #MLI.E.EOF
|
2017-01-26 21:57:35 +00:00
|
|
|
|
|
2017-03-19 21:47:54 +00:00
|
|
|
|
.9 plp
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.1 lda RTDATA+1,x discard RxStatus
|
2017-03-17 07:22:37 +00:00
|
|
|
|
lda RTDATA,x
|
2016-03-13 22:07:01 +00:00
|
|
|
|
|
2018-08-08 15:13:37 +00:00
|
|
|
|
lda RTDATA+1,x get RxLength
|
|
|
|
|
ldy #S.IOCTL.BYTECNT+1
|
|
|
|
|
|
|
|
|
|
sta (ZPIOCTL),y
|
|
|
|
|
pha
|
|
|
|
|
eor #$ff
|
|
|
|
|
sta Counter+1
|
|
|
|
|
|
|
|
|
|
lda RTDATA,x
|
|
|
|
|
dey
|
|
|
|
|
sta (ZPIOCTL),y
|
|
|
|
|
tay
|
|
|
|
|
eor #$ff
|
|
|
|
|
sta Counter
|
2017-03-19 21:47:54 +00:00
|
|
|
|
|
2018-08-08 15:13:37 +00:00
|
|
|
|
pla
|
|
|
|
|
|
2018-07-20 11:51:08 +00:00
|
|
|
|
>SYSCALL getmem
|
2017-03-19 21:47:54 +00:00
|
|
|
|
bcs .9
|
2017-03-17 07:22:37 +00:00
|
|
|
|
|
2018-07-23 06:28:47 +00:00
|
|
|
|
>STYA ZPBufPtr
|
2017-01-26 21:57:35 +00:00
|
|
|
|
stx .8+1
|
2017-01-29 21:47:19 +00:00
|
|
|
|
|
2018-08-08 15:13:37 +00:00
|
|
|
|
phy
|
|
|
|
|
ldy #S.IOCTL.BUFPTR+1
|
2018-07-24 06:24:23 +00:00
|
|
|
|
sta (ZPIOCTL),y
|
2018-08-08 15:13:37 +00:00
|
|
|
|
dey
|
|
|
|
|
pla
|
2018-07-24 06:24:23 +00:00
|
|
|
|
sta (ZPIOCTL),y
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2016-03-13 22:07:01 +00:00
|
|
|
|
ldx DEVSLOTx0
|
|
|
|
|
|
2018-08-08 15:13:37 +00:00
|
|
|
|
ldy #0
|
|
|
|
|
|
2017-03-17 07:22:37 +00:00
|
|
|
|
.2 inc Counter
|
|
|
|
|
bne .3
|
2016-04-07 06:13:41 +00:00
|
|
|
|
inc Counter+1
|
2016-03-13 22:07:01 +00:00
|
|
|
|
beq .8
|
2016-04-07 06:13:41 +00:00
|
|
|
|
|
2017-03-17 07:22:37 +00:00
|
|
|
|
.3 lda RTDATA,x
|
2018-07-23 06:28:47 +00:00
|
|
|
|
sta (ZPBufPtr),y
|
2015-03-14 21:48:35 +00:00
|
|
|
|
iny
|
2017-03-17 07:22:37 +00:00
|
|
|
|
bne .4
|
2018-07-23 06:28:47 +00:00
|
|
|
|
inc ZPBufPtr+1
|
2016-03-13 22:07:01 +00:00
|
|
|
|
|
2017-03-17 07:22:37 +00:00
|
|
|
|
.4 inc Counter
|
|
|
|
|
bne .5
|
2016-04-07 06:13:41 +00:00
|
|
|
|
inc Counter+1
|
2015-03-14 21:48:35 +00:00
|
|
|
|
beq .8
|
2016-04-07 06:13:41 +00:00
|
|
|
|
|
2017-03-17 07:22:37 +00:00
|
|
|
|
.5 lda RTDATA+1,x
|
2018-07-23 06:28:47 +00:00
|
|
|
|
sta (ZPBufPtr),y
|
2015-03-14 21:48:35 +00:00
|
|
|
|
iny
|
2017-03-17 07:22:37 +00:00
|
|
|
|
bne .2
|
2018-07-23 06:28:47 +00:00
|
|
|
|
inc ZPBufPtr+1
|
2017-03-17 07:22:37 +00:00
|
|
|
|
bne .2
|
2016-03-13 22:07:01 +00:00
|
|
|
|
|
2018-07-23 06:28:47 +00:00
|
|
|
|
.8 lda #$ff SELF MODIFIED hMem
|
|
|
|
|
|
2017-03-17 07:22:37 +00:00
|
|
|
|
plp
|
2017-01-26 21:57:35 +00:00
|
|
|
|
clc
|
2015-03-14 21:48:35 +00:00
|
|
|
|
rts
|
2015-06-03 18:30:57 +00:00
|
|
|
|
*--------------------------------------
|
2018-08-25 11:23:59 +00:00
|
|
|
|
WRITE php
|
2018-07-23 06:28:47 +00:00
|
|
|
|
sei
|
|
|
|
|
|
2018-08-25 11:23:59 +00:00
|
|
|
|
>STYA ZPIOCTL
|
|
|
|
|
|
2015-03-14 21:48:35 +00:00
|
|
|
|
ldx DEVSLOTx0
|
|
|
|
|
|
2017-03-17 07:22:37 +00:00
|
|
|
|
lda /PP.TxCMD.LID+PP.TxCMD.TxStartFULL
|
|
|
|
|
sta TxCMD+1,x
|
|
|
|
|
lda #PP.TxCMD.LID+PP.TxCMD.TxStartFULL
|
|
|
|
|
sta TxCMD,x
|
|
|
|
|
|
2018-07-23 06:28:47 +00:00
|
|
|
|
ldy #S.IOCTL.BYTECNT+1
|
|
|
|
|
lda (ZPIOCTL),y
|
2017-03-17 07:22:37 +00:00
|
|
|
|
sta TxLength+1,x
|
2017-03-17 16:50:32 +00:00
|
|
|
|
eor #$ff
|
|
|
|
|
sta Counter+1
|
|
|
|
|
|
2018-07-23 06:28:47 +00:00
|
|
|
|
dey
|
|
|
|
|
lda (ZPIOCTL),y
|
2017-03-17 07:22:37 +00:00
|
|
|
|
sta TxLength,x
|
2017-03-17 16:50:32 +00:00
|
|
|
|
eor #$ff
|
|
|
|
|
sta Counter
|
2017-03-17 07:22:37 +00:00
|
|
|
|
|
|
|
|
|
lda /PP.BusST
|
|
|
|
|
sta PacketPagePTR+1,x
|
|
|
|
|
lda #PP.BusST
|
|
|
|
|
sta PacketPagePTR,x
|
|
|
|
|
|
2015-03-14 21:48:35 +00:00
|
|
|
|
ldy #16
|
2017-03-17 07:22:37 +00:00
|
|
|
|
|
2017-03-17 16:50:32 +00:00
|
|
|
|
.1 lda PacketPageDATA+1,x
|
2015-03-14 21:48:35 +00:00
|
|
|
|
and /PP.BusST.Rdy4TxNOW
|
2018-07-23 06:28:47 +00:00
|
|
|
|
bne WRITE.1
|
2016-03-20 22:12:57 +00:00
|
|
|
|
|
2017-03-17 16:50:32 +00:00
|
|
|
|
lda PacketPageDATA,x
|
|
|
|
|
and #PP.BusST.TxBidErr
|
|
|
|
|
bne .9
|
|
|
|
|
|
2015-03-14 21:48:35 +00:00
|
|
|
|
dey
|
|
|
|
|
bne .1
|
2016-03-20 22:12:57 +00:00
|
|
|
|
|
2018-07-23 06:28:47 +00:00
|
|
|
|
.9 lda #MLI.E.EOF
|
2018-08-25 11:23:59 +00:00
|
|
|
|
|
2017-03-17 07:22:37 +00:00
|
|
|
|
plp
|
2015-03-14 21:48:35 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
2018-08-25 11:23:59 +00:00
|
|
|
|
WRITE.1 ldy #S.IOCTL.BUFPTR
|
|
|
|
|
lda (ZPIOCTL),y
|
|
|
|
|
sta ZPBufPtr
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPIOCTL),y
|
|
|
|
|
sta ZPBufPtr+1
|
|
|
|
|
|
|
|
|
|
ldx #5
|
|
|
|
|
ldy #S.ETH.SRCMAC+5
|
|
|
|
|
|
|
|
|
|
.10 lda DCB+S.DCB.NIC.MAC,x
|
|
|
|
|
sta (ZPBufPtr),y
|
|
|
|
|
dey
|
|
|
|
|
dex
|
|
|
|
|
bpl .10
|
|
|
|
|
|
|
|
|
|
ldx DEVSLOTx0
|
|
|
|
|
|
|
|
|
|
ldy #0
|
2016-03-13 22:07:01 +00:00
|
|
|
|
|
2016-04-07 06:13:41 +00:00
|
|
|
|
.1 inc Counter
|
2017-03-17 07:22:37 +00:00
|
|
|
|
bne .2
|
2016-04-07 06:13:41 +00:00
|
|
|
|
inc Counter+1
|
2016-03-13 22:07:01 +00:00
|
|
|
|
beq .8
|
2016-04-07 06:13:41 +00:00
|
|
|
|
|
2018-07-23 06:28:47 +00:00
|
|
|
|
.2 lda (ZPBufPtr),y
|
2015-03-14 21:48:35 +00:00
|
|
|
|
sta RTDATA,x
|
|
|
|
|
iny
|
2017-03-17 07:22:37 +00:00
|
|
|
|
bne .3
|
2018-07-23 06:28:47 +00:00
|
|
|
|
inc ZPBufPtr+1
|
2016-03-13 22:07:01 +00:00
|
|
|
|
|
2017-03-17 07:22:37 +00:00
|
|
|
|
.3 inc Counter
|
|
|
|
|
bne .4
|
2016-04-07 06:13:41 +00:00
|
|
|
|
inc Counter+1
|
2015-03-14 21:48:35 +00:00
|
|
|
|
beq .8
|
2016-04-07 06:13:41 +00:00
|
|
|
|
|
2018-07-23 06:28:47 +00:00
|
|
|
|
.4 lda (ZPBufPtr),y
|
2015-03-14 21:48:35 +00:00
|
|
|
|
sta RTDATA+1,x
|
|
|
|
|
iny
|
2016-03-13 22:07:01 +00:00
|
|
|
|
bne .1
|
2018-07-23 06:28:47 +00:00
|
|
|
|
inc ZPBufPtr+1
|
2015-03-14 21:48:35 +00:00
|
|
|
|
bne .1
|
2016-03-13 22:07:01 +00:00
|
|
|
|
|
2017-03-17 07:22:37 +00:00
|
|
|
|
.8 plp
|
|
|
|
|
clc
|
2015-03-14 21:48:35 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-01-26 21:57:35 +00:00
|
|
|
|
DRV.CS.END
|
2015-03-14 21:48:35 +00:00
|
|
|
|
DEVSLOTx0 .BS 1
|
2017-01-25 21:46:40 +00:00
|
|
|
|
*--------------------------------------
|
2018-07-23 06:28:47 +00:00
|
|
|
|
DIB .DA #0
|
|
|
|
|
.DA #0,#0,#0 size
|
2017-01-12 22:04:44 +00:00
|
|
|
|
>PSTR "Uthernet/CS8900A"
|
2018-07-23 06:28:47 +00:00
|
|
|
|
.DA #S.DIB.T.NIC
|
2017-01-12 22:04:44 +00:00
|
|
|
|
.BS 1 Subtype
|
|
|
|
|
.BS 2 Version
|
|
|
|
|
*--------------------------------------
|
2018-07-23 06:28:47 +00:00
|
|
|
|
DCB .DA #S.DCB.T.NIC
|
|
|
|
|
.BS 1 FLAGS
|
|
|
|
|
.BS 1 LINK
|
|
|
|
|
.BS 1 SPEED
|
|
|
|
|
.HS 000E3A123456 MAC
|
2018-08-25 11:23:59 +00:00
|
|
|
|
.BS 12 IP/MASK/GW
|
2018-07-23 06:28:47 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
DRV.END
|
2015-03-14 21:48:35 +00:00
|
|
|
|
MAN
|
2017-03-29 15:48:15 +00:00
|
|
|
|
SAVE /A2OSX.SRC/DRV/UTHERNET.DRV.S
|
2015-03-14 21:48:35 +00:00
|
|
|
|
ASM
|