mirror of
https://github.com/A2osX/A2osX.git
synced 2024-08-15 04:29:35 +00:00
59 lines
1.0 KiB
Plaintext
59 lines
1.0 KiB
Plaintext
|
PR#3
|
|||
|
PREFIX /A2OSX.SRC
|
|||
|
NEW
|
|||
|
INC 1
|
|||
|
AUTO 6
|
|||
|
.LIST OFF
|
|||
|
*--------------------------------------
|
|||
|
ICMPListener ldy #S.ICMP.TYPE
|
|||
|
lda (ZPFrameBase1),y
|
|||
|
cmp #S.ICMP.TYPE.ECHOREQ
|
|||
|
bne .9
|
|||
|
|
|||
|
jsr GetIPCFG
|
|||
|
|
|||
|
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
|
|||
|
|
|||
|
>LIBCALL hLIBTCPIP,LIBTCPIP.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
|
|||
|
>LIBCALL hLIBTCPIP,LIBTCPIP.SEND.ICMP.FRAME
|
|||
|
|
|||
|
pla
|
|||
|
>SYSCALL SYS.FreeMemA
|
|||
|
clc
|
|||
|
rts
|
|||
|
.9 sec
|
|||
|
rts
|
|||
|
|
|||
|
*--------------------------------------
|
|||
|
|
|||
|
*--------------------------------------
|
|||
|
MAN
|
|||
|
SAVE SBIN/TCPIP.S.ICMP
|
|||
|
LOAD SBIN/TCPIP.S
|
|||
|
ASM
|