2015-03-14 21:47:37 +00:00
|
|
|
|
PR#3
|
2015-06-03 18:30:57 +00:00
|
|
|
|
PREFIX /A2OSX.SRC
|
2015-03-14 21:47:37 +00:00
|
|
|
|
NEW
|
|
|
|
|
INC 1
|
|
|
|
|
AUTO 6
|
|
|
|
|
.LIST OFF
|
|
|
|
|
.OP 65C02
|
|
|
|
|
.OR $2000
|
2015-11-22 22:30:06 +00:00
|
|
|
|
.TF /A2OSX.BOOT/BIN/NETINFO
|
2015-03-14 21:47:37 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.INB INC/MACROS.I
|
|
|
|
|
.INB INC/A2OSX.I
|
|
|
|
|
.INB INC/LIBSTR.I
|
|
|
|
|
.INB INC/LIBTCPIP.I
|
|
|
|
|
*--------------------------------------
|
2016-02-24 20:00:42 +00:00
|
|
|
|
ZPIPCfgPtr .EQ ZPBIN
|
|
|
|
|
ZPDevInfoPtr .EQ ZPBIN+2
|
2015-03-14 21:47:37 +00:00
|
|
|
|
*--------------------------------------
|
2015-06-03 18:30:57 +00:00
|
|
|
|
* File Header (16 Bytes)
|
2015-03-14 21:47:37 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.START cld
|
|
|
|
|
jmp (.1,x)
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.DA #$61 6502,Level 1 (65c02)
|
|
|
|
|
.DA #1 BIN Layout Version 1
|
|
|
|
|
.DA 0
|
|
|
|
|
.DA CS.END-CS.START Code Length To Relocate
|
|
|
|
|
.DA 0 Data Segment to Allocate
|
|
|
|
|
.DA 0
|
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Relocation Table
|
|
|
|
|
*--------------------------------------
|
2015-03-14 21:47:37 +00:00
|
|
|
|
.1 .DA CS.INIT
|
|
|
|
|
.DA CS.RUN
|
|
|
|
|
.DA CS.DOEVENT
|
|
|
|
|
.DA CS.QUIT
|
|
|
|
|
L.LIBSTR .DA LIBSTR
|
2016-02-24 20:00:42 +00:00
|
|
|
|
L.LIBTCPIP .DA LIBTCPIP
|
2015-03-14 21:47:37 +00:00
|
|
|
|
L.MSG0 .DA MSG0
|
|
|
|
|
L.MSG0.C .DA MSG0.C
|
2016-02-24 20:00:42 +00:00
|
|
|
|
L.MSG0.U .DA MSG0.U
|
2015-03-14 21:47:37 +00:00
|
|
|
|
L.MSG1.DEV .DA MSG1.DEV
|
|
|
|
|
L.MSG1.DHCPSRVR .DA MSG1.DHCPSRVR
|
|
|
|
|
L.MSG1.IP .DA MSG1.IP
|
|
|
|
|
L.MSG1.GW .DA MSG1.GW
|
|
|
|
|
L.MSG1.DNS .DA MSG1.DNS
|
|
|
|
|
L.MSG1.HOSTNAME .DA MSG1.HOSTNAME
|
|
|
|
|
L.MSG1.DOMAIN .DA MSG1.DOMAIN
|
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
2015-06-03 18:30:57 +00:00
|
|
|
|
CS.INIT >LDYA L.LIBSTR
|
2015-11-22 22:30:06 +00:00
|
|
|
|
>SYSCALL SYS.LoadLibYA
|
2015-03-14 21:47:37 +00:00
|
|
|
|
sta hLIBSTR
|
|
|
|
|
|
2016-02-24 20:00:42 +00:00
|
|
|
|
>LDYA L.LIBTCPIP
|
|
|
|
|
>SYSCALL SYS.LoadLibYA
|
|
|
|
|
sta hLIBTCPIP
|
|
|
|
|
|
2015-03-14 21:47:37 +00:00
|
|
|
|
>PUSHW L.MSG0
|
|
|
|
|
>LIBCALL hLIBSTR,LIBSTR.PRINTF
|
|
|
|
|
|
2016-02-24 20:00:42 +00:00
|
|
|
|
>LIBCALL hLIBTCPIP,LIBTCPIP.GET.IPCFG
|
|
|
|
|
>STYA ZPIPCfgPtr
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
2016-02-24 20:00:42 +00:00
|
|
|
|
lda (ZPIPCfgPtr)
|
|
|
|
|
and #S.IPCFG.STATUS.OK
|
|
|
|
|
beq .11
|
|
|
|
|
>LDYA L.MSG0.C
|
|
|
|
|
bra .10
|
|
|
|
|
.11 >LDYA L.MSG0.U
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
2016-02-24 20:00:42 +00:00
|
|
|
|
.10 >PUSHYA
|
2015-03-14 21:47:37 +00:00
|
|
|
|
>LIBCALL hLIBSTR,LIBSTR.PRINTF
|
|
|
|
|
|
2016-02-24 20:00:42 +00:00
|
|
|
|
CS.INIT.PRINT ldy #S.IPCFG.MAC+6
|
|
|
|
|
.1 dey
|
|
|
|
|
>PUSHB (ZPIPCfgPtr),y
|
|
|
|
|
cpy #S.IPCFG.MAC
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
ldy #S.IPCFG.hDEV
|
|
|
|
|
lda (ZPIPCfgPtr),y
|
|
|
|
|
>SYSCALL SYS.GetDevInfoA
|
|
|
|
|
>STYA ZPDevInfoPtr
|
|
|
|
|
ldy #S.DEVINFO.NET.STATUS
|
|
|
|
|
>PUSHB (ZPDevInfoPtr),y
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
2016-02-24 20:00:42 +00:00
|
|
|
|
ldy #S.IPCFG.hDEV
|
|
|
|
|
>PUSHB (ZPIPCfgPtr),y
|
|
|
|
|
|
|
|
|
|
>PUSHW L.MSG1.DEV
|
|
|
|
|
|
|
|
|
|
>LIBCALL hLIBSTR,LIBSTR.PRINTF
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.IPCFG.DHCPSRVR+3
|
|
|
|
|
ldx #4
|
2016-02-24 20:00:42 +00:00
|
|
|
|
.2 >PUSHB (ZPIPCfgPtr),y
|
2015-03-14 21:47:37 +00:00
|
|
|
|
dey
|
|
|
|
|
dex
|
2016-02-24 20:00:42 +00:00
|
|
|
|
bne .2
|
2015-03-14 21:47:37 +00:00
|
|
|
|
>PUSHW L.MSG1.DHCPSRVR
|
|
|
|
|
>LIBCALL hLIBSTR,LIBSTR.PRINTF
|
|
|
|
|
|
|
|
|
|
ldy #S.IPCFG.IP+7 IP/MASK
|
|
|
|
|
ldx #8
|
2016-02-24 20:00:42 +00:00
|
|
|
|
.3 >PUSHB (ZPIPCfgPtr),y
|
2015-03-14 21:47:37 +00:00
|
|
|
|
dey
|
|
|
|
|
dex
|
2016-02-24 20:00:42 +00:00
|
|
|
|
bne .3
|
2015-03-14 21:47:37 +00:00
|
|
|
|
>PUSHW L.MSG1.IP
|
|
|
|
|
>LIBCALL hLIBSTR,LIBSTR.PRINTF
|
|
|
|
|
|
|
|
|
|
ldy #S.IPCFG.GW+3
|
|
|
|
|
ldx #4
|
2016-02-24 20:00:42 +00:00
|
|
|
|
.4 >PUSHB (ZPIPCfgPtr),y
|
2015-03-14 21:47:37 +00:00
|
|
|
|
dey
|
|
|
|
|
dex
|
2016-02-24 20:00:42 +00:00
|
|
|
|
bne .4
|
2015-03-14 21:47:37 +00:00
|
|
|
|
>PUSHW L.MSG1.GW
|
|
|
|
|
>LIBCALL hLIBSTR,LIBSTR.PRINTF
|
|
|
|
|
|
2016-02-24 20:00:42 +00:00
|
|
|
|
ldy #S.IPCFG.DNS1+7
|
2015-03-14 21:47:37 +00:00
|
|
|
|
ldx #8
|
2016-02-24 20:00:42 +00:00
|
|
|
|
.5 >PUSHB (ZPIPCfgPtr),y
|
2015-03-14 21:47:37 +00:00
|
|
|
|
dey
|
|
|
|
|
dex
|
2016-02-24 20:00:42 +00:00
|
|
|
|
bne .5
|
2015-03-14 21:47:37 +00:00
|
|
|
|
>PUSHW L.MSG1.DNS
|
|
|
|
|
>LIBCALL hLIBSTR,LIBSTR.PRINTF
|
|
|
|
|
|
2016-02-24 20:00:42 +00:00
|
|
|
|
lda ZPIPCfgPtr
|
2015-03-14 21:47:37 +00:00
|
|
|
|
clc
|
|
|
|
|
adc #S.IPCFG.HOSTNAME
|
|
|
|
|
tay
|
2016-02-24 20:00:42 +00:00
|
|
|
|
lda ZPIPCfgPtr+1
|
2015-03-14 21:47:37 +00:00
|
|
|
|
adc #0
|
|
|
|
|
>PUSHYA
|
|
|
|
|
>PUSHW L.MSG1.HOSTNAME
|
|
|
|
|
>LIBCALL hLIBSTR,LIBSTR.PRINTF
|
|
|
|
|
|
|
|
|
|
ldy #S.IPCFG.DOMAIN
|
2016-02-24 20:00:42 +00:00
|
|
|
|
lda (ZPIPCfgPtr),y
|
|
|
|
|
beq CS.INIT.DONE
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
2016-02-24 20:00:42 +00:00
|
|
|
|
lda ZPIPCfgPtr
|
2015-03-14 21:47:37 +00:00
|
|
|
|
clc
|
|
|
|
|
adc #S.IPCFG.DOMAIN
|
|
|
|
|
tay
|
2016-02-24 20:00:42 +00:00
|
|
|
|
lda ZPIPCfgPtr+1
|
2015-03-14 21:47:37 +00:00
|
|
|
|
adc #0
|
|
|
|
|
>PUSHYA
|
|
|
|
|
>PUSHW L.MSG1.DOMAIN
|
|
|
|
|
>LIBCALL hLIBSTR,LIBSTR.PRINTF
|
|
|
|
|
|
2016-02-24 20:00:42 +00:00
|
|
|
|
CS.INIT.DONE lda #0 tell TSKMGR that all done ok, but
|
2015-03-14 21:47:37 +00:00
|
|
|
|
sec we do not want to stay in memory
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-02-24 20:00:42 +00:00
|
|
|
|
CS.RUN
|
2015-03-14 21:47:37 +00:00
|
|
|
|
CS.DOEVENT clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-02-24 20:00:42 +00:00
|
|
|
|
CS.QUIT lda hLIBTCPIP
|
|
|
|
|
>SYSCALL SYS.FreeMemA
|
|
|
|
|
lda hLIBSTR
|
2015-03-14 21:47:37 +00:00
|
|
|
|
>SYSCALL SYS.FreeMemA
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.END
|
|
|
|
|
LIBSTR >PSTRING "libstr.o"
|
2016-02-24 20:00:42 +00:00
|
|
|
|
LIBTCPIP >PSTRING "libtcpip.o"
|
|
|
|
|
MSG0 >CSTRING "TCP/IP Status: "
|
|
|
|
|
MSG0.C >CSTRING "Configured.\n"
|
|
|
|
|
MSG0.U >CSTRING "Not Configured.\n"
|
|
|
|
|
MSG1.DEV >CSTRING " DeviceID : %h,%b,MAC=%02h:%02h:%02h:%02h:%02h:%02h\n"
|
2015-03-14 21:47:37 +00:00
|
|
|
|
MSG1.DHCPSRVR >CSTRING " DHCP Server : %d.%d.%d.%d\n"
|
|
|
|
|
MSG1.IP >CSTRING " IP/Mask : %d.%d.%d.%d/%d.%d.%d.%d\n"
|
|
|
|
|
MSG1.GW >CSTRING " Gateway : %d.%d.%d.%d\n"
|
|
|
|
|
MSG1.DNS >CSTRING " DNS : %d.%d.%d.%d,%d.%d.%d.%d\n"
|
|
|
|
|
MSG1.HOSTNAME >CSTRING " Hostname : %s"
|
2016-02-24 20:00:42 +00:00
|
|
|
|
MSG1.DOMAIN >CSTRING ".%s\n"
|
2015-03-14 21:47:37 +00:00
|
|
|
|
hLIBSTR .BS 1
|
2016-02-24 20:00:42 +00:00
|
|
|
|
hLIBTCPIP .BS 1
|
2015-03-14 21:47:37 +00:00
|
|
|
|
MAN
|
2015-11-22 22:30:06 +00:00
|
|
|
|
SAVE BIN/NETINFO.S
|
2015-03-14 21:47:37 +00:00
|
|
|
|
ASM
|