Kernel version 0.9 : TCPIP stack reorg

This commit is contained in:
Rémy GIBERT 2017-01-29 22:47:19 +01:00
parent d736762046
commit 1867933ae8
21 changed files with 365 additions and 438 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -47,40 +47,75 @@ CS.INIT >LDYA L.LIBTCPIP
>SYSCALL LoadLibYA >SYSCALL LoadLibYA
sta hLIBTCPIP sta hLIBTCPIP
>SYSCALL GetArgC lda (pPs)
ora #S.PS.F.EVENT Now accept events
sta (pPs)
clc
rts
*--------------------------------------
CS.RUN >SYSCALL GetArgC
cmp #1 cmp #1
beq CS.INIT.DUMP bne .1
jmp CS.RUN.DUMP
>PUSHW L.DST.IP .1 >PUSHW L.DST.IP
>PUSHW L.SSCANF.IP >PUSHW L.SSCANF.IP
lda #1 lda #1
>SYSCALL GetArgA >SYSCALL GetArgA
>PUSHYA >PUSHYA
>SYSCALL SSCANF >SYSCALL SSCANF
bcc CS.RUN.QUERY
bcs .9
stz bCTRLC
lda (pPs)
ora #S.PS.F.EVENT Now accept events
sta (pPs)
rts CC,Give back control to CS.RUN
.9 lda #SYSMGR.ERRSYN lda #SYSMGR.ERRSYN
sec sec
rts rts
*-------------------------------------- *--------------------------------------
CS.INIT.DUMP >LIBCALL hLIBTCPIP,LIBTCPIP.ARP.GETCACHE CS.RUN.QUERY jsr Init.Timeout
.1 >PUSHW L.DST.MAC
>PUSHW L.DST.IP
>LIBCALL hLIBTCPIP,LIBTCPIP.ARP.QUERY
bcc .2 success, print & exit
jsr Wait.TimeOut
bcs .9
>SYSCALL Sleep
>SYSCALL GetC
bcs .1
cmp #3
beq .8
bra .1
.2 ldx #5
.3 >PUSHB DST.MAC,x
dex
bpl .3
ldx #3
.4 >PUSHB DST.IP,x
dex
bpl .4
>LDYA L.MSG2
>SYSCALL CPrintFYA
.8 lda #0
.9 sec
rts
*--------------------------------------
CS.RUN.DUMP >LIBCALL hLIBTCPIP,LIBTCPIP.ARP.GETCACHE
>STYA ZPPTR1 >STYA ZPPTR1
>LDYA L.MSG0 >LDYA L.MSG0
>SYSCALL CPrintFYA >SYSCALL CPrintFYA
ldx #K.ARPCACHE.SIZE ldx #K.ARPCACHE.SIZE
.1 lda (ZPPTR1) .1 lda (ZPPTR1)
beq .4 * beq .4
ldy #S.ARPCACHE.IP+4 ldy #S.ARPCACHE.IP+4
.2 dey .2 dey
@ -119,42 +154,8 @@ CS.INIT.DUMP >LIBCALL hLIBTCPIP,LIBTCPIP.ARP.GETCACHE
sec we do not want to stay in memory sec we do not want to stay in memory
rts rts
*-------------------------------------- *--------------------------------------
CS.RUN jsr Init.Timeout
.1 lda bCTRLC
bne .9
>PUSHW L.DST.MAC
>PUSHW L.DST.IP
>LIBCALL hLIBTCPIP,LIBTCPIP.ARP.QUERY
bcc .2 success, print & exit
jsr Wait.TimeOut
bcs .9
>SYSCALL Sleep
bra .1
.2 ldx #5
.3 >PUSHB DST.MAC,x
dex
bpl .3
ldx #3
.4 >PUSHB DST.IP,x
dex
bpl .4
>LDYA L.MSG2
>SYSCALL CPrintFYA
lda #0
.9 sec
rts
*--------------------------------------
CS.DOEVENT lda (pEvent) CS.DOEVENT lda (pEvent)
bpl .1 is it a TIMER event? bpl .9 is it a TIMER event?
ldy #TimeOut ldy #TimeOut
lda (pData),y lda (pData),y
@ -163,30 +164,6 @@ CS.DOEVENT lda (pEvent)
sta (pData),y sta (pData),y
.9 sec do not discard TIMER event .9 sec do not discard TIMER event
rts rts
.1 lda (pEvent)
and #S.EVT.F.KEY is it a KEY event?
beq .9
ldy #S.EVT.hDEV is Event from active IN device?
lda (pEvent),y
ldy #S.PS.hStdIn
cmp (pPs),y
bne .9
ldy #S.EVT.DATAHI is it an O or SAPPLE key ?
lda (pEvent),y
bne .9
ldy #S.EVT.DATALO
lda (pEvent),y
cmp #$03 Ctrl-C
bne .9
lda #$FF
sta bCTRLC
clc
rts
*-------------------------------------- *--------------------------------------
CS.QUIT lda hLIBTCPIP CS.QUIT lda hLIBTCPIP
>SYSCALL UnloadLibA >SYSCALL UnloadLibA
@ -202,9 +179,6 @@ Wait.TimeOut sec
ldy #TimeOut ldy #TimeOut
lda (pData),y lda (pData),y
beq .9 beq .9
ldy #bCTRLC
lda (pData),y
bmi .9
clc clc
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
@ -220,7 +194,6 @@ hLIBTCPIP .BS 1
DST.IP .BS 4 DST.IP .BS 4
DST.MAC .BS 6 DST.MAC .BS 6
TimeOut .BS 1 TimeOut .BS 1
bCTRLC .BS 1
DS.END DS.END
*-------------------------------------- *--------------------------------------
MAN MAN

View File

@ -44,11 +44,17 @@ CS.INIT >LDYA L.LIBTCPIP
>SYSCALL LoadLibYA >SYSCALL LoadLibYA
sta hLIBTCPIP sta hLIBTCPIP
>SYSCALL GetArgC .8 lda (pPs)
cmp #1 ora #S.PS.F.EVENT Now accept events
beq CS.INIT.DUMP sta (pPs)
clc
rts
*-------------------------------------- *--------------------------------------
CS.INIT.ADD cmp #3 CS.RUN >SYSCALL GetArgC
cmp #1
beq CS.RUN.DUMP
CS.RUN.ADD cmp #3
bne .9 bne .9
>PUSHW L.IP >PUSHW L.IP
@ -73,8 +79,8 @@ CS.INIT.ADD cmp #3
.9 lda #SYSMGR.ERRSYN .9 lda #SYSMGR.ERRSYN
sec sec
.99 rts .99 rts
*--------------------------------------
CS.INIT.DUMP >LIBCALL hLIBTCPIP,LIBTCPIP.DNS.GETCACHE CS.RUN.DUMP >LIBCALL hLIBTCPIP,LIBTCPIP.DNS.GETCACHE
>STYA ZPPTR1 >STYA ZPPTR1
>LDYA L.MSG0 >LDYA L.MSG0
>SYSCALL CPrintFYA >SYSCALL CPrintFYA
@ -128,8 +134,7 @@ CS.INIT.DUMP >LIBCALL hLIBTCPIP,LIBTCPIP.DNS.GETCACHE
sec we do not want to stay in memory sec we do not want to stay in memory
rts rts
*-------------------------------------- *--------------------------------------
CS.RUN CS.EVENT sec
CS.EVENT clc
rts rts
*-------------------------------------- *--------------------------------------
CS.QUIT lda hLIBTCPIP CS.QUIT lda hLIBTCPIP

View File

@ -14,8 +14,8 @@ AUTO 6
*-------------------------------------- *--------------------------------------
TIMEOUT.MAX .EQ 20 2 sec. TIMEOUT.MAX .EQ 20 2 sec.
*-------------------------------------- *--------------------------------------
ZPFrameBase1 .EQ ZPBIN ZPFrameBase .EQ ZPBIN
ZPFrameLen1 .EQ ZPBIN+2 ZPFrameLen .EQ ZPBIN+2
ZPFramePtr1 .EQ ZPBIN+4 ZPFramePtr1 .EQ ZPBIN+4
ZPIPCfgPtr .EQ ZPBIN+6 ZPIPCfgPtr .EQ ZPBIN+6
*-------------------------------------- *--------------------------------------
@ -83,7 +83,8 @@ CS.INIT >SYSCALL GetArgC
sta (pPs) sta (pPs)
clc clc
.9 rts .9 sec
rts
*-------------------------------------- *--------------------------------------
CS.RUN jsr Init.Timeout CS.RUN jsr Init.Timeout
@ -121,16 +122,16 @@ CS.RUN jsr Init.Timeout
>SYSCALL CPrintFYA >SYSCALL CPrintFYA
CS.RUN.ECHO >LIBCALL hLIBTCPIP,LIBTCPIP.NEW.ICMP.FRAME CS.RUN.ECHO >LIBCALL hLIBTCPIP,LIBTCPIP.NEW.ICMP.FRAME
>STYA ZPFrameBase1 >STYA ZPFrameBase
txa txa
ldy #hFrame ldy #hFrame
sta (pData),y sta (pData),y
lda #S.ICMP+32-2 lda #S.ICMP+32-2
sta (ZPFrameBase1) sta (ZPFrameBase)
lda /S.ICMP+32-2 lda /S.ICMP+32-2
ldy #1 ldy #1
sta (ZPFrameBase1),y sta (ZPFrameBase),y
ldx #3 ldx #3
ldy #0 ldy #0
@ -143,14 +144,14 @@ CS.RUN.ECHO >LIBCALL hLIBTCPIP,LIBTCPIP.NEW.ICMP.FRAME
ldx #3 ldx #3
ldy #S.IP.DST+3 ldy #S.IP.DST+3
.1 pla .1 pla
sta (ZPFrameBase1),y sta (ZPFrameBase),y
dey dey
dex dex
bpl .1 bpl .1
ldy #S.ICMP.TYPE ldy #S.ICMP.TYPE
lda #S.ICMP.TYPE.ECHOREQ lda #S.ICMP.TYPE.ECHOREQ
sta (ZPFrameBase1),y sta (ZPFrameBase),y
ldy #Identifier ldy #Identifier
lda (pData),y lda (pData),y
@ -159,10 +160,10 @@ CS.RUN.ECHO >LIBCALL hLIBTCPIP,LIBTCPIP.NEW.ICMP.FRAME
lda (pData),y lda (pData),y
ldy #S.ICMP.IDENTIFIER+1 ldy #S.ICMP.IDENTIFIER+1
sta (ZPFrameBase1),y sta (ZPFrameBase),y
dey dey
txa txa
sta (ZPFrameBase1),y sta (ZPFrameBase),y
ldy #Sequence+1 ldy #Sequence+1
lda (pData),y lda (pData),y
@ -179,17 +180,17 @@ CS.RUN.ECHO >LIBCALL hLIBTCPIP,LIBTCPIP.NEW.ICMP.FRAME
pla pla
.2 ldy #S.ICMP.SEQUENCE .2 ldy #S.ICMP.SEQUENCE
sta (ZPFrameBase1),y sta (ZPFrameBase),y
iny iny
txa txa
sta (ZPFrameBase1),y sta (ZPFrameBase),y
ldx #31 ldx #31
ldy #S.ICMP+31 ldy #S.ICMP+31
.21 txa .21 txa
and #$0f and #$0f
ora #$60 ora #$60
sta (ZPFrameBase1),y sta (ZPFrameBase),y
dey dey
dex dex
bpl .21 bpl .21
@ -263,63 +264,31 @@ CS.DOEVENT lda (pEvent)
dec dec
sta (pData),y sta (pData),y
sec do not discard TIMER event .9 sec do not discard TIMER event
rts rts
*--------------------------------------
.1 lda (pEvent)
and #S.EVT.F.KEY is it a KEY event?
beq .2
ldy #S.EVT.hDEV is Event from active IN device?
lda (pEvent),y
ldy #S.PS.hStdIn
cmp (pPs),y
bne .9
ldy #S.EVT.DATAHI is it an O or SAPPLE key ?
lda (pEvent),y
bne .9
ldy #S.EVT.DATALO
lda (pEvent),y
cmp #$03 Ctrl-C
bne .8
lda #$FF
ldy #bCTRLC
sta (pData),y
bra .8
.2 lda (pEvent)
and #S.EVT.F.NET
beq .9
ldy #S.EVT.hDEV
lda (pEvent),y
cmp hDev
bne .9
ldy #S.EVT.DATALO Get Frame hMem ldy #S.EVT.DATALO Get Frame hMem
lda (pEvent),y lda (pEvent),y
>SYSCALL GetMemPtrA >SYSCALL GetMemPtrA
>STYA ZPFrameBase1 >STYA ZPFrameBase
ldy #S.IP.PROTOCOL ldy #S.IP.PROTOCOL
lda (ZPFrameBase1),y lda (ZPFrameBase),y
cmp #S.IP.PROTOCOL.ICMP cmp #S.IP.PROTOCOL.ICMP
bne .9 bne .9
ldy #S.ICMP.TYPE ldy #S.ICMP.TYPE
lda (ZPFrameBase1),y lda (ZPFrameBase),y
cmp #S.ICMP.TYPE.ECHOREP cmp #S.ICMP.TYPE.ECHOREP
bne .9 bne .9
ldy #S.ICMP.IDENTIFIER ldy #S.ICMP.IDENTIFIER
lda (ZPFrameBase1),y lda (ZPFrameBase),y
tax tax
iny iny
lda (ZPFrameBase1),y lda (ZPFrameBase),y
ldy #Identifier+1 ldy #Identifier+1
cmp (pData),y cmp (pData),y
bne .9 bne .9
@ -357,21 +326,21 @@ CS.EVENT.REPLY lda #TIMEOUT.MAX
.3 >PUSHW TimeOut.ms .3 >PUSHW TimeOut.ms
ldy #S.IP.TTL ldy #S.IP.TTL
>PUSHB (ZPFrameBase1),y >PUSHB (ZPFrameBase),y
ldy #S.ICMP.SEQUENCE+1 ldy #S.ICMP.SEQUENCE+1
>PUSHB (ZPFrameBase1),y >PUSHB (ZPFrameBase),y
dey dey
>PUSHB (ZPFrameBase1),y >PUSHB (ZPFrameBase),y
ldy #S.IP.SRC+3 ldy #S.IP.SRC+3
>PUSHB (ZPFrameBase1),y >PUSHB (ZPFrameBase),y
dey dey
>PUSHB (ZPFrameBase1),y >PUSHB (ZPFrameBase),y
dey dey
>PUSHB (ZPFrameBase1),y >PUSHB (ZPFrameBase),y
dey dey
>PUSHB (ZPFrameBase1),y >PUSHB (ZPFrameBase),y
>LDYA L.MSG3 >LDYA L.MSG3
>SYSCALL CPrintFYA >SYSCALL CPrintFYA
@ -396,9 +365,7 @@ Wait.TimeOut sec
ldy #TimeOut ldy #TimeOut
lda (pData),y lda (pData),y
beq .9 beq .9
ldy #bCTRLC
lda (pData),y
bmi .9
clc clc
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
@ -420,7 +387,6 @@ hFrame .BS 1
TimeOut .BS 1 TimeOut .BS 1
Identifier .BS 2 Identifier .BS 2
Sequence .BS 2 Sequence .BS 2
bCTRLC .BS 1
bReply .BS 1 bReply .BS 1
DS.END DS.END
.ED .ED

View File

@ -156,7 +156,7 @@ CS.RUN jsr Init.Timeout
rts rts
*-------------------------------------- *--------------------------------------
CS.DOEVENT lda (pEvent) CS.DOEVENT lda (pEvent)
bpl .1 is it a TIMER event? bpl .9 is it a TIMER event?
ldy #TimeOut ldy #TimeOut
lda (pData),y lda (pData),y
@ -165,32 +165,6 @@ CS.DOEVENT lda (pEvent)
sta (pData),y sta (pData),y
.9 sec do not discard TIMER event .9 sec do not discard TIMER event
rts rts
.1 bit #S.EVT.F.KEY is it a KEY event?
beq .8
ldy #S.EVT.hDEV is Event from active IN device?
lda (pEvent),y
ldy #S.PS.hStdIn
cmp (pPs),y
bne .9
ldy #S.EVT.DATAHI is it an O or SAPPLE key ?
lda (pEvent),y
bne .9
ldy #S.EVT.DATALO
lda (pEvent),y
cmp #$03 Ctrl-C
bne .8
lda #$FF
ldy #bCTRLC
sta (pData),y
bra .8
.8 clc
rts
*-------------------------------------- *--------------------------------------
CS.QUIT ldy #hSocket CS.QUIT ldy #hSocket
lda (pData),y lda (pData),y
@ -212,9 +186,6 @@ Wait.TimeOut sec
ldy #TimeOut ldy #TimeOut
lda (pData),y lda (pData),y
beq .9 beq .9
ldy #bCTRLC
lda (pData),y
bmi .9
clc clc
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
@ -297,7 +268,6 @@ DS.START
hSocket .BS 1 hSocket .BS 1
hFrame .BS 1 hFrame .BS 1
TimeOut .BS 1 TimeOut .BS 1
bCTRLC .BS 1
DS.END DS.END
.ED .ED
*-------------------------------------- *--------------------------------------

View File

@ -11,7 +11,6 @@ AUTO 6
.INB /A2OSX.DEV/INC/MACROS.I .INB /A2OSX.DEV/INC/MACROS.I
.INB /A2OSX.DEV/INC/A2OSX.I .INB /A2OSX.DEV/INC/A2OSX.I
.INB /A2OSX.DEV/INC/LIBTCPIP.I .INB /A2OSX.DEV/INC/LIBTCPIP.I
.INB /A2OSX.DEV/INC/PRODOS.I
*-------------------------------------- *--------------------------------------
ZPTmpPTR .EQ ZPDRV ZPTmpPTR .EQ ZPDRV
*-------------------------------------- *--------------------------------------
@ -71,7 +70,7 @@ Dev.Detect >STYA ARGS
>LDYA L.MSG.DETECT.KO >LDYA L.MSG.DETECT.KO
>SYSCALL CPrintFYA >SYSCALL CPrintFYA
lda #MLI.ERR.NODEV lda #$28 MLI.ERR.NODEV
sec sec
rts rts
@ -154,7 +153,7 @@ DRV.CS.START cld
L.DEVSTAT .DA DEVSTAT L.DEVSTAT .DA DEVSTAT
.DA 0 end or relocation .DA 0 end or relocation
*-------------------------------------- *--------------------------------------
BADCALL lda #MLI.ERR.BADCALL BADCALL lda #1 MLI.ERR.BADCALL
sec sec
rts rts
*-------------------------------------- *--------------------------------------
@ -212,16 +211,17 @@ READBLOCK.RxOK and /PP.RxEvent.Brdcast
adc #2 adc #2
tay tay
pla pla
bcc .11 adc #2
inc
.11 >PUSHYA Size+2 >PUSHYA Size+2
>PUSHBI 0 >PUSHBI 0
>SYSCALL GetMem >SYSCALL GetMem
bcs READBLOCK.Err bcs READBLOCK.Err
>STYA ZPTmpPTR >STYA ZPTmpPTR
stx .8+1 stx .8+1
sty .8+3
sta .8+5
lda Size lda Size
sta (ZPTmpPTR) sta (ZPTmpPTR)
eor #$ff eor #$ff
@ -259,8 +259,9 @@ READBLOCK.RxOK and /PP.RxEvent.Brdcast
inc ZPTmpPTR+1 inc ZPTmpPTR+1
bne .1 bne .1
.8 lda #$ff hMem .8 ldx #$ff hMem
ldy #$00 Flags ldy #$ff PtrLO
lda #$ff PtrHI
clc clc
rts rts
*-------------------------------------- *--------------------------------------

View File

@ -49,7 +49,7 @@ LIBTCPIP.DNS.QUERY .EQ 42
LIBTCPIP.DNS.ADD .EQ 44 LIBTCPIP.DNS.ADD .EQ 44
LIBTCPIP.DNS.GETCACHE .EQ 46 LIBTCPIP.DNS.GETCACHE .EQ 46
LIBTCPIP.RCVD.FRAMEA .EQ 48 LIBTCPIP.POLL .EQ 48
LIBTCPIP.PULSEA .EQ 50 LIBTCPIP.PULSEA .EQ 50
LIBTCPIP.SKT.NEW .EQ 52 LIBTCPIP.SKT.NEW .EQ 52
@ -133,6 +133,7 @@ S.DNSCACHE .EQ 12
S.SOCKET.SOCK .EQ 0 S.SOCKET.SOCK .EQ 0
S.SOCKET.SOCK.DGRAM .EQ 1 S.SOCKET.SOCK.DGRAM .EQ 1
S.SOCKET.SOCK.STREAM .EQ 2 S.SOCKET.SOCK.STREAM .EQ 2
S.SOCKET.SOCK.RAW .EQ 3
S.SOCKET.SO .EQ 1 S.SOCKET.SO .EQ 1
S.SOCKET.SO.DEBUG .EQ $01 S.SOCKET.SO.DEBUG .EQ $01
@ -180,6 +181,11 @@ S.SOCKET.SQ.HEAD .EQ 20
S.SOCKET.SQ.TAIL .EQ 22 S.SOCKET.SQ.TAIL .EQ 22
S.SOCKET.SQ.SEQNUM .EQ 24 S.SOCKET.SQ.SEQNUM .EQ 24
S.SOCKET.SQ.ACKNUM .EQ 28 S.SOCKET.SQ.ACKNUM .EQ 28
* Raw Type Queue
S.SOCKET.RQ.HEAD .EQ 16
S.SOCKET.RQ.TAIL .EQ 17
S.SOCKET.RQ .EQ 18
S.SOCKET.RQ.MAX .EQ 14 14 hMem (frames)
* *
S.SOCKET .EQ 32 S.SOCKET .EQ 32
*-------------------------------------- *--------------------------------------

View File

@ -1,14 +1,13 @@
PR#3 PR#3
PREFIX /A2OSX.SRC PREFIX /A2OSX.SRC
NEW LOMEM $A00
INC 1 INC 1
AUTO 6 AUTO 6
.LIST OFF .LIST OFF
*-------------------------------------- *--------------------------------------
ARP.CLEAR ldx #K.ARPCACHE.SIZE*S.ARPCACHE ARP.CLEAR ldx #K.ARPCACHE.SIZE*S.ARPCACHE
.1 dex .1 stz ARP.CACHE-1,x
stz ARP.CACHE,x dex
txa
bne .1 bne .1
clc clc
rts rts
@ -93,28 +92,30 @@ ARP.GETCACHE >LDYA L.ARP.CACHE
ARP.IN ldy #S.ARP.TPA+3 ARP.IN ldy #S.ARP.TPA+3
ldx #3 ldx #3
.1 lda (ZPFrameBase1),y .1 lda (ZPFrameBase),y
cmp IPCFG+S.IPCFG.IP,x cmp IPCFG+S.IPCFG.IP,x
bne .9 bne ARP.IN.EXIT
dey dey
dex dex
bpl .1 bpl .1
ldy #S.ARP.OPERATION+1 HI byte ldy #S.ARP.OPERATION+1 HI byte
lda (ZPFrameBase1),y lda (ZPFrameBase),y
cmp #S.ARP.OPERATION.REQ cmp #S.ARP.OPERATION.REQ
beq ARP.IN.REQ beq ARP.IN.REQ
cmp #S.ARP.OPERATION.REP cmp #S.ARP.OPERATION.REP
beq ARP.IN.REP beq ARP.IN.REP
.9 clc Discard any other ARP frames ARP.IN.EXIT lda hFrameIn
>SYSCALL FreeMemA
clc
rts rts
ARP.IN.REQ ldy #S.ARP.SPA+3 ARP.IN.REQ ldy #S.ARP.SPA+3
ldx #3 ldx #3
.1 lda (ZPFrameBase1),y .1 lda (ZPFrameBase),y
sta ARP.REP.TPA,x sta ARP.REP.TPA,x
dey dey
dex dex
@ -123,7 +124,7 @@ ARP.IN.REQ ldy #S.ARP.SPA+3
ldy #S.ARP.SHA+5 ldy #S.ARP.SHA+5
ldx #5 ldx #5
.2 lda (ZPFrameBase1),y .2 lda (ZPFrameBase),y
sta ARP.REP.DSTMAC,x sta ARP.REP.DSTMAC,x
sta ARP.REP.THA,x sta ARP.REP.THA,x
dey dey
@ -133,6 +134,7 @@ ARP.IN.REQ ldy #S.ARP.SPA+3
>LDYA L.ARP.REP >LDYA L.ARP.REP
ldx #DEVMGR.WRITEBLOCK ldx #DEVMGR.WRITEBLOCK
jsr NetDevJmp jsr NetDevJmp
bra ARP.IN.EXIT
ARP.IN.REP lda #K.ARP.TTL ARP.IN.REP lda #K.ARP.TTL
sta ARP.TmpCache+S.ARPCACHE.TTL sta ARP.TmpCache+S.ARPCACHE.TTL
@ -142,7 +144,7 @@ ARP.IN.REP lda #K.ARP.TTL
ldy #S.ARP.SPA+3 ldy #S.ARP.SPA+3
ldx #3 ldx #3
.1 lda (ZPFrameBase1),y .1 lda (ZPFrameBase),y
sta ARP.TmpCache+S.ARPCACHE.IP,x sta ARP.TmpCache+S.ARPCACHE.IP,x
dey dey
dex dex
@ -151,7 +153,7 @@ ARP.IN.REP lda #K.ARP.TTL
ldy #S.ARP.SHA+5 ldy #S.ARP.SHA+5
ldx #5 ldx #5
.2 lda (ZPFrameBase1),y .2 lda (ZPFrameBase),y
sta ARP.TmpCache+S.ARPCACHE.MAC,x sta ARP.TmpCache+S.ARPCACHE.MAC,x
dey dey
dex dex
@ -160,8 +162,7 @@ ARP.IN.REP lda #K.ARP.TTL
lda #S.ARPCACHE.STATUS.RESOLVED lda #S.ARPCACHE.STATUS.RESOLVED
jsr ARP.ADD.I jsr ARP.ADD.I
clc jmp ARP.IN.EXIT
rts
*-------------------------------------- *--------------------------------------
ARP.QUERY.I jsr ARP.FIND.BY.IP ARP.QUERY.I jsr ARP.FIND.BY.IP
bcs .3 send an ARP request bcs .3 send an ARP request

View File

@ -368,36 +368,36 @@ DNS.POLL lda hDNSSocket1
.8 clc .8 clc
rts rts
*-------------------------------------- *--------------------------------------
DNS.DecodeMsg sta hFrame1 DNS.DecodeMsg sta hFrameIn
>SYSCALL GetMemPtrA >SYSCALL GetMemPtrA
>STYA ZPFrameBase1 >STYA ZPFrameBase
ldy #S.DNS.F+1 ldy #S.DNS.F+1
lda (ZPFrameBase1),y lda (ZPFrameBase),y
and /S.DNS.F.QR and /S.DNS.F.QR
beq .9 beq .9
ldy #S.DNS.ID ldy #S.DNS.ID
lda (ZPFrameBase1),y lda (ZPFrameBase),y
sta DNS.TmpCache+S.DNSCACHE.ID sta DNS.TmpCache+S.DNSCACHE.ID
iny iny
lda (ZPFrameBase1),y lda (ZPFrameBase),y
sta DNS.TmpCache+S.DNSCACHE.ID+1 sta DNS.TmpCache+S.DNSCACHE.ID+1
ldy #S.DNS.ANCOUNT+1 ldy #S.DNS.ANCOUNT+1
lda (ZPFrameBase1),y lda (ZPFrameBase),y
beq .9 beq .9
pha save Answer count... pha save Answer count...
ldy #S.DNS.QDCOUNT+1 ldy #S.DNS.QDCOUNT+1
lda (ZPFrameBase1),y lda (ZPFrameBase),y
ldy #S.DNS Point to DATA ldy #S.DNS Point to DATA
tax tax
beq .3 no QUERY to skip beq .3 no QUERY to skip
.1 lda (ZPFrameBase1),y .1 lda (ZPFrameBase),y
beq .2 beq .2
bpl .11 Pointer ? bpl .11 Pointer ?
iny yes, skip 2 bytes iny yes, skip 2 bytes
@ -406,7 +406,7 @@ DNS.DecodeMsg sta hFrame1
.11 tya .11 tya
sec sec
adc (ZPFrameBase1),y Skip LEN+1 bytes adc (ZPFrameBase),y Skip LEN+1 bytes
tay tay
bra .1 bra .1
@ -422,7 +422,7 @@ DNS.DecodeMsg sta hFrame1
plx get back answer count plx get back answer count
.3 lda (ZPFrameBase1),y .3 lda (ZPFrameBase),y
beq .32 beq .32
bpl .31 Pointer ? bpl .31 Pointer ?
iny yes, skip 2 bytes iny yes, skip 2 bytes
@ -431,12 +431,12 @@ DNS.DecodeMsg sta hFrame1
.31 tya .31 tya
sec sec
adc (ZPFrameBase1),y Skip LEN+1 bytes adc (ZPFrameBase),y Skip LEN+1 bytes
tay tay
bra .3 bra .3
.32 iny skip S.DNS.QTYPE HIGH .32 iny skip S.DNS.QTYPE HIGH
lda (ZPFrameBase1),y lda (ZPFrameBase),y
cmp #S.DNS.QTYPE.A cmp #S.DNS.QTYPE.A
beq .40 beq .40
@ -445,7 +445,7 @@ DNS.DecodeMsg sta hFrame1
adc #7 skip CLASS,TTL+DATALENHIGH adc #7 skip CLASS,TTL+DATALENHIGH
tay tay
sec skip DATALENLO sec skip DATALENLO
adc (ZPFrameBase1),y add DATALEN adc (ZPFrameBase),y add DATALEN
tay tay
dex dex
bne .3 bne .3
@ -457,7 +457,7 @@ DNS.DecodeMsg sta hFrame1
iny next pos iny next pos
ldx #3 ldx #3
.4 lda (ZPFrameBase1),y .4 lda (ZPFrameBase),y
sta DNS.TmpCache+S.DNSCACHE.TTL,x sta DNS.TmpCache+S.DNSCACHE.TTL,x
iny iny
dex dex
@ -467,7 +467,7 @@ DNS.DecodeMsg sta hFrame1
iny iny
ldx #0 ldx #0
.5 lda (ZPFrameBase1),y .5 lda (ZPFrameBase),y
sta DNS.TmpCache+S.DNSCACHE.IP,x sta DNS.TmpCache+S.DNSCACHE.IP,x
iny iny
inx inx
@ -476,7 +476,7 @@ DNS.DecodeMsg sta hFrame1
jsr DNS.UPDATE.BY.ID jsr DNS.UPDATE.BY.ID
.9 lda hFrame1 .9 lda hFrameIn
>SYSCALL FreeMemA >SYSCALL FreeMemA
rts rts
*-------------------------------------- *--------------------------------------

View File

@ -5,34 +5,6 @@ INC 1
AUTO 6 AUTO 6
.LIST OFF .LIST OFF
*-------------------------------------- *--------------------------------------
RCVD.FRAMEA sta hFrame1
>SYSCALL GetMemPtrA
>STYA ZPFrameBase1
jsr FRM.GetLen1
ldy #S.ETH.ETHERTYPE
lda (ZPFrameBase1),y
tax
iny
lda (ZPFrameBase1),y
cmp #S.ETH.ETHERTYPE.ARP
bne .1
cpx /S.ETH.ETHERTYPE.ARP
bne .1
jmp ARP.IN
.1 cmp #S.ETH.ETHERTYPE.IP
bne .9
cpx /S.ETH.ETHERTYPE.IP
bne .9
jmp IP.IN
.9 sec
rts
*--------------------------------------
* Out: * Out:
* Y,A = Frame PTR * Y,A = Frame PTR
* X = hMem * X = hMem
@ -41,8 +13,8 @@ NEW.ICMP.FRAME jsr NEW.IP.FRAME
bcs .9 bcs .9
ldy #S.IP.PROTOCOL ldy #S.IP.PROTOCOL
lda #S.IP.PROTOCOL.ICMP lda #S.IP.PROTOCOL.ICMP
sta (ZPFrameBase1),y sta (ZPFrameBase),y
>LDYA ZPFrameBase1 >LDYA ZPFrameBase
clc clc
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
@ -54,8 +26,8 @@ NEW.TCP.FRAME jsr NEW.IP.FRAME
bcs .9 bcs .9
ldy #S.IP.PROTOCOL ldy #S.IP.PROTOCOL
lda #S.IP.PROTOCOL.TCP lda #S.IP.PROTOCOL.TCP
sta (ZPFrameBase1),y sta (ZPFrameBase),y
>LDYA ZPFrameBase1 >LDYA ZPFrameBase
clc clc
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
@ -67,8 +39,8 @@ NEW.UDP.FRAME jsr NEW.IP.FRAME
bcs .9 bcs .9
ldy #S.IP.PROTOCOL ldy #S.IP.PROTOCOL
lda #S.IP.PROTOCOL.UDP lda #S.IP.PROTOCOL.UDP
sta (ZPFrameBase1),y sta (ZPFrameBase),y
>LDYA ZPFrameBase1 >LDYA ZPFrameBase
clc clc
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
@ -80,7 +52,7 @@ NEW.IP.FRAME >PUSHWI K.ETH.FRAME.LEN
>PUSHBI S.MEM.F.INIT0 >PUSHBI S.MEM.F.INIT0
>SYSCALL GetMem >SYSCALL GetMem
bcs .9 bcs .9
>STYA ZPFrameBase1 >STYA ZPFrameBase
lda DevFlags lda DevFlags
and #S.DEVSTAT.NET.FLAGS.IPOFFLOAD and #S.DEVSTAT.NET.FLAGS.IPOFFLOAD
@ -88,90 +60,90 @@ NEW.IP.FRAME >PUSHWI K.ETH.FRAME.LEN
ldy #S.ETH.ETHERTYPE ldy #S.ETH.ETHERTYPE
lda /S.ETH.ETHERTYPE.IP lda /S.ETH.ETHERTYPE.IP
sta (ZPFrameBase1),y sta (ZPFrameBase),y
iny iny
lda #S.ETH.ETHERTYPE.IP lda #S.ETH.ETHERTYPE.IP
sta (ZPFrameBase1),y sta (ZPFrameBase),y
ldy #S.IP.V.IHL.DSCP.ECN ldy #S.IP.V.IHL.DSCP.ECN
lda #$45 lda #$45
sta (ZPFrameBase1),y sta (ZPFrameBase),y
iny iny
lda #$0 lda #$0
sta (ZPFrameBase1),y sta (ZPFrameBase),y
ldy #S.IP.IDENTIFICATION ldy #S.IP.IDENTIFICATION
sta (ZPFrameBase1),y sta (ZPFrameBase),y
inc inc
iny iny
sta (ZPFrameBase1),y sta (ZPFrameBase),y
dec dec
ldy #S.IP.FRAGMENT.FLAGS ldy #S.IP.FRAGMENT.FLAGS
sta (ZPFrameBase1),y sta (ZPFrameBase),y
iny iny
sta (ZPFrameBase1),y sta (ZPFrameBase),y
ldy #S.IP.TTL ldy #S.IP.TTL
lda #K.IP.TTL lda #K.IP.TTL
sta (ZPFrameBase1),y sta (ZPFrameBase),y
>LDYA ZPFrameBase1 >LDYA ZPFrameBase
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
SEND.ICMP.FRAME >PULLW ZPFrameBase1 SEND.ICMP.FRAME >PULLW ZPFrameBase
jsr FRM.GetLen1 jsr FRM.GetLen
stz hFrame1 stz hFrameOut
SEND.ICMP.FRAME.I SEND.ICMP.FRAME.I
>PUSHW ZPFrameLen1 >PUSHW ZPFrameLen
>PUSHWI S.ICMP.TYPE-2 >PUSHWI S.ICMP.TYPE-2
ldy #S.ICMP.CHECKSUM ldy #S.ICMP.CHECKSUM
lda #0 lda #0
sta (ZPFrameBase1),y sta (ZPFrameBase),y
iny iny
sta (ZPFrameBase1),y sta (ZPFrameBase),y
jsr IP.ComputeChecksum jsr IP.ComputeChecksum
phy phy
ldy #S.ICMP.CHECKSUM ldy #S.ICMP.CHECKSUM
sta (ZPFrameBase1),y sta (ZPFrameBase),y
iny iny
pla pla
sta (ZPFrameBase1),y sta (ZPFrameBase),y
bra SEND.IP.FRAME.I bra SEND.IP.FRAME.I
*-------------------------------------- *--------------------------------------
SEND.TCP.FRAME >PULLW ZPFrameBase1 SEND.TCP.FRAME >PULLW ZPFrameBase
jsr FRM.GetLen1 jsr FRM.GetLen
stz hFrame1 stz hFrameOut
SEND.TCP.FRAME.I SEND.TCP.FRAME.I
bra SEND.IP.FRAME.I bra SEND.IP.FRAME.I
*-------------------------------------- *--------------------------------------
SEND.UDP.FRAME >PULLW ZPFrameBase1 SEND.UDP.FRAME >PULLW ZPFrameBase
jsr FRM.GetLen1 jsr FRM.GetLen
stz hFrame1 stz hFrameOut
SEND.UDP.FRAME.I SEND.UDP.FRAME.I
ldy #S.UDP.LENGTH+1 ldy #S.UDP.LENGTH+1
lda ZPFrameLen1 lda ZPFrameLen
sec sec
sbc #S.IP-2 sbc #S.IP-2
sta (ZPFrameBase1),y sta (ZPFrameBase),y
dey dey
lda ZPFrameLen1+1 lda ZPFrameLen+1
sbc /S.IP-2 sbc /S.IP-2
sta (ZPFrameBase1),y sta (ZPFrameBase),y
bra SEND.IP.FRAME.I bra SEND.IP.FRAME.I
*-------------------------------------- *--------------------------------------
SEND.IP.FRAME >PULLW ZPFrameBase1 SEND.IP.FRAME >PULLW ZPFrameBase
jsr FRM.GetLen1 jsr FRM.GetLen
stz hFrame1 stz hFrameOut
SEND.IP.FRAME.I ldx #3 Copy SRC.IP even if IP offload SEND.IP.FRAME.I ldx #3 Copy SRC.IP even if IP offload
ldy #S.IP.SRC+3 for proper UDP/TCP CRC calculation ldy #S.IP.SRC+3 for proper UDP/TCP CRC calculation
.1 lda IPCFG+S.IPCFG.IP,x .1 lda IPCFG+S.IPCFG.IP,x
sta (ZPFrameBase1),y sta (ZPFrameBase),y
dey dey
dex dex
bpl .1 bpl .1
@ -181,20 +153,20 @@ SEND.IP.FRAME.I ldx #3 Copy SRC.IP even if IP offload
bne .21 bne .21
ldy #S.IP.TOTAL.LENGTH+1 ldy #S.IP.TOTAL.LENGTH+1
lda ZPFrameLen1 lda ZPFrameLen
sec sec
sbc #S.ETH-2 sbc #S.ETH-2
sta (ZPFrameBase1),y sta (ZPFrameBase),y
dey dey
lda ZPFrameLen1+1 lda ZPFrameLen+1
sbc /S.ETH-2 sbc /S.ETH-2
sta (ZPFrameBase1),y sta (ZPFrameBase),y
lda #0 lda #0
ldy #S.IP.HDR.CHECKSUM ldy #S.IP.HDR.CHECKSUM
sta (ZPFrameBase1),y sta (ZPFrameBase),y
iny iny
sta (ZPFrameBase1),y sta (ZPFrameBase),y
stz IP.CHECKSUM RESET.IP.CHECKSUM stz IP.CHECKSUM RESET.IP.CHECKSUM
stz IP.CHECKSUM+1 stz IP.CHECKSUM+1
@ -204,12 +176,12 @@ SEND.IP.FRAME.I ldx #3 Copy SRC.IP even if IP offload
ldy #S.IP.V.IHL.DSCP.ECN ldy #S.IP.V.IHL.DSCP.ECN
ldx #10 10 words for IP Header ldx #10 10 words for IP Header
.2 lda (ZPFrameBase1),y .2 lda (ZPFrameBase),y
adc IP.CHECKSUM adc IP.CHECKSUM
sta IP.CHECKSUM sta IP.CHECKSUM
iny iny
lda (ZPFrameBase1),y lda (ZPFrameBase),y
adc IP.CHECKSUM+1 adc IP.CHECKSUM+1
sta IP.CHECKSUM+1 sta IP.CHECKSUM+1
iny iny
@ -220,15 +192,15 @@ SEND.IP.FRAME.I ldx #3 Copy SRC.IP even if IP offload
lda IP.CHECKSUM lda IP.CHECKSUM
adc #0 adc #0
eor #$FF eor #$FF
sta (ZPFrameBase1),y sta (ZPFrameBase),y
iny iny
lda IP.CHECKSUM+1 lda IP.CHECKSUM+1
adc #0 adc #0
eor #$FF eor #$FF
sta (ZPFrameBase1),y sta (ZPFrameBase),y
.21 ldy #S.IP.PROTOCOL .21 ldy #S.IP.PROTOCOL
lda (ZPFrameBase1),y lda (ZPFrameBase),y
cmp #S.IP.PROTOCOL.TCP cmp #S.IP.PROTOCOL.TCP
bne .3 bne .3
jsr TCP.ComputeChecksum jsr TCP.ComputeChecksum
@ -245,18 +217,18 @@ SEND.IP.FRAME.I ldx #3 Copy SRC.IP even if IP offload
jsr IP.SetDestMAC jsr IP.SetDestMAC
bcs FRM.Queue bcs FRM.Queue
.5 >LDYA ZPFrameBase1 .5 >LDYA ZPFrameBase
ldx #DEVMGR.WRITEBLOCK ldx #DEVMGR.WRITEBLOCK
jsr NetDevJmp jsr NetDevJmp
bcs FRM.Queue bcs FRM.Queue
lda hFrame1 lda hFrameOut
beq .9 beq .9
>SYSCALL FreeMemA >SYSCALL FreeMemA
clc clc
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
FRM.Queue ldy hFrame1 no hFrame, cannot queue for retry FRM.Queue ldy hFrameOut no hFrame, cannot queue for retry
beq .9 beq .9
ldx FRM.QUEUE.Head ldx FRM.QUEUE.Head
@ -272,7 +244,7 @@ FRM.Queue ldy hFrame1 no hFrame, cannot queue for retry
sta FRM.QUEUE.State,y sta FRM.QUEUE.State,y
lda #K.FRMSEND.RETRY lda #K.FRMSEND.RETRY
sta FRM.QUEUE.Retry,y sta FRM.QUEUE.Retry,y
lda hFrame1 lda hFrameOut
sta FRM.QUEUE.hMem,y sta FRM.QUEUE.hMem,y
clc clc
rts rts
@ -286,7 +258,7 @@ FRM.Retry ldx FRM.QUEUE.Tail
beq .8 Queue is empty, exit.... beq .8 Queue is empty, exit....
lda FRM.QUEUE.hMem,x lda FRM.QUEUE.hMem,x
>SYSCALL GetMemPtrA >SYSCALL GetMemPtrA
>STYA ZPFrameBase1 >STYA ZPFrameBase
ldx FRM.QUEUE.Tail ldx FRM.QUEUE.Tail
lda FRM.QUEUE.State,x lda FRM.QUEUE.State,x
@ -295,7 +267,7 @@ FRM.Retry ldx FRM.QUEUE.Tail
jsr IP.SetDestMAC Err is ARP or higher, retry getting MAC jsr IP.SetDestMAC Err is ARP or higher, retry getting MAC
bcs .2 still error getting dest MAC bcs .2 still error getting dest MAC
.1 >LDYA ZPFrameBase1 try sending again to DRV .1 >LDYA ZPFrameBase try sending again to DRV
ldx #DEVMGR.WRITEBLOCK ldx #DEVMGR.WRITEBLOCK
jsr NetDevJmp jsr NetDevJmp
bcc .3 bcc .3
@ -319,11 +291,11 @@ FRM.Retry ldx FRM.QUEUE.Tail
.8 rts .8 rts
*-------------------------------------- *--------------------------------------
FRM.GetLen1 lda (ZPFrameBase1) Get Frame Len FRM.GetLen lda (ZPFrameBase) Get Frame Len
sta ZPFrameLen1 sta ZPFrameLen
ldy #1 ldy #1
lda (ZPFrameBase1),y lda (ZPFrameBase),y
sta ZPFrameLen1+1 sta ZPFrameLen+1
rts rts
*-------------------------------------- *--------------------------------------
MAN MAN

View File

@ -6,13 +6,13 @@ AUTO 6
.LIST OFF .LIST OFF
*-------------------------------------- *--------------------------------------
ICMP.IN ldy #S.ICMP.TYPE ICMP.IN ldy #S.ICMP.TYPE
lda (ZPFrameBase1),y lda (ZPFrameBase),y
cmp #S.ICMP.TYPE.ECHOREQ cmp #S.ICMP.TYPE.ECHOREQ
bne .9 bne .9
ldy #S.IP.DST ldy #S.IP.DST
ldx #S.IPCFG.IP ldx #S.IPCFG.IP
.1 lda (ZPFrameBase1),y .1 lda (ZPFrameBase),y
cmp IPCFG,x cmp IPCFG,x
bne .9 bne .9
iny iny
@ -22,12 +22,12 @@ ICMP.IN ldy #S.ICMP.TYPE
ldy #S.ICMP.TYPE ldy #S.ICMP.TYPE
lda #S.ICMP.TYPE.ECHOREP lda #S.ICMP.TYPE.ECHOREP
sta (ZPFrameBase1),y sta (ZPFrameBase),y
ldy #S.IP.SRC+3 ldy #S.IP.SRC+3
ldx #3 ldx #3
.2 lda (ZPFrameBase1),y .2 lda (ZPFrameBase),y
sta ARP.TmpCache+S.ARPCACHE.IP,x sta ARP.TmpCache+S.ARPCACHE.IP,x
dey dey
dex dex
@ -37,7 +37,7 @@ ICMP.IN ldy #S.ICMP.TYPE
ldx #3 ldx #3
.3 lda ARP.TmpCache+S.ARPCACHE.IP,x .3 lda ARP.TmpCache+S.ARPCACHE.IP,x
sta (ZPFrameBase1),y sta (ZPFrameBase),y
dey dey
dex dex
bpl .3 bpl .3
@ -45,7 +45,7 @@ ICMP.IN ldy #S.ICMP.TYPE
ldy #S.ETH.SRCMAC+5 ldy #S.ETH.SRCMAC+5
ldx #5 ldx #5
.4 lda (ZPFrameBase1),y .4 lda (ZPFrameBase),y
sta ARP.TmpCache+S.ARPCACHE.MAC,x sta ARP.TmpCache+S.ARPCACHE.MAC,x
dey dey
dex dex
@ -59,7 +59,7 @@ ICMP.IN ldy #S.ICMP.TYPE
lda #S.ARPCACHE.STATUS.RESOLVED lda #S.ARPCACHE.STATUS.RESOLVED
jsr ARP.ADD.I jsr ARP.ADD.I
stz hFrame1 DO NOT QUEUE/DISCARD this frame,it is SOURCE frame!!! stz hFrameOut DO NOT QUEUE/DISCARD this frame,it is SOURCE frame!!!
jmp SEND.ICMP.FRAME.I jmp SEND.ICMP.FRAME.I
.9 sec .9 sec
rts rts

View File

@ -6,7 +6,7 @@ AUTO 6
.LIST OFF .LIST OFF
*-------------------------------------- *--------------------------------------
IP.IN ldy #S.IP.PROTOCOL IP.IN ldy #S.IP.PROTOCOL
lda (ZPFrameBase1),y lda (ZPFrameBase),y
cmp #S.IP.PROTOCOL.ICMP cmp #S.IP.PROTOCOL.ICMP
bne .2 bne .2
jmp ICMP.IN jmp ICMP.IN
@ -14,15 +14,14 @@ IP.IN ldy #S.IP.PROTOCOL
.2 cmp #S.IP.PROTOCOL.UDP .2 cmp #S.IP.PROTOCOL.UDP
bne .3 bne .3
jsr UDP.IN jmp UDP.IN
bcs .9
jmp DNS.POLL
.3 cmp #S.IP.PROTOCOL.TCP .3 cmp #S.IP.PROTOCOL.TCP
bne .9 bne .9
jmp TCP.IN jmp TCP.IN
.9 sec .9 lda hFrameIn
>SYSCALL FreeMemA
rts rts
*-------------------------------------- *--------------------------------------
* In: * In:
@ -34,18 +33,18 @@ IP.IN ldy #S.IP.PROTOCOL
IP.ComputeChecksum IP.ComputeChecksum
>PULLA >PULLA
clc clc
adc ZPFrameBase1 adc ZPFrameBase
sta ZPTmpPtr1 sta ZPTmpPtr1
>PULLA >PULLA
adc ZPFrameBase1+1 adc ZPFrameBase+1
sta ZPTmpPtr1+1 sta ZPTmpPtr1+1
>PULLA >PULLA
clc clc
adc ZPFrameBase1 adc ZPFrameBase
sta TmpOffset sta TmpOffset
>PULLA >PULLA
adc ZPFrameBase1+1 adc ZPFrameBase+1
sta TmpOffset+1 sta TmpOffset+1
stz IP.CHECKSUM stz IP.CHECKSUM
@ -95,10 +94,10 @@ IP.ComputeChecksum
rts rts
*-------------------------------------- *--------------------------------------
IP.SetDestMAC ldy #S.IP.DST IP.SetDestMAC ldy #S.IP.DST
lda (ZPFrameBase1),y lda (ZPFrameBase),y
iny iny
.1 and (ZPFrameBase1),y .1 and (ZPFrameBase),y
iny iny
cpy #S.IP.DST+4 cpy #S.IP.DST+4
bne .1 bne .1
@ -108,7 +107,7 @@ IP.SetDestMAC ldy #S.IP.DST
ldy #S.ETH.DSTMAC ldy #S.ETH.DSTMAC
.2 sta (ZPFrameBase1),y .2 sta (ZPFrameBase),y
iny iny
cpy #S.ETH.DSTMAC+6 cpy #S.ETH.DSTMAC+6
bne .2 bne .2
@ -119,7 +118,7 @@ IP.SetDestMAC ldy #S.IP.DST
.3 ldy #S.IP.DST+3 .3 ldy #S.IP.DST+3
ldx #3 ldx #3
.4 lda (ZPFrameBase1),y .4 lda (ZPFrameBase),y
eor IPCFG+S.IPCFG.IP,x eor IPCFG+S.IPCFG.IP,x
and IPCFG+S.IPCFG.MASK,x and IPCFG+S.IPCFG.MASK,x
bne .6 bne .6
@ -130,7 +129,7 @@ IP.SetDestMAC ldy #S.IP.DST
ldy #S.IP.DST+3 Same network, query ARP for dest IP ldy #S.IP.DST+3 Same network, query ARP for dest IP
ldx #3 ldx #3
.5 lda (ZPFrameBase1),y .5 lda (ZPFrameBase),y
sta ARP.TmpCache+S.ARPCACHE.IP,x sta ARP.TmpCache+S.ARPCACHE.IP,x
dey dey
dex dex
@ -150,7 +149,7 @@ IP.SetDestMAC ldy #S.IP.DST
ldx #5 ldx #5
ldy #S.ETH.DSTMAC+5 ldy #S.ETH.DSTMAC+5
.11 lda ARP.TmpCache+S.ARPCACHE.MAC,x .11 lda ARP.TmpCache+S.ARPCACHE.MAC,x
sta (ZPFrameBase1),y sta (ZPFrameBase),y
dey dey
dex dex
bpl .11 bpl .11

View File

@ -140,19 +140,19 @@ SKT.SEND >PULLB hSocket
*-------------------------------------- *--------------------------------------
SKT.SEND.UDP jsr NEW.UDP.FRAME SKT.SEND.UDP jsr NEW.UDP.FRAME
bcs .9 bcs .9
stx hFrame1 stx hFrameOut
lda #S.UDP-2 lda #S.UDP-2
clc clc
adc ZPDataLen adc ZPDataLen
sta (ZPFrameBase1) sta (ZPFrameBase)
sta ZPFrameLen1 sta ZPFrameLen
lda /S.UDP-2 lda /S.UDP-2
adc ZPDataLen+1 adc ZPDataLen+1
ldy #1 ldy #1
sta (ZPFrameBase1),y sta (ZPFrameBase),y
sta ZPFrameLen1+1 sta ZPFrameLen+1
ldy #S.SOCKET.SRC.PORT ldy #S.SOCKET.SRC.PORT
lda (ZPPtrSKT),y lda (ZPPtrSKT),y
@ -160,10 +160,10 @@ SKT.SEND.UDP jsr NEW.UDP.FRAME
iny iny
lda (ZPPtrSKT),y lda (ZPPtrSKT),y
ldy #S.UDP.SRCPORT ldy #S.UDP.SRCPORT
sta (ZPFrameBase1),y sta (ZPFrameBase),y
iny iny
txa txa
sta (ZPFrameBase1),y sta (ZPFrameBase),y
ldy #S.SOCKET.DST.ADDR ldy #S.SOCKET.DST.ADDR
ldx #4 ldx #4
@ -178,7 +178,7 @@ SKT.SEND.UDP jsr NEW.UDP.FRAME
ldx #4 ldx #4
.2 pla .2 pla
sta (ZPFrameBase1),y sta (ZPFrameBase),y
dey dey
dex dex
bne .2 bne .2
@ -189,17 +189,17 @@ SKT.SEND.UDP jsr NEW.UDP.FRAME
iny iny
lda (ZPPtrSKT),y lda (ZPPtrSKT),y
ldy #S.UDP.DSTPORT ldy #S.UDP.DSTPORT
sta (ZPFrameBase1),y sta (ZPFrameBase),y
iny iny
txa txa
sta (ZPFrameBase1),y sta (ZPFrameBase),y
lda #S.UDP lda #S.UDP
clc clc
adc ZPFrameBase1 adc ZPFrameBase
sta ZPTmpPtr1 sta ZPTmpPtr1
lda /S.UDP lda /S.UDP
adc ZPFrameBase1+1 adc ZPFrameBase+1
sta ZPTmpPtr1+1 sta ZPTmpPtr1+1
ldy #0 ldy #0
@ -349,7 +349,7 @@ SKT.AddToQueueD ldy #S.SOCKET.DQ.HEAD
clc clc
adc #S.SOCKET.DQ adc #S.SOCKET.DQ
tay tay
lda hFrame1 lda hFrameOut
sta (ZPPtrSKT),y sta (ZPPtrSKT),y
clc clc
rts rts

View File

@ -8,32 +8,32 @@ AUTO 6
TCP.IN ldy #S.IP.SRC+3 TCP.IN ldy #S.IP.SRC+3
ldx #3 ldx #3
.1 lda (ZPFrameBase1),y .1 lda (ZPFrameBase),y
sta TmpSocket+S.SOCKET.DST.ADDR,x sta TmpSocket+S.SOCKET.DST.ADDR,x
dey dey
dex dex
bpl .1 bpl .1
ldy #S.TCP.SRCPORT ldy #S.TCP.SRCPORT
lda (ZPFrameBase1),y lda (ZPFrameBase),y
sta TmpSocket+S.SOCKET.DST.PORT+1 sta TmpSocket+S.SOCKET.DST.PORT+1
iny iny
lda (ZPFrameBase1),y lda (ZPFrameBase),y
sta TmpSocket+S.SOCKET.DST.PORT sta TmpSocket+S.SOCKET.DST.PORT
ldy #S.IP.DST+3 ldy #S.IP.DST+3
ldx #3 ldx #3
.2 lda (ZPFrameBase1),y .2 lda (ZPFrameBase),y
sta TmpSocket+S.SOCKET.SRC.ADDR,x sta TmpSocket+S.SOCKET.SRC.ADDR,x
dey dey
dex dex
bpl .2 bpl .2
ldy #S.TCP.DSTPORT ldy #S.TCP.DSTPORT
lda (ZPFrameBase1),y lda (ZPFrameBase),y
sta TmpSocket+S.SOCKET.SRC.PORT+1 sta TmpSocket+S.SOCKET.SRC.PORT+1
iny iny
lda (ZPFrameBase1),y lda (ZPFrameBase),y
sta TmpSocket+S.SOCKET.SRC.PORT sta TmpSocket+S.SOCKET.SRC.PORT
>LDYA L.SKT.TABLE >LDYA L.SKT.TABLE
@ -61,7 +61,7 @@ TCP.IN ldy #S.IP.SRC+3
beq .5 beq .5
ldy #S.TCP.OPTIONS yes, only accept SYN packet ldy #S.TCP.OPTIONS yes, only accept SYN packet
lda (ZPFrameBase1),y lda (ZPFrameBase),y
cmp #S.TCP.OPTIONS.SYN cmp #S.TCP.OPTIONS.SYN
bne .7 not for this listening socket bne .7 not for this listening socket
jmp TCP.IN.LISTEN.NEW jmp TCP.IN.LISTEN.NEW
@ -102,7 +102,7 @@ TCP.IN.LISTEN.NEW
sec sec
.1 lda (ZPFrameBase1),y .1 lda (ZPFrameBase),y
adc #0 adc #0
sta TmpSocket+S.SOCKET.SQ.ACKNUM,x sta TmpSocket+S.SOCKET.SQ.ACKNUM,x
dey dey
@ -159,7 +159,7 @@ TCP.IN.JMP.SYNSENT
*-------------------------------------- *--------------------------------------
TCP.IN.JMP.SYNRCVD TCP.IN.JMP.SYNRCVD
ldy #S.TCP.OPTIONS only accept ACK packet ldy #S.TCP.OPTIONS only accept ACK packet
lda (ZPFrameBase1),y lda (ZPFrameBase),y
cmp #S.TCP.OPTIONS.ACK cmp #S.TCP.OPTIONS.ACK
bne .8 bne .8
@ -175,7 +175,7 @@ TCP.IN.JMP.SYNRCVD
ldx #3 ldx #3
ldy #S.TCP.ACK.NUMBER+3 ldy #S.TCP.ACK.NUMBER+3
.11 lda (ZPFrameBase1),y .11 lda (ZPFrameBase),y
cmp TmpDWord,x cmp TmpDWord,x
bne .8 bne .8
dey dey
@ -217,22 +217,22 @@ TCP.IN.JMP.SYNRCVD
*-------------------------------------- *--------------------------------------
TCP.IN.JMP.ESTBLSH TCP.IN.JMP.ESTBLSH
ldy #S.TCP.OPTIONS ldy #S.TCP.OPTIONS
lda (ZPFrameBase1),y lda (ZPFrameBase),y
cmp #S.TCP.OPTIONS.ACK cmp #S.TCP.OPTIONS.ACK
bne .3 bne .3
jsr TCP.UpdateAck jsr TCP.UpdateAck
.3 lda ZPFrameBase1 .3 lda ZPFrameBase
clc clc
adc #S.TCP adc #S.TCP
sta ZPDataPtr sta ZPDataPtr
lda ZPFrameBase1+1 lda ZPFrameBase+1
adc /S.TCP adc /S.TCP
sta ZPDataPtr+1 sta ZPDataPtr+1
ldy #S.TCP.DATAOFFSET ldy #S.TCP.DATAOFFSET
lda (ZPFrameBase1),y lda (ZPFrameBase),y
lsr lsr
lsr lsr
clc clc
@ -244,10 +244,10 @@ TCP.IN.JMP.ESTBLSH
lda ZPDataPtr lda ZPDataPtr
sec sec
sbc ZPFrameBase1 sbc ZPFrameBase
sta ZPDataLen sta ZPDataLen
lda ZPDataPtr+1 lda ZPDataPtr+1
sbc ZPFrameBase1+1 sbc ZPFrameBase+1
sta ZPDataLen+1 sta ZPDataLen+1
ldy #S.SOCKET.SQ.ACKNUM+3 ldy #S.SOCKET.SQ.ACKNUM+3
@ -285,7 +285,7 @@ TCP.IN.JMP.TIMEWT
TCP.UpdateAck ldy #S.TCP.ACK.NUMBER TCP.UpdateAck ldy #S.TCP.ACK.NUMBER
ldx #4 ldx #4
.1 lda (ZPFrameBase1),y .1 lda (ZPFrameBase),y
pha pha
iny iny
dex dex
@ -354,19 +354,19 @@ TCP.SendMSG sta TCP.MSG+S.TCP.OPTIONS
TCP.ComputeChecksum TCP.ComputeChecksum
lda #0 RESET.TCP.CHECKSUM lda #0 RESET.TCP.CHECKSUM
ldy #S.TCP.CHECKSUM ldy #S.TCP.CHECKSUM
sta (ZPFrameBase1),y sta (ZPFrameBase),y
iny iny
sta (ZPFrameBase1),y sta (ZPFrameBase),y
>LDYA ZPFrameBase1 >LDYA ZPFrameBase
>STYA ZPTmpPtr1 >STYA ZPTmpPtr1
lda ZPFrameLen1 lda ZPFrameLen
sec sec
sbc #S.IP-2 sbc #S.IP-2
sta ZPDataLen sta ZPDataLen
lda ZPFrameLen1+1 lda ZPFrameLen+1
sbc /S.IP-2 sbc /S.IP-2
sta ZPDataLen+1 sta ZPDataLen+1
@ -384,11 +384,11 @@ TCP.ComputeChecksum
ldx #4 4 words for SRC & DST IP ldx #4 4 words for SRC & DST IP
.10 lda (ZPFrameBase1),y .10 lda (ZPFrameBase),y
adc IP.CHECKSUM adc IP.CHECKSUM
sta IP.CHECKSUM sta IP.CHECKSUM
iny iny
lda (ZPFrameBase1),y lda (ZPFrameBase),y
adc IP.CHECKSUM+1 adc IP.CHECKSUM+1
sta IP.CHECKSUM+1 sta IP.CHECKSUM+1
iny iny
@ -427,12 +427,12 @@ TCP.ComputeChecksum
lda IP.CHECKSUM lda IP.CHECKSUM
adc #0 Don't forget to add last carry!!! adc #0 Don't forget to add last carry!!!
eor #$FF eor #$FF
sta (ZPFrameBase1),y sta (ZPFrameBase),y
iny iny
lda IP.CHECKSUM+1 lda IP.CHECKSUM+1
adc #0 Don't forget to add last carry!!! adc #0 Don't forget to add last carry!!!
eor #$FF eor #$FF
sta (ZPFrameBase1),y sta (ZPFrameBase),y
rts rts
*-------------------------------------- *--------------------------------------
MAN MAN

View File

@ -1,38 +1,38 @@
PR#3 PR#3
PREFIX /A2OSX.SRC PREFIX /A2OSX.SRC
NEW LOMEM $A00
INC 1 INC 1
AUTO 6 AUTO 6
.LIST OFF .LIST OFF
*-------------------------------------- *--------------------------------------
UDP.IN ldy #S.IP.SRC+3 UDP.IN ldy #S.IP.SRC+3
ldx #3 ldx #3
.1 lda (ZPFrameBase1),y .1 lda (ZPFrameBase),y
sta TmpSocket+S.SOCKET.DST.ADDR,x sta TmpSocket+S.SOCKET.DST.ADDR,x
dey dey
dex dex
bpl .1 bpl .1
ldy #S.UDP.SRCPORT ldy #S.UDP.SRCPORT
lda (ZPFrameBase1),y lda (ZPFrameBase),y
sta TmpSocket+S.SOCKET.DST.PORT+1 sta TmpSocket+S.SOCKET.DST.PORT+1
iny iny
lda (ZPFrameBase1),y lda (ZPFrameBase),y
sta TmpSocket+S.SOCKET.DST.PORT sta TmpSocket+S.SOCKET.DST.PORT
ldy #S.IP.DST+3 ldy #S.IP.DST+3
ldx #3 ldx #3
.2 lda (ZPFrameBase1),y .2 lda (ZPFrameBase),y
sta TmpSocket+S.SOCKET.SRC.ADDR,x sta TmpSocket+S.SOCKET.SRC.ADDR,x
dey dey
dex dex
bpl .2 bpl .2
ldy #S.UDP.DSTPORT ldy #S.UDP.DSTPORT
lda (ZPFrameBase1),y lda (ZPFrameBase),y
sta TmpSocket+S.SOCKET.SRC.PORT+1 sta TmpSocket+S.SOCKET.SRC.PORT+1
iny iny
lda (ZPFrameBase1),y lda (ZPFrameBase),y
sta TmpSocket+S.SOCKET.SRC.PORT sta TmpSocket+S.SOCKET.SRC.PORT
>LDYA L.SKT.TABLE >LDYA L.SKT.TABLE
@ -70,12 +70,9 @@ UDP.IN ldy #S.IP.SRC+3
bne .5 bne .5
jsr SKT.AddToQueueD jsr SKT.AddToQueueD
bcs .99 bcs .9 Q full, discard...
lda (pEvent) Make sure kernel not discard frame...
and #$FF^S.EVT.F.hMEM1 rts DO NOT Discard this queued frame
sta (pEvent)
clc ...when clearing event!!!!
rts
.7 lda ZPPtrSKT .7 lda ZPPtrSKT
clc clc
@ -88,37 +85,38 @@ UDP.IN ldy #S.IP.SRC+3
cpx #K.SKTTABLE.SIZE cpx #K.SKTTABLE.SIZE
bne .3 bne .3
.9 sec .9 lda hFrameIn
.99 rts >SYSCALL FreeMemA
rts
*-------------------------------------- *--------------------------------------
UDP.ComputeChecksum UDP.ComputeChecksum
lda #0 RESET.TCP.CHECKSUM lda #0 RESET.TCP.CHECKSUM
ldy #S.UDP.CHECKSUM ldy #S.UDP.CHECKSUM
sta (ZPFrameBase1),y sta (ZPFrameBase),y
iny iny
sta (ZPFrameBase1),y sta (ZPFrameBase),y
>LDYA ZPFrameBase1 >LDYA ZPFrameBase
>STYA ZPTmpPtr1 >STYA ZPTmpPtr1
lda ZPFrameLen1 lda ZPFrameLen
sec sec
sbc #S.IP-2 sbc #S.IP-2
sta ZPDataLen sta ZPDataLen
lda ZPFrameLen1+1 lda ZPFrameLen+1
sbc /S.IP-2 sbc /S.IP-2
sta ZPDataLen+1 sta ZPDataLen+1
clc clc
ldy #S.UDP.LENGTH ldy #S.UDP.LENGTH
lda (ZPFrameBase1),y lda (ZPFrameBase),y
* adc #0 RESERVED (all zero) * adc #0 RESERVED (all zero)
sta IP.CHECKSUM sta IP.CHECKSUM
iny iny
lda (ZPFrameBase1),y lda (ZPFrameBase),y
adc #S.IP.PROTOCOL.UDP adc #S.IP.PROTOCOL.UDP
sta IP.CHECKSUM+1 sta IP.CHECKSUM+1
@ -126,11 +124,11 @@ UDP.ComputeChecksum
ldx #4 4 words for SRC & DST IP ldx #4 4 words for SRC & DST IP
.10 lda (ZPFrameBase1),y .10 lda (ZPFrameBase),y
adc IP.CHECKSUM adc IP.CHECKSUM
sta IP.CHECKSUM sta IP.CHECKSUM
iny iny
lda (ZPFrameBase1),y lda (ZPFrameBase),y
adc IP.CHECKSUM+1 adc IP.CHECKSUM+1
sta IP.CHECKSUM+1 sta IP.CHECKSUM+1
iny iny
@ -169,12 +167,12 @@ UDP.ComputeChecksum
lda IP.CHECKSUM lda IP.CHECKSUM
adc #0 Don't forget to add last carry!!! adc #0 Don't forget to add last carry!!!
eor #$FF eor #$FF
sta (ZPFrameBase1),y sta (ZPFrameBase),y
iny iny
lda IP.CHECKSUM+1 lda IP.CHECKSUM+1
adc #0 Don't forget to add last carry!!! adc #0 Don't forget to add last carry!!!
eor #$FF eor #$FF
sta (ZPFrameBase1),y sta (ZPFrameBase),y
rts rts
*-------------------------------------- *--------------------------------------
MAN MAN

View File

@ -12,19 +12,18 @@ AUTO 6
.INB /A2OSX.DEV/INC/A2OSX.I .INB /A2OSX.DEV/INC/A2OSX.I
.INB /A2OSX.DEV/INC/LIBTCPIP.I .INB /A2OSX.DEV/INC/LIBTCPIP.I
*-------------------------------------- *--------------------------------------
ZPFrameBase1 .EQ ZPLIB ZPFrameBase .EQ ZPLIB
ZPFrameLen1 .EQ ZPLIB+2 ZPFrameLen .EQ ZPLIB+2
*ZPFramePtr1 .EQ ZPLIB+4 ZPDataPtr .EQ ZPLIB+4
ZPPtrIP .EQ ZPLIB+12 ZPDataLen .EQ ZPLIB+6
ZPPtrMAC .EQ ZPLIB+14 ZPPtrIP .EQ ZPLIB+8
ZPPtrDNS .EQ ZPLIB+16 ZPPtrMAC .EQ ZPLIB+10
ZPPtrSKT .EQ ZPLIB+18 ZPPtrDNS .EQ ZPLIB+12
ZPTmpPtr1 .EQ ZPLIB+20 ZPPtrSKT .EQ ZPLIB+14
ZPTmpPtr2 .EQ ZPLIB+22 ZPCachePtr .EQ ZPLIB+16
ZPTmpPtr3 .EQ ZPLIB+24 ZPTmpPtr1 .EQ ZPLIB+18
ZPDataPtr .EQ ZPLIB+26 ZPTmpPtr2 .EQ ZPLIB+20
ZPDataLen .EQ ZPLIB+28 ZPTmpPtr3 .EQ ZPLIB+22
ZPCachePtr .EQ ZPLIB+30
*-------------------------------------- *--------------------------------------
* File Header (16 Bytes) * File Header (16 Bytes)
*-------------------------------------- *--------------------------------------
@ -47,16 +46,16 @@ CS.START cld
.DA GET.IPCFG .DA GET.IPCFG
.DA NEW.ICMP.FRAME .DA NEW.ICMP.FRAME
.DA NEW.TCP.FRAME .DA $ffff NEW.TCP.FRAME
.DA NEW.UDP.FRAME .DA $ffff NEW.UDP.FRAME
.DA NEW.IP.FRAME .DA $ffff NEW.IP.FRAME
.DA $ffff NEW.ARP.FRAME .DA $ffff NEW.ARP.FRAME
.DA $ffff NEW.ETH.FRAME .DA $ffff NEW.ETH.FRAME
.DA SEND.ICMP.FRAME .DA SEND.ICMP.FRAME
.DA SEND.TCP.FRAME .DA $ffff SEND.TCP.FRAME
.DA SEND.UDP.FRAME .DA $ffff SEND.UDP.FRAME
.DA SEND.IP.FRAME .DA $ffff SEND.IP.FRAME
.DA $ffff SEND.ARP.FRAME .DA $ffff SEND.ARP.FRAME
.DA $ffff SEND.ETH.FRAME .DA $ffff SEND.ETH.FRAME
@ -70,7 +69,7 @@ CS.START cld
.DA DNS.ADD .DA DNS.ADD
.DA DNS.GETCACHE .DA DNS.GETCACHE
.DA RCVD.FRAMEA .DA POLL
.DA PULSEA .DA PULSEA
.DA SKT.NEW .DA SKT.NEW
@ -126,6 +125,38 @@ LIB.LOAD lda bFirstLoad
LIB.UNLOAD clc LIB.UNLOAD clc
rts rts
*-------------------------------------- *--------------------------------------
POLL ldx #DEVMGR.READBLOCK
jsr NetDevJmp
bcs .99 No Frame
stx hFrameIn
>STYA ZPFrameBase
jsr FRM.GetLen
ldy #S.ETH.ETHERTYPE
lda (ZPFrameBase),y
tax
iny
lda (ZPFrameBase),y
cmp #S.ETH.ETHERTYPE.ARP
bne .1
cpx /S.ETH.ETHERTYPE.ARP
bne .1
jmp ARP.IN
.1 cmp #S.ETH.ETHERTYPE.IP
bne .9
cpx /S.ETH.ETHERTYPE.IP
bne .9
jmp IP.IN
.9 lda hFrameIn
>SYSCALL FreeMemA
.99 rts
*--------------------------------------
* Expire = every sec * Expire = every sec
* Retry = every 100 msec * Retry = every 100 msec
*-------------------------------------- *--------------------------------------
@ -133,7 +164,9 @@ PULSEA asl
bpl .1 bpl .1
jsr ARP.EXPIRE jsr ARP.EXPIRE
jsr DNS.EXPIRE jsr DNS.EXPIRE
.1 jmp FRM.RETRY
.1 jsr DNS.POLL
jmp FRM.RETRY
*-------------------------------------- *--------------------------------------
ToLowerCaseA cmp #'A' ToLowerCaseA cmp #'A'
bcc .1 bcc .1
@ -270,7 +303,8 @@ DNS.TmpCache .BS S.DNSCACHE
ARP.TmpCache .BS S.ARP ARP.TmpCache .BS S.ARP
TmpDWord .BS 4 TmpDWord .BS 4
TmpSocket .BS S.SOCKET TmpSocket .BS S.SOCKET
hFrame1 .BS 1 hFrameIn .BS 1
hFrameOut .BS 1
hSocket .BS 1 hSocket .BS 1
TmpOffset .BS 2 TmpOffset .BS 2
HST.DecStr .BS 4 HST.DecStr .BS 4

View File

@ -148,9 +148,9 @@ note : '$VAR' does NOT expand Variable
| | | -S : Suppress repeated empty output lines | | | | | -S : Suppress repeated empty output lines | |
| EDIT | Working | still missing : find/replace | 0.9 | | EDIT | Working | still missing : find/replace | 0.9 |
| NSCUTIL | Working | Tool for setting time in NSC/DL1216E | 0.8 | | NSCUTIL | Working | Tool for setting time in NSC/DL1216E | 0.8 |
| ARP | Working | dump ARP cache, setup a static ARP entry | 0.8 | | ARP | Working | dump ARP cache, setup a static ARP entry | 0.9 |
| PING | Working | | 0.8 | | PING | Working | | 0.8 |
| DNSINFO | Working | dump DNS cache, setup a static DNS entry | | 0.8 | | DNSINFO | Working | dump DNS cache, setup a static DNS entry | | 0.9 |
| IPCONFIG | Working | renamed from NETINFO | 0.9 | | IPCONFIG | Working | renamed from NETINFO | 0.9 |
| NETSTAT | Working | | 0.9 | | NETSTAT | Working | | 0.9 |
@ -160,7 +160,7 @@ note : '$VAR' does NOT expand Variable
| ASM | In Progress | S-C MASM based multi CPU assembler | | | ASM | In Progress | S-C MASM based multi CPU assembler | |
| DEVDUMP | | | 0.8 | | DEVDUMP | | | 0.8 |
| MEMDUMP | Working | | 0.9 | | MEMDUMP | Working | | 0.9 |
| RPCDUMP | Working | tool based on UDP socket API, renamed from RPCINFO | 0.8 | | RPCDUMP | Working | tool based on UDP socket API, renamed from RPCINFO | 0.9 |
## Misc ## Misc
### S-C MASM color scheme for Notepad++ ### S-C MASM color scheme for Notepad++

View File

@ -1,6 +1,6 @@
PR#3 PR#3
PREFIX /A2OSX.SRC PREFIX /A2OSX.SRC
LOMEM $C00 LOMEM $A00
INC 1 INC 1
AUTO 6 AUTO 6
.LIST OFF .LIST OFF
@ -220,6 +220,11 @@ CS.RUN.SKT.RCVD ldy #hSocket
>STYA ZPFrameBase >STYA ZPFrameBase
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
CS.RUN.DISCARD ldy #hFrame
lda (pData),y
>SYSCALL FreeMemA
rts
*--------------------------------------
CS.DOEVENT lda (pEvent) CS.DOEVENT lda (pEvent)
bpl .9 is it a TIMER event? bpl .9 is it a TIMER event?
@ -301,10 +306,13 @@ CheckDHCPOffer jsr CheckDHCPXID
beq .8 beq .8
jsr GetDHCPOption jsr GetDHCPOption
bra .5 bra .5
.8 clc
.8 jsr CS.RUN.DISCARD
clc
rts rts
.9 sec .9 jsr CS.RUN.DISCARD
sec
rts rts
*-------------------------------------- *--------------------------------------
GetDHCPOption cmp #S.DHCP.OPTIONS.MASK GetDHCPOption cmp #S.DHCP.OPTIONS.MASK
@ -378,10 +386,12 @@ CheckDHCPAck jsr CheckDHCPXID
cmp #S.DHCP.OPTIONS.DHCPAck cmp #S.DHCP.OPTIONS.DHCPAck
bne .9 bne .9
jsr CS.RUN.DISCARD
clc clc
rts rts
.9 sec .9 jsr CS.RUN.DISCARD
sec
rts rts
*-------------------------------------- *--------------------------------------
CheckDHCPXID ldy #S.DHCP.XID+3 CheckDHCPXID ldy #S.DHCP.XID+3
@ -392,8 +402,10 @@ CheckDHCPXID ldy #S.DHCP.XID+3
dey dey
dex dex
bpl .1 bpl .1
clc clc
rts rts
.9 sec .9 sec
rts rts
*-------------------------------------- *--------------------------------------

View File

@ -148,18 +148,8 @@ CS.INIT.DEV >LDYA L.DEVNAME
.9 sec .9 sec
rts rts
*-------------------------------------- *--------------------------------------
CS.RUN ldx #DEVMGR.READBLOCK CS.RUN >LIBCALL hLIBTCPIP,LIBTCPIP.POLL
jsr NetDevJmp clc
bcs .8
sta .1+1
>LIBCALL hLIBTCPIP,LIBTCPIP.RCVD.FRAMEA
bcc .8
.1 lda #$ff
>SYSCALL FreeMemA
.8 clc
rts rts
*-------------------------------------- *--------------------------------------
CS.DOEVENT lda (pEvent) CS.DOEVENT lda (pEvent)