A2osX/LIB/LIBETALK.S.FRM.txt

160 lines
2.7 KiB
Plaintext
Raw Normal View History

2019-03-11 07:01:40 +00:00
NEW
2019-05-27 06:01:59 +00:00
AUTO 3,1
2019-03-11 07:01:40 +00:00
*--------------------------------------
2023-10-18 05:41:12 +00:00
FRM.NewDDP >STYA ZPDataOutLen
2021-05-19 12:44:47 +00:00
2023-10-18 05:41:12 +00:00
lda ZPDataOutLen
clc
adc #S.DDP2
sta ZPFrameOutLen
tay
lda ZPDataOutLen+1
adc /S.DDP2
sta ZPFrameOutLen+1
bne .10
cpy #60
bcs .10
ldy #60
.10 >SYSCALL2 GetMem
bcs .9
>STYA ZPFrameOutPtr
stx hFrameOut
lda ZPFrameOutLen
sec
sbc #S.ETH.802.2.LLC
ldy #S.ETH.802.3.LENGTH+1
sta (ZPFrameOutPtr),y
lda ZPFrameOutLen+1
sbc /S.ETH.802.2.LLC
dey
sta (ZPFrameOutPtr),y
ldx #DDP.LLC.L-1
ldy #S.ETH.802.2.LLC+DDP.LLC.L-1
.1 lda DDP.LLC,x
sta (ZPFrameOutPtr),y
dey
dex
bpl .1
lda ZPFrameOutLen
sec
sbc #S.ETH.SNAP
ldy #S.DDP2.DATALEN+1
sta (ZPFrameOutPtr),y
lda ZPFrameOutLen+1
sbc /S.ETH.SNAP
dey
sta (ZPFrameOutPtr),y
ldy #S.DDP2.CHECKSUM
lda #0
sta (ZPFrameOutPtr),y
iny
sta (ZPFrameOutPtr),y
lda hFrameOut
clc
.9 rts
*--------------------------------------
FRM.SendDDP ldy #S.DDP2.SRC.NET
lda ETKCFG+S.ETKCFG.NetID+1
sta (ZPFrameOutPtr),y
iny
lda ETKCFG+S.ETKCFG.NetID
sta (ZPFrameOutPtr),y
ldy #S.DDP2.SRC.NOD
lda ETKCFG+S.ETKCFG.NodID
sta (ZPFrameOutPtr),y
ldy #S.DDP2.DST.NOD
lda (ZPFrameOutPtr),y
beq .10 DST.NOD = 0 : any router
cmp #$FF Broadcast
bne FRM.SendAARP
.10 ldy #S.DDP2.DST.NET
lda (ZPFrameOutPtr),y
iny
ora (ZPFrameOutPtr),y
bne .2
ldy #5
.1 lda MAC.BROADCAST,y
sta (ZPFrameOutPtr),y
dey
bpl .1
bra FRM.Send
.2 ldy #5
.3 lda ETKCFG+S.ETKCFG.MCAddress+1,y
sta (ZPFrameOutPtr),y
dey
bpl .3
bra FRM.Send
FRM.SendAARP >DEBUG
2019-03-11 07:01:40 +00:00
*--------------------------------------
FRM.Send ldx #3
2020-03-23 07:08:27 +00:00
2019-03-11 07:01:40 +00:00
.1 lda ZPFrameOutPtr,x Get Frame Ptr & Len
sta IOCTL+S.IOCTL.BUFPTR,x
dex
bpl .1
2023-10-18 05:41:12 +00:00
lda IOCTL+S.IOCTL.BYTECNT+1
bne FRM.Send.IOCTL
lda #60
cmp IOCTL+S.IOCTL.BYTECNT
bcc FRM.Send.IOCTL
sta IOCTL+S.IOCTL.BYTECNT
2020-03-23 07:08:27 +00:00
FRM.Send.IOCTL >PUSHB ETKCFG+S.NETCFG.DevID
2019-03-11 07:01:40 +00:00
>PUSHBI IOCTL.WRITE
2020-03-23 07:08:27 +00:00
>PUSHW L.IOCTL
2019-05-05 17:15:37 +00:00
>SYSCALL2 IOCTL
2019-03-11 07:01:40 +00:00
rts
*--------------------------------------
2023-10-18 05:41:12 +00:00
FRM.DiscardIn lda hFrameIn
beq .8
stz hFrameIn
>SYSCALL2 FreeMem
.8 clc
rts
*--------------------------------------
FRM.DiscardOut lda hFrameOut
beq .8
stz hFrameOut
>SYSCALL2 FreeMem
.8 sec
rts
*--------------------------------------
2019-03-11 07:01:40 +00:00
MAN
2021-05-19 12:44:47 +00:00
SAVE usr/src/lib/libetalk.s.frm
LOAD usr/src/lib/libetalk.s
2019-03-11 07:01:40 +00:00
ASM