A2osX/BIN/ATLOGON.S.txt

173 lines
3.3 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
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
.DA 0
*--------------------------------------
CS.INIT clc
rts
*--------------------------------------
2020-08-06 20:01:14 +00:00
CS.RUN.USAGE >PUSHW L.MSG.USAGE
>PUSHBI 0
>SYSCALL PrintF
lda #E.SYN
sec
CS.RUN.USAGE.RTS
rts
*--------------------------------------
CS.RUN jsr CS.RUN.ATCHECK
bcs CS.RUN.USAGE.RTS
lda #AT.LookupName
>STA.G P.LookupName+1
lda #1
>SYSCALL ArgV
bcs CS.RUN.USAGE
>STYA.G P.LookupName+$08
lda #4
>STA.G P.LookupName+$C RetInt
>STA.G P.LookupName+$D RetCnt
>LDYAI 64
>STYA.G P.LookupName+$10 BufLen
>LDYA.G NameBuf
>STYA ZPPTR1
>STYA.G P.LookupName+$12 BufPtr
lda #1
>STA.G P.LookupName+$16 MaxMatch
>LEA.G P.LookupName
jsr CS.RUN.GOATLK
bcs .9
lda #AT.FILogin
>STA.G P.FILogin+1
>LEA.G P.FILogin+$4
>STYA ZPPTR2
ldy #3
.1 lda (ZPPTR1),y
sta (ZPPTR2),y
dey
bpl .1
>LDYAI 64
>STYA.G P.FILogin+$E
>LEA.G ReplyBuf
>STYA.G P.FILogin+$10
>LEA.G P.FILogin
jsr CS.RUN.GOATLK
bcs .9
.8 lda #0
sec
.9 rts
*--------------------------------------
CS.RUN.ATCHECK lda #AT.GetInfo
2020-08-04 07:10:48 +00:00
>STA.G P.GetInfo+1
>LEA.G P.GetInfo
jsr A2osX.ATKCALL
2020-08-06 20:01:14 +00:00
bcc .9
2020-08-04 07:10:48 +00:00
pha
>LDYA L.MSG.NOATK
2020-08-04 07:10:48 +00:00
>SYSCALL puts
pla
2020-08-06 20:01:14 +00:00
.9 sec
*--------------------------------------
CS.RUN.GOATLK >STYA ZPAtlkParams
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
ldy #3
lda (ZPAtlkParams),y
>PUSHA
dey
lda (ZPAtlkParams),y
>PUSHA
>PUSHBI 2
>SYSCALL printf
2020-08-04 07:10:48 +00:00
2020-08-06 20:01:14 +00:00
pla
sec
2020-08-04 07:10:48 +00:00
2020-08-06 20:01:14 +00:00
.9 rts
*--------------------------------------
CS.DOEVENT sec
rts
*--------------------------------------
CS.QUIT clc
rts
*--------------------------------------
CS.END
2020-08-04 07:10:48 +00:00
MSG.NOATK .AZ "AppleTalk Not Loaded."
2020-08-06 20:01:14 +00:00
MSG.ATKERR .AZ "AppleTalk ERR:%H\r\n"
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
P.FILogin .BS $19
NameBuf .BS 64
ReplyBuf .BS 64
DS.END
.ED
*--------------------------------------
MAN
2020-08-04 07:10:48 +00:00
SAVE usr/src/bin/atlogon.s
ASM