if1 ifndef %%scan,.insrt ksc;nscan >
if2 ife %%scan,.insrt ksc;nscan >

fnpard:
fnpart=fnpard+1
.begin fnpar		; filename parser. addr of string in 1
			; returns dev/sname/fn1/fn2 in accs 1,2,3,4

	tdca b,b		;FNPARD entry point = DDT type
	 seto b,		;FNPART entry point = TECO type
	movem b,fmode'		;set type
	movem a,finstr'		;save addr of input string
	setzm fdev'		;clear accumulated vars
	setz b,			;fdir
	setzb c,d		;fn1,fn2
fnpr20:	push p,[brkchr']
	push p,[fstr]
	push p,[fbrktb]
	push p,finstr
	pushj p,scanrt
	move a,brkchr
	cain a,40
	 jrst [pushj p,fcvstr ? pushj p,ffnput ? jrst fnpr20]
	cain a,";
	 jrst [pushj p,fcvstr ? move b,a ? jrst fnpr20]
	cain a,":
	 jrst [pushj p,fcvstr ? movem a,fdev ? jrst fnpr20]
	pushj p,fcvstr		;handle EOF or foreign char
	pushj p,ffnput
	move a,fdev
	popj p,

ffnput:	jumpe a,[popj p,]	;nothing to deposit
	skipn fmode		;DDT or TECO style?
	 jrst [jumpe c,[move c,a ? popj p,]	;DDT
		move d,a ? popj p,]
	jumpe d,[move d,a ? popj p,]		;TECO
	move c,d
	move d,a
	popj p,


	;break table
fbrktb:	cain a,^Q
	 jrst scbrqt
	cain a,":
	 jrst scbrsk
	cain a,";
	 jrst scbrsk
	cain a,40
	 jrst scbrsk
	cain a,^M
	 jrst scbrsk
	cain a,^J
	 jrst scbrsk
	jrst (b)

.scalar fstr(2)

;convert string (ptr in fstr) to sixbit wd in a
fcvstr:	pushae p,[b,c,d]
	setz a,
	move c,[440600,,a]
	hrrz d,fstr	;get cnt
	
fcvst5:	sojl d,fcvst9
	ildb b,fstr+1
	cain b,^Q	; if quoter,
	 jrst fcvst5	; don't deposit it.
	cail b,"a
	 caile b,"z
	  caia		;not lowercase
	   subi b,40	;cvt to uppercase
	subi b,40	;cvt to 6bit
	idpb b,c	;deposit
	tlne c,770000
	 jrst fcvst5	;if sixbit word not exhausted, get more chars
fcvst9:	popae p,[d,c,b]
	popj p,
.end fnpar