2016-03-13 21:51:50 +00:00
|
|
|
|
NEW
|
2017-12-22 21:24:30 +00:00
|
|
|
|
PREFIX /A2OSX.BUILD
|
|
|
|
|
AUTO 4,1
|
2016-03-13 21:51:50 +00:00
|
|
|
|
.LIST OFF
|
|
|
|
|
.OP 65C02
|
|
|
|
|
.OR $2000
|
2017-03-29 15:48:15 +00:00
|
|
|
|
.TF /A2OSX.BUILD/BIN/IPCONFIG
|
2016-03-13 21:51:50 +00:00
|
|
|
|
*--------------------------------------
|
2017-03-29 15:48:15 +00:00
|
|
|
|
.INB /A2OSX.BUILD/INC/MACROS.I
|
|
|
|
|
.INB /A2OSX.BUILD/INC/A2OSX.I
|
2017-12-22 21:24:30 +00:00
|
|
|
|
.INB /A2OSX.BUILD/INC/NIC.I
|
2017-03-29 15:48:15 +00:00
|
|
|
|
.INB /A2OSX.BUILD/INC/LIBTCPIP.I
|
2016-03-13 21:51:50 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
ZPIPCfgPtr .EQ ZPBIN
|
|
|
|
|
ZPDevPtr .EQ ZPBIN+2
|
2017-01-28 22:05:20 +00:00
|
|
|
|
ZPDevStatPtr .EQ ZPBIN+4
|
2016-03-13 21:51:50 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* File Header (16 Bytes)
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.START cld
|
|
|
|
|
jmp (.1,x)
|
|
|
|
|
.DA #$61 6502,Level 1 (65c02)
|
|
|
|
|
.DA #1 BIN Layout Version 1
|
|
|
|
|
.DA 0
|
2017-10-09 05:51:32 +00:00
|
|
|
|
.DA CS.END-CS.START CS
|
|
|
|
|
.DA DS.END-DS.START DS
|
|
|
|
|
.DA #16 SS
|
|
|
|
|
.DA #6 ZP
|
2016-03-13 21:51:50 +00:00
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Relocation Table
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.1 .DA CS.INIT
|
|
|
|
|
.DA CS.RUN
|
|
|
|
|
.DA CS.DOEVENT
|
|
|
|
|
.DA CS.QUIT
|
|
|
|
|
L.LIBTCPIP .DA LIBTCPIP
|
|
|
|
|
L.MSG0 .DA MSG0
|
|
|
|
|
L.MSG0.NL .DA MSG0.NL
|
|
|
|
|
L.MSG0.L .DA MSG0.L
|
|
|
|
|
L.MSG1.DEV .DA MSG1.DEV
|
|
|
|
|
L.MSG1.DEV.ARP .DA MSG1.DEV.ARP
|
2016-04-18 20:17:28 +00:00
|
|
|
|
L.MSG1.DEV.IP .DA MSG1.DEV.IP
|
2016-03-13 21:51:50 +00:00
|
|
|
|
L.MSG1.LINK .DA MSG1.LINK
|
|
|
|
|
L.MSG1.LINK.OK .DA MSG1.LINK.OK
|
|
|
|
|
L.MSG1.LINK.KO .DA MSG1.LINK.KO
|
|
|
|
|
L.MSG1.LINKSPEED .DA MSG1.LINKSPEED
|
|
|
|
|
L.MSG1.DPLX.FD .DA MSG1.DPLX.FD
|
|
|
|
|
L.MSG1.DPLX.HD .DA MSG1.DPLX.HD
|
|
|
|
|
L.MSG2 .DA MSG2
|
|
|
|
|
L.MSG2.C .DA MSG2.C
|
|
|
|
|
L.MSG2.U .DA MSG2.U
|
|
|
|
|
L.MSG2.DHCPSRVR .DA MSG2.DHCPSRVR
|
|
|
|
|
L.MSG2.IP .DA MSG2.IP
|
|
|
|
|
L.MSG2.GW .DA MSG2.GW
|
|
|
|
|
L.MSG2.DNS .DA MSG2.DNS
|
|
|
|
|
L.MSG2.HOSTNAME .DA MSG2.HOSTNAME
|
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
2016-10-17 06:21:04 +00:00
|
|
|
|
CS.INIT >LDYA L.LIBTCPIP
|
2017-10-09 05:51:32 +00:00
|
|
|
|
>SYSCALL LoadLib.YA
|
2017-01-28 22:05:20 +00:00
|
|
|
|
bcs .9
|
2016-03-13 21:51:50 +00:00
|
|
|
|
sta hLIBTCPIP
|
2017-01-28 22:05:20 +00:00
|
|
|
|
clc
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.RUN >LDYA L.MSG0
|
2017-08-25 15:02:16 +00:00
|
|
|
|
>SYSCALL PrintF.YA
|
2016-03-13 21:51:50 +00:00
|
|
|
|
|
|
|
|
|
>LIBCALL hLIBTCPIP,LIBTCPIP.GET.IPCFG
|
|
|
|
|
>STYA ZPIPCfgPtr
|
|
|
|
|
|
|
|
|
|
ldy #S.IPCFG.HDEV
|
|
|
|
|
lda (ZPIPCfgPtr),y
|
2017-01-28 22:05:20 +00:00
|
|
|
|
bne CS.RUN.DUMPDEV
|
2016-03-13 21:51:50 +00:00
|
|
|
|
|
2016-10-17 06:21:04 +00:00
|
|
|
|
>LDYA L.MSG0.NL
|
2017-08-25 15:02:16 +00:00
|
|
|
|
>SYSCALL PrintF.YA
|
2017-01-28 22:05:20 +00:00
|
|
|
|
jmp CS.RUN.DONE
|
2016-03-13 21:51:50 +00:00
|
|
|
|
|
2018-04-16 15:25:39 +00:00
|
|
|
|
CS.RUN.DUMPDEV >STA.G DevID
|
2017-10-09 05:51:32 +00:00
|
|
|
|
>SYSCALL GetDevByID.A
|
2016-03-13 21:51:50 +00:00
|
|
|
|
>STYA ZPDevPtr
|
2017-01-28 22:05:20 +00:00
|
|
|
|
|
2018-04-16 15:25:39 +00:00
|
|
|
|
>LDA.G DevID
|
|
|
|
|
>SYSCALL GetDevStatus.A
|
2017-01-28 22:05:20 +00:00
|
|
|
|
>STYA ZPDevStatPtr
|
|
|
|
|
|
2016-10-17 06:21:04 +00:00
|
|
|
|
>LDYA L.MSG0.L
|
2017-08-25 15:02:16 +00:00
|
|
|
|
>SYSCALL PrintF.YA
|
2016-03-13 21:51:50 +00:00
|
|
|
|
|
2017-12-22 21:24:30 +00:00
|
|
|
|
ldy #S.DSTAT.NIC.MAC+5
|
2017-01-28 22:05:20 +00:00
|
|
|
|
|
|
|
|
|
.1 >PUSHB (ZPDevStatPtr),y
|
|
|
|
|
dey
|
2017-12-22 21:24:30 +00:00
|
|
|
|
cpy #S.DSTAT.NIC.MAC-1
|
2016-03-13 21:51:50 +00:00
|
|
|
|
bne .1
|
|
|
|
|
|
2017-03-15 16:44:15 +00:00
|
|
|
|
lda #S.DEV.NAME
|
|
|
|
|
clc
|
|
|
|
|
adc ZPDevPtr
|
|
|
|
|
tay
|
|
|
|
|
lda /S.DEV.NAME
|
|
|
|
|
adc ZPDevPtr+1
|
2017-01-28 22:05:20 +00:00
|
|
|
|
|
2017-03-15 16:44:15 +00:00
|
|
|
|
>PUSHYA
|
2016-03-13 21:51:50 +00:00
|
|
|
|
|
2017-03-16 07:32:24 +00:00
|
|
|
|
lda ZPDevStatPtr
|
|
|
|
|
clc
|
2017-10-27 06:36:46 +00:00
|
|
|
|
adc #S.DSTAT.IDS
|
2017-03-16 07:32:24 +00:00
|
|
|
|
tay
|
|
|
|
|
lda ZPDevStatPtr+1
|
2017-10-27 06:36:46 +00:00
|
|
|
|
adc /S.DSTAT.IDS
|
2017-03-16 07:32:24 +00:00
|
|
|
|
>PUSHYA
|
|
|
|
|
|
2018-04-16 15:25:39 +00:00
|
|
|
|
>PUSHB.G DevID
|
2016-03-13 21:51:50 +00:00
|
|
|
|
|
2016-10-17 06:21:04 +00:00
|
|
|
|
>LDYA L.MSG1.DEV
|
2017-08-25 15:02:16 +00:00
|
|
|
|
>SYSCALL PrintF.YA
|
2016-03-13 21:51:50 +00:00
|
|
|
|
|
2017-12-22 21:24:30 +00:00
|
|
|
|
ldy #S.DSTAT.NIC.FLAGS
|
2017-01-28 22:05:20 +00:00
|
|
|
|
lda (ZPDevStatPtr),y
|
2017-12-22 21:24:30 +00:00
|
|
|
|
and #S.DSTAT.NIC.FLAGS.ARPOFFLOAD
|
2016-03-13 21:51:50 +00:00
|
|
|
|
beq .2
|
|
|
|
|
lda #1
|
|
|
|
|
.2 >PUSHA
|
2016-10-17 06:21:04 +00:00
|
|
|
|
>LDYA L.MSG1.DEV.ARP
|
2017-08-25 15:02:16 +00:00
|
|
|
|
>SYSCALL PrintF.YA
|
2016-03-13 21:51:50 +00:00
|
|
|
|
|
2017-12-22 21:24:30 +00:00
|
|
|
|
ldy #S.DSTAT.NIC.FLAGS
|
2017-01-28 22:05:20 +00:00
|
|
|
|
lda (ZPDevStatPtr),y
|
2017-12-22 21:24:30 +00:00
|
|
|
|
and #S.DSTAT.NIC.FLAGS.IPOFFLOAD
|
2016-04-18 20:17:28 +00:00
|
|
|
|
beq .3
|
|
|
|
|
lda #1
|
|
|
|
|
.3 >PUSHA
|
2016-10-17 06:21:04 +00:00
|
|
|
|
>LDYA L.MSG1.DEV.IP
|
2017-08-25 15:02:16 +00:00
|
|
|
|
>SYSCALL PrintF.YA
|
2016-04-18 20:17:28 +00:00
|
|
|
|
|
2017-12-22 21:24:30 +00:00
|
|
|
|
ldy #S.DSTAT.NIC.STATUS
|
2017-01-28 22:05:20 +00:00
|
|
|
|
lda (ZPDevStatPtr),y
|
2017-12-22 21:24:30 +00:00
|
|
|
|
and #S.DSTAT.NIC.STATUS.OK
|
2017-01-28 22:05:20 +00:00
|
|
|
|
bne CS.RUN.LINK
|
2016-03-13 21:51:50 +00:00
|
|
|
|
>PUSHW L.MSG1.LINK.KO
|
2016-10-17 06:21:04 +00:00
|
|
|
|
>LDYA L.MSG1.LINK
|
2017-08-25 15:02:16 +00:00
|
|
|
|
>SYSCALL PrintF.YA
|
2017-01-28 22:05:20 +00:00
|
|
|
|
bra CS.RUN.DUMPIP
|
2016-03-13 21:51:50 +00:00
|
|
|
|
|
2017-01-28 22:05:20 +00:00
|
|
|
|
CS.RUN.LINK >PUSHW L.MSG1.LINK.OK
|
2016-10-17 06:21:04 +00:00
|
|
|
|
>LDYA L.MSG1.LINK
|
2017-08-25 15:02:16 +00:00
|
|
|
|
>SYSCALL PrintF.YA
|
2016-03-13 21:51:50 +00:00
|
|
|
|
|
2016-10-17 06:21:04 +00:00
|
|
|
|
>LDYA L.MSG1.LINKSPEED
|
2017-08-25 15:02:16 +00:00
|
|
|
|
>SYSCALL PrintF.YA
|
2016-03-13 21:51:50 +00:00
|
|
|
|
|
2017-12-22 21:24:30 +00:00
|
|
|
|
ldy #S.DSTAT.NIC.STATUS
|
2017-01-28 22:05:20 +00:00
|
|
|
|
lda (ZPDevStatPtr),y
|
2016-03-13 21:51:50 +00:00
|
|
|
|
and #$0F
|
|
|
|
|
tax
|
|
|
|
|
|
|
|
|
|
.4 phx
|
|
|
|
|
lda #'0'
|
2017-08-25 06:37:21 +00:00
|
|
|
|
>SYSCALL PutChar.A
|
2016-03-13 21:51:50 +00:00
|
|
|
|
plx
|
|
|
|
|
dex
|
|
|
|
|
bne .4
|
|
|
|
|
|
2017-12-22 21:24:30 +00:00
|
|
|
|
ldy #S.DSTAT.NIC.STATUS
|
2017-01-28 22:05:20 +00:00
|
|
|
|
lda (ZPDevStatPtr),y
|
2017-12-22 21:24:30 +00:00
|
|
|
|
and #S.DSTAT.NIC.STATUS.FD
|
2016-03-13 21:51:50 +00:00
|
|
|
|
bne .5
|
2016-10-17 06:21:04 +00:00
|
|
|
|
>LDYA L.MSG1.DPLX.HD
|
2016-03-13 21:51:50 +00:00
|
|
|
|
bra .6
|
2016-10-17 06:21:04 +00:00
|
|
|
|
.5 >LDYA L.MSG1.DPLX.FD
|
2017-08-25 15:02:16 +00:00
|
|
|
|
.6 >SYSCALL PrintF.YA
|
2016-03-13 21:51:50 +00:00
|
|
|
|
|
2017-01-28 22:05:20 +00:00
|
|
|
|
CS.RUN.DUMPIP >LDYA L.MSG2
|
2017-08-25 15:02:16 +00:00
|
|
|
|
>SYSCALL PrintF.YA
|
2016-03-13 21:51:50 +00:00
|
|
|
|
lda (ZPIPCfgPtr)
|
|
|
|
|
and #S.IPCFG.STATUS.OK
|
|
|
|
|
beq .11
|
|
|
|
|
>LDYA L.MSG2.C
|
|
|
|
|
bra .10
|
|
|
|
|
.11 >LDYA L.MSG2.U
|
|
|
|
|
|
2017-08-25 15:02:16 +00:00
|
|
|
|
.10 >SYSCALL PrintF.YA
|
2016-03-13 21:51:50 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.IPCFG.DHCPSRVR+3
|
|
|
|
|
ldx #4
|
|
|
|
|
.2 >PUSHB (ZPIPCfgPtr),y
|
|
|
|
|
dey
|
|
|
|
|
dex
|
|
|
|
|
bne .2
|
2016-10-17 06:21:04 +00:00
|
|
|
|
>LDYA L.MSG2.DHCPSRVR
|
2017-08-25 15:02:16 +00:00
|
|
|
|
>SYSCALL PrintF.YA
|
2016-03-13 21:51:50 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.IPCFG.IP+7 IP/MASK
|
|
|
|
|
ldx #8
|
|
|
|
|
.3 >PUSHB (ZPIPCfgPtr),y
|
|
|
|
|
dey
|
|
|
|
|
dex
|
|
|
|
|
bne .3
|
2016-10-17 06:21:04 +00:00
|
|
|
|
>LDYA L.MSG2.IP
|
2017-08-25 15:02:16 +00:00
|
|
|
|
>SYSCALL PrintF.YA
|
2016-03-13 21:51:50 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.IPCFG.GW+3
|
|
|
|
|
ldx #4
|
|
|
|
|
.4 >PUSHB (ZPIPCfgPtr),y
|
|
|
|
|
dey
|
|
|
|
|
dex
|
|
|
|
|
bne .4
|
2016-10-17 06:21:04 +00:00
|
|
|
|
>LDYA L.MSG2.GW
|
2017-08-25 15:02:16 +00:00
|
|
|
|
>SYSCALL PrintF.YA
|
2016-03-13 21:51:50 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.IPCFG.DNS1+7
|
|
|
|
|
ldx #8
|
|
|
|
|
.5 >PUSHB (ZPIPCfgPtr),y
|
|
|
|
|
dey
|
|
|
|
|
dex
|
|
|
|
|
bne .5
|
2016-10-17 06:21:04 +00:00
|
|
|
|
>LDYA L.MSG2.DNS
|
2017-08-25 15:02:16 +00:00
|
|
|
|
>SYSCALL PrintF.YA
|
2016-03-13 21:51:50 +00:00
|
|
|
|
|
|
|
|
|
lda ZPIPCfgPtr
|
|
|
|
|
clc
|
|
|
|
|
adc #S.IPCFG.DOMAIN
|
|
|
|
|
tay
|
|
|
|
|
lda ZPIPCfgPtr+1
|
|
|
|
|
adc #0
|
|
|
|
|
>PUSHYA
|
|
|
|
|
|
|
|
|
|
lda ZPIPCfgPtr
|
|
|
|
|
clc
|
|
|
|
|
adc #S.IPCFG.HOSTNAME
|
|
|
|
|
tay
|
|
|
|
|
lda ZPIPCfgPtr+1
|
|
|
|
|
adc #0
|
|
|
|
|
>PUSHYA
|
|
|
|
|
|
2016-10-17 06:21:04 +00:00
|
|
|
|
>LDYA L.MSG2.HOSTNAME
|
2017-08-25 15:02:16 +00:00
|
|
|
|
>SYSCALL PrintF.YA
|
2016-03-13 21:51:50 +00:00
|
|
|
|
|
2017-01-28 22:05:20 +00:00
|
|
|
|
CS.RUN.DONE lda #0 tell TSKMGR that all done ok, but
|
2016-03-13 21:51:50 +00:00
|
|
|
|
sec we do not want to stay in memory
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-01-28 22:05:20 +00:00
|
|
|
|
CS.DOEVENT sec
|
2016-03-13 21:51:50 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.QUIT lda hLIBTCPIP
|
2017-01-28 22:05:20 +00:00
|
|
|
|
beq .8
|
2017-12-22 21:24:30 +00:00
|
|
|
|
>SYSCALL UnloadLib.A
|
2017-01-28 22:05:20 +00:00
|
|
|
|
|
|
|
|
|
.8 clc
|
2016-03-13 21:51:50 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.END
|
2018-04-11 15:35:51 +00:00
|
|
|
|
LIBTCPIP .AZ "libtcpip.o"
|
2016-03-13 21:51:50 +00:00
|
|
|
|
*--------------------------------------
|
2018-04-11 15:35:51 +00:00
|
|
|
|
MSG0 .AZ "TCP/IP Status : "
|
|
|
|
|
MSG0.L .AZ "Loaded\r\n"
|
|
|
|
|
MSG0.NL .AZ "Not Loaded\r\n"
|
2016-03-13 21:51:50 +00:00
|
|
|
|
*--------------------------------------
|
2018-04-11 15:35:51 +00:00
|
|
|
|
MSG1.DEV .AZ "\r\nDevice Configuration :\r\n DevID : $%h\r\n Device Type : %S\r\n Device Name : %s\r\n HW Address : %02h:%02h:%02h:%02h:%02h:%02h\r\n"
|
|
|
|
|
MSG1.DEV.ARP .AZ " ARP Offload : %d\r\n"
|
|
|
|
|
MSG1.DEV.IP .AZ " IP Offload : %d\r\n"
|
|
|
|
|
MSG1.LINK .AZ " Link Status : %s\r\n"
|
|
|
|
|
MSG1.LINK.OK .AZ "OK"
|
|
|
|
|
MSG1.LINK.KO .AZ "Media Disconnected"
|
|
|
|
|
MSG1.LINKSPEED .AZ " Link Speed : 1"
|
|
|
|
|
MSG1.DPLX.FD .AZ " Mbit/s,Full Duplex\r\n"
|
|
|
|
|
MSG1.DPLX.HD .AZ " Mbit/s,Half Duplex\r\n"
|
2016-03-13 21:51:50 +00:00
|
|
|
|
*--------------------------------------
|
2018-04-11 15:35:51 +00:00
|
|
|
|
MSG2 .AZ "\r\nIP Configuration : "
|
|
|
|
|
MSG2.C .AZ "Configured\r\n"
|
|
|
|
|
MSG2.U .AZ "Not Configured\r\n"
|
|
|
|
|
MSG2.DHCPSRVR .AZ " DHCP Server : %d.%d.%d.%d\r\n"
|
|
|
|
|
MSG2.IP .AZ " IP/Mask : %d.%d.%d.%d/%d.%d.%d.%d\r\n"
|
|
|
|
|
MSG2.GW .AZ " Gateway : %d.%d.%d.%d\r\n"
|
|
|
|
|
MSG2.DNS .AZ " DNS : %d.%d.%d.%d,%d.%d.%d.%d\r\n"
|
|
|
|
|
MSG2.HOSTNAME .AZ " Hostname : %S.%S\r\n"
|
2016-03-13 21:51:50 +00:00
|
|
|
|
hLIBTCPIP .BS 1
|
2017-10-09 05:51:32 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.DUMMY
|
|
|
|
|
.OR 0
|
|
|
|
|
DS.START
|
2018-04-16 15:25:39 +00:00
|
|
|
|
DevID .BS 1
|
2017-10-09 05:51:32 +00:00
|
|
|
|
DS.END .ED
|
|
|
|
|
*--------------------------------------
|
2016-03-13 21:51:50 +00:00
|
|
|
|
MAN
|
2017-03-29 15:48:15 +00:00
|
|
|
|
SAVE /A2OSX.SRC/BIN/IPCONFIG.S
|
2016-03-13 21:51:50 +00:00
|
|
|
|
ASM
|