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-06-03 18:30:57 +00:00
|
|
|
|
.TF /A2OSX.BOOT/BIN/PING
|
2015-03-14 21:47:37 +00:00
|
|
|
|
*--------------------------------------
|
2016-10-26 20:51:06 +00:00
|
|
|
|
.INB /A2OSX.DEV/INC/MACROS.I
|
|
|
|
|
.INB /A2OSX.DEV/INC/A2OSX.I
|
|
|
|
|
.INB /A2OSX.DEV/INC/LIBTCPIP.I
|
2015-03-14 21:47:37 +00:00
|
|
|
|
*--------------------------------------
|
2016-04-04 20:54:55 +00:00
|
|
|
|
TIMEOUT.MAX .EQ 20 2 sec.
|
2015-03-14 21:47:37 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
ZPFrameBase1 .EQ ZPBIN
|
|
|
|
|
ZPFrameLen1 .EQ ZPBIN+2
|
|
|
|
|
ZPFramePtr1 .EQ ZPBIN+4
|
2015-11-22 22:30:06 +00:00
|
|
|
|
ZPIPCfgPtr .EQ ZPBIN+6
|
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 DS.END-DS.START Data Segment to Allocate
|
|
|
|
|
.DA 0
|
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
2015-03-14 21:47:37 +00:00
|
|
|
|
.1 .DA CS.INIT
|
|
|
|
|
.DA CS.RUN
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.DA CS.DOEVENT
|
2015-03-14 21:47:37 +00:00
|
|
|
|
.DA CS.QUIT
|
|
|
|
|
L.LIBTCPIP .DA LIBTCPIP
|
|
|
|
|
L.MSG0 .DA MSG0
|
|
|
|
|
L.MSG1 .DA MSG1
|
|
|
|
|
L.MSG2 .DA MSG2
|
|
|
|
|
L.MSG3 .DA MSG3
|
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
2016-10-24 15:54:43 +00:00
|
|
|
|
CS.INIT >SYSCALL GetArgC
|
2016-08-17 06:25:58 +00:00
|
|
|
|
cmp #1
|
2015-03-14 21:47:37 +00:00
|
|
|
|
bne .1
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
2015-03-14 21:47:37 +00:00
|
|
|
|
lda #SYSMGR.ERRSYN
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
2016-10-17 06:21:04 +00:00
|
|
|
|
.1 >LDYA L.LIBTCPIP
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL LoadLibYA
|
2015-03-14 21:47:37 +00:00
|
|
|
|
sta hLIBTCPIP
|
|
|
|
|
|
|
|
|
|
>LIBCALL hLIBTCPIP,LIBTCPIP.GET.IPCFG is TCPIP loaded ?
|
|
|
|
|
bcs .9
|
2015-11-22 22:30:06 +00:00
|
|
|
|
>STYA ZPIPCfgPtr
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
2015-11-22 22:30:06 +00:00
|
|
|
|
lda (ZPIPCfgPtr) Configured ?
|
2015-03-14 21:47:37 +00:00
|
|
|
|
bpl .9
|
|
|
|
|
|
|
|
|
|
ldy #S.IPCFG.HDEV
|
2015-11-22 22:30:06 +00:00
|
|
|
|
lda (ZPIPCfgPtr),y
|
2015-03-14 21:47:37 +00:00
|
|
|
|
sta hDev
|
|
|
|
|
|
|
|
|
|
lda A2OSX.RANDOM16
|
2015-06-03 18:30:57 +00:00
|
|
|
|
ldy #Identifier
|
|
|
|
|
sta (pData),y
|
2015-03-14 21:47:37 +00:00
|
|
|
|
lda A2OSX.RANDOM16+1
|
2015-06-03 18:30:57 +00:00
|
|
|
|
iny
|
|
|
|
|
sta (pData),y
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
lda #0
|
|
|
|
|
ldy #Sequence
|
|
|
|
|
sta (pData),y
|
|
|
|
|
iny
|
|
|
|
|
sta (pData),y
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
lda (pPs)
|
2015-03-14 21:47:37 +00:00
|
|
|
|
ora #S.PS.F.EVENT Now accept events
|
2015-06-03 18:30:57 +00:00
|
|
|
|
sta (pPs)
|
2015-03-14 21:47:37 +00:00
|
|
|
|
clc
|
|
|
|
|
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2016-03-13 21:51:50 +00:00
|
|
|
|
CS.RUN jsr Init.Timeout
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2016-03-13 21:51:50 +00:00
|
|
|
|
.1 >PUSHW pData DST.IP
|
2016-08-17 06:25:58 +00:00
|
|
|
|
lda #1
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL GetArgA
|
2015-09-13 20:35:07 +00:00
|
|
|
|
>PUSHYA
|
2016-03-13 21:51:50 +00:00
|
|
|
|
>LIBCALL hLIBTCPIP,LIBTCPIP.HST.GETBYNAME
|
|
|
|
|
bcc .2
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL Sleep
|
2016-03-13 21:51:50 +00:00
|
|
|
|
jsr Wait.Timeout
|
|
|
|
|
bcc .1
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
2016-08-17 06:25:58 +00:00
|
|
|
|
lda #1
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL GetArgA
|
2015-03-14 21:47:37 +00:00
|
|
|
|
>PUSHYA
|
2016-10-17 06:21:04 +00:00
|
|
|
|
>LDYA L.MSG0
|
2016-11-03 16:27:43 +00:00
|
|
|
|
>SYSCALL CPrintFYA
|
2016-03-13 21:51:50 +00:00
|
|
|
|
lda #1
|
2015-03-14 21:47:37 +00:00
|
|
|
|
sec
|
2016-03-13 21:51:50 +00:00
|
|
|
|
rts
|
|
|
|
|
|
2016-08-17 06:25:58 +00:00
|
|
|
|
.2 lda #1
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL GetArgA
|
2015-03-14 21:47:37 +00:00
|
|
|
|
>PUSHYA
|
2016-03-13 21:51:50 +00:00
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
ldy #3
|
|
|
|
|
>PUSHB (pData),y DST.IP+3
|
|
|
|
|
dey
|
|
|
|
|
>PUSHB (pData),y DST.IP+2
|
|
|
|
|
dey
|
|
|
|
|
>PUSHB (pData),y DST.IP+1
|
|
|
|
|
>PUSHB (pData) DST.IP
|
2016-10-17 06:21:04 +00:00
|
|
|
|
>LDYA L.MSG1
|
2016-11-03 16:27:43 +00:00
|
|
|
|
>SYSCALL CPrintFYA
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
|
|
|
|
CS.RUN.ECHO >LIBCALL hLIBTCPIP,LIBTCPIP.NEW.ICMP.FRAME
|
|
|
|
|
>STYA ZPFrameBase1
|
2015-06-03 18:30:57 +00:00
|
|
|
|
txa
|
|
|
|
|
ldy #hFrame
|
|
|
|
|
sta (pData),y
|
|
|
|
|
|
2016-03-13 21:51:50 +00:00
|
|
|
|
lda #S.ICMP+32-2
|
|
|
|
|
sta (ZPFrameBase1)
|
|
|
|
|
lda /S.ICMP+32-2
|
|
|
|
|
ldy #1
|
|
|
|
|
sta (ZPFrameBase1),y
|
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
ldx #3
|
|
|
|
|
ldy #0
|
|
|
|
|
.10 lda (pData),y
|
|
|
|
|
pha
|
|
|
|
|
iny
|
|
|
|
|
dex
|
|
|
|
|
bpl .10
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
|
|
|
|
ldx #3
|
|
|
|
|
ldy #S.IP.DST+3
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.1 pla
|
2015-03-14 21:47:37 +00:00
|
|
|
|
sta (ZPFrameBase1),y
|
|
|
|
|
dey
|
|
|
|
|
dex
|
|
|
|
|
bpl .1
|
|
|
|
|
|
|
|
|
|
ldy #S.ICMP.TYPE
|
|
|
|
|
lda #S.ICMP.TYPE.ECHOREQ
|
|
|
|
|
sta (ZPFrameBase1),y
|
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
ldy #Identifier
|
|
|
|
|
lda (pData),y
|
|
|
|
|
tax
|
2015-03-14 21:47:37 +00:00
|
|
|
|
iny
|
2015-06-03 18:30:57 +00:00
|
|
|
|
lda (pData),y
|
|
|
|
|
|
|
|
|
|
ldy #S.ICMP.IDENTIFIER+1
|
|
|
|
|
sta (ZPFrameBase1),y
|
|
|
|
|
dey
|
|
|
|
|
txa
|
2015-03-14 21:47:37 +00:00
|
|
|
|
sta (ZPFrameBase1),y
|
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
ldy #Sequence+1
|
|
|
|
|
lda (pData),y
|
|
|
|
|
tax
|
|
|
|
|
dey
|
|
|
|
|
lda (pData),y
|
|
|
|
|
inc
|
|
|
|
|
sta (pData),y
|
2015-03-14 21:47:37 +00:00
|
|
|
|
bne .2
|
2015-06-03 18:30:57 +00:00
|
|
|
|
pha
|
|
|
|
|
inx
|
|
|
|
|
txa
|
|
|
|
|
sta (pData),y
|
|
|
|
|
pla
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
|
|
|
|
.2 ldy #S.ICMP.SEQUENCE
|
|
|
|
|
sta (ZPFrameBase1),y
|
|
|
|
|
iny
|
2015-06-03 18:30:57 +00:00
|
|
|
|
txa
|
2015-03-14 21:47:37 +00:00
|
|
|
|
sta (ZPFrameBase1),y
|
|
|
|
|
|
2016-03-13 21:51:50 +00:00
|
|
|
|
ldx #31
|
|
|
|
|
ldy #S.ICMP+31
|
|
|
|
|
.21 txa
|
|
|
|
|
and #$0f
|
|
|
|
|
ora #$60
|
|
|
|
|
sta (ZPFrameBase1),y
|
|
|
|
|
dey
|
|
|
|
|
dex
|
|
|
|
|
bpl .21
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
2016-03-13 21:51:50 +00:00
|
|
|
|
jsr Init.Timeout
|
|
|
|
|
|
|
|
|
|
.3 ldy #hFrame
|
2015-06-03 18:30:57 +00:00
|
|
|
|
lda (pData),y
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL GetMemPtrA
|
2015-03-14 21:47:37 +00:00
|
|
|
|
>PUSHYA
|
|
|
|
|
>LIBCALL hLIBTCPIP,LIBTCPIP.SEND.ICMP.FRAME
|
|
|
|
|
bcc .4
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL Sleep
|
2016-03-13 21:51:50 +00:00
|
|
|
|
|
|
|
|
|
jsr Wait.Timeout
|
|
|
|
|
bcc .3
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.4 ldy #hFrame
|
|
|
|
|
lda (pData),y
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL FreeMemA
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
ldy #bReply
|
|
|
|
|
lda #0
|
|
|
|
|
sta (pData),y
|
2016-03-13 21:51:50 +00:00
|
|
|
|
|
|
|
|
|
jsr Init.Timeout
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
2016-10-24 15:54:43 +00:00
|
|
|
|
CS.RUN.WAIT >SYSCALL Sleep
|
2015-06-03 18:30:57 +00:00
|
|
|
|
ldy #bReply
|
|
|
|
|
lda (pData),y
|
2015-03-14 21:47:37 +00:00
|
|
|
|
bne .1
|
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
ldy #bCTRLC
|
|
|
|
|
lda (pData),y
|
2015-03-14 21:47:37 +00:00
|
|
|
|
bne CS.RUN.ERROR
|
2016-03-13 21:51:50 +00:00
|
|
|
|
|
|
|
|
|
jsr Wait.Timeout
|
|
|
|
|
bcc CS.RUN.WAIT
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
ldy #3
|
|
|
|
|
>PUSHB (pData),y DST.IP+3
|
|
|
|
|
dey
|
|
|
|
|
>PUSHB (pData),y DST.IP+2
|
|
|
|
|
dey
|
|
|
|
|
>PUSHB (pData),y DST.IP+1
|
|
|
|
|
>PUSHB (pData) DST.IP
|
2016-10-17 06:21:04 +00:00
|
|
|
|
>LDYA L.MSG2
|
2016-11-03 16:27:43 +00:00
|
|
|
|
>SYSCALL CPrintFYA
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.1 ldy #bCTRLC
|
|
|
|
|
lda (pData),y
|
2015-03-14 21:47:37 +00:00
|
|
|
|
bne CS.RUN.ERROR
|
2015-06-03 18:30:57 +00:00
|
|
|
|
ldy #TimeOut
|
|
|
|
|
lda (pData),y
|
2015-03-14 21:47:37 +00:00
|
|
|
|
beq .2
|
|
|
|
|
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL Sleep
|
2015-03-14 21:47:37 +00:00
|
|
|
|
bra .1
|
|
|
|
|
|
|
|
|
|
.2 jmp CS.RUN.ECHO
|
|
|
|
|
|
|
|
|
|
CS.RUN.ERROR sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2015-06-03 18:30:57 +00:00
|
|
|
|
CS.DOEVENT lda (pEvent)
|
2016-03-13 21:51:50 +00:00
|
|
|
|
bpl .1 is it a TIMER event?
|
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
ldy #TimeOut
|
|
|
|
|
lda (pData),y
|
2016-03-13 21:51:50 +00:00
|
|
|
|
beq .9
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
2016-03-13 21:51:50 +00:00
|
|
|
|
dec
|
2015-06-03 18:30:57 +00:00
|
|
|
|
sta (pData),y
|
2016-03-13 21:51:50 +00:00
|
|
|
|
sec do not discard TIMER event
|
2015-03-14 21:47:37 +00:00
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.1 lda (pEvent)
|
|
|
|
|
and #S.EVT.F.KEY is it a KEY event?
|
|
|
|
|
beq .2
|
|
|
|
|
|
|
|
|
|
ldy #S.EVT.hDEV is Event from active IN device?
|
|
|
|
|
lda (pEvent),y
|
|
|
|
|
ldy #S.PS.hINDEV
|
2015-06-03 18:30:57 +00:00
|
|
|
|
cmp (pPs),y
|
2015-03-14 21:47:37 +00:00
|
|
|
|
bne .9
|
|
|
|
|
|
|
|
|
|
ldy #S.EVT.DATAHI is it an O or SAPPLE key ?
|
|
|
|
|
lda (pEvent),y
|
|
|
|
|
bne .9
|
|
|
|
|
|
|
|
|
|
ldy #S.EVT.DATALO
|
|
|
|
|
lda (pEvent),y
|
|
|
|
|
cmp #$03 Ctrl-C
|
|
|
|
|
bne .8
|
|
|
|
|
|
|
|
|
|
lda #$FF
|
2015-06-03 18:30:57 +00:00
|
|
|
|
ldy #bCTRLC
|
|
|
|
|
sta (pData),y
|
2015-03-14 21:47:37 +00:00
|
|
|
|
bra .8
|
|
|
|
|
|
|
|
|
|
.2 lda (pEvent)
|
|
|
|
|
and #S.EVT.F.NET
|
|
|
|
|
beq .9
|
|
|
|
|
|
|
|
|
|
ldy #S.EVT.hDEV
|
|
|
|
|
lda (pEvent),y
|
|
|
|
|
cmp hDev
|
|
|
|
|
bne .9
|
|
|
|
|
|
|
|
|
|
ldy #S.EVT.DATALO Get Frame hMem
|
|
|
|
|
lda (pEvent),y
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL GetMemPtrA
|
2015-03-14 21:47:37 +00:00
|
|
|
|
>STYA ZPFrameBase1
|
|
|
|
|
|
|
|
|
|
ldy #S.IP.PROTOCOL
|
|
|
|
|
lda (ZPFrameBase1),y
|
|
|
|
|
cmp #S.IP.PROTOCOL.ICMP
|
|
|
|
|
|
|
|
|
|
bne .9
|
|
|
|
|
|
|
|
|
|
ldy #S.ICMP.TYPE
|
|
|
|
|
lda (ZPFrameBase1),y
|
|
|
|
|
cmp #S.ICMP.TYPE.ECHOREP
|
|
|
|
|
bne .9
|
|
|
|
|
|
|
|
|
|
ldy #S.ICMP.IDENTIFIER
|
|
|
|
|
lda (ZPFrameBase1),y
|
2015-06-03 18:30:57 +00:00
|
|
|
|
tax
|
2015-03-14 21:47:37 +00:00
|
|
|
|
iny
|
|
|
|
|
lda (ZPFrameBase1),y
|
2015-06-03 18:30:57 +00:00
|
|
|
|
ldy #Identifier+1
|
|
|
|
|
cmp (pData),y
|
2015-03-14 21:47:37 +00:00
|
|
|
|
bne .9
|
2015-06-03 18:30:57 +00:00
|
|
|
|
dey
|
|
|
|
|
txa
|
|
|
|
|
cmp (pData),y
|
|
|
|
|
bne .9
|
|
|
|
|
|
2015-03-14 21:47:37 +00:00
|
|
|
|
jsr CS.EVENT.REPLY
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.8 clc
|
2015-03-14 21:47:37 +00:00
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-03-13 21:51:50 +00:00
|
|
|
|
CS.EVENT.REPLY lda #TIMEOUT.MAX
|
2015-03-14 21:47:37 +00:00
|
|
|
|
sec
|
2016-03-13 21:51:50 +00:00
|
|
|
|
ldy #TimeOut
|
|
|
|
|
sbc (pData),y
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
|
|
|
|
stz TimeOut.ms
|
|
|
|
|
stz TimeOut.ms+1
|
|
|
|
|
|
|
|
|
|
tay
|
|
|
|
|
beq .3
|
|
|
|
|
|
|
|
|
|
.1 lda TimeOut.ms
|
|
|
|
|
clc
|
2016-03-13 21:51:50 +00:00
|
|
|
|
adc #100
|
2015-03-14 21:47:37 +00:00
|
|
|
|
sta TimeOut.ms
|
|
|
|
|
bcc .2
|
2015-06-03 18:30:57 +00:00
|
|
|
|
inc TimeOut
|
2015-03-14 21:47:37 +00:00
|
|
|
|
.2 dey
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
.3 >PUSHW TimeOut.ms
|
|
|
|
|
ldy #S.IP.TTL
|
|
|
|
|
>PUSHB (ZPFrameBase1),y
|
|
|
|
|
|
|
|
|
|
ldy #S.ICMP.SEQUENCE+1
|
|
|
|
|
>PUSHB (ZPFrameBase1),y
|
|
|
|
|
dey
|
|
|
|
|
>PUSHB (ZPFrameBase1),y
|
|
|
|
|
|
|
|
|
|
ldy #S.IP.SRC+3
|
|
|
|
|
>PUSHB (ZPFrameBase1),y
|
|
|
|
|
dey
|
|
|
|
|
>PUSHB (ZPFrameBase1),y
|
|
|
|
|
dey
|
|
|
|
|
>PUSHB (ZPFrameBase1),y
|
|
|
|
|
dey
|
|
|
|
|
>PUSHB (ZPFrameBase1),y
|
|
|
|
|
|
2016-10-17 06:21:04 +00:00
|
|
|
|
>LDYA L.MSG3
|
2016-11-03 16:27:43 +00:00
|
|
|
|
>SYSCALL CPrintFYA
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
ldy #bReply
|
|
|
|
|
lda (pData),y
|
|
|
|
|
inc
|
|
|
|
|
sta (pData),y
|
2015-03-14 21:47:37 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.QUIT lda hLIBTCPIP
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL UnloadLibA
|
2015-03-14 21:47:37 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-03-13 21:51:50 +00:00
|
|
|
|
Init.Timeout ldy #TimeOut
|
|
|
|
|
lda #TIMEOUT.MAX
|
|
|
|
|
sta (pData),y
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
Wait.TimeOut sec
|
|
|
|
|
ldy #TimeOut
|
|
|
|
|
lda (pData),y
|
|
|
|
|
beq .9
|
|
|
|
|
ldy #bCTRLC
|
|
|
|
|
lda (pData),y
|
|
|
|
|
bmi .9
|
|
|
|
|
clc
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2015-03-14 21:47:37 +00:00
|
|
|
|
CS.END
|
2016-10-24 15:54:43 +00:00
|
|
|
|
LIBTCPIP >PSTR "libtcpip.o"
|
|
|
|
|
MSG0 >CSTR "%S: Unknown host\n"
|
|
|
|
|
MSG1 >CSTR "PING %d.%d.%d.%d (%S)\n"
|
|
|
|
|
MSG2 >CSTR "%d.%d.%d.%d: TimeOut/Host unreachable\n"
|
|
|
|
|
MSG3 >CSTR "32 bytes from %d.%d.%d.%d, icmp_seq=%D, ttl=%d, time=%D ms\n"
|
2015-03-14 21:47:37 +00:00
|
|
|
|
hLIBTCPIP .BS 1
|
|
|
|
|
hDev .BS 1
|
2015-06-03 18:30:57 +00:00
|
|
|
|
TimeOut.ms .BS 2
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.DUMMY
|
|
|
|
|
.OR 0
|
|
|
|
|
DS.START
|
2015-03-14 21:47:37 +00:00
|
|
|
|
DST.IP .BS 4
|
|
|
|
|
hFrame .BS 1
|
|
|
|
|
TimeOut .BS 1
|
|
|
|
|
Identifier .BS 2
|
|
|
|
|
Sequence .BS 2
|
|
|
|
|
bCTRLC .BS 1
|
|
|
|
|
bReply .BS 1
|
|
|
|
|
DS.END
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.ED
|
2015-03-14 21:47:37 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
|
|
|
|
SAVE BIN/PING.S
|
|
|
|
|
ASM
|