A2osX/BIN/ATLOGON.S.txt

287 lines
5.4 KiB
Plaintext
Raw Normal View History

NEW
2019-05-02 09:52:32 +00:00
AUTO 3,1
.LIST OFF
.OP 65C02
.OR $2000
2020-08-04 07:10:48 +00:00
.TF bin/atlogon
*--------------------------------------
2020-08-04 07:10:48 +00:00
.INB inc/macros.i
.INB inc/a2osx.i
.INB inc/mli.i
.INB inc/mli.e.i
.INB inc/appletalk.i
*--------------------------------------
2020-08-04 07:10:48 +00:00
.DUMMY
.OR ZPBIN
ZS.START
2020-08-06 20:01:14 +00:00
ZPAtlkParams .BS 2
2021-01-12 21:14:13 +00:00
hCmdBuf .BS 1
hReplyBuf .BS 1
ZPCmdBuf .BS 2
ZPReplyBuf .BS 2
2020-08-04 07:10:48 +00:00
ZPPTR1 .BS 2
ZPPTR2 .BS 2
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 Code Length To Relocate
.DA 0 Data Segment to Allocate
.DA 0
.DA 0
*--------------------------------------
* Relocation Table
2019-10-03 06:25:27 +00:00
*--------------------------------------
.1 .DA CS.INIT
.DA CS.RUN
.DA CS.DOEVENT
.DA CS.QUIT
L.MSG.NOATK .DA MSG.NOATK
2020-08-06 20:01:14 +00:00
L.MSG.ATKERR .DA MSG.ATKERR
L.MSG.USAGE .DA MSG.USAGE
2020-09-05 18:44:58 +00:00
L.MSG.GETINFO .DA MSG.GETINFO
.DA 0
*--------------------------------------
CS.INIT clc
rts
*--------------------------------------
2020-09-05 18:44:58 +00:00
CS.RUN ldy #S.PS.ARGC
2020-12-15 13:23:22 +00:00
lda (pPS),y
2020-09-05 18:44:58 +00:00
beq CS.RUN.USAGE
jsr CS.RUN.GetInfo
bcs .9
jsr CS.RUN.LookupName
bcs .9
2021-01-12 21:14:13 +00:00
jsr CS.RUN.GetParms
bcs .9
2020-09-05 18:44:58 +00:00
jsr CS.RUN.FILogin
bcs .9
lda #0
sec
.9 rts
*--------------------------------------
2020-08-06 20:01:14 +00:00
CS.RUN.USAGE >PUSHW L.MSG.USAGE
>PUSHBI 0
>SYSCALL PrintF
2020-09-05 18:44:58 +00:00
2020-08-06 20:01:14 +00:00
lda #E.SYN
sec
rts
*--------------------------------------
2021-01-12 21:14:13 +00:00
CS.RUN.GetInfo >LEA.G P.GetInfo
ldx #AT.GetInfo
jsr CS.RUN.GOATLK
2020-09-05 18:44:58 +00:00
bcs .9
>PUSHW L.MSG.GETINFO
>PUSHB.G P.GetInfo+$09 THIS-NET
>PUSHB.G P.GetInfo+$08 THIS-NET
>PUSHB.G P.GetInfo+$0E NODE
>PUSHB.G P.GetInfo+$0A BRIDGE
>PUSHB.G P.GetInfo+$0D HARDWARE ID
>PUSHB.G P.GetInfo+$0C HARDWARE ID
>PUSHB.G P.GetInfo+$0B ROM VERSION
>PUSHBI 7
>SYSCALL PrintF
rts
2020-08-06 20:01:14 +00:00
2020-09-05 18:44:58 +00:00
.9 pha
>LDYA L.MSG.NOATK
>SYSCALL PutS
pla
sec
rts
*--------------------------------------
CS.RUN.LookupName
2020-08-06 20:01:14 +00:00
lda #1
>SYSCALL ArgV
2021-01-12 21:14:13 +00:00
>STYA ZPPTR1
>LEA.G NameBuf
>STYA ZPPTR2
2020-08-06 20:01:14 +00:00
>STYA.G P.LookupName+$08
2021-01-12 21:14:13 +00:00
lda #1
jsr CS.RUN.PutPtr2
lda #'='
jsr CS.RUN.PutPtr2
ldy #$ff
.1 iny
lda (ZPPTR1),y
bne .1
tya
tax
jsr CS.RUN.PutPtr2
.2 ldy #0
.3 lda (ZPPTR1),y
jsr CS.RUN.PutPtr2
iny
dex
bne .3
lda #1
jsr CS.RUN.PutPtr2
lda #'*'
jsr CS.RUN.PutPtr2
2020-08-06 20:01:14 +00:00
lda #4
>STA.G P.LookupName+$C RetInt
>STA.G P.LookupName+$D RetCnt
>LDYAI 64
>STYA.G P.LookupName+$10 BufLen
2021-01-12 21:14:13 +00:00
>LDYA.G LookupBuf
2020-08-06 20:01:14 +00:00
>STYA.G P.LookupName+$12 BufPtr
lda #1
>STA.G P.LookupName+$16 MaxMatch
>LEA.G P.LookupName
2020-09-05 18:44:58 +00:00
ldx #AT.LookupName
jmp CS.RUN.GOATLK
*--------------------------------------
2021-01-12 21:14:13 +00:00
CS.RUN.GetParms >LEA.G P.GetParms
ldx #AT.GetParms
jsr CS.RUN.GOATLK
bcs .9
>LDYA.G P.GetParms+$4
>SYSCALL GetMem
bcs .9
>STYA ZPCmdBuf
stx hCmdBuf
>LDYA.G P.GetParms+$6
>SYSCALL GetMem
bcs .9
>STYA ZPReplyBuf
stx hReplyBuf
.9 rts
*--------------------------------------
CS.RUN.FILogin >LDYA.G LookupBuf
>STYA ZPPTR1
>LEA.G P.FILogin+$4
2020-08-06 20:01:14 +00:00
>STYA ZPPTR2
ldy #3
2021-01-12 21:14:13 +00:00
.1 lda (ZPPTR1),y copy NETWORK/NODE/SOCKET
2020-08-06 20:01:14 +00:00
sta (ZPPTR2),y
dey
bpl .1
2021-01-12 21:14:13 +00:00
>LDYA.G P.GetParms+$4
>STYA.G P.FILogin+$8 Cmd buffer length
>LDYA ZPCmdBuf
>STYA.G P.FILogin+$A
>LDYA.G P.GetParms+$6
>STYA.G P.FILogin+$E Reply buffer length
2020-08-06 20:01:14 +00:00
2021-01-12 21:14:13 +00:00
>LDYA ZPReplyBuf
2020-08-06 20:01:14 +00:00
>STYA.G P.FILogin+$10
>LEA.G P.FILogin
2020-09-05 18:44:58 +00:00
ldx #AT.FILogin
jmp CS.RUN.GOATLK
2020-08-06 20:01:14 +00:00
*--------------------------------------
CS.RUN.GOATLK >STYA ZPAtlkParams
2020-09-05 18:44:58 +00:00
ldy #1
txa
sta (ZPAtlkParams),y
>LDYA ZPAtlkParams
2020-08-06 20:01:14 +00:00
jsr A2osX.ATKCALL
bcc .9
2020-08-04 07:10:48 +00:00
2020-08-06 20:01:14 +00:00
pha
2020-08-04 07:10:48 +00:00
2020-08-06 20:01:14 +00:00
>PUSHW L.MSG.ATKERR
2020-09-05 18:44:58 +00:00
ldy #1
lda (ZPAtlkParams),y
>PUSHA
2020-08-06 20:01:14 +00:00
ldy #3
lda (ZPAtlkParams),y
>PUSHA
dey
lda (ZPAtlkParams),y
>PUSHA
2020-09-05 18:44:58 +00:00
>PUSHBI 3
2020-08-25 14:54:30 +00:00
>SYSCALL PrintF
2020-08-04 07:10:48 +00:00
2020-08-06 20:01:14 +00:00
pla
sec
.9 rts
*--------------------------------------
2021-01-12 21:14:13 +00:00
CS.RUN.PutPtr2 sta (ZPPTR2)
inc ZPPTR2
bne .8
inc ZPPTR2+1
.8 rts
*--------------------------------------
CS.DOEVENT sec
rts
*--------------------------------------
2021-01-12 21:14:13 +00:00
CS.QUIT lda hReplyBuf
beq .1
>SYSCALL FreeMem
.1 lda hCmdBuf
beq .2
>SYSCALL FreeMem
.2 clc
rts
*--------------------------------------
CS.END
2020-08-04 07:10:48 +00:00
MSG.NOATK .AZ "AppleTalk Not Loaded."
2020-09-05 18:44:58 +00:00
MSG.ATKERR .AZ "AppleTalk Call %h, ERR:%H\r\n"
MSG.GETINFO .AS "Network/Node:$%h%h/$%h\r\n"
.AS "Bridge : $%h\r\n"
.AZ "HWID/ROMVER :$%h%h/$%h\r\n"
2020-08-06 20:01:14 +00:00
MSG.USAGE .AZ "Usage : ATLOGON <SERVER> [USER] [PASSWORD]"
*--------------------------------------
.DUMMY
.OR 0
DS.START
2020-08-04 07:10:48 +00:00
P.GetInfo .BS $0F
2020-08-06 20:01:14 +00:00
P.LookupName .BS $17
2021-01-12 21:14:13 +00:00
P.GetParms .BS $07
2020-08-06 20:01:14 +00:00
P.FILogin .BS $19
2021-01-12 21:14:13 +00:00
NameBuf .BS 36
lookupBuf .BS 5+99
DS.END
.ED
*--------------------------------------
MAN
2020-08-04 07:10:48 +00:00
SAVE usr/src/bin/atlogon.s
ASM