mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-04 03:05:43 +00:00
55 lines
926 B
Plaintext
55 lines
926 B
Plaintext
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
|