mirror of
https://github.com/A2osX/A2osX.git
synced 2024-09-10 07:54:37 +00:00
378 lines
7.0 KiB
Plaintext
378 lines
7.0 KiB
Plaintext
NEW
|
||
AUTO 3,1
|
||
.LIST OFF
|
||
.OP 65C02
|
||
.OR $2000
|
||
.TF bin/atlogon
|
||
*--------------------------------------
|
||
.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
|
||
hCmdBuf .BS 1
|
||
hReplyBuf .BS 1
|
||
ZPCmdBuf .BS 2
|
||
ZPReplyBuf .BS 2
|
||
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 CS
|
||
.DA DS.END-DS.START DS
|
||
.DA #64 Stack Size
|
||
.DA #ZS.END-ZS.START Zero Page Size
|
||
.DA 0
|
||
*--------------------------------------
|
||
* Relocation Table
|
||
*--------------------------------------
|
||
.1 .DA CS.INIT
|
||
.DA CS.RUN
|
||
.DA CS.DOEVENT
|
||
.DA CS.QUIT
|
||
L.MSG.USAGE .DA MSG.USAGE
|
||
L.MSG.NOATK .DA MSG.NOATK
|
||
L.MSG.ATKERR .DA MSG.ATKERR
|
||
L.MSG.GETINFO .DA MSG.GETINFO
|
||
L.MSG.NETNODPORT .DA MSG.NETNODPORT
|
||
L.MSG.NOTFOUND .DA MSG.NOTFOUND
|
||
L.MSG.SRVINFO .DA MSG.SRVINFO
|
||
L.FPLogin .DA FPLogin
|
||
.DA 0
|
||
*--------------------------------------
|
||
CS.INIT clc
|
||
rts
|
||
*--------------------------------------
|
||
CS.RUN ldy #S.PS.ARGC
|
||
lda (pPS),y
|
||
beq CS.RUN.USAGE
|
||
|
||
jsr CS.RUN.GetInfo
|
||
bcs .9
|
||
|
||
jsr CS.RUN.LookupName
|
||
bcs .9
|
||
|
||
jsr CS.RUN.GetParms
|
||
bcs .9
|
||
|
||
jsr CS.RUN.GetStatus
|
||
bcs .9
|
||
|
||
jsr CS.RUN.FILogin
|
||
bcs .9
|
||
|
||
lda #0
|
||
sec
|
||
.9 rts
|
||
*--------------------------------------
|
||
CS.RUN.USAGE >PUSHW L.MSG.USAGE
|
||
>PUSHBI 0
|
||
>SYSCALL PrintF
|
||
|
||
lda #E.SYN
|
||
sec
|
||
rts
|
||
*--------------------------------------
|
||
CS.RUN.GetInfo >LEA.G P.GetInfo
|
||
ldx #AT.GetInfo
|
||
jsr CS.RUN.GOATLK
|
||
bcs .9
|
||
|
||
>PUSHW L.MSG.GETINFO
|
||
>PUSHB.G P.GetInfo+$08 THIS-NET
|
||
>PUSHB.G P.GetInfo+$09 THIS-NET
|
||
>PUSHB.G P.GetInfo+$0E NODE
|
||
|
||
>PUSHB.G P.GetInfo+$0A BRIDGE
|
||
|
||
>PUSHB.G P.GetInfo+$0C HARDWARE ID
|
||
>PUSHB.G P.GetInfo+$0D HARDWARE ID
|
||
>PUSHB.G P.GetInfo+$0B ROM VERSION
|
||
|
||
>PUSHBI 7
|
||
>SYSCALL PrintF
|
||
rts
|
||
|
||
.9 pha
|
||
>LDYA L.MSG.NOATK
|
||
>SYSCALL PutS
|
||
pla
|
||
sec
|
||
rts
|
||
*--------------------------------------
|
||
CS.RUN.LookupName
|
||
lda #1
|
||
>SYSCALL ArgV
|
||
>STYA ZPPTR1
|
||
|
||
>LEA.G NameBuf
|
||
>STYA ZPPTR2
|
||
>STYA.G P.LookupName+$08
|
||
|
||
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
|
||
|
||
ldx #SEARCH.STRING.Len
|
||
ldy #0
|
||
|
||
.4 lda SEARCH.STRING,y
|
||
jsr CS.RUN.PutPtr2
|
||
iny
|
||
dex
|
||
bne .4
|
||
|
||
lda #4
|
||
>STA.G P.LookupName+$C RetInt
|
||
>STA.G P.LookupName+$D RetCnt
|
||
|
||
>LDYAI 5+99
|
||
>STYA.G P.LookupName+$10 BufLen
|
||
|
||
>LEA.G LookupBuf
|
||
>STYA.G P.LookupName+$12 BufPtr
|
||
|
||
lda #1
|
||
>STA.G P.LookupName+$16 MaxMatch
|
||
|
||
>LEA.G P.LookupName
|
||
ldx #AT.LookupName
|
||
jsr CS.RUN.GOATLK
|
||
bcs .9
|
||
|
||
>LDA.G P.LookupName+$17
|
||
beq .99
|
||
|
||
>PUSHW L.MSG.NETNODPORT
|
||
|
||
ldy #LookupBuf
|
||
ldx #4
|
||
|
||
.5 lda (pData),y
|
||
>PUSHA
|
||
iny
|
||
dex
|
||
bne .5
|
||
|
||
>PUSHBI 4
|
||
>SYSCALL PrintF
|
||
|
||
.9 rts
|
||
|
||
.99 >LDYA L.MSG.NOTFOUND
|
||
>SYSCALL PutS
|
||
lda #MLI.E.IO
|
||
sec
|
||
rts
|
||
*--------------------------------------
|
||
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.GetStatus
|
||
>LDYA.G LookupBuf
|
||
>STYA ZPPTR1
|
||
>LEA.G P.GetStatus+$8
|
||
>STYA ZPPTR2
|
||
|
||
ldy #3
|
||
|
||
.1 lda (ZPPTR1),y copy NETWORK/NODE/SOCKET
|
||
sta (ZPPTR2),y
|
||
dey
|
||
bpl .1
|
||
|
||
>LDYA.G P.GetParms+$6
|
||
>STYA.G P.GetStatus+$C Reply buffer length
|
||
|
||
>LDYA ZPReplyBuf
|
||
>STYA.G P.GetStatus+$E
|
||
|
||
>LEA.G P.GetStatus
|
||
ldx #AT.GetStatus
|
||
jsr CS.RUN.GOATLK
|
||
bcs .9
|
||
|
||
>PUSHW L.MSG.SRVINFO
|
||
|
||
lda (ZPReplyBuf) Offset to Machine Type
|
||
clc
|
||
adc ZPReplyBuf
|
||
tay
|
||
lda #0
|
||
adc ZPReplyBuf+1
|
||
>PUSHYA
|
||
|
||
|
||
|
||
>PUSHBI 2
|
||
>SYSCALL PrintF
|
||
|
||
.9 rts
|
||
*--------------------------------------
|
||
CS.RUN.FILogin >LDYA.G LookupBuf
|
||
>STYA ZPPTR1
|
||
>LEA.G P.FILogin+$4
|
||
>STYA ZPPTR2
|
||
|
||
ldy #3
|
||
|
||
.1 lda (ZPPTR1),y copy NETWORK/NODE/SOCKET
|
||
sta (ZPPTR2),y
|
||
dey
|
||
bpl .1
|
||
|
||
>LDYAI FPLogin.Len
|
||
>STYA.G P.FILogin+$8 Cmd buffer length
|
||
|
||
>LDYA L.FPLogin
|
||
>STYA.G P.FILogin+$A
|
||
|
||
>LDYA.G P.GetParms+$6
|
||
>STYA.G P.FILogin+$E Reply buffer length
|
||
|
||
>LDYA ZPReplyBuf
|
||
>STYA.G P.FILogin+$10
|
||
|
||
>LEA.G P.FILogin
|
||
ldx #AT.FILogin
|
||
jmp CS.RUN.GOATLK
|
||
*--------------------------------------
|
||
CS.RUN.GOATLK >STYA ZPAtlkParams
|
||
|
||
ldy #1
|
||
txa
|
||
sta (ZPAtlkParams),y
|
||
|
||
>LDYA ZPAtlkParams
|
||
jsr A2osX.ATKCALL
|
||
bcc .9
|
||
|
||
pha
|
||
|
||
>PUSHW L.MSG.ATKERR
|
||
|
||
ldy #1
|
||
lda (ZPAtlkParams),y
|
||
>PUSHA
|
||
|
||
ldy #3
|
||
lda (ZPAtlkParams),y
|
||
>PUSHA
|
||
dey
|
||
lda (ZPAtlkParams),y
|
||
>PUSHA
|
||
|
||
>PUSHBI 3
|
||
>SYSCALL PrintF
|
||
|
||
pla
|
||
sec
|
||
.9 rts
|
||
*--------------------------------------
|
||
CS.RUN.PutPtr2 sta (ZPPTR2)
|
||
inc ZPPTR2
|
||
bne .8
|
||
|
||
inc ZPPTR2+1
|
||
.8 rts
|
||
*--------------------------------------
|
||
CS.DOEVENT sec
|
||
rts
|
||
*--------------------------------------
|
||
CS.QUIT lda hReplyBuf
|
||
beq .1
|
||
|
||
>SYSCALL FreeMem
|
||
|
||
.1 lda hCmdBuf
|
||
beq .2
|
||
|
||
>SYSCALL FreeMem
|
||
|
||
.2 clc
|
||
rts
|
||
*--------------------------------------
|
||
CS.END
|
||
MSG.USAGE .AZ "Usage : ATLOGON <SERVER> [USER] [PASSWORD]"
|
||
MSG.NOATK .AZ "AppleTalk Not Loaded."
|
||
MSG.ATKERR .AZ "AppleTalk Call %h, ERR:%H\r\n"
|
||
MSG.GETINFO .AS "Network/Node:%H/%h\r\n"
|
||
.AS "Bridge : %h\r\n"
|
||
.AZ "HWID/ROMVER :%H/%h\r\n"
|
||
MSG.NETNODPORT .AZ "Server Address : %H/%h:%h\r\n"
|
||
MSG.NOTFOUND .AZ "Server not found"
|
||
MSG.SRVINFO .AS "Server Type : %S\r\n"
|
||
.DA #0
|
||
SEARCH.STRING >PSTR "AFPServer"
|
||
>PSTR "*"
|
||
SEARCH.STRING.Len .EQ *-SEARCH.STRING
|
||
*--------------------------------------
|
||
FPLogin .DA #12
|
||
.DA #0
|
||
>PSTR "AFPVersion 1.1"
|
||
>PSTR "No User Authent"
|
||
.DA #0
|
||
FPLogin.Len .EQ *-FPLogin
|
||
*--------------------------------------
|
||
.DUMMY
|
||
.OR 0
|
||
DS.START
|
||
P.GetInfo .BS $0F
|
||
P.LookupName .BS $17
|
||
P.GetParms .BS $07
|
||
P.GetStatus .BS $14
|
||
P.FILogin .BS $19
|
||
NameBuf .BS 36
|
||
lookupBuf .BS 5+99
|
||
DS.END
|
||
.ED
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE usr/src/bin/atlogon.s
|
||
ASM
|