	.TITLE	TAPDMP
/
/  12 MAY 77 - PAUL HENDERSON
/
/  PROGRAM TO DUMP (IN OCTAL) EACH FRAME OF A PAPER TAPE.
/
	.DEC
PR=8
LP=16
	.OCT
ECLA=641000			/ EAE CLEAR AC INSTRUCTION
/
	.GLOBL	.IOERR
/
TAPDMP	CAL	WRFF		/ BEGIN LISTING WITH A FORM FEED
READ	CAL	READPR		/ READ A TAPE FRAME
	JMS	WTFOR
	LAC	(10
	PAL
	CLX
	LAC	CHAR		/ PICK UP CHARACTER READ IN FROM TAPE
	CLQ!LRSS 10
LOOP	ECLA!LLSS 1		/ SHIFT IN NEXT CHARACTER
	AAC	60		/ CONVERT TO ASCII
	DAC	IMAGE+2,X	/ STORE IN LINE BUFFER
	AXS	1
	JMP	LOOP
	CAL	WRITLP		/ OUTPUT THE CONVERTED-TO-ASCII FRAME
	JMS	WTFOR
	ISZ	LINCNT		/ TIME FOR A FORM FEED YET?
	JMP	READ
	LAW	-70		/ YES.  RESET LINES PER PAGE COUNTER
	DAC	LINCNT		/ TO 56 LINES
	JMP	TAPDMP
/
WTFOR	XX
	CAL	WAITFR		/ WAIT FOR EVENT VARIABLE
	LAC	EV
	SMA
	JMP*	WTFOR		/ GOOD EV.  RETURN
	JMP*	.IOERR		/  BAD EV.  ABORT.
/
WAITFR	20;	EV
READPR	2600;	EV;	PR; 3; ILINE; 3
WRITLP	2700;	EV;	LP; 3; IMAGE
WRFF	2700;	0;	LP; 2; FF
FF	2002; 0; .ASCII <14><15>
LINCNT	-70;EV
ILINE	0; 0;CHAR
IMAGE	6003; 0
	.BLOCK	10
	15; 12
	.END	TAPDMP
