LUNFDB	MACRO M1110  22-AUG-78 02:16  PAGE 1





      1						.TITLE	LUNFDB

      2						.IDENT	/01/

      3					;

      4					; COPYRIGHT (C) 1976,1977,1978

      5					; DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

      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 INCLU-

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

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

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

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

     13					; OWNERSHIP OF THE SOFTWARE SHALL AT ALL TIMES REMAIN IN DEC.

     14					;

     15					; THE INFORMATION IN THIS SOFTWARE  IS  SUBJECT TO CHANGE WITHOUT

     16					; NOTICE AND SHOULD NOT BE CONSTRUED  AS  A COMMITMENT BY DIGITAL

     17					; EQUIPMENT CORPORATION.

     18					;

     19					; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS

     20					; SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.

     21					;

     22					; VERSION 01

     23					;

     24					; K. D. MORSE 1-AUG-76

     25					;

     26					; MODIFICATIONS:

     27					;

     28					; NO		DATE		PROGRAMMER		PURPOSE

     29					; --		----		----------		-------

     30					;

     31					; 01		24-MAY-78	K.D. MORSE		REMOVE LUNFDB FROM

     32					;							FILE OPNCLS.

     33					;

LUNFDB	MACRO M1110  22-AUG-78 02:16  PAGE 2





     35					;+

     36					;**-LUNFDB-FIND FDB FOR A GIVEN LUN

     37					;

     38					; THIS ROUTINE ACCEPTS AS INPUT A LOGICAL UNIT NUMBER AND RETURNS THE

     39					; ADDRESS OF THE FDB ASSOCIATED WITH THIS LUN.

     40					;

     41					; INPUTS:

     42					;

     43					;	2(R5) IS THE ADDRESS OF THE LUN

     44					;

     45					; OUTPUTS:

     46					;

     47					;	R0 CONTAINS THE ADDRESS OF THE FDB

     48					;	R1 CONTAINS THE OFFSET INTO LUNMAP

     49					;

     50					;-

     51	000000	012701 	000000G		LUNFDB:: MOV	#LUNMAP,R1	;FIND ADDRESS OF LUNS IN USE

     52	000004	012702 	000004 			MOV	#4,R2		;CHECK ALL FOUR FDB'S

     53	000010	022175 	000002 		10$:	CMP	(R1)+,@2(R5)	;DOES LUN MATCH?

     54	000014	001402 				BEQ	20$		;YES, BRANCH

     55	000016	077204 				SOB	R2,10$		;NO, CHECK NEXT ONE

     56	000020	000412 				BR	90$		;NO MATCH, ERROR, FILE NOT OPEN

     57	000022	162701 	000002 		20$:	SUB	#2,R1		;SUBTRACT OFF EXTRA INCREMENT AND MAPPING

     58	000026	162701 	000000G			SUB	#LUNMAP,R1	;TABLE ADDRESS TO GET OFFSET TO FDB ADDR.

     59	000032	012702 	000000G			MOV	#FDBADR,R2	;GET ADDRESS OF FDB TABLE OF ADDRESSES

     60	000036	060102 				ADD	R1,R2		;GET ADDRESS OF FDB ADDRESS

     61	000040	011200 				MOV	(R2),R0		;GET FDB ADDRESS

     62	000042	000241 				CLC			;CLEAR CARRY, AS SUCCESS

     63	000044	000401 				BR	100$		;RETURN

     64	000046	000261 			90$:	SEC			;SET CARRY, AS FAILURE FILE NOT OPEN

     65	000050	000207 			100$:	RETURN			;RETURN

     66		000001 				.END

LUNFDB	MACRO M1110  22-AUG-78 02:16  PAGE 2-1

SYMBOL TABLE



FDBADR= ****** GX	LUNFDB  000000RG 	LUNMAP= ****** GX



. ABS.	000000	   000

      	000052	   001

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  69 WORDS  ( 1 PAGES)

DYNAMIC MEMORY:  2772 WORDS  ( 10 PAGES)

ELAPSED TIME:  00:00:02

OBJ$:LUNFDB,LIS$:LUNFDB/-SP=SRC$:LUNFDB.MAC

