2015-08-05 20:38:05 +00:00
|
|
|
|
PR#3
|
|
|
|
|
PREFIX /A2OSX.SRC
|
2016-03-13 22:07:01 +00:00
|
|
|
|
LOMEM $C00
|
2015-08-05 20:38:05 +00:00
|
|
|
|
INC 1
|
|
|
|
|
AUTO 6
|
|
|
|
|
.LIST OFF
|
|
|
|
|
.OP 65C02
|
|
|
|
|
.OR $2000
|
|
|
|
|
.TF /A2OSX.BOOT/DRV/UTHERNET2.DRV
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.INB INC/MACROS.I
|
|
|
|
|
.INB INC/A2OSX.I
|
2016-01-08 16:41:11 +00:00
|
|
|
|
.INB INC/LIBTCPIP.I
|
2015-08-05 20:38:05 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
ZPTmpPTR .EQ ZPDRV
|
|
|
|
|
*--------------------------------------
|
2016-01-06 17:02:39 +00:00
|
|
|
|
.MA AR.SELECT
|
|
|
|
|
lda /W5100.AR.]1
|
2016-03-13 22:07:01 +00:00
|
|
|
|
sta W5100.AR,x
|
2016-01-06 17:02:39 +00:00
|
|
|
|
lda #W5100.AR.]1
|
2016-03-13 22:07:01 +00:00
|
|
|
|
sta W5100.AR+1,x
|
2016-01-06 17:02:39 +00:00
|
|
|
|
.EM
|
2015-08-05 20:38:05 +00:00
|
|
|
|
*--------------------------------------
|
2015-09-11 18:48:12 +00:00
|
|
|
|
* WIZnet W5100 IO Registers
|
2015-08-05 20:38:05 +00:00
|
|
|
|
*--------------------------------------
|
2016-01-10 22:16:07 +00:00
|
|
|
|
W5100.MR .EQ $C084 Mode Register
|
2016-03-31 13:42:01 +00:00
|
|
|
|
W5100.MR.RST .EQ %10000000
|
|
|
|
|
W5100.MR.PB .EQ %00010000
|
|
|
|
|
W5100.MR.PPPOE .EQ %00001000
|
|
|
|
|
W5100.MR.AI .EQ %00000010
|
|
|
|
|
W5100.MR.IND .EQ %00000001
|
2016-01-10 22:16:07 +00:00
|
|
|
|
W5100.AR .EQ $C085 Memory Pointer
|
2015-09-11 18:48:12 +00:00
|
|
|
|
W5100.AR.GAR .EQ $0001
|
|
|
|
|
W5100.AR.SUBR .EQ $0005
|
|
|
|
|
W5100.AR.SHAR .EQ $0009
|
2016-01-08 16:41:11 +00:00
|
|
|
|
W5100.AR.SIPR .EQ $000F
|
2015-09-11 18:48:12 +00:00
|
|
|
|
W5100.AR.IR .EQ $0015
|
|
|
|
|
W5100.AR.IMR .EQ $0016
|
|
|
|
|
W5100.AR.RTR .EQ $0017
|
|
|
|
|
W5100.AR.RCR .EQ $0019
|
|
|
|
|
W5100.AR.RMSR .EQ $001A
|
|
|
|
|
W5100.AR.TMSR .EQ $001B
|
|
|
|
|
W5100.AR.PATR .EQ $001C
|
|
|
|
|
W5100.AR.PTIMER .EQ $0028
|
|
|
|
|
W5100.AR.PMAGIC .EQ $0029
|
|
|
|
|
W5100.AR.UIPR .EQ $002A
|
|
|
|
|
W5100.AR.UPORT .EQ $002E
|
|
|
|
|
W5100.AR.S0.MR .EQ $0400
|
|
|
|
|
W5100.AR.S0.CR .EQ $0401
|
|
|
|
|
W5100.AR.S0.IR .EQ $0402
|
|
|
|
|
W5100.AR.S0.SR .EQ $0403
|
|
|
|
|
W5100.AR.S0.PORT .EQ $0404
|
|
|
|
|
W5100.AR.S0.DHAR .EQ $0406
|
|
|
|
|
W5100.AR.S0.DIPR .EQ $040C
|
|
|
|
|
W5100.AR.S0.DPORT .EQ $0410
|
|
|
|
|
W5100.AR.S0.MSSR .EQ $0412
|
|
|
|
|
W5100.AR.S0.PROTO .EQ $0414
|
|
|
|
|
W5100.AR.S0.TOS .EQ $0415
|
|
|
|
|
W5100.AR.S0.TTL .EQ $0416
|
|
|
|
|
W5100.AR.S0.TX.FSR .EQ $0420
|
|
|
|
|
W5100.AR.S0.TX.RD .EQ $0422
|
|
|
|
|
W5100.AR.S0.TX.WR .EQ $0424
|
|
|
|
|
W5100.AR.S0.RX.RSR .EQ $0426
|
|
|
|
|
W5100.AR.S0.RX.RD .EQ $0428
|
2016-03-31 13:42:01 +00:00
|
|
|
|
W5100.DR .EQ $C087
|
2016-01-10 22:16:07 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
RX.BASE .EQ $4000
|
|
|
|
|
TX.BASE .EQ $6000
|
|
|
|
|
RXTX.MASK .EQ $1FFF
|
2015-08-05 20:38:05 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* 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
|
|
|
|
|
.DA DEV.HEADER-CS.START Device Header Offset
|
|
|
|
|
.DA DRV.CS.START-CS.START Driver Code Offset
|
|
|
|
|
.DA DRV.CS.END-DRV.CS.START Drv Code Length
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Relocation Table
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
L.MSG.DETECT .DA MSG.DETECT
|
2016-01-04 07:29:32 +00:00
|
|
|
|
L.MSG.DETECT.OK .DA MSG.DETECT.OK
|
|
|
|
|
L.MSG.DETECT.KO .DA MSG.DETECT.KO
|
|
|
|
|
L.DEV.HEADER.NAME .DA DEV.HEADER.NAME
|
2015-08-05 20:38:05 +00:00
|
|
|
|
.DA 0 End Of Reloc Table
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
Dev.Detect sta hArgs
|
|
|
|
|
>LDYA L.MSG.DETECT
|
2016-01-04 07:29:32 +00:00
|
|
|
|
>SYSCALL SYS.PSTROutYA
|
2015-08-05 20:38:05 +00:00
|
|
|
|
|
2016-03-13 22:07:01 +00:00
|
|
|
|
ldx #$10
|
2016-01-10 22:16:07 +00:00
|
|
|
|
.1 lda #W5100.MR.RST
|
2016-03-13 22:07:01 +00:00
|
|
|
|
sta W5100.MR,x
|
2016-01-06 17:02:39 +00:00
|
|
|
|
|
|
|
|
|
lda #W5100.MR.AI+W5100.MR.IND
|
2016-03-13 22:07:01 +00:00
|
|
|
|
sta W5100.MR,x
|
2016-01-06 17:02:39 +00:00
|
|
|
|
|
2016-03-13 22:07:01 +00:00
|
|
|
|
lda W5100.MR,x
|
2016-01-06 17:02:39 +00:00
|
|
|
|
cmp #W5100.MR.AI+W5100.MR.IND
|
2016-01-10 22:16:07 +00:00
|
|
|
|
bne .2
|
|
|
|
|
|
|
|
|
|
>AR.SELECT RTR Double Check with RTR default value...
|
|
|
|
|
|
2016-03-13 22:07:01 +00:00
|
|
|
|
lda W5100.DR,x Get RTR HI
|
2016-01-10 22:16:07 +00:00
|
|
|
|
cmp /2000
|
|
|
|
|
bne .2
|
2016-03-13 22:07:01 +00:00
|
|
|
|
lda W5100.DR,x Get RTR LO
|
2016-01-10 22:16:07 +00:00
|
|
|
|
cmp #2000
|
2015-08-05 20:38:05 +00:00
|
|
|
|
beq .3
|
|
|
|
|
|
2016-01-10 22:16:07 +00:00
|
|
|
|
.2 inc DEV.HEADER.NAME+4
|
2015-08-05 20:38:05 +00:00
|
|
|
|
txa
|
|
|
|
|
clc
|
|
|
|
|
adc #$10
|
|
|
|
|
tax
|
2016-03-31 13:42:01 +00:00
|
|
|
|
bpl .1 #$80 ?
|
2015-08-05 20:38:05 +00:00
|
|
|
|
|
2016-01-10 22:16:07 +00:00
|
|
|
|
>LDYA L.MSG.DETECT.KO
|
|
|
|
|
>SYSCALL SYS.PSTROutYA
|
|
|
|
|
|
2015-08-05 20:38:05 +00:00
|
|
|
|
lda #DEVMGR.ERRNOHW
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
2016-03-13 22:07:01 +00:00
|
|
|
|
.3 stx DEVSLOTx0
|
2016-01-10 22:16:07 +00:00
|
|
|
|
|
|
|
|
|
lda hARGS
|
2016-04-01 15:57:51 +00:00
|
|
|
|
bne .4
|
2016-03-13 22:07:01 +00:00
|
|
|
|
|
2016-04-01 15:57:51 +00:00
|
|
|
|
lda #$00
|
|
|
|
|
sta MAC
|
|
|
|
|
lda #$08
|
|
|
|
|
sta MAC+1
|
|
|
|
|
lda #$DC
|
|
|
|
|
sta MAC+2
|
|
|
|
|
lda A2osX.RANDOM16
|
|
|
|
|
eor A2osX.TIMER16
|
|
|
|
|
sta MAC+3
|
|
|
|
|
eor A2osX.RANDOM16+1
|
|
|
|
|
sta MAC+4
|
|
|
|
|
eor A2osX.TIMER16+1
|
|
|
|
|
sta MAC+5
|
|
|
|
|
bra .8
|
|
|
|
|
|
|
|
|
|
.4 >SYSCALL SYS.GetMemPtrA
|
2015-08-05 20:38:05 +00:00
|
|
|
|
>STYA ZPTmpPTR
|
|
|
|
|
jsr DecodeMac
|
2016-04-01 15:57:51 +00:00
|
|
|
|
bcc .8
|
2016-01-04 07:29:32 +00:00
|
|
|
|
lda #DEVMGR.ERRICL
|
2015-08-05 20:38:05 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
2016-04-01 15:57:51 +00:00
|
|
|
|
.8 >LDYA L.MSG.DETECT.OK
|
2016-01-10 22:16:07 +00:00
|
|
|
|
>SYSCALL SYS.PSTROutYA
|
|
|
|
|
>LDYA L.DEV.HEADER.NAME
|
|
|
|
|
>SYSCALL SYS.PSTROutYA
|
|
|
|
|
lda #13
|
|
|
|
|
>SYSCALL SYS.COutA
|
|
|
|
|
clc
|
2015-08-05 20:38:05 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-03-20 22:12:57 +00:00
|
|
|
|
.INB DRV/X.NET.DRV.S
|
2015-08-05 20:38:05 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.END
|
2016-01-04 07:29:32 +00:00
|
|
|
|
MSG.DETECT >PSTRING "UtherNetII/W5100 Driver.\n"
|
|
|
|
|
MSG.DETECT.OK >PSTRING "UtherNetII/W5100 Installed As Device : "
|
|
|
|
|
MSG.DETECT.KO >PSTRING "Hardware Not Found.\n"
|
2015-08-05 20:38:05 +00:00
|
|
|
|
hArgs .BS 1
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Device Header (16 Bytes)
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
DEV.HEADER cld
|
|
|
|
|
jmp (DRV.CS.START,x)
|
|
|
|
|
.DA #S.DEV.F.SHARE+S.DEV.F.EVENT
|
2016-01-06 17:02:39 +00:00
|
|
|
|
DEV.HEADER.NAME >PSTRING "ETH1" NAME
|
2016-01-09 22:34:18 +00:00
|
|
|
|
.HS 00.00
|
2015-08-05 20:38:05 +00:00
|
|
|
|
.HS 00.00.00.00
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Driver Code
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
DRV.CS.START .DA OPEN
|
|
|
|
|
.DA GETEVENT
|
|
|
|
|
.DA $FFFF no COUT
|
|
|
|
|
.DA CLOSE
|
|
|
|
|
.DA GETINFO
|
|
|
|
|
.DA $FFFF no IRQ
|
|
|
|
|
.DA SEND
|
2016-01-10 22:16:07 +00:00
|
|
|
|
.DA SETIPCFG
|
2015-08-05 20:38:05 +00:00
|
|
|
|
L.DEVINFO .DA DEVINFO
|
|
|
|
|
.DA 0 end or relocation
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
OPEN jsr Reset
|
2016-04-01 15:57:51 +00:00
|
|
|
|
|
|
|
|
|
lda #W5100.MR.AI+W5100.MR.IND
|
|
|
|
|
sta W5100.MR,x
|
|
|
|
|
|
2016-01-06 17:02:39 +00:00
|
|
|
|
>AR.SELECT RMSR
|
|
|
|
|
lda #3 8k
|
2016-03-13 22:07:01 +00:00
|
|
|
|
sta W5100.DR,x ...for Socket0 RX Buffer
|
|
|
|
|
sta W5100.DR,x ...for Socket0 TX Buffer
|
2015-08-05 20:38:05 +00:00
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-03-13 22:07:01 +00:00
|
|
|
|
GETEVENT ldx DEVSLOTx0
|
|
|
|
|
>AR.SELECT S0.CR
|
|
|
|
|
lda W5100.DR,x
|
|
|
|
|
bne .9
|
2016-04-01 15:57:51 +00:00
|
|
|
|
|
2016-01-10 22:16:07 +00:00
|
|
|
|
>AR.SELECT S0.RX.RSR
|
2016-03-13 22:07:01 +00:00
|
|
|
|
lda W5100.DR,x get the received size HI
|
2016-04-01 15:57:51 +00:00
|
|
|
|
ora W5100.DR,x LO
|
2015-08-05 20:38:05 +00:00
|
|
|
|
bne GETEVENT.RxOK
|
2016-03-13 22:07:01 +00:00
|
|
|
|
|
2016-03-20 22:12:57 +00:00
|
|
|
|
.9 lda #ERR.DEV.NOFRAME
|
2016-04-01 15:57:51 +00:00
|
|
|
|
GETEVENT.Err sec
|
2015-08-05 20:38:05 +00:00
|
|
|
|
rts
|
2016-01-10 22:16:07 +00:00
|
|
|
|
|
2016-04-01 15:57:51 +00:00
|
|
|
|
GETEVENT.RxOK >AR.SELECT S0.RX.RD
|
2016-03-13 22:07:01 +00:00
|
|
|
|
lda W5100.DR,x get the received ptr HI
|
2016-04-01 15:57:51 +00:00
|
|
|
|
ldy W5100.DR,x get the received ptr LO
|
2016-01-10 22:16:07 +00:00
|
|
|
|
and /RXTX.MASK
|
2016-04-01 15:57:51 +00:00
|
|
|
|
ora /RX.BASE
|
2016-03-13 22:07:01 +00:00
|
|
|
|
sta W5100.AR,x
|
2016-01-10 22:16:07 +00:00
|
|
|
|
tya
|
2016-03-13 22:07:01 +00:00
|
|
|
|
sta W5100.AR+1,x
|
2016-04-01 15:57:51 +00:00
|
|
|
|
|
|
|
|
|
lda W5100.DR,x
|
|
|
|
|
sta RX.IP
|
|
|
|
|
lda W5100.DR,x
|
|
|
|
|
sta RX.IP+1
|
|
|
|
|
lda W5100.DR,x
|
|
|
|
|
sta RX.IP+2
|
|
|
|
|
lda W5100.DR,x
|
|
|
|
|
sta RX.IP+3
|
|
|
|
|
|
|
|
|
|
lda W5100.DR,x get RX.Size HI
|
|
|
|
|
sta RXTX.Size+1
|
|
|
|
|
tay
|
|
|
|
|
lda W5100.DR,x get RX.Size LO
|
|
|
|
|
sta RXTX.Size
|
|
|
|
|
|
2016-01-10 22:16:07 +00:00
|
|
|
|
clc
|
2016-04-01 15:57:51 +00:00
|
|
|
|
adc #S.IP-2
|
2016-01-10 22:16:07 +00:00
|
|
|
|
sta FRAMELEN
|
2016-04-01 15:57:51 +00:00
|
|
|
|
pha
|
|
|
|
|
tya
|
|
|
|
|
adc /S.IP-2
|
2016-01-10 22:16:07 +00:00
|
|
|
|
sta FRAMELEN+1
|
2016-04-01 15:57:51 +00:00
|
|
|
|
ply
|
|
|
|
|
iny
|
|
|
|
|
bne .10
|
|
|
|
|
inc
|
|
|
|
|
.10 iny
|
|
|
|
|
bne .11
|
|
|
|
|
inc
|
2016-01-10 22:16:07 +00:00
|
|
|
|
|
2016-04-01 15:57:51 +00:00
|
|
|
|
.11 >PUSHYA
|
2015-08-05 20:38:05 +00:00
|
|
|
|
>PUSHBI 0
|
|
|
|
|
>SYSCALL SYS.GetMem
|
2016-04-01 15:57:51 +00:00
|
|
|
|
bcs GETEVENT.Err
|
2015-08-05 20:38:05 +00:00
|
|
|
|
>STYA ZPTmpPTR
|
|
|
|
|
txa
|
|
|
|
|
ldy #S.EVT.DATALO
|
|
|
|
|
sta (pEvent),y
|
2016-03-13 22:07:01 +00:00
|
|
|
|
|
2015-08-05 20:38:05 +00:00
|
|
|
|
lda FRAMELEN
|
2016-03-13 22:07:01 +00:00
|
|
|
|
sta (ZPTmpPTR)
|
|
|
|
|
|
|
|
|
|
ldy #1
|
2015-08-05 20:38:05 +00:00
|
|
|
|
lda FRAMELEN+1
|
2016-03-13 22:07:01 +00:00
|
|
|
|
sta (ZPTmpPTR),y
|
|
|
|
|
|
2015-08-05 20:38:05 +00:00
|
|
|
|
lda #S.EVT.F.NET+S.EVT.F.hMEM1
|
|
|
|
|
sta (pEvent)
|
2016-03-13 22:07:01 +00:00
|
|
|
|
|
2016-04-01 15:57:51 +00:00
|
|
|
|
ldy #S.IP.DST+3
|
|
|
|
|
ldx #3
|
2015-08-05 20:38:05 +00:00
|
|
|
|
|
2016-04-01 15:57:51 +00:00
|
|
|
|
.1 lda RX.IP,x
|
2016-01-10 22:16:07 +00:00
|
|
|
|
sta (ZPTmpPTR),y
|
2016-04-01 15:57:51 +00:00
|
|
|
|
dey
|
|
|
|
|
dex
|
|
|
|
|
bpl .1
|
2016-01-10 22:16:07 +00:00
|
|
|
|
|
2016-04-01 15:57:51 +00:00
|
|
|
|
sec
|
|
|
|
|
lda #0
|
|
|
|
|
sbc RXTX.Size
|
|
|
|
|
sta Counter
|
|
|
|
|
lda #0
|
|
|
|
|
sbc RXTX.Size+1
|
|
|
|
|
sta Counter+1
|
2016-01-10 22:16:07 +00:00
|
|
|
|
|
2016-04-01 15:57:51 +00:00
|
|
|
|
ldx DEVSLOTx0
|
|
|
|
|
|
2016-01-10 22:16:07 +00:00
|
|
|
|
ldy #S.IP
|
2016-04-01 15:57:51 +00:00
|
|
|
|
.2
|
2016-01-10 22:16:07 +00:00
|
|
|
|
sta (ZPTmpPTR),y
|
|
|
|
|
iny
|
2016-04-01 15:57:51 +00:00
|
|
|
|
bne .3
|
2016-01-10 22:16:07 +00:00
|
|
|
|
inc ZPTmpPTR+1
|
2016-04-01 15:57:51 +00:00
|
|
|
|
|
|
|
|
|
.3 inc Counter
|
|
|
|
|
bne .2
|
|
|
|
|
inc Counter+1
|
|
|
|
|
bne .3
|
2016-01-10 22:16:07 +00:00
|
|
|
|
|
|
|
|
|
.8 >AR.SELECT S0.RX.RD
|
2016-04-01 15:57:51 +00:00
|
|
|
|
ldy W5100.DR,x Get HI
|
|
|
|
|
lda W5100.DR,x Get LO
|
2016-01-10 22:16:07 +00:00
|
|
|
|
clc
|
2016-04-01 15:57:51 +00:00
|
|
|
|
adc RXTX.Size
|
|
|
|
|
pha save LO
|
2016-01-10 22:16:07 +00:00
|
|
|
|
tya
|
2016-04-01 15:57:51 +00:00
|
|
|
|
adc RXTX.Size+1
|
|
|
|
|
and /RXTX.MASK
|
|
|
|
|
ora /RX.BASE
|
|
|
|
|
pha save HI
|
|
|
|
|
|
|
|
|
|
>AR.SELECT S0.RX.RD
|
|
|
|
|
pla
|
|
|
|
|
sta W5100.DR,x write HI
|
|
|
|
|
pla
|
|
|
|
|
sta W5100.DR,x write LO
|
2016-01-10 22:16:07 +00:00
|
|
|
|
|
|
|
|
|
>AR.SELECT S0.CR
|
|
|
|
|
lda #$40 RECV
|
2016-03-13 22:07:01 +00:00
|
|
|
|
sta W5100.DR,x
|
2016-01-10 22:16:07 +00:00
|
|
|
|
clc
|
2015-08-05 20:38:05 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CLOSE jsr Reset
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
GETINFO >LDYA L.DEVINFO
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SEND >PULLW ZPTmpPTR
|
2016-03-13 22:07:01 +00:00
|
|
|
|
|
2016-04-01 15:57:51 +00:00
|
|
|
|
ldy #S.IP.TOTAL.LENGTH+1
|
2016-03-13 22:07:01 +00:00
|
|
|
|
lda (ZPTmpPTR),y
|
|
|
|
|
sta RXTX.Size
|
2016-04-01 15:57:51 +00:00
|
|
|
|
dey
|
|
|
|
|
lda (ZPTmpPTR),y
|
|
|
|
|
sta RXTX.Size+1
|
2016-03-13 22:07:01 +00:00
|
|
|
|
|
|
|
|
|
ldx DEVSLOTx0
|
|
|
|
|
>AR.SELECT S0.TX.FSR
|
2016-04-01 15:57:51 +00:00
|
|
|
|
|
2016-03-13 22:07:01 +00:00
|
|
|
|
lda W5100.DR,x get send size HI
|
2016-04-01 15:57:51 +00:00
|
|
|
|
ldy W5100.DR,x LO
|
|
|
|
|
cpy RXTX.Size
|
2016-03-13 22:07:01 +00:00
|
|
|
|
sbc RXTX.Size+1
|
|
|
|
|
bcs SEND.READY
|
|
|
|
|
|
2016-03-20 22:12:57 +00:00
|
|
|
|
lda #ERR.DEV.NOBUFFER
|
2015-08-05 20:38:05 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
2016-03-13 22:07:01 +00:00
|
|
|
|
SEND.READY >AR.SELECT S0.DIPR
|
|
|
|
|
ldy #S.IP.DST
|
2016-01-06 17:02:39 +00:00
|
|
|
|
|
2016-03-13 22:07:01 +00:00
|
|
|
|
.1 lda (ZPTmpPTR),y
|
|
|
|
|
sta W5100.DR,x
|
2015-08-05 20:38:05 +00:00
|
|
|
|
iny
|
2016-03-13 22:07:01 +00:00
|
|
|
|
cpy #S.IP.DST+4
|
|
|
|
|
bne .1
|
|
|
|
|
|
2016-04-01 15:57:51 +00:00
|
|
|
|
>AR.SELECT S0.PROTO
|
|
|
|
|
ldy #S.IP.PROTOCOL
|
|
|
|
|
lda (ZPTmpPTR),y
|
|
|
|
|
sta W5100.DR,x
|
|
|
|
|
|
|
|
|
|
* >AR.SELECT S0.TOS
|
|
|
|
|
lda #0
|
|
|
|
|
sta W5100.DR,x
|
|
|
|
|
|
|
|
|
|
* >AR.SELECT S0.TTL
|
|
|
|
|
lda #K.IP.TTL
|
|
|
|
|
sta W5100.DR,x
|
|
|
|
|
|
2016-03-13 22:07:01 +00:00
|
|
|
|
>AR.SELECT S0.TX.WR
|
2016-04-01 15:57:51 +00:00
|
|
|
|
lda W5100.DR,x Get HI
|
|
|
|
|
ldy W5100.DR,x Get LO
|
|
|
|
|
and /RXTX.MASK
|
|
|
|
|
ora /TX.BASE
|
|
|
|
|
sta W5100.AR,x Write HI
|
|
|
|
|
tya
|
|
|
|
|
sta W5100.AR+1,x Write LO
|
|
|
|
|
|
|
|
|
|
sec
|
|
|
|
|
lda #0
|
|
|
|
|
sbc RXTX.Size
|
|
|
|
|
sta Counter
|
|
|
|
|
|
|
|
|
|
lda #0
|
|
|
|
|
sbc RXTX.Size+1
|
|
|
|
|
sta Counter+1
|
2016-03-13 22:07:01 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.IP
|
|
|
|
|
|
|
|
|
|
.2 lda (ZPTmpPTR),y
|
2016-04-01 15:57:51 +00:00
|
|
|
|
sta W5100.DR,x
|
2015-08-05 20:38:05 +00:00
|
|
|
|
iny
|
2016-04-01 15:57:51 +00:00
|
|
|
|
bne .3
|
2015-08-05 20:38:05 +00:00
|
|
|
|
inc ZPTmpPTR+1
|
2016-04-01 15:57:51 +00:00
|
|
|
|
|
|
|
|
|
.3 inc Counter
|
|
|
|
|
bne .2
|
|
|
|
|
|
|
|
|
|
inc Counter+1
|
|
|
|
|
bne .2
|
|
|
|
|
|
|
|
|
|
>AR.SELECT S0.TX.WR
|
|
|
|
|
ldy W5100.DR,x Get HI
|
|
|
|
|
lda W5100.DR,x Get LO
|
|
|
|
|
clc
|
|
|
|
|
adc RXTX.Size
|
|
|
|
|
pha save LO
|
|
|
|
|
tya
|
|
|
|
|
adc RXTX.Size+1
|
|
|
|
|
and /RXTX.MASK
|
|
|
|
|
ora /TX.BASE
|
|
|
|
|
pha save HI
|
|
|
|
|
>AR.SELECT S0.TX.WR
|
|
|
|
|
pla
|
|
|
|
|
sta W5100.DR,x write HI
|
|
|
|
|
pla
|
|
|
|
|
sta W5100.DR,x write LO
|
2016-03-13 22:07:01 +00:00
|
|
|
|
|
|
|
|
|
.8 >AR.SELECT S0.CR
|
|
|
|
|
lda #$20 SEND
|
|
|
|
|
sta W5100.DR,x
|
|
|
|
|
clc
|
|
|
|
|
rts
|
2015-08-05 20:38:05 +00:00
|
|
|
|
*--------------------------------------
|
2016-01-08 16:41:11 +00:00
|
|
|
|
SETIPCFG >PULLW ZPTmpPTR
|
|
|
|
|
|
2016-03-13 22:07:01 +00:00
|
|
|
|
ldx DEVSLOTx0
|
2016-01-08 16:41:11 +00:00
|
|
|
|
|
2016-04-01 15:57:51 +00:00
|
|
|
|
>AR.SELECT S0.CR
|
|
|
|
|
lda #10 CLOSE
|
|
|
|
|
sta W5100.DR,x
|
|
|
|
|
|
|
|
|
|
>AR.SELECT S0.MR
|
|
|
|
|
lda #3 IPRAW
|
|
|
|
|
sta W5100.DR,x
|
|
|
|
|
|
|
|
|
|
>AR.SELECT GAR
|
|
|
|
|
|
2016-01-08 16:41:11 +00:00
|
|
|
|
ldy #S.IPCFG.GW
|
|
|
|
|
.1 lda (ZPTmpPTR),y
|
2016-03-13 22:07:01 +00:00
|
|
|
|
sta W5100.DR,x
|
2016-01-08 16:41:11 +00:00
|
|
|
|
iny
|
|
|
|
|
cpy #S.IPCFG.GW+4
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
* >AR.SELECT SUBR Implicit, next to GAR
|
|
|
|
|
|
|
|
|
|
ldy #S.IPCFG.MASK
|
|
|
|
|
.2 lda (ZPTmpPTR),y
|
2016-03-13 22:07:01 +00:00
|
|
|
|
sta W5100.DR,x
|
2016-01-08 16:41:11 +00:00
|
|
|
|
iny
|
|
|
|
|
cpy #S.IPCFG.MASK+4
|
|
|
|
|
bne .2
|
|
|
|
|
|
2016-04-01 15:57:51 +00:00
|
|
|
|
* >AR.SELECT SHAR Implicit, next to SUBR
|
|
|
|
|
|
|
|
|
|
ldy #0
|
|
|
|
|
.3 lda MAC,y
|
|
|
|
|
sta W5100.DR,x
|
|
|
|
|
iny
|
|
|
|
|
cpy #6
|
|
|
|
|
bne .3
|
|
|
|
|
|
|
|
|
|
* >AR.SELECT SIPR Implicit, next to SHAR
|
2016-01-08 16:41:11 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.IPCFG.IP
|
2016-04-01 15:57:51 +00:00
|
|
|
|
.4 lda (ZPTmpPTR),y
|
2016-03-13 22:07:01 +00:00
|
|
|
|
sta W5100.DR,x
|
2016-01-08 16:41:11 +00:00
|
|
|
|
iny
|
|
|
|
|
cpy #S.IPCFG.IP+4
|
2016-04-01 15:57:51 +00:00
|
|
|
|
bne .4
|
2016-01-08 16:41:11 +00:00
|
|
|
|
|
2016-04-01 15:57:51 +00:00
|
|
|
|
>AR.SELECT S0.CR
|
|
|
|
|
lda #1 OPEN
|
|
|
|
|
sta W5100.DR,x
|
|
|
|
|
|
2016-01-08 16:41:11 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-03-13 22:07:01 +00:00
|
|
|
|
Reset ldx DEVSLOTx0
|
2016-01-06 17:02:39 +00:00
|
|
|
|
lda #W5100.MR.RST
|
2016-03-13 22:07:01 +00:00
|
|
|
|
sta W5100.MR,x
|
2015-08-05 20:38:05 +00:00
|
|
|
|
rts
|
2016-03-31 13:42:01 +00:00
|
|
|
|
*--------------------------------------
|
2015-08-05 20:38:05 +00:00
|
|
|
|
DRV.CS.END
|
2016-03-13 22:07:01 +00:00
|
|
|
|
DEVSLOTx0 .BS 1
|
2015-08-05 20:38:05 +00:00
|
|
|
|
FRAMELEN .BS 2
|
2016-04-01 15:57:51 +00:00
|
|
|
|
RX.IP .BS 4
|
2016-03-13 22:07:01 +00:00
|
|
|
|
RXTX.Size .BS 2
|
2016-04-01 15:57:51 +00:00
|
|
|
|
Counter .BS 2
|
2016-03-31 13:42:01 +00:00
|
|
|
|
*--------------------------------------
|
2015-08-05 20:38:05 +00:00
|
|
|
|
DEVINFO .DA #S.DEVINFO.TYPE.NET
|
2016-03-13 22:07:01 +00:00
|
|
|
|
DEVFLAGS .DA #S.DEVINFO.NET.FLAGS.ARPOFFLOAD
|
2015-08-05 20:38:05 +00:00
|
|
|
|
MAC .BS 6
|
2016-03-13 22:07:01 +00:00
|
|
|
|
LINK.STATUS .DA #S.DEVINFO.NET.STATUS.OK+S.DEVINFO.NET.STATUS.FD+S.DEVINFO.NET.STATUS.100
|
2015-08-05 20:38:05 +00:00
|
|
|
|
MAN
|
|
|
|
|
SAVE DRV/UTHERNET2.DRV.S
|
|
|
|
|
ASM
|