	.TITLE	LIST
/
/  23 MAY 73 - CORRECT END-OF-FILE ACTION
/  30 OCT 72 - PAUL HENDERSON
/
TTO=-3
TTI=-2
DT=3
LP=6
/
	.IODEV	TTO,TTI,DT,LP
/
	.GLOBL	FILENM
/
LIST	.INIT	TTO,1,LIST
	.INIT	TTI,0,LIST
	.WRITE	TTO,2,FILMSG,0
	.READ	TTI,2,LINE,34
	.WAIT	TTI
	JMS*	FILENM
	LINE+2
	NAME
	LAC	NAME+2
	SNA
	LAC	SRC
	DAC	NAME+2
	.INIT	DT,0,LIST
	.FSTAT	DT,NAME
	SNA
	JMP	LIST
	.SEEK	DT,NAME
	.INIT	LP,1,LIST
	LAC	LST
	DAC	NAME+2
	.ENTER	LP,NAME
	DZM	EOF		/CLEAR END-OF-FILE FLAG
	.REALR	DT,2,LINE,52,WRITEL
IDLEC	.IDLEC
	LAC	EOF		/END OF FILE YET?
	SNA
	JMP	IDLEC
	JMP	LIST
/
WRITEL	0
	DAC	AC1
	LAC	LINE		/END OF FILE YET?
	AND	(7
	SAD	(2
	JMP	WRITE
	.CLOSE	LP
	CLC
	DAC	EOF
	JMP	EXIT
WRITE	.REALW	LP,2,LINE,0,READL
EXIT	LAC	AC1
	.RLXIT	WRITEL
/
READL	0
	DAC	AC2
	.READ	DT,2,LINE,52,WRITEL
	LAC	AC2
	.RLXIT	READL
/
FILMSG	FI-.*400+2
EOF
	.ASCII	'FILE NAME  >'<175>
FI=.
/
SRC	.SIXBT	'SRC'
LST	.SIXBT	'LST'
NAME	.BLOCK	3
LINE	.BLOCK	100
AC1;AC2
	.END	LIST
