2015-03-14 21:47:37 +00:00
|
|
|
|
PR#3
|
2017-03-29 15:48:15 +00:00
|
|
|
|
PREFIX /A2OSX.BUILD
|
2015-03-14 21:47:37 +00:00
|
|
|
|
NEW
|
|
|
|
|
INC 1
|
|
|
|
|
AUTO 6
|
2015-11-22 22:30:06 +00:00
|
|
|
|
.LIST OFF
|
2015-03-14 21:47:37 +00:00
|
|
|
|
.OP 65C02
|
|
|
|
|
.OR $2000
|
2017-03-29 15:48:15 +00:00
|
|
|
|
.TF /A2OSX.BUILD/BIN/DNSINFO
|
2015-03-14 21:47:37 +00:00
|
|
|
|
*--------------------------------------
|
2017-03-29 15:48:15 +00:00
|
|
|
|
.INB /A2OSX.BUILD/INC/MACROS.I
|
|
|
|
|
.INB /A2OSX.BUILD/INC/A2OSX.I
|
|
|
|
|
.INB /A2OSX.BUILD/INC/LIBTCPIP.I
|
2015-03-14 21:47:37 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
ZPPTR1 .EQ ZPBIN
|
2015-10-19 20:35:00 +00:00
|
|
|
|
ZPPTR2 .EQ ZPBIN+2
|
2015-03-14 21:47:37 +00:00
|
|
|
|
*--------------------------------------
|
2015-09-13 20:35:07 +00:00
|
|
|
|
* File Header (16 Bytes)
|
2015-03-14 21:47:37 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.START cld
|
|
|
|
|
jmp (.1,x)
|
2015-09-13 20:35:07 +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 No 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.EVENT
|
|
|
|
|
.DA CS.QUIT
|
|
|
|
|
L.LIBTCPIP .DA LIBTCPIP
|
|
|
|
|
L.SSCANF.IP .DA SSCANF.IP
|
|
|
|
|
L.IP .DA IP
|
|
|
|
|
L.MSG0 .DA MSG0
|
|
|
|
|
L.MSG1 .DA MSG1
|
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
2016-10-18 06:26:24 +00:00
|
|
|
|
CS.INIT >LDYA L.LIBTCPIP
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL LoadLibYA
|
2015-03-14 21:47:37 +00:00
|
|
|
|
sta hLIBTCPIP
|
2015-09-13 20:35:07 +00:00
|
|
|
|
|
2017-01-29 21:47:19 +00:00
|
|
|
|
.8 lda (pPs)
|
|
|
|
|
ora #S.PS.F.EVENT Now accept events
|
|
|
|
|
sta (pPs)
|
|
|
|
|
clc
|
|
|
|
|
rts
|
2016-10-08 20:53:45 +00:00
|
|
|
|
*--------------------------------------
|
2017-01-29 21:47:19 +00:00
|
|
|
|
CS.RUN >SYSCALL GetArgC
|
|
|
|
|
cmp #1
|
|
|
|
|
beq CS.RUN.DUMP
|
|
|
|
|
|
|
|
|
|
CS.RUN.ADD cmp #3
|
2016-10-08 20:53:45 +00:00
|
|
|
|
bne .9
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
|
|
|
|
>PUSHW L.IP
|
|
|
|
|
>PUSHW L.SSCANF.IP
|
2016-10-08 20:53:45 +00:00
|
|
|
|
lda #3
|
2017-08-24 12:46:48 +00:00
|
|
|
|
>SYSCALL GetArg.A
|
2015-03-14 21:47:37 +00:00
|
|
|
|
>PUSHYA
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL SSCANF
|
2015-03-14 21:47:37 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>PUSHW L.IP
|
2016-10-08 20:53:45 +00:00
|
|
|
|
lda #2
|
2017-08-24 12:46:48 +00:00
|
|
|
|
>SYSCALL GetArg.A
|
2015-09-13 20:35:07 +00:00
|
|
|
|
>PUSHYA
|
2015-03-14 21:47:37 +00:00
|
|
|
|
>LIBCALL hLIBTCPIP,LIBTCPIP.DNS.ADD
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
lda #0 tell TSKMGR that all done ok, but
|
|
|
|
|
sec we do not want to stay in memory
|
|
|
|
|
rts
|
|
|
|
|
|
2017-10-26 16:01:54 +00:00
|
|
|
|
.9 lda #K.E.SYN
|
2015-03-14 21:47:37 +00:00
|
|
|
|
sec
|
|
|
|
|
.99 rts
|
2017-01-29 21:47:19 +00:00
|
|
|
|
|
2017-08-25 06:37:21 +00:00
|
|
|
|
CS.RUN.DUMP >LIBCALL hLIBTCPIP,LIBTCPIP.DNS.GetC.ACHE
|
2015-03-14 21:47:37 +00:00
|
|
|
|
>STYA ZPPTR1
|
2016-10-18 06:26:24 +00:00
|
|
|
|
>LDYA L.MSG0
|
2017-08-25 15:02:16 +00:00
|
|
|
|
>SYSCALL PrintF.YA
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
2016-03-17 07:31:11 +00:00
|
|
|
|
lda #K.DNSCACHE.SIZE
|
|
|
|
|
sta EntryCount
|
2015-09-13 20:35:07 +00:00
|
|
|
|
|
2016-03-17 07:31:11 +00:00
|
|
|
|
.1 lda (ZPPTR1)
|
2015-03-14 21:47:37 +00:00
|
|
|
|
beq .2
|
|
|
|
|
|
2015-10-19 20:35:00 +00:00
|
|
|
|
ldy #S.DNSCACHE.TTL+4
|
|
|
|
|
.6 dey
|
2015-09-13 20:35:07 +00:00
|
|
|
|
lda (ZPPTR1),y
|
|
|
|
|
>PUSHA
|
2015-10-19 20:35:00 +00:00
|
|
|
|
cpy #S.DNSCACHE.TTL
|
|
|
|
|
bne .6
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
2016-03-17 07:31:11 +00:00
|
|
|
|
ldy #S.DNSCACHE.IP+4
|
|
|
|
|
.5 dey
|
|
|
|
|
lda (ZPPTR1),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
cpy #S.DNSCACHE.IP
|
|
|
|
|
bne .5
|
|
|
|
|
|
2015-03-14 21:47:37 +00:00
|
|
|
|
ldy #S.DNSCACHE.hNAME
|
|
|
|
|
lda (ZPPTR1),y
|
2017-08-25 06:37:21 +00:00
|
|
|
|
>SYSCALL GetMemPtr.A
|
2016-03-17 07:31:11 +00:00
|
|
|
|
>PUSHYA
|
2015-10-19 20:35:00 +00:00
|
|
|
|
|
2016-03-27 21:03:40 +00:00
|
|
|
|
ldy #S.DNSCACHE.ID
|
|
|
|
|
>PUSHB (ZPPTR1),y
|
|
|
|
|
iny
|
|
|
|
|
>PUSHB (ZPPTR1),y
|
|
|
|
|
|
2015-10-19 20:35:00 +00:00
|
|
|
|
>PUSHB (ZPPTR1) Entry Status
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
2016-10-18 06:26:24 +00:00
|
|
|
|
>LDYA L.MSG1
|
2017-08-25 15:02:16 +00:00
|
|
|
|
>SYSCALL PrintF.YA
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
|
|
|
|
.2 lda ZPPTR1
|
|
|
|
|
clc
|
|
|
|
|
adc #S.DNSCACHE
|
|
|
|
|
sta ZPPTR1
|
|
|
|
|
bcc .3
|
|
|
|
|
inc ZPPTR1+1
|
2015-10-19 20:35:00 +00:00
|
|
|
|
|
2016-03-17 07:31:11 +00:00
|
|
|
|
.3 dec EntryCount
|
|
|
|
|
bne .1
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
2015-10-19 20:35:00 +00:00
|
|
|
|
.8 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
|
|
|
|
|
*--------------------------------------
|
2017-01-29 21:47:19 +00:00
|
|
|
|
CS.EVENT sec
|
2015-03-14 21:47:37 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-10-08 20:53:45 +00:00
|
|
|
|
CS.QUIT lda hLIBTCPIP
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL UnloadLibA
|
2015-03-14 21:47:37 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.END
|
2016-10-24 15:54:43 +00:00
|
|
|
|
LIBTCPIP >PSTR "libtcpip.o"
|
|
|
|
|
SSCANF.IP >PSTR "%d.%d.%d.%d"
|
2017-02-28 16:58:36 +00:00
|
|
|
|
MSG0 >CSTR "STS TR.ID Hostname IP Address TTL\r\n"
|
|
|
|
|
MSG1 >CSTR "$%h $%H %32S %03d.%03d.%03d.%03d %L\r\n"
|
2015-03-14 21:47:37 +00:00
|
|
|
|
hLIBTCPIP .BS 1
|
2016-10-08 20:53:45 +00:00
|
|
|
|
|
2015-03-14 21:47:37 +00:00
|
|
|
|
IP .BS 4
|
2016-03-17 07:31:11 +00:00
|
|
|
|
EntryCount .BS 1
|
2015-03-14 21:47:37 +00:00
|
|
|
|
MAN
|
2017-03-29 15:48:15 +00:00
|
|
|
|
SAVE /A2OSX.SRC/BIN/DNSINFO.S
|
2015-03-14 21:47:37 +00:00
|
|
|
|
ASM
|