SMRVB	X0005 - READ A STORAGE 	MACRO M1110  21-AUG-78 20:55  PAGE 3





      1	000000					$BEGIN	SMRVB,0005,<READ A STORAGE MAP BLOCK>

						.TITLE	SMRVB	X0005 - READ A STORAGE MAP BLOCK

						.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  14-AUG-76  0:48

SMRVB	X0005 - READ A STORAGE 	MACRO M1110  21-AUG-78 20:55  PAGE 4





     26					;+

     27					;

     28					; *** - .SMRVB	READ A STORAGE MAP BLOCK

     29					;

     30					; THIS ROUTINE READS THE INDICATED STORAGE MAP BLOCK INTO .SMBUF.

     31					; IF THE BUFFER CONTAINS A MODIFIED MAP BLOCK, IT IS WRITTEN FIRST.

     32					;

     33					; INPUTS:

     34					;

     35					;	R3 = VBN OF MAP BLOCK TO READ

     36					;	   = 0 IF JUST WRITE DIRTY BUFFER

     37					;	R4 = DEVICE TABLE ADDRESS

     38					;	OUTLUN ASSIGNED TO DEVICE

     39					;	.SMFLG	= 0 IF BUFFER IS CLEAN

     40					;		= 1 IF BUFFER IS DIRTY

     41					;

     42					; OUTPUTS:

     43					;

     44					;	BUFFER WRITTEN IF NECESSARY

     45					;	BLOCK READ INTO .SMBUF

     46					;	ALL REGISTERS PRESERVED

     47					;

     48					;-

     49

     50	000000				.SMRVB::

     51	000000					$CALL $SAVAL			; SAVE ALL REGISTERS

     52	000004					IF .SMFLG NE #0			; IF BUFFER IS DIRTY

     53	000012					  PUSH R3,R4			; SAVE NEW VBN

     54	000016					  LET R3 := .SMVBN + V.SBLB(R4)	; GET LBN OF OLD BLOCK

     55	000026					  LET R2 := V.SBLB+2(R4) + CARRY

     56	000034					  $CALL $WRI1B <,,R2,R3,#$B1HD>	; WRITE THE BLOCK

     57	000044					  $CALL $WAITO <,,,,R4>

     58	000050					  ON.ERROR THEN ERROR ER.WSM

     59	000054					  LET .SMFLG := #0		; MARK BUFFER CLEAN AGAIN

     60	000060					  POP R4,R3

     61	000064					END

     62

     63	000064					IF R3 NE .SMVBN			; READ IF BLOCK NOT ALREADY THERE

     64	000072					  IF R3 NE #0			; READ IF NOT JUST BUFFER FLUSH

     65	000076					    LET $B1HD+B.STAT := #0	; INVALIDATE BUFFER

     66	000102					    LET .SMVBN := R3		; SAVE THE NEW VBN

     67	000106					    IF R3 HI V.SBSZ(R4)		; CHECK AGAINST BOUNDS

     68	000114					      FATAL <TRIED TO READ OFF END OF BITMAP>

     69	000116					    END

     70	000116					    LET R3 := R3 + V.SBLB(R4)	; COMPUTE LBN

     71	000122					    LET R2 := V.SBLB+2(R4) + CARRY

     72	000130					    $CALL $RDWLN <#OUTLUN,,R2,R3,#$B1HD> ; READ IT

     73	000144					    ON.ERROR THEN ERROR ER.RSM

     74	000150					  END

     75	000150					END

     76	000150					RETURN

     77

     78

     79

     80		000001 				.END

SMRVB	X0005 - READ A STORAGE 	MACRO M1110  21-AUG-78 20:55  PAGE 4-1

SYMBOL TABLE



B.STAT= ****** GX	L2      000150R  	V.SBSZ= ****** GX	$R    = 177777   	$WRI1B= ****** GX

ER.RSM= ****** GX	L3      000150R  	$B1HD = ****** GX	$RDWLN= ****** GX	$Y$   = 000000

ER.WSM= ****** GX	L4      000116R  	$DIDDO= 000000   	$SAVAL= ****** GX	$Z$   = 000000

IIII  = 177777   	L5      000150R  	$EF$  = 000000   	$SUPMC= 000043   	$$T   = 000005

LBLS0 = 000002   	OUTLUN= ****** GX	$E$   = 000001   	$T    = 000006   	.SMFLG= ****** GX

LBLS1 = 000003   	TYPS0 = 000000   	$I$   = 000001   	$T1   = 000000   	.SMRVB  000000RG

LBLS2 = 000005   	TYPS1 = 000000   	$L    = 000000   	$T2   = 000002   	.SMVBN= ****** GX

L0      000064R  	TYPS2 = 000000   	$L$   = 000000   	$WAITO= ****** GX	.$T   = 000005

L1      000054R  	V.SBLB= ****** GX	$O$   = 000000



. ABS.	000000	   000

      	000152	   001

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  11309 WORDS  ( 45 PAGES)

DYNAMIC MEMORY:  12276 WORDS  ( 47 PAGES)

ELAPSED TIME:  00:00:43

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

