2015-06-03 18:30:57 +00:00
|
|
|
|
NEW
|
2018-11-17 17:17:13 +00:00
|
|
|
|
PREFIX
|
2018-05-04 14:55:29 +00:00
|
|
|
|
AUTO 4,1
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.LIST OFF
|
|
|
|
|
.OP 65C02
|
|
|
|
|
.OR $2000
|
2018-07-20 05:43:11 +00:00
|
|
|
|
.TF SBIN/LOGIN
|
2015-06-03 18:30:57 +00:00
|
|
|
|
*--------------------------------------
|
2018-07-20 05:43:11 +00:00
|
|
|
|
.INB INC/MACROS.I
|
|
|
|
|
.INB INC/A2OSX.I
|
2015-11-22 22:30:06 +00:00
|
|
|
|
*--------------------------------------
|
2018-12-18 14:37:07 +00:00
|
|
|
|
.DUMMY
|
|
|
|
|
.OR ZPBIN
|
|
|
|
|
ZS.START
|
|
|
|
|
ZPPTR1 .BS 2
|
|
|
|
|
ZS.END
|
|
|
|
|
.ED
|
2015-06-03 18:30:57 +00:00
|
|
|
|
*--------------------------------------
|
2019-02-20 16:07:43 +00:00
|
|
|
|
INPUT.BUF.SIZE .EQ 16
|
2015-06-03 18:30:57 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* File Header (16 Bytes)
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.START cld
|
|
|
|
|
jmp (.1,x)
|
|
|
|
|
.DA #$61 6502,Level 1 (65c02)
|
|
|
|
|
.DA #1 BIN Layout Version 1
|
2018-09-19 15:25:42 +00:00
|
|
|
|
.DA #S.PS.F.EVENT S.PS.F
|
|
|
|
|
.DA #0
|
2018-12-18 14:37:07 +00:00
|
|
|
|
.DA CS.END-CS.START Code Size (without Constants)
|
|
|
|
|
.DA DS.END-DS.START Data SegmentSize
|
|
|
|
|
.DA #16 Stack Size
|
|
|
|
|
.DA #ZS.END-ZS.START Zero Page Size
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Relocation Table
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.1 .DA CS.INIT
|
|
|
|
|
.DA CS.RUN
|
|
|
|
|
.DA CS.DOEVENT
|
|
|
|
|
.DA CS.QUIT
|
2019-03-12 14:41:55 +00:00
|
|
|
|
L.MSG.NOPASSWD .DA MSG.NOPASSWD
|
2015-06-03 18:30:57 +00:00
|
|
|
|
L.MSG.LOGIN .DA MSG.LOGIN
|
|
|
|
|
L.MSG.PASSWORD .DA MSG.PASSWORD
|
2018-12-04 13:20:35 +00:00
|
|
|
|
L.MSG.ECHOCRLF .DA MSG.ECHOCRLF
|
|
|
|
|
L.MSG.ECHODEL .DA MSG.ECHODEL
|
2018-11-23 16:20:19 +00:00
|
|
|
|
L.ENV.SHELL .DA ENV.SHELL
|
2015-06-03 18:30:57 +00:00
|
|
|
|
L.SHELL .DA SHELL
|
2018-11-23 16:20:19 +00:00
|
|
|
|
L.ENV.HOME .DA ENV.HOME
|
|
|
|
|
L.HOME .DA HOME
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
2018-09-19 15:25:42 +00:00
|
|
|
|
CS.INIT clc
|
|
|
|
|
rts
|
2015-06-03 18:30:57 +00:00
|
|
|
|
*--------------------------------------
|
2019-03-12 14:41:55 +00:00
|
|
|
|
CS.RUN >PUSHEA.G PW
|
|
|
|
|
lda #0
|
|
|
|
|
>SYSCALL GetPWUID
|
|
|
|
|
bcc .10
|
|
|
|
|
|
|
|
|
|
>PUSHBI 0
|
|
|
|
|
>LDYA L.MSG.NOPASSWD
|
|
|
|
|
>SYSCALL printf
|
|
|
|
|
bcs .9
|
|
|
|
|
bra .8
|
|
|
|
|
|
|
|
|
|
.10 >STZ.G INPUT.PrevCR
|
2018-12-04 13:20:35 +00:00
|
|
|
|
|
2018-08-22 15:23:27 +00:00
|
|
|
|
>PUSHBI 0
|
2015-06-03 18:30:57 +00:00
|
|
|
|
>LDYA L.MSG.LOGIN
|
2018-06-21 15:12:10 +00:00
|
|
|
|
>SYSCALL printf
|
2015-11-22 22:30:06 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
lda #0 Echo all caracters
|
|
|
|
|
jsr INPUT.RESET
|
|
|
|
|
|
2019-02-20 16:07:43 +00:00
|
|
|
|
.1 >SYSCALL GetChar
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
jsr INPUT.CHARIN
|
2015-06-03 18:30:57 +00:00
|
|
|
|
jsr INPUT.LINEIN
|
|
|
|
|
bcc .1
|
|
|
|
|
|
2018-08-22 15:23:27 +00:00
|
|
|
|
>PUSHBI 0
|
2015-06-03 18:30:57 +00:00
|
|
|
|
>LDYA L.MSG.PASSWORD
|
2018-06-21 15:12:10 +00:00
|
|
|
|
>SYSCALL printf
|
2016-11-01 17:18:04 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
lda #'*'
|
|
|
|
|
jsr INPUT.RESET
|
|
|
|
|
|
2019-02-20 16:07:43 +00:00
|
|
|
|
.2 >SYSCALL GetChar
|
|
|
|
|
bcs .9
|
2018-04-16 15:25:39 +00:00
|
|
|
|
|
2019-02-20 16:07:43 +00:00
|
|
|
|
jsr INPUT.CHARIN
|
2015-06-03 18:30:57 +00:00
|
|
|
|
jsr INPUT.LINEIN
|
|
|
|
|
bcc .2
|
|
|
|
|
|
2018-12-04 13:20:35 +00:00
|
|
|
|
>PUSHBI 0
|
|
|
|
|
>LDYA L.MSG.ECHOCRLF
|
|
|
|
|
>SYSCALL printf
|
2017-02-28 16:58:36 +00:00
|
|
|
|
bcs .9
|
2018-12-04 13:20:35 +00:00
|
|
|
|
|
2019-03-12 14:41:55 +00:00
|
|
|
|
.8 jsr CS.RUN.SETENV
|
2018-11-23 16:20:19 +00:00
|
|
|
|
bcs .9
|
2018-12-04 13:20:35 +00:00
|
|
|
|
|
2019-01-26 14:01:05 +00:00
|
|
|
|
>PUSHBI S.PS.F.HOLD+S.PS.F.DUPENV
|
2016-08-17 06:25:58 +00:00
|
|
|
|
>LDYA L.SHELL
|
2018-10-25 15:31:41 +00:00
|
|
|
|
>SYSCALL ExecL
|
2019-02-20 16:07:43 +00:00
|
|
|
|
.9 rts
|
2015-06-03 18:30:57 +00:00
|
|
|
|
*--------------------------------------
|
2018-11-23 21:36:31 +00:00
|
|
|
|
CS.RUN.SETENV >PUSHW L.HOME
|
|
|
|
|
>LDYA L.ENV.HOME
|
2018-11-23 16:20:19 +00:00
|
|
|
|
>SYSCALL setenv
|
|
|
|
|
bcs .9
|
|
|
|
|
|
2018-11-23 21:36:31 +00:00
|
|
|
|
>PUSHW L.SHELL
|
|
|
|
|
>LDYA L.ENV.SHELL
|
2018-11-23 16:20:19 +00:00
|
|
|
|
>SYSCALL setenv
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2017-01-12 17:43:45 +00:00
|
|
|
|
CS.DOEVENT
|
|
|
|
|
sec
|
2015-06-03 18:30:57 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-08-17 06:25:58 +00:00
|
|
|
|
CS.QUIT clc
|
2015-06-03 18:30:57 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* PRIVATE
|
|
|
|
|
*--------------------------------------
|
2018-12-04 13:20:35 +00:00
|
|
|
|
INPUT.RESET >STA.G INPUT.PassChar
|
|
|
|
|
|
2019-02-22 16:08:37 +00:00
|
|
|
|
>STZ.G INPUT.BUF
|
2018-12-04 13:20:35 +00:00
|
|
|
|
>STA.G INPUT.Status
|
2015-06-03 18:30:57 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-01-12 17:43:45 +00:00
|
|
|
|
INPUT.CHARIN tax save char...
|
2018-12-04 13:20:35 +00:00
|
|
|
|
|
|
|
|
|
>LDA.G INPUT.Status
|
2015-06-03 18:30:57 +00:00
|
|
|
|
bmi .9
|
|
|
|
|
|
2019-02-22 16:08:37 +00:00
|
|
|
|
lda #INPUT.BUF
|
2015-06-03 18:30:57 +00:00
|
|
|
|
clc
|
|
|
|
|
adc pData
|
2015-11-22 22:30:06 +00:00
|
|
|
|
sta ZPPTR1
|
2015-06-03 18:30:57 +00:00
|
|
|
|
lda pData+1
|
2019-02-22 16:08:37 +00:00
|
|
|
|
adc /INPUT.BUF
|
2015-11-22 22:30:06 +00:00
|
|
|
|
sta ZPPTR1+1
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
|
|
|
|
cpx #$20 Control Char?
|
|
|
|
|
bcc .2
|
|
|
|
|
|
2018-12-04 13:20:35 +00:00
|
|
|
|
cpx #C.DEL
|
|
|
|
|
beq INPUT.CHARIN.DEL
|
|
|
|
|
|
2015-11-22 22:30:06 +00:00
|
|
|
|
lda (ZPPTR1)
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2019-02-20 16:07:43 +00:00
|
|
|
|
cmp #INPUT.BUF.SIZE Buffer full?
|
2015-06-03 18:30:57 +00:00
|
|
|
|
beq .9
|
|
|
|
|
|
|
|
|
|
inc
|
2015-11-22 22:30:06 +00:00
|
|
|
|
sta (ZPPTR1)
|
2015-06-03 18:30:57 +00:00
|
|
|
|
tay
|
|
|
|
|
|
|
|
|
|
txa
|
2015-11-22 22:30:06 +00:00
|
|
|
|
sta (ZPPTR1),y
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2018-12-04 13:20:35 +00:00
|
|
|
|
>LDA.G INPUT.PassChar
|
2015-06-03 18:30:57 +00:00
|
|
|
|
bne .1
|
2018-12-04 13:20:35 +00:00
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
txa
|
2018-12-04 13:20:35 +00:00
|
|
|
|
|
2018-07-18 15:30:42 +00:00
|
|
|
|
.1 >SYSCALL PutChar
|
2018-12-04 13:20:35 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>STZ.G INPUT.PrevCR
|
2015-11-22 22:30:06 +00:00
|
|
|
|
rts
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2018-12-04 13:20:35 +00:00
|
|
|
|
.2 cpx #C.CR
|
2015-12-12 10:13:14 +00:00
|
|
|
|
bne .3
|
2018-12-04 13:20:35 +00:00
|
|
|
|
|
|
|
|
|
txa
|
|
|
|
|
>STA.G INPUT.PrevCR
|
2015-12-12 10:13:14 +00:00
|
|
|
|
|
2018-12-04 13:20:35 +00:00
|
|
|
|
lda #$80
|
|
|
|
|
>STA.G INPUT.Status
|
2015-12-12 10:13:14 +00:00
|
|
|
|
rts
|
|
|
|
|
|
2018-12-04 13:20:35 +00:00
|
|
|
|
.3 cpx #C.LF
|
2015-12-12 10:13:14 +00:00
|
|
|
|
bne .4
|
2018-12-04 13:20:35 +00:00
|
|
|
|
|
|
|
|
|
>LDA.G INPUT.PrevCR
|
|
|
|
|
beq .1
|
|
|
|
|
|
|
|
|
|
.4 >STZ.G INPUT.PrevCR
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2018-12-04 13:20:35 +00:00
|
|
|
|
INPUT.CHARIN.DEL
|
|
|
|
|
lda (ZPPTR1)
|
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
dec
|
|
|
|
|
sta (ZPPTR1)
|
|
|
|
|
|
|
|
|
|
>PUSHBI 0
|
|
|
|
|
>LDYA L.MSG.ECHODEL
|
|
|
|
|
>SYSCALL printf
|
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2015-12-12 10:13:14 +00:00
|
|
|
|
INPUT.LINEIN ldy #INPUT.Status
|
2015-06-03 18:30:57 +00:00
|
|
|
|
lda (pData),y
|
2015-12-10 18:53:30 +00:00
|
|
|
|
asl CS if a line is in the buffer
|
2015-06-03 18:30:57 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.END
|
2019-03-12 16:50:16 +00:00
|
|
|
|
MSG.NOPASSWD .AS "\r\n\r\nA2osX-Login:No ETC/PASSWD file present, Logged as ROOT.\r\n"
|
2019-03-12 14:41:55 +00:00
|
|
|
|
.AZ "Consider adding ROOT password with USERADD command.\r\n\r\n"
|
2018-04-11 15:35:51 +00:00
|
|
|
|
MSG.LOGIN .AZ "\r\nlogin:"
|
|
|
|
|
MSG.PASSWORD .AZ "\r\npassword:"
|
2018-12-04 13:20:35 +00:00
|
|
|
|
MSG.ECHOCRLF .AZ "\r\n"
|
|
|
|
|
MSG.ECHODEL .DA #C.BS,#C.SPACE,#C.BS,#0
|
2018-11-23 16:20:19 +00:00
|
|
|
|
ENV.SHELL .AZ "SHELL"
|
|
|
|
|
ENV.HOME .AZ "HOME"
|
2019-02-18 12:52:10 +00:00
|
|
|
|
SHELL .AZ "${ROOT}BIN/SH"
|
2019-01-23 16:26:48 +00:00
|
|
|
|
HOME .AZ "${ROOT}ROOT/"
|
2018-10-18 15:32:57 +00:00
|
|
|
|
.HS 00
|
2017-03-01 15:22:00 +00:00
|
|
|
|
*--------------------------------------
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.DUMMY
|
|
|
|
|
.OR 0
|
|
|
|
|
DS.START
|
2019-02-20 16:07:43 +00:00
|
|
|
|
INPUT.BUF .BS INPUT.BUF.SIZE+1
|
2015-12-12 10:13:14 +00:00
|
|
|
|
INPUT.Status .BS 1
|
|
|
|
|
INPUT.PassChar .BS 1
|
2018-12-04 13:20:35 +00:00
|
|
|
|
INPUT.PrevCR .BS 1
|
2019-03-12 14:41:55 +00:00
|
|
|
|
PW .BS S.PW
|
2015-06-03 18:30:57 +00:00
|
|
|
|
DS.END
|
|
|
|
|
.ED
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
2018-11-17 17:17:13 +00:00
|
|
|
|
SAVE USR/SRC/SBIN/LOGIN.S
|
2015-06-03 18:30:57 +00:00
|
|
|
|
ASM
|