A2osX/LIB/LIBTCPIP.S.ICMP.txt
2016-01-16 23:04:22 +01:00

55 lines
926 B
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

PR#3
PREFIX /A2OSX.SRC
NEW
INC 1
AUTO 6
.LIST OFF
*--------------------------------------
ICMP.IN ldy #S.ICMP.TYPE
lda (ZPFrameBase1),y
cmp #S.ICMP.TYPE.ECHOREQ
bne .9
ldy #S.IP.DST
ldx #S.IPCFG.IP
.10 lda (ZPFrameBase1),y
cmp IPCFG,x
bne .9
iny
inx
cpx #S.IPCFG.IP+4
bne .10
jsr NEW.ICMP.FRAME
bcs .9
phx
>STYA ZPFrameBase2
ldy #S.ICMP.TYPE
lda #S.ICMP.TYPE.ECHOREP
sta (ZPFrameBase2),y
jsr MakeIPReply
ldy #S.ICMP.IDENTIFIER
.1 lda (ZPFrameBase1),y
sta (ZPFrameBase2),y
iny
cpy #ZPFrameLen1
bne .1
>PUSHW ZPFrameLen1
>PUSHW ZPFrameBase2
jsr SEND.ICMP.FRAME
pla
>SYSCALL SYS.FreeMemA
clc
rts
.9 sec
rts
*--------------------------------------
MAN
SAVE LIB/LIBTCPIP.S.ICMP
LOAD LIB/LIBTCPIP.S
ASM