       .TITLE AUXIO
/COPYRIGHT 1970, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
/EDIT 4  10-14-70
/4-23-68
/AUXILIARY I/O STATEMENT OBJECT-TIME PACKAGE.
/   INTERNAL GLOBALS --
       .GLOBL .FT		       /BACKSPACE STATEMENT.
       .GLOBL .FU		       /REWIND STATEMENT.
       .GLOBL .FV		       /ENDFILE STATEMENT.
	.GLOBL AUXIO
AUXIO=.
/   VIRTUAL GLOBALS --
       .GLOBL .FH		       /READ/WRITE FLAG.
       .GLOBL .FC		       /I/O DEVICE INITIALIZER.
       .GLOBL .FQ		       /LINE BUFFER TRANSFER ROUTINE.
       .GLOBL .FN		       /LINE BUFFER
/   CONSTANTS AND WORKING STORAGE--
C00001	.DSA	1
C00002 .DSA   2
V77777 .DSA   377777
S02000 .DSA   2000
IDLOC=.FU
CNT=FT00
SLOT=.FV
       .EJECT
/BACKSPACE
/  CALLING SEQUENCE -- JMS   .FT
/		   .DSA  ADDRESS OF SLOT NUMBER
.FT    CAL    0
       DZM*   .FH		       /SET READ/WRITE FLAG TO READ.
       LAC*   .FT		       /INITIALIZE DEVICE.
       JMS*   .FC
       DAC    SLOT	         /SAVE SLOT NUMBER.
       XOR    S02000         /SET .MTAPE FUNCTION 02.
       DAC    FT00
       DAC    FT01
       ISZ    .FT		       /BUMP RETURN ADDRESS.
       LAC    .FN		       /GET ADDRESS OF RECORD ID.
       TAD    C00002
       DAC    IDLOC
	DZM* IDLOC	/FOR BACKSPACE OVER EOF.
FT00   CAL    0		     /BACKSPACE ONE PHYSICAL RECORD, AND READ
       .DSA   7		     /   IT INTO LINE BUFFER.
       LAC    SLOT
	JMS* .FQ
	LAC* .FN
	AND (17
	XOR C00002
	SNA
	JMP .+3
       LAC*   IDLOC          /CLEAR OUT BIT ZERO OF ID AND IT IS NOW
       AND    V77777         /   ONE LESS THA5 THE 5UMBER OF PHYSICAL
       CMA		/   RECORDS THAT MUST BE BACKSPACED.
       DAC    CNT		       /(-ID-1) TO COUNTER
FT01   CAL    0		     /BACKSPACE (ID+1) PHYSICAL RECORDS.
       .DSA   7
       ISZ    CNT
       JMP    FT01
       JMP*   .FT		       /EXIT
       .EJECT
/REWIND
/  CALLING SEQUENCE -- JMS   .FU
/		   .DSA  ADDRESS OF SLOT NUMBER
.FU    CAL    0
       DZM*   .FH		       /SET READ/WRITE FLAG TO READ.
       LAC*   .FU		       /INITIALIZE DEVICE.
       JMS*   .FC
       DAC    FU00
FU00   CAL    0		     /REWIND TAPE.
       .DSA   7
       ISZ    .FU		       /BUMP RETURN ADDRESS.
       JMP*   .FU		       /EXIT
       .EJECT
/WRITE END-OF-FILE
/  CALLING SEQUENCE -- JMS   .FV
/		   .DSA  ADDRESS OF SLOT NUMBER
.FV    CAL    0
       LAC    C00001         /SET READ/WRITE FLAG TO WRITE
       DAC*   .FH
       LAC*   .FV		       /INITIALIZE DEVICE.
       JMS*   .FC
       DAC    FV00
FV00   CAL    0		     /CLOSE FILE.
       .DSA   6
	DZM*	.FH
	LAC*	.FV
	JMS*	.FC
       ISZ    .FV		       /BUMP RETURN ADDRESS.
       JMP*   .FV		       /EXIT.
	.END
