d 	.title	implemented commands do their work here...
 	.sbttl this section deals with calling the proper code.
,
	.psect pure_data nopic,noexe,rd,nowrt,con
;
X; comtable is a table of the addresses of routines which implement 
; commands 
 ;

comtable:
L	.long	0
	.address -
		delete_com
x	.address -
		directory_com
@	.address -
J		done_com
	.address -
		help_com
	.address -
		logout_com
l	.address -
v		print_com
	.address -
		set_def_com
4	.address -
>		size_com
	.address -
		type_com

`		.psect impure_data nopic,noexe,rd,wrt,con
	;
(
; fab used to access files in directory.

;


Tcomfab::	$fab	nam=comnam, -
		xab=comdat,-
		fop=nam

comnam::	$nam	esa=estring,-
H		ess=100,-
		rsa=rstring,-
		rss=100
t
comdat::	$xabdat	nxt=comfhc
<
comfhc::	$xabfhc

comrab::	$rab	fab=comfab,-
			ubf=dir_out_buf,-
"			usz=512
,
hestring::
	.blkb	100
0
rstring::
	.blkb	100
\
	.psect pure_code nopic,exe,rd,nowrt,con
$
	.entry	com_impl ^M<r2,r3,r4,r5,r6,r7,r8,r9,r10,r11>
	movl	combits,r6
	cmpl	r6,#1
	bgeq	1$
	ret
1$:	cmpl	r6,#9
	bleq	2$
	ret
2$:
P	movl	comtable[r6],r5
	jmp	(r5)

|	.sbttl delete command
	.page
D;
; code to iplement the delete command.
;
p
delete_com:
8	clrl	r6
del_for_i:
 	movq	listspace[r6],r2
d	movb	r2,comfab+fab$b_fns
	movl	r3,comfab+fab$l_fna
,	$parse	fab=comfab
	cmpl	r0,#rms$_normal
	beql	delsrch
X	bsbw	simplerr
	jmp	del_next_i
 
delsrch:
	bitb	#ctrlcflag,simplflag
L	beql	70$
	jmp	unwind
70$:
x	$search	fab=comfab
	cmpl	r0,#rms$_normal
@	beql	10$
	cmpl	r0,#rms$_nmf
 	beql	del_next_i
l 	bsbw	simplerr
 	jmp	del_next_i
4!10$:
!	$open	fab=comfab
!	$close	fab=comfab
`"
"	$erase	fab=comfab
(#	cmpl	#rms$_normal,r0
#	beql	1$
#	bsbw	simplerr
T$	jmp	srch_end
$1$:
$	subl2	comfhc+xab$l_hbk,summ_space
%srch_end:
%	bitl	#nam$m_wildcard,comnam+nam$l_fnb
%	beql	10$
H&	jmp	delsrch
&10$:
'del_next_i:
t'	incl	r6
'	cmpl	r6,listlen
<(	bgeq	65$
(	jmp	del_for_i
)65$:
h)	ret
).end
