2016-01-16 22:04:22 +00:00
|
|
|
|
PR#3
|
|
|
|
|
PREFIX /A2OSX.SRC
|
2017-01-30 16:30:39 +00:00
|
|
|
|
LOMEM $A00
|
2016-01-16 22:04:22 +00:00
|
|
|
|
INC 1
|
|
|
|
|
AUTO 6
|
|
|
|
|
.LIST OFF
|
2017-01-31 16:40:37 +00:00
|
|
|
|
*/--------------------------------------
|
|
|
|
|
* #SKT.New
|
|
|
|
|
* ##In :
|
|
|
|
|
* PUSHW = PTR to S.SOCKET template
|
|
|
|
|
* ##Out :
|
|
|
|
|
* YA = PTR to new S.SOCKET
|
|
|
|
|
* X = hSocket
|
|
|
|
|
*\--------------------------------------
|
|
|
|
|
SKT.New >PULLW ZPTmpPtr1
|
2016-01-16 22:04:22 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.SOCKET.SRC.PORT+1
|
2016-03-13 22:09:00 +00:00
|
|
|
|
lda (ZPTmpPtr1),y
|
2016-01-16 22:04:22 +00:00
|
|
|
|
dey
|
2016-03-13 22:09:00 +00:00
|
|
|
|
ora (ZPTmpPtr1),y
|
2016-01-16 22:04:22 +00:00
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
jsr GetDynPort
|
2016-03-13 22:09:00 +00:00
|
|
|
|
sta (ZPTmpPtr1),y
|
2016-01-16 22:04:22 +00:00
|
|
|
|
txa
|
|
|
|
|
iny
|
2016-03-13 22:09:00 +00:00
|
|
|
|
sta (ZPTmpPtr1),y
|
2016-01-16 22:04:22 +00:00
|
|
|
|
|
|
|
|
|
.1 >LDYA L.SKT.TABLE
|
2016-03-13 22:09:00 +00:00
|
|
|
|
>STYA ZPTmpPtr2
|
2016-01-16 22:04:22 +00:00
|
|
|
|
|
2017-01-30 21:03:12 +00:00
|
|
|
|
lda #$ff
|
|
|
|
|
sta TmpOffset to keep track of any free slot
|
2016-03-13 22:09:00 +00:00
|
|
|
|
|
2016-01-16 22:04:22 +00:00
|
|
|
|
ldx #0
|
|
|
|
|
|
2016-03-13 22:09:00 +00:00
|
|
|
|
.2 lda (ZPTmpPtr2)
|
2017-01-30 21:03:12 +00:00
|
|
|
|
beq .4 empty!!!
|
|
|
|
|
|
2016-03-13 22:09:00 +00:00
|
|
|
|
cmp (ZPTmpPtr1)
|
2017-01-30 21:03:12 +00:00
|
|
|
|
bne .5 not same SKT type...try next
|
2016-01-16 22:04:22 +00:00
|
|
|
|
|
2016-03-13 22:09:00 +00:00
|
|
|
|
ldy #S.SOCKET.SRC.ADDR
|
2016-01-16 22:04:22 +00:00
|
|
|
|
|
2016-03-13 22:09:00 +00:00
|
|
|
|
.3 lda (ZPTmpPtr1),y
|
|
|
|
|
cmp (ZPTmpPtr2),y
|
2016-01-16 22:04:22 +00:00
|
|
|
|
bne .5
|
2016-03-13 22:09:00 +00:00
|
|
|
|
iny
|
|
|
|
|
cpy #S.SOCKET.DST.PORT+2
|
|
|
|
|
bne .3
|
2016-01-16 22:04:22 +00:00
|
|
|
|
|
2017-01-30 21:03:12 +00:00
|
|
|
|
lda #ERR.SKT.BUSY same one!!!!! busy...
|
2016-01-16 22:04:22 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
2017-01-30 21:03:12 +00:00
|
|
|
|
.4 lda TmpOffset
|
|
|
|
|
bpl .5 already found an empty slot....
|
|
|
|
|
|
|
|
|
|
>LDYA ZPTmpPtr2 found one...
|
|
|
|
|
>STYA ZPTmpPtr3 save it!
|
2017-01-30 16:30:39 +00:00
|
|
|
|
stx TmpOffset
|
2016-01-16 22:04:22 +00:00
|
|
|
|
|
2016-03-13 22:09:00 +00:00
|
|
|
|
.5 lda ZPTmpPtr2
|
2016-01-16 22:04:22 +00:00
|
|
|
|
clc
|
|
|
|
|
adc #S.SOCKET
|
2016-03-13 22:09:00 +00:00
|
|
|
|
sta ZPTmpPtr2
|
2016-01-16 22:04:22 +00:00
|
|
|
|
bcc .6
|
2016-03-13 22:09:00 +00:00
|
|
|
|
inc ZPTmpPtr2+1
|
2016-01-16 22:04:22 +00:00
|
|
|
|
.6 inx
|
|
|
|
|
cpx #K.SKTTABLE.SIZE
|
|
|
|
|
bne .2
|
|
|
|
|
|
2017-01-30 21:03:12 +00:00
|
|
|
|
lda TmpOffset Did we found an empty slot ?
|
|
|
|
|
bmi .9
|
2016-01-16 22:04:22 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.SOCKET-1
|
2016-03-13 22:09:00 +00:00
|
|
|
|
.7 lda (ZPTmpPtr1),y
|
|
|
|
|
sta (ZPTmpPtr3),y
|
2016-01-16 22:04:22 +00:00
|
|
|
|
dey
|
|
|
|
|
bpl .7
|
|
|
|
|
|
2016-03-16 07:19:54 +00:00
|
|
|
|
ldx TmpOffset
|
2016-03-13 22:09:00 +00:00
|
|
|
|
>LDYA ZPTmpPtr3
|
2016-01-16 22:04:22 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
2016-03-20 22:16:01 +00:00
|
|
|
|
.9 lda #ERR.SKT.OOS
|
2016-01-16 22:04:22 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-01-31 16:40:37 +00:00
|
|
|
|
SKT.ACCEPTA jsr SKT.GetA.I
|
2016-03-13 22:09:00 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
ldy #S.SOCKET.SO
|
|
|
|
|
lda (ZPPtrSKT),y
|
|
|
|
|
and #S.SOCKET.SO.ACCEPTCONN
|
|
|
|
|
bne .99
|
|
|
|
|
|
2017-01-31 16:40:37 +00:00
|
|
|
|
ldy #S.SOCKET.HQ.HEAD
|
2016-03-13 22:09:00 +00:00
|
|
|
|
lda (ZPPtrSKT),y
|
2017-01-31 16:40:37 +00:00
|
|
|
|
ldy #S.SOCKET.HQ.TAIL
|
2016-03-13 22:09:00 +00:00
|
|
|
|
cmp (ZPPtrSKT),y Queue Empty
|
|
|
|
|
beq .9 CC
|
|
|
|
|
pha
|
|
|
|
|
inc
|
2017-01-31 16:40:37 +00:00
|
|
|
|
cmp #S.SOCKET.HQ.MAX
|
2016-03-13 22:09:00 +00:00
|
|
|
|
bne .1
|
|
|
|
|
lda #0
|
|
|
|
|
.1 sta (ZPPtrSKT),y
|
|
|
|
|
pla
|
|
|
|
|
clc
|
2017-01-31 16:40:37 +00:00
|
|
|
|
adc #S.SOCKET.HQ
|
2016-03-13 22:09:00 +00:00
|
|
|
|
tay
|
|
|
|
|
lda (ZPPtrSKT),y
|
|
|
|
|
clc
|
2016-01-16 22:04:22 +00:00
|
|
|
|
rts
|
2016-03-13 22:09:00 +00:00
|
|
|
|
|
2016-03-20 22:16:01 +00:00
|
|
|
|
.99 lda #ERR.SKT.BAD
|
2016-01-16 22:04:22 +00:00
|
|
|
|
sec
|
2016-03-13 22:09:00 +00:00
|
|
|
|
.9 rts
|
2016-01-16 22:04:22 +00:00
|
|
|
|
*--------------------------------------
|
2017-01-30 16:30:39 +00:00
|
|
|
|
* SKT.Send
|
2016-01-16 22:04:22 +00:00
|
|
|
|
*--------------------------------------
|
2017-01-30 16:30:39 +00:00
|
|
|
|
SKT.Send >PULLB hSocket
|
2016-01-16 22:04:22 +00:00
|
|
|
|
pha
|
2017-01-31 16:40:37 +00:00
|
|
|
|
>PULLW ZPDataInPtr
|
|
|
|
|
>PULLW ZPDataInLen
|
2016-01-16 22:04:22 +00:00
|
|
|
|
|
|
|
|
|
pla
|
2017-01-31 16:40:37 +00:00
|
|
|
|
jsr SKT.GetA.I
|
2016-01-16 22:04:22 +00:00
|
|
|
|
bcs .9
|
2017-02-08 06:52:30 +00:00
|
|
|
|
and #S.SOCKET.SOCK.MASK
|
2017-01-31 16:40:37 +00:00
|
|
|
|
cmp #S.SOCKET.SOCK.DGRAM
|
2016-01-16 22:04:22 +00:00
|
|
|
|
beq SKT.SEND.UDP
|
|
|
|
|
|
2017-01-31 16:40:37 +00:00
|
|
|
|
cmp #S.SOCKET.SOCK.STREAM
|
2017-01-30 16:30:39 +00:00
|
|
|
|
bne .1
|
2016-03-13 22:09:00 +00:00
|
|
|
|
jmp SKT.SEND.TCP
|
2016-01-16 22:04:22 +00:00
|
|
|
|
|
2017-01-31 16:40:37 +00:00
|
|
|
|
.1 cmp #S.SOCKET.SOCK.RAW
|
2017-01-30 16:30:39 +00:00
|
|
|
|
bne .99
|
|
|
|
|
jmp SKT.SEND.RAW
|
|
|
|
|
|
2016-03-13 22:09:00 +00:00
|
|
|
|
.99 sec
|
2016-01-16 22:04:22 +00:00
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2017-01-30 16:30:39 +00:00
|
|
|
|
SKT.SEND.UDP lda #S.IP.PROTOCOL.UDP
|
|
|
|
|
jsr FRM.NewA
|
2016-01-16 22:04:22 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
2017-01-31 16:40:37 +00:00
|
|
|
|
>LDAXI S.UDP-2
|
|
|
|
|
jsr SKT.SetFrameOutLenAX
|
2016-01-16 22:04:22 +00:00
|
|
|
|
|
2017-01-31 16:40:37 +00:00
|
|
|
|
>LDAXI S.UDP
|
|
|
|
|
jsr SKT.SetDataOutPtrAX
|
|
|
|
|
|
|
|
|
|
jsr SKT.SetFrameOutDstIP
|
2016-01-16 22:04:22 +00:00
|
|
|
|
|
2017-01-31 16:40:37 +00:00
|
|
|
|
jsr SKT.SetFrameOutPorts
|
|
|
|
|
|
|
|
|
|
jsr SKT.CopyDataInToOut
|
|
|
|
|
|
|
|
|
|
jmp FRM.SendUDP
|
|
|
|
|
|
2016-01-16 22:04:22 +00:00
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2017-02-08 06:52:30 +00:00
|
|
|
|
SKT.SEND.TCP ldy #S.SOCKET.STREAM.hOutMem
|
|
|
|
|
lda (ZPPtrSKT),y
|
|
|
|
|
>SYSCALL GetMemPtrA
|
|
|
|
|
>STYA ZPTmpPtr1 Make ZPTmpPtr1=buffer base
|
2017-02-06 17:04:03 +00:00
|
|
|
|
|
2017-02-08 06:52:30 +00:00
|
|
|
|
ldy #S.SOCKET.SQ.OUTHEAD
|
|
|
|
|
lda (ZPPtrSKT),y
|
|
|
|
|
* clc
|
|
|
|
|
adc ZPDataInLen
|
|
|
|
|
tax
|
2017-02-06 17:04:03 +00:00
|
|
|
|
|
2017-02-08 06:52:30 +00:00
|
|
|
|
iny
|
|
|
|
|
lda (ZPPtrSKT),y
|
|
|
|
|
adc ZPDataInLen+1
|
2017-02-06 17:04:03 +00:00
|
|
|
|
|
2017-02-08 06:52:30 +00:00
|
|
|
|
|
|
|
|
|
clc
|
2017-02-06 17:04:03 +00:00
|
|
|
|
|
|
|
|
|
.9 rts
|
2016-01-16 22:04:22 +00:00
|
|
|
|
*--------------------------------------
|
2017-01-30 16:30:39 +00:00
|
|
|
|
SKT.SEND.RAW ldy #S.SOCKET.RAW.PROTO
|
|
|
|
|
lda (ZPPtrSKT),y
|
2017-01-31 22:13:26 +00:00
|
|
|
|
|
2017-01-30 16:30:39 +00:00
|
|
|
|
jsr FRM.NewA
|
|
|
|
|
bcs .9
|
|
|
|
|
|
2017-01-31 22:13:26 +00:00
|
|
|
|
>LDAXI S.IP-2
|
2017-01-31 16:40:37 +00:00
|
|
|
|
jsr SKT.SetFrameOutLenAX
|
|
|
|
|
|
2017-01-31 22:13:26 +00:00
|
|
|
|
>LDAXI S.IP
|
2017-01-31 16:40:37 +00:00
|
|
|
|
jsr SKT.SetDataOutPtrAX
|
2017-01-30 16:30:39 +00:00
|
|
|
|
|
2017-01-31 16:40:37 +00:00
|
|
|
|
jsr SKT.SetFrameOutDstIP
|
|
|
|
|
|
|
|
|
|
jsr SKT.CopyDataInToOut
|
|
|
|
|
|
2017-01-31 22:13:26 +00:00
|
|
|
|
ldy #S.SOCKET.RAW.PROTO
|
|
|
|
|
lda (ZPPtrSKT),y
|
|
|
|
|
cmp #S.IP.PROTOCOL.ICMP
|
|
|
|
|
bne .1
|
|
|
|
|
jmp FRM.SendICMP
|
|
|
|
|
.1 jmp FRM.SendIP
|
2017-01-30 16:30:39 +00:00
|
|
|
|
|
|
|
|
|
.9 sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-01-31 16:40:37 +00:00
|
|
|
|
SKT.RCVDA jsr SKT.GetA.I
|
2016-03-13 22:09:00 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
2017-01-31 16:40:37 +00:00
|
|
|
|
ldy #S.SOCKET.HQ.TAIL
|
2016-03-13 22:09:00 +00:00
|
|
|
|
lda (ZPPtrSKT),y
|
2016-03-27 21:06:56 +00:00
|
|
|
|
tax
|
2016-03-13 22:09:00 +00:00
|
|
|
|
|
2017-01-31 16:40:37 +00:00
|
|
|
|
ldy #S.SOCKET.HQ.HEAD
|
2016-03-13 22:09:00 +00:00
|
|
|
|
cmp (ZPPtrSKT),y
|
|
|
|
|
beq .99
|
|
|
|
|
|
|
|
|
|
inc
|
2017-01-31 16:40:37 +00:00
|
|
|
|
cmp #S.SOCKET.HQ.MAX
|
2016-03-13 22:09:00 +00:00
|
|
|
|
bne .1
|
|
|
|
|
lda #0
|
2016-03-27 21:06:56 +00:00
|
|
|
|
|
2017-01-31 16:40:37 +00:00
|
|
|
|
.1 ldy #S.SOCKET.HQ.TAIL
|
2016-03-27 21:06:56 +00:00
|
|
|
|
sta (ZPPtrSKT),y
|
|
|
|
|
|
|
|
|
|
txa
|
2016-03-13 22:09:00 +00:00
|
|
|
|
clc
|
2017-01-31 16:40:37 +00:00
|
|
|
|
adc #S.SOCKET.HQ
|
2016-03-13 22:09:00 +00:00
|
|
|
|
tay
|
|
|
|
|
lda (ZPPtrSKT),y
|
|
|
|
|
clc
|
2016-01-16 22:04:22 +00:00
|
|
|
|
rts
|
2016-03-13 22:09:00 +00:00
|
|
|
|
|
|
|
|
|
.99 sec
|
|
|
|
|
.9 rts
|
2016-01-16 22:04:22 +00:00
|
|
|
|
*--------------------------------------
|
2017-01-31 22:13:26 +00:00
|
|
|
|
SKT.CLOSEA cmp #K.SKTTABLE.SIZE
|
|
|
|
|
bcs SKT.GetA.9
|
|
|
|
|
|
|
|
|
|
jsr SKT.GetA.I
|
2016-03-13 22:09:00 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
2017-02-08 06:52:30 +00:00
|
|
|
|
and #S.SOCKET.SOCK.MASK
|
2017-01-31 16:40:37 +00:00
|
|
|
|
cmp #S.SOCKET.SOCK.DGRAM
|
2016-03-13 22:09:00 +00:00
|
|
|
|
beq .8
|
|
|
|
|
|
2017-01-31 16:40:37 +00:00
|
|
|
|
cmp #S.SOCKET.SOCK.RAW
|
2017-01-30 22:23:16 +00:00
|
|
|
|
beq .8
|
|
|
|
|
|
2016-03-13 22:09:00 +00:00
|
|
|
|
ldy #S.SOCKET.SO
|
|
|
|
|
lda (ZPPtrSKT),y
|
|
|
|
|
bit #S.SOCKET.SO.ACCEPTCONN
|
|
|
|
|
|
|
|
|
|
beq *
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.8 lda #0
|
|
|
|
|
sta (ZPPtrSKT)
|
|
|
|
|
clc
|
|
|
|
|
.9 rts
|
2016-01-16 22:04:22 +00:00
|
|
|
|
*--------------------------------------
|
2017-01-31 16:40:37 +00:00
|
|
|
|
SKT.GetA cmp #K.SKTTABLE.SIZE
|
|
|
|
|
bcs SKT.GetA.9
|
|
|
|
|
jsr SKT.GetA.I
|
|
|
|
|
bcs SKT.GetA.9
|
|
|
|
|
>LDYA ZPPtrSKT
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
SKT.GetA.I stz ZPPtrSKT
|
2016-03-13 22:09:00 +00:00
|
|
|
|
|
|
|
|
|
lsr
|
|
|
|
|
ror ZPPtrSKT
|
|
|
|
|
lsr
|
|
|
|
|
ror ZPPtrSKT
|
|
|
|
|
lsr
|
|
|
|
|
ror ZPPtrSKT
|
2017-01-30 22:23:16 +00:00
|
|
|
|
|
2016-03-13 22:09:00 +00:00
|
|
|
|
pha
|
|
|
|
|
|
|
|
|
|
lda ZPPtrSKT
|
2016-01-16 22:04:22 +00:00
|
|
|
|
adc L.SKT.TABLE
|
|
|
|
|
sta ZPPtrSKT
|
2016-03-13 22:09:00 +00:00
|
|
|
|
pla
|
2016-01-16 22:04:22 +00:00
|
|
|
|
adc L.SKT.TABLE+1
|
|
|
|
|
sta ZPPtrSKT+1
|
2016-03-13 22:09:00 +00:00
|
|
|
|
|
2016-01-16 22:04:22 +00:00
|
|
|
|
lda (ZPPtrSKT)
|
2017-01-31 16:40:37 +00:00
|
|
|
|
beq SKT.GetA.9
|
|
|
|
|
|
2016-01-16 22:04:22 +00:00
|
|
|
|
rts CC
|
|
|
|
|
|
2017-01-31 16:40:37 +00:00
|
|
|
|
SKT.GetA.9 lda #ERR.SKT.BAD
|
2016-01-16 22:04:22 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-03-13 22:09:00 +00:00
|
|
|
|
* ZPPtrSKT -> actual socket
|
2017-01-31 16:40:37 +00:00
|
|
|
|
* A = hSocket or hFrame
|
2016-03-13 22:09:00 +00:00
|
|
|
|
*--------------------------------------
|
2017-01-30 16:30:39 +00:00
|
|
|
|
SKT.AddToQueueA sta .2+1
|
2017-01-31 16:40:37 +00:00
|
|
|
|
ldy #S.SOCKET.HQ.HEAD
|
2016-03-13 22:09:00 +00:00
|
|
|
|
lda (ZPPtrSKT),y
|
|
|
|
|
tax
|
|
|
|
|
inc
|
2017-01-31 16:40:37 +00:00
|
|
|
|
cmp #S.SOCKET.HQ.MAX
|
2016-03-13 22:09:00 +00:00
|
|
|
|
bne .1
|
|
|
|
|
lda #0
|
2017-01-31 16:40:37 +00:00
|
|
|
|
.1 ldy #S.SOCKET.HQ.TAIL
|
2016-03-13 22:09:00 +00:00
|
|
|
|
cmp (ZPPtrSKT),y
|
|
|
|
|
beq .9 Queue full!!
|
|
|
|
|
|
2017-01-31 16:40:37 +00:00
|
|
|
|
ldy #S.SOCKET.HQ.HEAD
|
2016-03-13 22:09:00 +00:00
|
|
|
|
sta (ZPPtrSKT),y
|
|
|
|
|
txa
|
|
|
|
|
clc
|
2017-01-31 16:40:37 +00:00
|
|
|
|
adc #S.SOCKET.HQ
|
2016-03-13 22:09:00 +00:00
|
|
|
|
tay
|
2017-01-30 16:30:39 +00:00
|
|
|
|
|
|
|
|
|
.2 lda #$ff
|
2016-03-13 22:09:00 +00:00
|
|
|
|
sta (ZPPtrSKT),y
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-01-31 22:13:26 +00:00
|
|
|
|
SKT.GETTABLE >LDYA L.SKT.TABLE
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-03-13 22:09:00 +00:00
|
|
|
|
SKT.AddToQueueS
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-01-31 16:40:37 +00:00
|
|
|
|
SKT.SetFrameOutLenAX
|
|
|
|
|
clc
|
|
|
|
|
adc ZPDataInLen
|
|
|
|
|
sta (ZPFrameOutPtr)
|
|
|
|
|
sta ZPFrameOutLen
|
|
|
|
|
|
|
|
|
|
txa
|
|
|
|
|
adc ZPDataInLen+1
|
|
|
|
|
ldy #1
|
|
|
|
|
sta (ZPFrameOutPtr),y
|
|
|
|
|
sta ZPFrameOutLen+1
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SKT.SetDataOutPtrAX
|
|
|
|
|
clc
|
|
|
|
|
adc ZPFrameOutPtr
|
|
|
|
|
sta ZPDataOutPtr
|
|
|
|
|
txa
|
|
|
|
|
adc ZPFrameOutPtr+1
|
|
|
|
|
sta ZPDataOutPtr+1
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SKT.SetFrameOutDstIP
|
|
|
|
|
ldy #S.SOCKET.DST.ADDR
|
|
|
|
|
ldx #4
|
|
|
|
|
|
|
|
|
|
.1 lda (ZPPtrSKT),y
|
|
|
|
|
pha
|
|
|
|
|
iny
|
|
|
|
|
dex
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
ldy #S.IP.DST+3
|
|
|
|
|
ldx #4
|
|
|
|
|
|
|
|
|
|
.2 pla
|
|
|
|
|
sta (ZPFrameOutPtr),y
|
|
|
|
|
dey
|
|
|
|
|
dex
|
|
|
|
|
bne .2
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SKT.SetFrameOutPorts
|
|
|
|
|
ldy #S.SOCKET.SRC.PORT
|
|
|
|
|
lda (ZPPtrSKT),y
|
|
|
|
|
tax
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPPtrSKT),y
|
|
|
|
|
ldy #S.UDP.SRCPORT
|
|
|
|
|
sta (ZPFrameOutPtr),y
|
|
|
|
|
iny
|
|
|
|
|
txa
|
|
|
|
|
sta (ZPFrameOutPtr),y
|
|
|
|
|
|
|
|
|
|
ldy #S.SOCKET.DST.PORT
|
|
|
|
|
lda (ZPPtrSKT),y
|
|
|
|
|
tax
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPPtrSKT),y
|
|
|
|
|
ldy #S.UDP.DSTPORT
|
|
|
|
|
sta (ZPFrameOutPtr),y
|
|
|
|
|
iny
|
|
|
|
|
txa
|
|
|
|
|
sta (ZPFrameOutPtr),y
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SKT.CopyDataInToOut
|
|
|
|
|
lda ZPDataInLen
|
|
|
|
|
eor #$ff
|
|
|
|
|
sta ZPDataInLen
|
|
|
|
|
lda ZPDataInLen+1
|
|
|
|
|
eor #$ff
|
|
|
|
|
tax
|
|
|
|
|
|
|
|
|
|
ldy #0
|
|
|
|
|
|
|
|
|
|
.1 inc ZPDataInLen
|
|
|
|
|
bne .2
|
|
|
|
|
inx
|
|
|
|
|
beq .9
|
|
|
|
|
|
|
|
|
|
.2 lda (ZPDataInPtr),y
|
|
|
|
|
sta (ZPDataOutPtr),y
|
|
|
|
|
iny
|
|
|
|
|
bne .1
|
|
|
|
|
inc ZPDataInPtr+1
|
|
|
|
|
inc ZPDataOutPtr+1
|
|
|
|
|
bne .1
|
|
|
|
|
.9 rts
|
|
|
|
|
|
2016-01-16 22:04:22 +00:00
|
|
|
|
MAN
|
|
|
|
|
SAVE LIB/LIBTCPIP.S.SKT
|
|
|
|
|
LOAD LIB/LIBTCPIP.S
|
|
|
|
|
ASM
|