2016-10-17 06:21:04 +00:00
|
|
|
|
PR#3
|
|
|
|
|
PREFIX /A2OSX.SRC
|
2017-03-15 16:44:15 +00:00
|
|
|
|
LOMEM $A00
|
2016-10-17 06:21:04 +00:00
|
|
|
|
INC 1
|
|
|
|
|
AUTO 6
|
|
|
|
|
.LIST OFF
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* PULLW = PTR to S.IPCFG
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SET.IPCFG >PULLW ZPTmpPtr1
|
|
|
|
|
ldy #0
|
2017-03-23 16:41:36 +00:00
|
|
|
|
|
2016-10-17 06:21:04 +00:00
|
|
|
|
.1 lda (ZPTmpPtr1),y
|
|
|
|
|
sta IPCFG,y
|
|
|
|
|
iny
|
|
|
|
|
cpy #S.IPCFG
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
ldx #5
|
2017-03-23 16:41:36 +00:00
|
|
|
|
|
2016-10-17 06:21:04 +00:00
|
|
|
|
.2 lda IPCFG+S.IPCFG.MAC,x
|
|
|
|
|
sta ARP.REQ.SRCMAC,x
|
|
|
|
|
sta ARP.REQ.SHA,x
|
|
|
|
|
sta ARP.REP.SRCMAC,x
|
|
|
|
|
sta ARP.REP.SHA,x
|
|
|
|
|
dex
|
|
|
|
|
bpl .2
|
|
|
|
|
|
|
|
|
|
ldx #3
|
2017-03-23 16:41:36 +00:00
|
|
|
|
|
2016-10-17 06:21:04 +00:00
|
|
|
|
.3 lda IPCFG+S.IPCFG.IP,x
|
|
|
|
|
sta ARP.REQ.SPA,x
|
|
|
|
|
sta ARP.REP.SPA,x
|
|
|
|
|
sta DNS.SOCKET.SA,x
|
|
|
|
|
dex
|
|
|
|
|
bpl .3
|
|
|
|
|
|
|
|
|
|
lda IPCFG+S.IPCFG.HDEV
|
|
|
|
|
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL GetDevByIDA
|
2017-01-26 21:57:35 +00:00
|
|
|
|
>STYA ZPTmpPtr2
|
2017-03-15 16:44:15 +00:00
|
|
|
|
>STYA NetDevJmp+1
|
2017-01-26 21:57:35 +00:00
|
|
|
|
|
|
|
|
|
ldx #DEVMGR.STATUS
|
2016-10-17 06:21:04 +00:00
|
|
|
|
jsr NetDevJmp
|
|
|
|
|
|
|
|
|
|
>STYA ZPTmpPtr2
|
2017-01-26 21:57:35 +00:00
|
|
|
|
ldy #S.DEVSTAT.NET.FLAGS
|
2016-10-17 06:21:04 +00:00
|
|
|
|
lda (ZPTmpPtr2),y
|
|
|
|
|
sta DevFlags
|
2017-01-26 21:57:35 +00:00
|
|
|
|
and #S.DEVSTAT.NET.FLAGS.ARPOFFLOAD
|
2016-10-17 06:21:04 +00:00
|
|
|
|
beq .4
|
|
|
|
|
|
|
|
|
|
>LDYA ZPTmpPtr1
|
2017-01-26 21:57:35 +00:00
|
|
|
|
ldx #DEVMGR.CONTROL
|
2016-10-17 06:21:04 +00:00
|
|
|
|
jsr NetDevJmp
|
|
|
|
|
|
|
|
|
|
.4 lda hDNSSocket1
|
|
|
|
|
beq .41
|
|
|
|
|
jsr SKT.CLOSEA
|
2017-03-23 16:41:36 +00:00
|
|
|
|
stz hDNSSocket1
|
2016-10-17 06:21:04 +00:00
|
|
|
|
|
|
|
|
|
.41 lda hDNSSocket2
|
|
|
|
|
beq .42
|
|
|
|
|
jsr SKT.CLOSEA
|
2017-03-23 16:41:36 +00:00
|
|
|
|
stz hDNSSocket2
|
2016-10-17 06:21:04 +00:00
|
|
|
|
|
|
|
|
|
.42 lda IPCFG+S.IPCFG.DNS1
|
|
|
|
|
beq .6
|
|
|
|
|
|
|
|
|
|
ldx #3
|
2017-03-23 16:41:36 +00:00
|
|
|
|
|
2016-10-17 06:21:04 +00:00
|
|
|
|
.5 lda IPCFG+S.IPCFG.DNS1,x
|
|
|
|
|
sta DNS.SOCKET.DA,x
|
|
|
|
|
dex
|
|
|
|
|
bpl .5
|
|
|
|
|
|
2017-01-30 22:23:16 +00:00
|
|
|
|
stz DNS.SOCKET.SP
|
|
|
|
|
stz DNS.SOCKET.SP+1
|
|
|
|
|
|
2016-10-17 06:21:04 +00:00
|
|
|
|
>PUSHW L.DNS.SOCKET
|
2017-02-15 21:46:21 +00:00
|
|
|
|
jsr SKT.New
|
2016-10-17 06:21:04 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
stx hDNSSocket1
|
|
|
|
|
|
|
|
|
|
.6 lda IPCFG+S.IPCFG.DNS2
|
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
ldx #3
|
2017-03-23 16:41:36 +00:00
|
|
|
|
|
2016-10-17 06:21:04 +00:00
|
|
|
|
.7 lda IPCFG+S.IPCFG.DNS2,x
|
|
|
|
|
sta DNS.SOCKET.DA,x
|
|
|
|
|
dex
|
|
|
|
|
bpl .7
|
|
|
|
|
|
2017-01-30 22:23:16 +00:00
|
|
|
|
stz DNS.SOCKET.SP
|
|
|
|
|
stz DNS.SOCKET.SP+1
|
|
|
|
|
|
2016-10-17 06:21:04 +00:00
|
|
|
|
>PUSHW L.DNS.SOCKET
|
2017-02-15 21:46:21 +00:00
|
|
|
|
jsr SKT.New
|
2016-10-17 06:21:04 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
stx hDNSSocket2
|
|
|
|
|
|
|
|
|
|
.8 >LDYA ZPTmpPtr1
|
|
|
|
|
clc
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* grab a copy on the fly for lib function
|
|
|
|
|
* OUT :
|
|
|
|
|
* Y,A = PTR to S.IPCFG
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
GET.IPCFG >LDYA L.IPCFG
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
|
|
|
|
SAVE LIB/LIBTCPIP.S.CFG
|
|
|
|
|
LOAD LIB/LIBTCPIP.S
|
|
|
|
|
ASM
|