	OUT L
W07	EQU $13
W0700	EQU $1300
W17	EQU $1F
WBA	EQU $B0
WBA00	EQU $B000
WBE	EQU $BC
	ORG $A700,$A800
BSOFF	SEI
	LDA #0
	STA $D40E
	LDA $D301
	RTS
BSON	STA $D301
	LDA #$C0
	STA $D40E
	CLI
	RTS
CHIPINIT	LDA #3
	STA $D20F
	LDA #0
	STA $D208
	RTS
SROUT	LDA SAVEKEY
	BEQ SROUT1
	JSR GETKEY
SROUT1	JSR CHIPINIT
	TSX
	STX SP
	JSR SMOTON
	LDX #NAMEBUF:L
	STX $36+$80
	LDX #NAMEBUF:H
	STX $37+$80
	LDX #$14
	STX $38+$80
	LDX #$3
	STX $3E+$80
	JSR SVORTON
	LDA $39+$80
	CLC
	ADC #1
	DEX
	JSR SBYTE
	LDX #$12
SROUT2	LDA $0032+$80,Y
	JSR SBYTE
	LDX #$10
	INY
	CPY #4
	NOP
	BNE SROUT2
	LDY #0
	LDX #$E
SROUT3	LDA ($36+$80),Y
	CPY $38+$80
	BCC SROUT4
	LDA #$20
	DEX
SROUT4	JSR SBYTE
	LDX #$F
	INY
	CPY #$BB
	BNE SROUT3
	LDA $33+$80
	CMP #$C0
	BEQ SROUTD
	CLC
	ADC #WBA-W07
	STA $33+$80
	LDA $35+$80
	CLC
	ADC #WBA-W07
	STA $35+$80
SROUTD	JSR BSRAM
	LDA #4
	STA $3E+$80
	JSR SVORTON
	TYA
	JSR SBYTE
	STY $31+$80
	LDX #$14
SROUT5	DEX
	DEX
	DEX
	DEX
	DEX
SROUT6	LDA ($32+$80),Y
	JSR SBYTE
	LDX #$E
	INC $32+$80
	BNE SROUT7
	INC $33+$80
	LDX #$A
	LDA $33+$80
	CMP #$D0
	BNE SROUT7
	LDX #9
	LDA #$D8
	STA $33+$80
SROUT7	LDA $32+$80
	CMP $34+$80
	LDA $33+$80
	SBC $35+$80
	BCC SROUT6
	LDA $35+$80
	CMP #$00
	BNE SROUT9
	LDA $33+$80
	ORA $32+$80
	BNE SROUT5
	JMP SROUT8
SROUT8	DEX
	DEX
	DEX
	DEX
SROUT9	DEX
	DEX
	DEX
	LDA $31+$80
SROUTA	JSR SBYTE
	LDX #$11
	DEY
	BNE SROUTA
	LDA #0
SROUTC	STA $30+$80
	LDA #$3C
	STA $D302
	JSR CHIPINIT
	LDY #$22
	BNE SROUTB
SMOTON	LDY #$34
	STY $D302
	JSR DEXY
	STY $39+$80
SROUTB	STY $D400
	RTS
SVORTON	LDY #0
	STY $30+$80
SVORTON1	LDA #2
	JSR SBYTE
	LDX #$11
	DEY
	CPY #9
	BNE SVORTON1
	LDX #$F
	DEC $3E+$80
	BNE SVORTON1
SVORTON2	TYA
	JSR SBYTE
	LDX #$11
	DEY
	BNE SVORTON2
	DEX
	DEX
	RTS
SBYTE	STA $3F+$80
	EOR $31+$80
	STA $31+$80
	LDA #8
	STA $40+$80
SBYTE1	ASL $3F+$80
	LDA $30+$80
	EOR #7
	JSR SBIT
	LDX #$1B
	NOP
	EOR #$80
	JSR SBIT
	LDX #$18
	DEC $40+$80
	BNE SBYTE1
	RTS
SBIT     DEX
	BNE SBIT
	LDX $D20E
	BPL SBIT1
	LDX $00
	LDX #$00
	STX $D20E
	DEX
	STX $D20E
	BCC SBIT2
	LDX #$13
SBIT3	DEX
	BNE SBIT3
SBIT2	STA $D20F
	RTS
SBIT1	LDX SP
	TXS
	LDA #$80
	JMP SROUTC
LROUT	JSR CHIPINIT
	TSX
	STX SP
	JSR LMOTON
	LDA $33+$80
	BNE LROUT4
LROUT1	JSR LVORTON
	LDA $40+$80
	BEQ LROUT1
LROUT2	STA $0031+$80,Y
	JSR LBYTE
	INY
	CPY #5
	BNE LROUT2
	LDY #0
LROUT3	STA NAMEBUF,Y
	JSR LBYTE
	INY
	CPY #$14
	BNE LROUT3
	BEQ LROUTB
LROUT4	STA $37+$80
	JSR BSRAM
	LDA $32+$80
	STA $36+$80
LROUT5	JSR LVORTON
	TAX
	BNE LROUT5
	STY $31+$80
	LDX #$36
	STX $D01A
LROUT8	JSR LBYTE
	LDY #0
	STA ($36+$80),Y
	EOR $31+$80
	STA $31+$80
	INC $36+$80
	BNE LROUT6
	INC $37+$80
	LDA $37+$80
	CMP #$D0
	BNE LROUT6
	LDA #$D8
	STA $37+$80
LROUT6	LDA $35+$80
	BNE LROUT7
	LDA $37+$80
	BNE LROUT8
	BEQ LROUT9
LROUT7	LDA $36+$80
	CMP $34+$80
	LDA $37+$80
	SBC $35+$80
	BCC LROUT8
LROUT9	JSR LBYTE
	CMP $31+$80
	BNE LROUTA
LROUTB	INX
LROUTA	STX $30+$80
	JSR CHIPINIT
	JMP LMOTOFF
LVORTON	LDA #$70
	STA $D208
	LDA #$D2
	STA $D200
	LDA #1
	STA $D202
LVORTON1	LDX #0
	STX $D01A
	JSR LBIT
	ROL $40+$80
	LDA $40+$80
	CMP #2
	BNE LVORTON1
	STA $D01A
	LDY #9
LVORTON2	JSR LBYTE
	CMP #2
	BEQ LVORTON2
LVORTON3	CPY $40+$80
	BNE LVORTON1
	JSR LBYTE
	DEY
	BNE LVORTON3
	RTS
LBYTE	LDA #8
	STA $3F+$80
LBYTE1	JSR LBIT
	ROL $40+$80
	DEC $3F+$80
	BNE LBYTE1
	LDA $40+$80
	RTS
LBIT3	LDX SP
	TXS
	LDX #$80
	BNE LROUTA
LBIT	LDA #1
LBIT1	BIT $D20E
	BNE LBIT1
LBIT4	LDA #$80
LBIT2	BIT $D302
	BEQ LBIT2
	LDA $D20E
	BPL LBIT3
	PHA
	LDX #0
	STX $D20E
	DEX
	STX $D20E
	STX $D209
	LDA $D300
	PLA
	EOR #3
	LSR
	LSR
	RTS
LMOTOFF	LDA #$3C
LMOTOFF2	STA $D302
	TAY
	JSR DEXY
	STX $D01A
	LDA #$22
	BNE LMOTON1
LMOTON	LDA #$36
	JSR LMOTOFF2
	JSR LBIT4
	TYA
LMOTON1	STA $D400
	RTS
TURBOV	DFW OPEN-1,CLOSE-1,GETBYTE-1,PUTBYTE-1,GETSTAT-1,RTS1-1
	DFB $4C
	DFW GETSTAT
	DFB $00
OPEN	JSR BSOFF
	PHA
	LDX #4
	LDA #0
OPEN1	STA $D016,X
	LDA #$26
	DEX
	BPL OPEN1
	LDX #$13
	LDA #0
OPEN2	STA NEEDN-7,X
	STA NAMEBUF,X
	DEX
	BPL OPEN2
	LDX #$21
	STX NAMEBUF+$13
	STX NAMEBUF+$F
	LDX #$30
	STX NAMEBUF+$E
	LDX #$32
	STX NAMEBUF+$10
	LDX #$34
	STX NAMEBUF+$11
	JSR OPEN3
	PLA
	JSR BSON
	STY FNE
	RTS
OPEN3	LDA $2A
	STA FN
	CMP #8
	BEQ JSOPEN
	CMP #4
	BEQ JLOPEN
	RTS
JSOPEN	JMP SOPEN
JLOPEN	JSR SNAME
	LDA FNR
	AND #$FE
	CMP #$30
	BEQ TLOPEN
	JMP RLOPEN
TLOPEN6	CPY #$FF
	BNE TLOPEN3
TLOPEN	LDA #0
	STA $33+$80
	LDA #DLIST1:L
	STA $D402
	LDA #DLIST1:H
	STA $D403
	JSR LROUT
	LDY $30+$80
	BPL TLOPEN1
TLOPEN3	STY RAMDKZ
	STY NAMEBUF+$13
	RTS
TLOPEN1	JSR GETKEY
	CMP ' 
	BNE TLOPEN
	LDA NAMEBUF+$13
	AND #$3F
	CMP #$21
	BNE TLOPEN
	LDX #$31
	LDA $33+$80
	CMP #$C0
	BEQ TLOPEN2
	DEX
	PHA
	CLC
	ADC #WBA-W07
	STA $33+$80
	LDA $35+$80
	CLC
	ADC #WBA-W07
	STA $35+$80
	PLA
	CMP #W07
	BNE TLOPEN
TLOPEN2	STX FNR
	JSR LROUT
	LDY $30+$80
	BMI TLOPEN6
TLOPEN7	LDX #2
	LDY FNR
TLOPEN5	LDA WBA00,X
	CPX #2
	BNE TLOPEN8
	CLC
	ADC #WBA-W07
TLOPEN8	CPY #$30
	BEQ TLOPEN4
	LDA $C000,X
TLOPEN4	STA KENNBYTE,X
	DEX
	BPL TLOPEN5
	LDY #1
	LDA #3
	STA $32+$80
	RTS
SOPEN	LDA #NAMEE:L
	STA DLIST8+$9
	LDA #DLIST8:L
	STA $D402
	LDA #DLIST8:H
	STA $D403
	JSR SNAME
	LDA FNR
	LDY #$FC
	AND #$FE
	CMP #$30
	BEQ TSOPEN
	LDY #$FA
TSOPEN	STY KENNBYTE
	LDA FNR
	LDY #WBA
	AND #$FD
	CMP #$30
	BEQ TSOPEN1
	LDY #$C0
TSOPEN1	STY $33+$80
	STY AREGE+1
	STY $35+$80
	LDA #0
	STA $32+$80
	LDA #3
	STA $34+$80
	STA AREGE
GETSTAT	LDY #1
RTS1	RTS
GETBYTE	LDY FNE
	CPY #$1
	BEQ GETBYTE1
	RTS
GETBYTE5	LDY #1
GETBYTE6	PLA
	JSR BSON
	TXA
	RTS
GETBYTE1	JSR BSOFF
	PHA
GETBYTEE	LDY #0
	JSR BSRAM
	LDA ($32+$80),Y
	INC $32+$80
	BNE GETBYTE2
	INC $33+$80
	LDY $33+$80
	CPY #$D0
	BNE GETBYTE2
	LDY #$D8
	STY $33+$80
GETBYTE2	TAX
	LDA AREGE
	CMP $32+$80
	LDA AREGE+1
	SBC $33+$80
	BCS GETBYTE5
	LDA AREGE+1
	BNE GETBYTE4
	LDA $33+$80
	BNE GETBYTE5
GETBYTE4	LDY #$88
	LDX KENNBYTE
	LDA AREGE+1
	AND #$C0
	CMP #$C0
	BNE GETBYTEF
	LDX $C000
	CPX #$FA
	BEQ GETBYTE6
	LDY #162
GETBYTEF	CPX #$FC
	BNE GETBYTE6
	LDX #$B
GETBYTE9	LDA NAMEBUF,X
	STA NEEDN,X
	DEX
	BPL GETBYTE9
	INC $D301
	INC NAMEBUF+$13
GETBYTEA	LDA NAMEBUF+$13
GETBYTE8	PHA
	LDA #0
	STA $33+$80
	LDA #DLIST3:L
	STA $D402
	LDA #DLIST3:H
	STA $D403
	JSR LROUT
	LDY $30+$80
	BPL GETBYTEB
	PLA
GETBYTEX	JMP GETBYTE6
GETBYTEB	LDA #$34
	STA $D302
	LDA #6
	JSR TOSB3
	LDA #$3C
	STA $D302
	PLA
	CMP NAMEBUF+$13
	BNE GETBYTE8
	LDX #$B
GETBYTEC	LDA NAMEBUF,X
	CMP NEEDN,X
	BNE GETBYTEA
	DEX
	BPL GETBYTEC
	LDA $33+$80
	CMP #$C0
	BEQ GETBYTEG
	CLC
	ADC #WBA-W07
	STA $33+$80
	LDA $35+$80
	CLC
	ADC #WBA-W07
	STA $35+$80
GETBYTEG	JSR LROUT
	LDY $30+$80
	BPL GETBYTED
	CPY #$FF
	BNE GETBYTEX
	BEQ GETBYTEA
GETBYTED	JSR TLOPEN7
	JMP GETBYTEE
SNAME	LDY #1
	LDA ($24),Y
	TAX
	DEX
	CMP #$32
	BEQ SNAME1
	CMP #$33
	BEQ SNAME6
	CMP #$34
	BEQ SNAME6
	LDX #$30
SNAME1	STX FNR
SNAME2	INY
	CMP #$9B
	BEQ SNAME7
	CMP #$3A
	BEQ SNAME3
	LDA ($24),Y
	CPY #3
	BNE SNAME2
	BEQ SNAME7
SNAME3	LDX #$14
	LDA $2A
	CMP #8
	BNE SNAME4
	LDX #0
SNAME4	LDA ($24),Y
	CMP #$9B
	BEQ SNAME8
	CLC
	ADC #$20
	STA NAMEBUF,X
	INY
	INX
	CPX #$C
	BEQ SNAME5
	CPX #$20
	BNE SNAME4
SNAME5	RTS
SNAME6	STX FNR
	RTS
SNAME7	LDA $2A
	CMP #8
	BNE SNAME5
SNAME9	LDX #0
SNAME8	TXA
	BNE SNAME5
	TAY
SNAME10	LDA #$4E
	STA NAMEBUF,Y
	TYA
	PHA
	JSR GETKEY
	CMP #$20
	BNE SNAME11
	LDA #0
	BEQ SNAME12
SNAME11	CLC
	ADC #$20
SNAME12	TAX
	PLA
	TAY
	CPX #$3B
	BEQ SNAME9
	TXA
	STA NAMEBUF,Y
	INY
	CPY #$C
	BNE SNAME10
	RTS
GETKEY	LDY #$80
	JSR DEXY
GETKEY2	LDA $D20F
	AND #4
	BNE GETKEY2
	LDA $D209
	AND #$7F
GETKEY3	TAY
	LDA ($79),Y
	CMP #$61
	BCC GETKEY4
	CMP #$7B
	BCS GETKEY4
	TYA
	ORA #$40
	JMP GETKEY3
GETKEY4	CPY $2F2
	STY $2F2
	BEQ GETKEY5
	LDY #$80
	JSR DEXY
GETKEY5	LDY #1
	RTS
RLOPEN	LDY #$88
	RTS
RLOPEN2	LDA AREGE+1
	AND #$80
	LDX #$32
	LDY #W07
	CMP #$80
	BNE RLOPEN1
	INX
	LDY #$C0
RLOPEN1	STX FNR
	STY $33+$80
	LDY #3
	STY $32+$80
	LDY #1
	RTS
PUTBYTE	LDY FNE
	CPY #1
	BEQ PUTBYTE1
	RTS
PUTBYTE1	TAX
	JSR BSOFF
	PHA
	LDY #0
	JSR BSRAM
	TXA
	STA ($34+$80),Y
	INC $34+$80
	LDA $34+$80
	STA AREGE
	BNE PUTBYTE2
	INC $35+$80
	LDA $35+$80
	STA AREGE+1
	BEQ PUTBYTE3
	CMP #WBE
	BEQ PUTBYTE3
	CMP #$D0
	BNE PUTBYTEG
	LDA #$D8
	STA $35+$80
PUTBYTEG	STA AREGE+1
PUTBYTE2	LDY #1
PUTBYTE4	PLA
	JSR BSON
	STY FNE
	RTS
PUTBYTE3	LDA FNR
	LDY #162
	AND #$FE
	CMP #$32
	BEQ PUTBYTE4
	LDY #2
PUTBYTE7	LDA KENNBYTE,Y
	CPY #2
	BNE PUTBYTE8
	CMP #0
	BEQ PUTBYTE8
	SEC
	SBC #WBA-W07
PUTBYTE8	STA ($32+$80),Y
	DEY
	BPL PUTBYTE7
	LDA $33+$80
	PHA
	CMP #$C0
	BEQ PUTBYTE9
	SEC
	SBC #WBA-W07
	STA $33+$80
	LDA $35+$80
	SEC
	SBC #WBA-W07
	STA $35+$80
PUTBYTE9	JSR SROUT
	INC NAMEBUF+$13
	PLA
	STA $33+$80
	STA $35+$80
	STA AREGE+1
	LDA #0
	STA $32+$80
	LDA #3
	STA $34+$80
	STA AREGE
	LDY $30+$80
	BPL PUTBYTE2
	BMI PUTBYTE4
CLOSE	LDA FNR
	ORA FN
	AND #$FE
	LDY FNE
	DEY
	BNE CLOSE6
	CMP #$36
	BEQ CLOSE4
	CMP #$38
	PHP
	LDA NAMEBUF+$13
	AND #$3F
	SEC
	SBC #$21
	PLP
CLOSE6	STA RAMDKZ
	BEQ CLOSE1
CLOSE4	LDY #1
	RTS
CLOSE1	LDA #$FA
	STA KENNBYTE
	JSR BSOFF
	PHA
	JSR BSRAM
	LDY #2
CLOSE3	LDA KENNBYTE,Y
	CPY #2
	BNE CLOSE7
	CMP #$BF
	BCS CLOSE7
	SEC
	SBC #WBA-W07
CLOSE7	STA ($32+$80),Y
	DEY
	BPL CLOSE3
	LDA $33+$80
	CMP #$C0
	BEQ CLOSE8
	SEC
	SBC #WBA-W07
	STA $33+$80
	LDA $35+$80
	SEC
	SBC #WBA-W07
	STA $35+$80
CLOSE8	JSR SROUT
	PLA
	JSR BSON
	LDY $30+$80
	BEQ CLOSE4
	RTS
SETV	LDA $D01F
	AND #1
	BNE SETV1
	JMP $E477
SETV1	LDX #$0
	LDA #$54
	STA $31A,X
	INX
	LDA #TURBOV:L
	STA $31A,X
	INX
	LDA #TURBOV:H
	STA $31A,X
	LDA #0
	STA $2E7
	LDA #$1F
	STA $2E8
	RTS
BSRAM	LDA #$FE
	STA $D301
	RTS
DLIST1	DFB $70,$70,$70,$70,$70,$46
	DFW NEEDN
	DFB $70,$70,$70,$46
	DFW FOUNDA
	DFB $70,$47
	DFW NAMEBUF
	DFB $70,$70,$70,$46
	DFW GETA
	DFB $41
	DFW DLIST1
NAMEBUF	ASC %                    %
NEEDN	ASC %             TO LOAD%
RAMDKZ	DFB $10
FNR	DFB $30
GETA	ASC %PRESS SPACE  TO LOAD%
KENNBYTE	DFB $FA
AREGE	DFB $03,$07
SP	DFB $80
FNE	DFB $1
NAMEE	ASC % PLEASE ENTER NAME.%
FOUNDA	ASC %      FOUND...      %
DLIST3	DFB $70,$70,$70,$70,$70,$46
	DFW NEEDN
	DFB $70,$70,$70,$46
	DFW FOUNDA
	DFB $70,$47
	DFW NAMEBUF
	DFB $41
	DFW DLIST3
SAVEKEY	DFB $0
FN	DFB $4
AFN	DFB $0
DLIST8	DFB $70,$70,$70,$70,$70,$70,$70,$70,$46
	DFW FOUNDA
	DFB $70,$70,$70,$70,$47
	DFW NAMEBUF
	DFB $41
	DFW DLIST8
DLIST7	DFB $70,$70,$70,$70,$70,$70,$70,$70,$47
	DFW ERRA
	DFB $41
	DFW DLIST7
ERRA	ASC %ERROR.  PRESS A KEY.%
LDATNAME	ASC "                    "
SDATNAME	ASC "                    "
DEXY	DEX
	BNE DEXY
	INY
	BNE DEXY
	RTS
TOSB5	LDA #$04
TOSB3	TAY
TOSB4	JSR DEXY
	SEC
	SBC #$01
	BNE TOSB4
	RTS
SCR	LDA $E411
	PHA
	LDA $E410
	PHA
	RTS
TOS	JSR SCR
	LDA #$2C
	STA $BC40
	LDA #$1F
	STA $BC41
	LDY #LDATNAME:L
	STY $344
	LDX #0
	LDA #5
	STA $342
	STX $349
	LDA #$12
	STA $348
	LDA #LDATNAME:H
	STA $345
	JSR $E456
	BMI TOS
COPY1	JSR SCR
	LDA #$33
	STA $BC40
	LDA #$1F
	STA $BC41
	LDY #SDATNAME:L
	STY $344
	LDX #0
	LDA #5
	STA $342
	STX $349
	LDA #$12
	STA $348
	LDA #SDATNAME:H
	STA $345
	JSR $E456
	BMI COPY1
	LDA LDATNAME
	AND SDATNAME
	CMP #$54
	BEQ COPY2
	LDX #$10
	LDA #3
	STA $352
	LDA #$80
	STA $35B
	LDA #4
	STA $35A
	LDA #LDATNAME:L
	STA $354
	LDA #LDATNAME:H
	STA $355
	JSR $E456
	BPL COPY3
COPY2	JMP ERROR
COPY3	LDX #$20
	LDA #3
	STA $362
	LDA #8
	STA $36A
	LDA #0
	STA $36B
	LDA #SDATNAME:L
	STA $364
	LDA #SDATNAME:H
	STA $365
	JSR $E456
	BMI COPY2
COPY4	LDX #$10
	LDA #7
	STA $352
	LDA #0
	STA $358
	STA $359
	JSR $E456
	BMI COPY2
	LDX #$B
	STX $362
	LDX #0
	STX $368
	STX $369
	LDX #$20
	JSR $E456
	BPL COPY4
ERROR	CPY #$88
	PHP
	LDX #$10
	LDA #$C
	STA $352
	JSR $E456
	LDX #$20
	LDA #$C
	STA $362
	JSR $E456
	PLP
	BNE ERROR1
	CPY #1
	BNE ERROR1
	JMP TOS
ERROR1	LDA #DLIST7:L
	STA $230
	LDA #DLIST7:H
	STA $231
	JSR GETKEY
	LDA #$FF
	STA $2FC
	JMP TOS
	ORG $B000,$B100
START1	LDX #1
	STX $03F8
	JSR SETV
	LDA #DLIST4:L
	STA $0230
	LDA #DLIST4:H
	STA $0231
	JSR GETKEY
	CMP 'Y
	BNE START9
	STA SAVEKEY
START9	JMP TOS
DLIST4	DFB $70,$70,$70,$70,$70,$70,$70,$70,$46
	DFW COPA
	DFB $70,$06,$30,$07,$70,$70,$70,$70,$06,$41
	DFW DLIST4
COPA	ASC % COPY T & D  TO THE %
	ASC % TOS 1.0 WRITTEN BY %
	ASC % THE CHAOTIC HACKER %
DEV	ASC %   KEY TO SAVE Y?   %�������������������������������������������������������������������������������������