A2osX/LIB/LIBETALK.S.txt

235 lines
5.1 KiB
Plaintext
Raw Normal View History

2019-01-05 20:33:08 +00:00
NEW
2019-05-27 06:01:59 +00:00
AUTO 3,1
2019-01-05 20:33:08 +00:00
.LIST OFF
.OP 65C02
.OR $2000
2019-12-03 15:42:17 +00:00
.TF lib/libetalk
2023-10-18 05:41:12 +00:00
*--------------------------------------
ETLK.Q.SIZE .EQ 8
2019-01-05 20:33:08 +00:00
*--------------------------------------
2021-05-19 12:44:47 +00:00
.INB inc/macros.i
.INB inc/a2osx.i
2023-10-18 05:41:12 +00:00
.INB inc/kernel.i
.INB inc/mli.e.i
2021-05-19 12:44:47 +00:00
.INB inc/nic.i
.INB inc/eth.i
.INB inc/lib.net.i
.INB inc/libetalk.i
2019-01-05 20:33:08 +00:00
*--------------------------------------
ZPFrameInPtr .EQ ZPLIB
ZPFrameInLen .EQ ZPLIB+2
ZPDataInPtr .EQ ZPLIB+4
ZPDataInLen .EQ ZPLIB+6
ZPFrameOutPtr .EQ ZPLIB+8
ZPFrameOutLen .EQ ZPLIB+10
ZPDataOutPtr .EQ ZPLIB+12
ZPDataOutLen .EQ ZPLIB+14
2019-03-11 07:01:40 +00:00
ZPPtrADDR .EQ ZPLIB+16
ZPPtrMAC .EQ ZPLIB+18
ZPCachePtr .EQ ZPLIB+24
ZPTmpPtr1 .EQ ZPLIB+26
2019-01-05 20:33:08 +00:00
*--------------------------------------
* File Header (16 Bytes)
*--------------------------------------
CS.START cld
jmp (.1,x)
.DA #$61 6502,Level 1 (65c02)
.DA #1 BIN Layout Version 1
.DA 0
.DA CS.END-CS.START
.DA 0
.DA 0
.DA 0
*--------------------------------------
* Relocation Table
*--------------------------------------
.1 .DA LIB.LOAD
.DA LIB.UNLOAD
2019-01-14 16:37:56 +00:00
.DA CFG.SET
.DA CFG.GET
2019-01-05 20:33:08 +00:00
.DA INCOMING
.DA PULSE
2019-03-11 07:01:40 +00:00
.DA AARP.CLEAR
.DA AARP.QUERY
.DA AARP.ADD
2023-10-18 05:41:12 +00:00
.DA AARP.GetCache
.DA NBP.Clear
.DA NBP.Query
.DA NBP.Lookup
.DA NBP.GetCache
2019-03-11 07:01:40 +00:00
L.IOCTL .DA IOCTL
L.AARP.REQ .DA AARP.REQ
L.AARP.REP .DA AARP.REP
L.AARP.CACHE .DA AARP.CACHE
2023-10-18 05:41:12 +00:00
J.DDP.IN .DA RTMP.IN.REP
.DA NBP.IN
.DA ATP.IN
.DA AEP.IN
.DA RTMP.IN.REQ
.DA ZIP.IN
.DA ADSP.IN
2019-01-05 20:33:08 +00:00
*--------------------------------------
2019-01-14 16:37:56 +00:00
L.ETKCFG .DA ETKCFG
2019-01-05 20:33:08 +00:00
.DA 0
*--------------------------------------
2019-03-11 07:01:40 +00:00
LIB.LOAD ldx RefCount
bne .8
jsr AARP.CLEAR
2023-10-18 05:41:12 +00:00
2019-03-11 07:01:40 +00:00
.8 inc RefCount
2019-01-14 16:37:56 +00:00
clc
rts
2019-01-05 20:33:08 +00:00
*--------------------------------------
2019-03-11 07:01:40 +00:00
LIB.UNLOAD dec RefCount
2019-01-14 07:11:50 +00:00
clc
rts
2019-01-05 20:33:08 +00:00
*--------------------------------------
INCOMING sta hFrameIn
2019-03-11 07:01:40 +00:00
>PULLW ZPTmpPtr1
2019-01-05 20:33:08 +00:00
ldy #S.IOCTL.BUFPTR+3
2023-10-18 05:41:12 +00:00
2019-03-11 07:01:40 +00:00
.1 lda (ZPTmpPtr1),y Get Frame Ptr & Len
2019-01-14 16:37:56 +00:00
sta ZPFrameInPtr-S.IOCTL.BUFPTR,y
2019-01-05 20:33:08 +00:00
dey
bpl .1
2019-03-11 07:01:40 +00:00
2023-10-18 05:41:12 +00:00
ldy #S.ETH.802.3.LENGTH
lda (ZPFrameInPtr),y
cmp /$800
bcs .9 EII, not for us
lda #$AA SRCSAP=DSTSAP=$AA
ldy #S.ETH.802.2.DSTSAP
cmp (ZPFrameInPtr),y
bne .9
iny S.ETH.802.2.SRCSAP
cmp (ZPFrameInPtr),y
bne .9
2019-03-11 07:01:40 +00:00
ldy #S.ETH.SNAP.PROTO
lda (ZPFrameInPtr),y
2023-10-18 05:41:12 +00:00
cmp /S.ETH.SNAP.PROTO.DDP $80 for both AARP & DDP
bne .9
2019-03-11 07:01:40 +00:00
iny
2019-10-03 06:25:27 +00:00
lda (ZPFrameInPtr),y
2023-10-18 05:41:12 +00:00
cmp #S.ETH.SNAP.PROTO.DDP
2019-03-11 07:01:40 +00:00
bne .2
2023-10-18 05:41:12 +00:00
jmp DDP.IN
.2 cmp #S.ETH.SNAP.PROTO.AARP
2019-03-11 07:01:40 +00:00
bne .9
2023-10-18 05:41:12 +00:00
jmp AARP.IN
2019-03-11 07:01:40 +00:00
2023-10-18 05:41:12 +00:00
.9 lda #MLI.E.EOF
sec
2019-01-05 20:33:08 +00:00
rts
*--------------------------------------
2019-01-14 16:37:56 +00:00
*--------------------------------------
* A = S.EVT.F
2019-01-05 20:33:08 +00:00
*--------------------------------------
PULSE and #S.EVT.F.T1SEC
2019-01-14 16:37:56 +00:00
beq .9
2019-01-05 20:33:08 +00:00
2019-01-14 16:37:56 +00:00
.9 rts
2019-03-11 07:01:40 +00:00
*--------------------------------------
2021-05-19 12:44:47 +00:00
.INB usr/src/lib/libetalk.s.aarp
2023-10-18 05:41:12 +00:00
.INB usr/src/lib/libetalk.s.adsp
.INB usr/src/lib/libetalk.s.aep
.INB usr/src/lib/libetalk.s.atp
2021-05-19 12:44:47 +00:00
.INB usr/src/lib/libetalk.s.cfg
.INB usr/src/lib/libetalk.s.ddp
.INB usr/src/lib/libetalk.s.elap
.INB usr/src/lib/libetalk.s.frm
2023-10-18 05:41:12 +00:00
.INB usr/src/lib/libetalk.s.nbp
2021-05-19 12:44:47 +00:00
.INB usr/src/lib/libetalk.s.rtmp
2023-10-18 05:41:12 +00:00
.INB usr/src/lib/libetalk.s.zip
2019-01-05 20:33:08 +00:00
*--------------------------------------
CS.END
*--------------------------------------
2023-10-18 05:41:12 +00:00
MAC.BROADCAST .EQ *
2019-03-11 07:01:40 +00:00
AARP.REQ .HS 090007FFFFFF S.ETH.DSTMAC
AARP.REQ.SRCMAC .BS 6
.DA #0,#36 S.ETH.802.3.LENGTH
.HS AA S.ETH.802.2.DSTSAP
.HS AA S.ETH.802.2.SRCSAP
.HS 03 S.ETH.802.2.CTRL
.HS 00.00.00.80.F3 S.ETH.SNAP.PROTO
2023-10-18 05:41:12 +00:00
*--------------------------------------
2019-03-11 07:01:40 +00:00
.HS 00.01.80.9B.06.04
.HS 0001 Request
AARP.REQ.SHA .BS 6
AARP.REQ.SPA .BS 4
AARP.REQ.THA .BS 6
AARP.REQ.TPA .BS 4
.BS AARP.REQ+60-*
AARP.REQ.LEN .EQ 60
*--------------------------------------
AARP.REP .EQ *
AARP.REP.DSTMAC .BS 6
AARP.REP.SRCMAC .BS 6
.DA #0,#36 S.ETH.802.3.LENGTH
.HS AA S.ETH.802.2.DSTSAP
.HS AA S.ETH.802.2.SRCSAP
.HS 03 S.ETH.802.2.CTRL
.HS 00.00.00.80.F3 S.ETH.SNAP.PROTO
2023-10-18 05:41:12 +00:00
*--------------------------------------
2019-03-11 07:01:40 +00:00
.HS 00.01.80.9B.06.04
.HS 0002 Response
AARP.REP.SHA .BS 6
AARP.REP.SPA .BS 4
AARP.REP.THA .BS 6
AARP.REP.TPA .BS 4
.BS AARP.REP+60-*
AARP.REP.LEN .EQ 60
*--------------------------------------
2023-10-18 05:41:12 +00:00
DDP.LLC .HS AA
.HS AA
.HS 03
.HS 08.00.07
.HS 80.9B
DDP.LLC.L .EQ *-DDP.LLC
*--------------------------------------
NBP.ID .BS 1
*--------------------------------------
ETLK.Q.Tail .BS 1
ETLK.Q.Head .BS 1
ETLK.Q.hMem .BS ETLK.Q.SIZE
ETLK.Q.State .BS ETLK.Q.SIZE
ETLK.Q.Retry .BS ETLK.Q.SIZE
ETLK.Q.LenL .BS ETLK.Q.SIZE
ETLK.Q.LenH .BS ETLK.Q.SIZE
*--------------------------------------
2019-03-11 07:01:40 +00:00
RefCount .BS 1
IOCTL .BS S.IOCTL
2019-01-05 20:33:08 +00:00
hFrameIn .BS 1
2023-10-18 05:41:12 +00:00
hFrameOut .BS 1
2019-01-14 16:37:56 +00:00
ETKCFG .BS S.ETKCFG
2019-03-11 07:01:40 +00:00
AARP.CACHE .BS K.AARPCACHE.SIZE*S.AARPCACHE
AARP.TmpCache .BS S.AARPCACHE
TmpDWord .BS 4
TmpOffset .BS 2
2019-01-05 20:33:08 +00:00
*--------------------------------------
MAN
2021-05-19 12:44:47 +00:00
SAVE usr/src/lib/libetalk.s
2019-01-05 20:33:08 +00:00
ASM