A2osX/BIN/ATBROWSE.S.txt
2020-08-17 22:47:31 +02:00

195 lines
3.6 KiB
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.

NEW
AUTO 3,1
.LIST OFF
.OP 65C02
.OR $2000
.TF bin/atbrowse
*--------------------------------------
.INB inc/macros.i
.INB inc/a2osx.i
.INB inc/mli.i
.INB inc/mli.e.i
.INB inc/appletalk.i
*--------------------------------------
.DUMMY
.OR ZPBIN
ZS.START
ZPAtlkParams .BS 2
ZPPTR1 .BS 2
ZPPTR2 .BS 2
hBuf .BS 1
ZS.END .ED
*--------------------------------------
* 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 CS
.DA DS.END-DS.START DS
.DA #64 SS
.DA #4 ZP
.DA 0
*--------------------------------------
* Relocation Table
*--------------------------------------
.1 .DA CS.INIT
.DA CS.RUN
.DA CS.DOEVENT
.DA CS.QUIT
L.MSG.NOATK .DA MSG.NOATK
L.MSG.ATKERR .DA MSG.ATKERR
L.MSG.NETNODE .DA MSG.NETNODE
L.SEARCH.STRING .DA SEARCH.STRING
L.MSG.DUMP0 .DA MSG.DUMP0
L.MSG.DUMP .DA MSG.DUMP
.DA 0
*--------------------------------------
CS.INIT clc
rts
*--------------------------------------
CS.RUN lda #AT.GetInfo
>STA.G P.GetInfo+1
>LEA.G P.GetInfo
jsr A2osX.ATKCALL
bcc CS.RUN.ATKOK
pha
>LDYA L.MSG.NOATK
>SYSCALL PutS
pla
sec
rts
CS.RUN.ATKOK >PUSHW L.MSG.NETNODE
>PUSHW.G P.GetInfo+$8 NET
>PUSHB.G P.GetInfo+$E NODE
>PUSHBI 3
>SYSCALL PrintF
lda #AT.LookupName
>STA.G P.LookupName+1
>LDYA L.SEARCH.STRING
>STYA.G P.LookupName+$08 Entry Name Ptr
lda #4
>STA.G P.LookupName+$C RetInt
>STA.G P.LookupName+$D RetCnt
>LDYAI 1024
>STYA.G P.LookupName+$10 BufLen
>LDYAI 1024
>SYSCALL GetMem
bcs .99
>STYA ZPPTR1
stx hBuf
>STYA.G P.LookupName+$12 BufPtr
lda #16
>STA.G P.LookupName+$16 MaxMatch
>LEA.G P.LookupName
jsr CS.RUN.GOATLK
.99 bcs .9
>LDA.G P.LookupName+$17
beq .8
>LDYA L.MSG.DUMP0
>SYSCALL PutS
bcs .9
.1 >PUSHW L.MSG.DUMP
ldy #0
.2 >PUSHB (ZPPTR1),y
iny
cpy #5
bne .2
lda ZPPTR1
clc
adc #5
sta ZPPTR2
lda ZPPTR1+1
adc #0
sta ZPPTR2+2
>PUSHW ZPPTR2
>PUSHBI 7
>SYSCALL PrintF
bcs .9
lda ZPPTR2
sec
adc (ZPPTR2)
sta ZPPTR1
lda ZPPTR2+1
adc #0
sta ZPPTR1+1
>DEC.G P.LookupName+$17
bne .1
lda #0
.8 sec
.9 rts
*--------------------------------------
CS.RUN.GOATLK >STYA ZPAtlkParams
jsr A2osX.ATKCALL
bcc .9
pha
>PUSHW L.MSG.ATKERR
ldy #3
lda (ZPAtlkParams),y
>PUSHA
dey
lda (ZPAtlkParams),y
>PUSHA
>PUSHBI 2
>SYSCALL PrintF
pla
sec
.9 rts
*--------------------------------------
CS.DOEVENT sec
rts
*--------------------------------------
CS.QUIT lda hBuf
beq .8
>SYSCALL FreeMem
.8 clc
rts
*--------------------------------------
CS.END
MSG.NOATK .AZ "AppleTalk Not Loaded."
MSG.ATKERR .AZ "AppleTalk ERR:%H\r\n"
MSG.NETNODE .AZ "Network/Node:$%H/$%h\r\n"
SEARCH.STRING >PSTR "*:=@="
MSG.DUMP0 .AZ "Net Nod SkT En# Name"
MSG.DUMP .AZ "%H $%h $%h $%h %S\r\n"
*--------------------------------------
.DUMMY
.OR 0
DS.START
P.GetInfo .BS $0F
P.LookupName .BS $17
DS.END .ED
*--------------------------------------
MAN
SAVE usr/src/bin/atbrowse.s
ASM