;:poke56,64:clr
;:sys36864
	*= $c000
	;.opt oo
setnam	=$ffbd
setpar	=$ffba
open	=$ffc0
close	=$ffc3
strout	=$ab1e
cint	=65409
key	=198
bsout	=65490
pos	=1864
fpos	=pos+54272
flop	=8
chkin	=$ffc6
chkout	=$ffc9
clrchn	=$ffcc
clall	=$ffe7
get	=65508
memo	=$4000
mem	=247
return	=$aad7
st	=144
axout	=$bdcd
	jmp heiahopp
ein	.byt 13
	.byte "\x93\x08\x99\x11 vizaspell - wortlinker     version 2.0"
	.byt 13
	.byte "\x11 von nikolaus heusler 030789 nss-progr.\x11"
	.byt 13
	.byte "\x11dieses programm macht aus den 26 wortda-"
	.byte "teien  des checkers einen  grossen viza-"
	brk
r2	.byte "write-text,  in dem alle woerter enthal-"
	.byte "ten sind.  dieser text wird auf der disk"
	.byte "erzeugt, auf der sich auch die spell-da-"
	.byte "teien befinden (auf genuegend freie sek-"
	.byte "toren achten!).  der erzeugte text  kann"
	brk
r3	.byte "nicht wie ein  normales dokument geladen"
	.byte "werden, sondern nur mit merge (commodore"
	.byte "taste und shift m)."
	.byt 13
	.byte "\x11  - bitte legen sie die diskette ein -"
	.byt 13,13,0
bea	.byte "bearbeite\xa0"
name1	.byte "spell.dict."
name2	.word 0
errtxt	.byte "\x11\x12diskettenfehler\x92 !!                   "
	.byt 13,0
endtxt	.byte "\x11fertig. gezaehlte woerter: "
	brk
len	brk
anz	.word 0
waitkey	ldx #0
	stx key
wk	cpx key
	beq wk
	stx key
good	rts
error	jsr clrchn
	lda #2
	jsr close
	jsr clall
	lda #<errtxt
	ldy #>errtxt
	jmp strout
status	bcs bad
	lda st
	and #191
	beq good
bad	pla
	pla
	jmp error
heiahopp	jsr clall
	jsr cint
	lda #0
	sta 53280
	sta 53281
	lda #<ein
	ldy #>ein
	jsr strout
	ldx #200
rv	lda 1023,x
	eor #128
	sta 1023,x
	lda #13
	sta 55295,x
	dex
	bne rv
	lda #<r2
	ldy #>r2
	jsr strout
	lda #<r3
	ldy #>r3
	jsr strout
	jsr waitkey
	lda #13
	ldx #39
colin	sta fpos,x
	dex
	bpl colin
	lda #0
	sta anz
	sta anz+1
	lda #65
	sta name2
loop1	lda #<bea
	ldy #>bea
	jsr strout
	jsr return
	lda #12
	ldx #<name1
	ldy #>name1
	jsr setnam
	ldx #flop
	lda #2
	tay
	jsr setpar
	jsr open
	jsr status
	ldx #2
	jsr chkin
	jsr status
	lda #<memo
	ldy #>memo
	sta mem
	sty mem+1
loop2	jsr get
	tax
	jsr status
	txa
	cmp #-1
	beq stop
	pha
	jsr get
	sta len
	pla
	tax
loop3	jsr get
	cmp #"\x1e"
	bne nosz
	lda #$7c
	bne noue
nosz	cmp #"\x1d"
	bne nooe
	lda #$76
	bne noue
nooe	cmp #"\x1b"
	bne noae
	lda #$65
	bne noue
noae	cmp #"\x1c"
	bne noue
	lda #$78
noue	sta pos,x
	inx
	cpx len
	bcc loop3
	lda #32
loop3a	cpx #40
	bcs loop3b
	sta pos,x
	inx
	bne loop3a
loop3b	ldy #0
loop4	lda pos,y
	sta (mem),y
	iny
	cpy len
	bcc loop4
	lda #32
	sta (mem),y
	iny
	tya
	clc
	adc mem
	sta mem
	lda mem+1
	adc #0
	sta mem+1
	inc anz
	bne loop2
	inc anz+1
	bne loop2
stop	jsr clrchn
	lda #2
	jsr close
	inc name2
	lda name2
	cmp #"z"+1
	bcs fertig
	lda #"\x91"
	jsr bsout
	jmp loop1
fertig	jsr clall
	lda #<endtxt
	ldy #>endtxt
	jsr strout
	ldx anz
	lda anz+1
	jsr axout
	jmp return
