TPRDY	X0006 - VERIFY TAPE REA	MACRO M1110  21-AUG-78 21:17  PAGE 3





      1	000000					$BEGIN	TPRDY,0006,<VERIFY TAPE READY>

						.TITLE	TPRDY	X0006 - VERIFY TAPE READY

						.IDENT	"X0006"

      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  15-AUG-78  11:03

     25					; GEORGE RITTENBURG  6-APR-77  ;MODIFIED FOR VFY/CMP DISK TO/FROM TAPE

     26

     27

     28						.MCALL	QIOW$S

TPRDY	X0006 - VERIFY TAPE REA	MACRO M1110  21-AUG-78 21:17  PAGE 4





     30					;

     31					; BIT DEFINITIONS IN MAGTAPE STATUS WORD

     32					;

     33		000400 			CH.OFL = 400			; UNIT OFF-LINE

     34		020000 			CH.BOT = 20000			; UNIT IS AT BOT

     35		002000 			CH.WLK = 2000			; TAPE IS WRITE LOCKED

     36

     37		002460 			IO.ACK = 2460			; PACK ACKNOWLEDGE I/O FUNCTION

     38

     39					;+

     40					;

     41					; *** - $INRDY	VERIFY TAPE READY FOR INPUT

     42					;

     43					; *** - $OTRDY	VERIFY TAPE READY FOR OUTPUT

     44					;

     45					; THIS ROUTINE VERIFIES THAT THE CURRENT TAPE UNIT IS ON LINE

     46					; AND READY FOR INPUT OR OUTPUT, AS SPECIFIED. IF THE UNIT IS

     47					; NOT READY, A MESSAGE IS ISSUED AND THE ROUTINE WAITS FOR THE

     48					; OPERATOR RESPONSE.

     49					;

     50					; INPUTS:

     51					;

     52					;	INPUT OR OUTPUT LUN ASSIGNED TO DEVICE

     53					;	$INDEV OR $OUDEV POINTING TO TABLE ENTRY

     54					;

     55					; OUTPUTS:

     56					;

     57					;	R0 = 0 IF TAPE IF AT BOT

     58					;	     1 IF TAPE IS NOT AT BOT

     59					;

     60					;-

     61

     62	000000				$INRDY::

     63	000000					IF #KY.NIP SET.IN $FLAG1

     64	000010						LET R3 := $OUDEV

     65	000014						LET R5 := #1

     66	000020						LET R2 := #INLUN

     67	000024						GOTO RDYCOM

     68	000026					ELSE

     69	000030						LET R3 := $INDEV		; GET DEVICE TABLE ENTRY

     70	000034					END

     71	000034					LET R2 := #INLUN		; AND LUN

     72	000040					LET R5 := #0			; FLAG FOR READ ACCESS

     73	000042					GOTO RDYCOM

     74

     75	000044				$OTRDY::

     76	000044					LET R3 := $OUDEV		; GET DEVICE TABLE ENTRY

     77	000050					LET R2 := #OUTLUN		; AND LUN

     78	000054					LET R5 := #1			; FLAG FOR WRITE ACCESS

     79

     80	000060				RDYCOM:

     81	000060	024646 				CMP -(SP),-(SP)			; ALLOCATE I/O STATUS ON STACK

     82	000062					LET R4 := SP

     83	000064					REPEAT				; UNTIL HE GETS IT RIGHT

     84	000064					  QIOW$S #IO.ACK,R2,#EFN,,R4	; DO PACKACK ON TAPE DRIVE

     85	000126					  QIOW$S #IO.SEC,R2,#EFN,,R4	; GET CHARACTERISTICS WORD

     86	000170	006146 				  ROL -(SP)

TPRDY	X0006 - VERIFY TAPE REA	MACRO M1110  21-AUG-78 21:17  PAGE 4-1





     87	000172					  IF R2 EQ #INLUN

     88	000200	006026 				    ROR (SP)+

     89	000202					    $CALL $INCK <,,,,R4>	; CHECK FOR ERRORS

     90	000206					  ELSE

     91	000210	006026 				    ROR (SP)+

     92	000212					    $CALL $OUTCK <,,,,R4>	; CHECK FOR ERRORS

     93	000216					  END

     94	000216	005726 				  TST (SP)+			; DISCARD 1ST STATUS WORD

     95	000220					  IF #CH.OFL OFF.IN (SP)	; IF TAPE IS ON-LINE

     96	000226					    LET R0 := #0		; ASSUME BOT

     97	000230					    IF #CH.BOT OFF.IN (SP) THEN LET R0 := #1

     98						    				; CHECK FOR WRITE LOCK IF WRITING

     99	000242					    IF R5 EQ #0 OR #CH.WLK OFF.IN (SP)

    100	000254	005726 				      TST (SP)+			; CLEAN STACK

    101	000256					      RETURN

    102	000260					    ELSE

    103	000262					      IF #KY.CMP SET.IN $OFLAG  ; IF COMPARE ONLY **5-10-77

    104	000272	005726 					TST (SP)+		; ** 5-10-77

    105	000274						RETURN			; **5-10-77

    106	000276					      END			; **5-10-77

    107	000276					      ERRP ER.WLK		; ISSUE WRITE LOCK MESSAGE

    108	000300					    END

    109	000300					  ELSE

    110	000302					    ERRP ER.RDY			; ISSUE READY MESSAGE

    111	000304					  END

    112	000304	024646 				  CMP -(SP),-(SP)		; STATUS & BUFFER ON STACK

    113	000306					  LET R1 := SP

    114						  				; WAIT FOR CR ON TERMINAL

    115	000310					  REPEAT

    116	000310					    QIOW$S #IO.RVB,#TTYLUN,#EFN,,R4,,<R1,#2>

    117	000356					    ON.ERROR THEN ERROR ER.DIR

    118	000362					    IF (R4) EQ #IS.CR LEAVE LOOP

    119	000370					  END LOOP			; WAIT FOR A REAL CR, DAMMIT!

    120	000372	005726 				  TST (SP)+			; CLEAN BUFFER OFF STACK

    121	000374					END LOOP			; VERIFY THAT TAPE IS REALLY READY

    122

    123

    124

    125		000001 				.END

TPRDY	X0006 - VERIFY TAPE REA	MACRO M1110  21-AUG-78 21:17  PAGE 4-2

SYMBOL TABLE



B0      000064R  	IO.SEC= ****** GX	L3      000216R  	$FLAG1= ****** GX	$R    = 177777

B1      000310R  	IS.CR = ****** GX	L4      000302R  	$INCK = ****** GX	$SUPMC= 000043

CH.BOT= 020000   	KY.CMP= ****** GX	L5      000242R  	$INDEV= ****** GX	$SV$  = 000000

CH.OFL= 000400   	KY.NIP= ****** GX	L6      000254R  	$INRDY  000000RG 	$T    = 000014

CH.WLK= 002000   	LBLS0 = 000000   	L7      000262R  	$I$   = 000001   	$T1   = 000005

EFN   = ****** GX	LBLS1 = 000001   	OUTLUN= ****** GX	$K$   = 000001   	$T2   = 000000

ER.DIR= ****** GX	LBLS2 = 000014   	RDYCOM  000060R  	$K$L  = 000001   	$XXX$ = 000001

ER.RDY= ****** GX	LBLS3 = 000011   	TTYLUN= ****** GX	$K$T  = 000005   	$Y$   = 000000

ER.WLK= ****** GX	L0      000030R  	TYPS0 = 000005   	$L    = 000002   	$Z$   = 000000

E0      000376R  	L1      000034R  	TYPS1 = 000005   	$L$   = 000000   	$$S   = 000000

E1      000372R  	L10     000300R  	TYPS2 = 000000   	$OFLAG= ****** GX	$$T   = 000013

IIII  = 177777   	L11     000276R  	TYPS3 = 000000   	$OTRDY  000044RG 	$$TT  = 000014

INLUN = ****** GX	L12     000304R  	$DIDDO= 000000   	$OUDEV= ****** GX	$$$ARG= 000002

IO.ACK= 002460   	L13     000362R  	$EF$  = 000000   	$OUTCK= ****** GX	.$T   = 000005

IO.RVB= ****** GX	L2      000210R  	$E$   = 000001   	$O$   = 000000



. ABS.	000000	   000

      	000376	   001

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  12107 WORDS  ( 48 PAGES)

DYNAMIC MEMORY:  13332 WORDS  ( 51 PAGES)

ELAPSED TIME:  00:01:06

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

