TFINO	X0005 - FINISH UP OUTPU	MACRO M1110  21-AUG-78 21:08  PAGE 3





      1	000000					$BEGIN	TFINO,0005,<FINISH UP OUTPUT TAPE>

						.TITLE	TFINO	X0005 - FINISH UP OUTPUT TAPE

						.IDENT	"X0005"

      2

      3					;

      4					; COPYRIGHT (C) 1976 BY DIGITAL EQUIPMENT CORPORATION,

      5					; MAYNARD, MASSACHUSETTS

      6					;

      7					; THIS SOFTWARE IS FURNISHED UNDER A LICENSE FOR USE ONLY ON A

      8					; SINGLE  COMPUTER  SYSTEM AND MAY BE COPIED ONLY WITH THE IN-

      9					; CLUSION OF THE ABOVE COPYRIGHT NOTICE.   THIS  SOFTWARE,  OR

     10					; ANY  OTHER  COPIES THEREOF, MAY NOT BE PROVIDED OR OTHERWISE

     11					; MADE AVAILABLE TO ANY OTHER PERSON EXCEPT FOR  USE  ON  SUCH

     12					; SYSTEM  AND TO ONE WHO AGREES TO THESE LICENSE TERMS.  TITLE

     13					; TO AND OWNERSHIP OF THE SOFTWARE SHALL AT ALL  TIMES  REMAIN

     14					; IN DIGITAL.

     15					;

     16					; THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITH-

     17					; OUT  NOTICE  AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY

     18					; DIGITAL EQUIPMENT CORPORATION.

     19					;

     20					; DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY  FOR

     21					; THE USE OR RELIABILITY OF ITS SOFTWARE ON EQUIPMENT WHICH IS

     22					; NOT SUPPLIED BY DIGITAL.

     23					;

     24					; ANDREW C. GOLDSTEIN  13-AUG-76  2:52

     25					; GEORGE RITTENBURG  30-MAR-77	CORRECTION  001

     26

     27

     28						.MCALL	ALUN$S

TFINO	X0005 - FINISH UP OUTPU	MACRO M1110  21-AUG-78 21:08  PAGE 4





     30					;+

     31					;

     32					; *** - $TFINO	FINISH TAPE OUTPUT

     33					;

     34					; THIS ROUTINE COMPLETES THE OUTPUT TAPE. IT WRITES THE TRAILER

     35					; LABEL SET, THE TRAILING EOF MARKS, AND THEN REWINDS THE TAPE

     36					; WHEN APPROPRIATE. NOTE THAT THIS ROUTINE IS ALSO CALLED TO FINISH

     37					; A TAPE WHEN IT IS FULL AND A NEW REEL IS BEING STARTED.

     38					;

     39					; INPUTS:

     40					;

     41					;	R0 = 0 TO FINISH THE TAPE FILE

     42					;	     1 TO FINISH CURRENT REEL

     43					;	OUTPUT LUN ASSIGNED TO OUTPUT TAPE

     44					;	VOLUME LABEL IN $OVBF

     45					;	HEADER LABELS IN $OF1BF AND $OF2BF

     46					;

     47					; OUTPUTS:

     48					;

     49					;	TRAILER LABEL SET WRITTEN TO TAPE

     50					;	TAPE REWOUND IF APPROPRIATE

     51					;	EOF (OR EOV) LABELS IN $OF1BF AND $OF2BF

     52					;	ALL REGISTERS CLOBBERED

     53					;

     54					;-

     55

     56	000000				$TFINO:: LET $FLAG1 := $FLAG1 SET.BY #KY.NIP

     57

     58	000006					PUSH R0				; SAVE MODE FLAG

     59	000010					$CALL $WEOF <,,,,#$OF3HD>	; WRITE EOF MARK

     60

     61	000020					LET $OF1BF := #"EO		; CONVERT LABELS TO TRAILER

     62	000026					LET $OF2BF := #"EO

     63	000034					IF (SP) EQ #0			; IF END OF FILE

     64	000040					  LET $OF1BF+2 := #"F1		; PUT IN "EOF"

     65	000046					  LET $OF2BF+2 := #"F2

     66	000054					ELSE				; IF REEL SWITCH

     67	000056					  LET $OF1BF+2 := #"V1		; PUT IN "EOV"

     68	000064					  LET $OF2BF+2 := #"V2

     69	000072					  LET $OFLAG := $OFLAG OFF.BY #KY.EOT	;CLEAR EOT CONDITION

     70	000100					  LET $FLAG1 := $FLAG1 OFF.BY #KY.BSP	;CAN NOT BACKSPACE BEYOND EOT

     71							;BACKSPACE NEEDED FOR VERIFY ONLY

     72

     73	000106					END

     74	000106					LET R0 := #$OF1BF+55.		; POINT TO BLOCK COUNT

     75	000112					$CALL $CBDMG <R0,$BLCNT,#1>	; PUT IN ACCUMULATED COUNT

     76	000126					LET $BLCNT := #0		; RE-INIT COUNT

     77	000132					$CALL $WRITE <,#80.,,,#$OF1HD>	; WRITE FIRST TRAILER

     78

     79	000146					$CALL $WRITE <,#80.,,,#$OF2HD>	; WRITE SECOND TRAILER

     80

     81	000162					$CALL $WEOF <,,,,#$OF4HD>	; WRITE TRAILING TAPE MARKS

     82	000172					$CALL $WEOF <,,,,#$OF5HD>

     83	000202					$CALL $WAITO <,,,,R4>		; WAIT FOR ALL OF THE ABOVE

     84	000206					ON.ERROR THEN ERROR ER.IOR	; OUT ON ANY ERRORS

     85										; BACK UP OVER EOF'S

     86	000212					$CALL  $SPACF  <,#OUTLUN,,,#$OF6HD,#-2>

TFINO	X0005 - FINISH UP OUTPU	MACRO M1110  21-AUG-78 21:08  PAGE 4-1





     87	000232					LET $OWAIT := R4	  ;LINK TO WAIT LIST

     88	000236					$CALL $WAITO  <,,,,R4>  ;WAIT BECAUSE OF HDWRE.MALFCTN

     89	000242					$CALL $OUTCK <,,,,R4>

     90	000246					LET (R4) := #0			; RESET STAUS $OF6HD

     91	000250					LET $FLAG1 := $FLAG1 OFF.BY #KY.NIP

     92					;

     93					; IF THIS IS A REEL SWITCH OR IF THIS IS NOT THE FIRST REEL OF A SET,

     94					; THEN REWIND THE TAPE AND PUT IT OFF-LINE.

     95					;

     96	000256					IF #KY.VER SET.IN $OFLAG THEN JUMPTO POSIT

     97	000272					IF (SP)+ NE #0 OR $RELNO NE #1

     98	000306					  $CALL  $RWNDU  <,#OUTLUN,,,R4>	;REWIND AND UNLOAD THE TAPE

     99	000316					END

    100	000316					RETURN

TFINO	X0005 - FINISH UP OUTPU	MACRO M1110  21-AUG-78 21:08  PAGE 5





    102					;+

    103					;

    104					; *** - $TFINI	FINISH TAPE INPUT

    105					;

    106					; THIS ROUTINE FINISHES THE INPUT TAPE. IF THE TAPE IS A CONTINUATION

    107					; REEL, IT IS REWOUND AND PUT OFF LINE. OTHERWISE, NOTHING HAPPENS.

    108					;

    109					; INPUTS:

    110					;

    111					;	INLUN ASSIGNED TO TAPE

    112					;

    113					;-

    114

    115	000320				$TFINI::

    116	000320					IF $RELNI NE #1

    117	000330					  $CALL $RWNDU  <,#INLUN,,,R4>

    118	000340					END

    119	000340					RETURN

    120

    121

    122

    123		000001 				.END

TFINO	X0005 - FINISH UP OUTPU	MACRO M1110  21-AUG-78 21:08  PAGE 5-1

SYMBOL TABLE



ER.IOR= ****** GX	L4      000306R  	$I$   = 000001   	$OUTCK= ****** GX	$TFINO  000000RG

IIII  = 177777   	L5      000316R  	$L    = 000000   	$OWAIT= ****** GX	$T1   = 000000

INLUN = ****** GX	L6      000340R  	$L$   = 000000   	$O$   = 000000   	$T2   = 000006

KY.BSP= ****** GX	OUTLUN= ****** GX	$OFLAG= ****** GX	$R    = 177777   	$WAITO= ****** GX

KY.EOT= ****** GX	POSIT = ****** GX	$OF1BF= ****** GX	$RELNI= ****** GX	$WEOF = ****** GX

KY.NIP= ****** GX	TYPS0 = 000000   	$OF1HD= ****** GX	$RELNO= ****** GX	$WRITE= ****** GX

KY.VER= ****** GX	TYPS1 = 000000   	$OF2BF= ****** GX	$RWNDU= ****** GX	$Y$   = 000000

LBLS0 = 000006   	$BLCNT= ****** GX	$OF2HD= ****** GX	$SPACF= ****** GX	$Z$   = 000000

LBLS1 = 000005   	$CBDMG= ****** GX	$OF3HD= ****** GX	$SUPMC= 000043   	$$S   = 000000

L0      000056R  	$DIDDO= 000000   	$OF4HD= ****** GX	$SV$  = 000000   	$$T   = 000004

L1      000106R  	$EF$  = 000000   	$OF5HD= ****** GX	$T    = 000007   	$$TT  = 000005

L2      000212R  	$E$   = 000001   	$OF6HD= ****** GX	$TFINI  000320RG 	.$T   = 000005

L3      000272R  	$FLAG1= ****** GX



. ABS.	000000	   000

      	000342	   001

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  11409 WORDS  ( 45 PAGES)

DYNAMIC MEMORY:  12276 WORDS  ( 47 PAGES)

ELAPSED TIME:  00:00:51

EXE$:TFINO,LIS$:TFINO/-SP=SRC$:SMAC/PA:1,DSCPRE,TFINO

