

; Bliss-32 7.352	Saturday 22-AUG-1978 02:54:17	DBB3:[BADBLK.SRC]GETREQ.B32;18					Page 1

; Digital Equipment Corporation

;

;	0001	MODULE GETREQ (MAIN=MAIN_BAD,

;	0002			LANGUAGE (BLISS32),

;	0003			IDENT = 'X01'

;	0004			) =

;	0005	BEGIN

;	0006	

;	0007	!

;	0008	! Copyright (c) 1977

;	0009	! Digital Equipment Corporation, Maynard, Massachusetts 01754

;	0010	!

;	0011	! This software is furnished  under a license for use only on a single

;	0012	! computer  system and  may be  copied only with  the inclusion of the

;	0013	! above copyright notice.  This software, or any other copies thereof,

;	0014	! may not be provided or  otherwise made available to any other person

;	0015	! except for use on such system and to one who agrees to these license

;	0016	! terms.  Title to and  ownership of the  software  shall at all times

;	0017	! remain in DEC.

;	0018	!

;	0019	! The information in this software is subject to change without notice

;	0020	! and should  not be construed  as a commitment  by Digital  Equipment

;	0021	! Corporation.

;	0022	!

;	0023	! DEC assumes  no  responsibility  for  the use or  reliability of its

;	0024	! software on equipment which is not supplied by DEC.

;	0025	

;	0026	!++

;	0027	!

;	0028	! FACILITY:  DYNAMIC BADBLOCK UTILITY

;	0029	!

;	0030	! ABSTRACT:

;	0031	!

;	0032	!	THESE ROUTINES PERFORM THE ITERACTIONS WITH THE FILE SYSTEM

;	0033	!	ACP FOR THE BAD BLOCK SCAN UTILITY.SPECIFIC FUNCTIONS ARE

;	0034	!

;	0035	!		1. READ THE MAILBOX INTERFACING THE UTILITY AND THE ACP

;	0036	!		2. ACCESS THE SUSPECT FILE BY PATCHING ITS UCB INTO

;	0037	!			A PREVIOUSLY OPENED CCB

;	0038	!

;	0039	! ENVIRONMENT:

;	0040	!

;	0041	!	VAX/VMS OPERATING SYSTEM, VERSION 1.0

;	0042	!

;	0043	!--

;	0044	!

;	0045	!

;	0046	! AUTHOR:  THOMAS G. DOPIRAK,	 CREATION DATE:  7-JUNE-1978

;	0047	!

;	0048	! REVISION HISTORY:

;	0049	!

;	0050	!**

;	0051	

;	0052	

;	0053	LIBRARY 'SYS$LIBRARY:LIB.L32';

;	0054	

;	0055	



; Bliss-32 7.352	Saturday 22-AUG-1978 02:54:17	DBB3:[BADBLK.SRC]GETREQ.B32;18					Page 1-1

; Digital Equipment Corporation

;

;	0056	FORWARD ROUTINE

;	0057		MAIN_BAD,			!MAIN PROGRAM

;	0058		RESTORE_CHANNEL:NOVALUE,	!PLACE SYS$DISK UCB BACK INTO CCB

;	0059	 	SET_UCB:NOVALUE,		!SET UCB ADDRESS IN TO CCB

;	0060		OPEN_CHANNEL,			!OPEN CHANNELS TO F11ACP AND SYS$DISK

;	0061		GET_BBSMSG,			!READ MAIL FROM F11ACP

;	0062		GET_CCB;			! get address of CCB of channel

;	0063	EXTERNAL ROUTINE

;	0064	    DATA_INIT:NOVALUE,

;	0065	    SCAN;



; Bliss-32 7.352	Saturday 22-AUG-1978 02:54:17	DBB3:[BADBLK.SRC]GETREQ.B32;18					Page 2

; Digital Equipment Corporation

;

;	0066	!

;	0067	!OWN STORAGE

;	0068	!

;	0069	

;	0070	GLOBAL

;	0071	    CHANNEL:WORD,			!CHANNEL NUMBER OF SYS$DISK

;	0072	    MBX_CHANNEL:WORD,			!CHANNEL NUMBER OF F11ACP MAILBOX

;	0073	    CCBUCB,				!ADDRESS OF UCB ENTRY IN CCB

;	0074	    OLD_UCB,				!UCB ADDRESS FOR OPEN CHANNEL

;	0075	    SYS$DISK_UCB,			!SAVED ADDRESS OF UCB FOR SYS$DISK

;	0076	    ACP_MAIL:BLOCK[BBS$C_LENGTH,BYTE];	!MESSAGE FROM F11ACP

;	0077	!

;	0078	!READ ONLY STORAGE

;	0079	!

;	0080	

;	0081	BIND

;	0082	

;	0083	    DISK_DESC=UPLIT(%CHARCOUNT('SYS$DISK'),

;	0084				UPLIT BYTE('SYS$DISK'));

;	0085	

;	0086	LITERAL

;	0087	    TRUE=1;



; Bliss-32 7.352	Saturday 22-AUG-1978 02:54:17	DBB3:[BADBLK.SRC]GETREQ.B32;18					Page 3

; Digital Equipment Corporation

;

;	0088	ROUTINE MAIN_BAD=

;	0089	

;	0090	!++

;	0091	! FUNCTIONAL DESCRIPTION:

;	0092	!

;	0093	!	MAIN PROGRAM ON BADBLOCK_SCAN UTILITY. THIS ROUTINE RECEIVES

;	0094	!	MAIL FROM THE F11ACP INDICATING FILES THAT HAVE BEEN DELETED

;	0095	!	AND THAT HAVE ENCOUNTERED HARD DEVICE ERRORS DURING IO.

;	0096	!	MAIN_BAD USES THE UCB ADDRESS(INDICATING WHICH DISK) AND

;	0097	!	FILE-ID(INDICATING THE FILE) TO SEPARATE THE SUSPECT FILE

;	0098	!	INTO ITS "BAD" AND GOOD PORTIONS. THE BAD PORTIONS ARE 

;	0099	!	ADDED ONTO BADBLK.SYS(SYSTEM BADBLOCK FILE) AND THE GOOD

;	0100	!	PORTIONS ARE RECYCLED FOR GENERAL USE.

;	0101	!	SINCE THE DISK INVOLVED MAY BE ALLOCATED, BADBLOCK_SCAN

;	0102	!	SLIDES AROUND SYSTEM PROTECTION BY OPENING A CHANNEL TO

;	0103	!	SYS$DISK AND THEN REPLACING THE UCB ADDRESS IN THAT CCB

;	0104	!	BY THAT OF THE SUSPECT DISK.

;	0105	!

;	0106	! FORMAL PARAMETERS:

;	0107	!

;	0108	!	NONE

;	0109	!

;	0110	! IMPLICIT INPUTS:

;	0111	!

;	0112	!	NONE

;	0113	!

;	0114	! IMPLICIT OUTPUTS:

;	0115	!

;	0116	!	NONE

;	0117	!

;	0118	! ROUTINE VALUE:

;	0119	! COMPLETION CODES:

;	0120	!

;	0121	!	NONE

;	0122	!

;	0123	! SIDE EFFECTS:

;	0124	!

;	0125	!	NONE

;	0126	!

;	0127	!--

;	0128	

;	0129	BEGIN

;	0130	

;	0131	!+

;	0132	!OPEN CHANNELS TO SYS$DISK AND THE F11ACP MAILBOX

;	0133	

;	0134	    IF

;	0135		NOT OPEN_CHANNEL()

;	0136	    THEN

;	0137		RETURN;

;	0138	

;	0139	!++

;	0140	!INITIALIZE TEST DATA

;	0141	!--

;	0142	



; Bliss-32 7.352	Saturday 22-AUG-1978 02:54:17	DBB3:[BADBLK.SRC]GETREQ.B32;18					Page 3-1

; Digital Equipment Corporation

;

;	0143	    DATA_INIT();

;	0144	

;	0145	!+

;	0146	!GET THE ADDRESS OF THE  CCB FOR OPEN CHANNEL

;	0147	

;	0148	    IF NOT $CMKRNL(ROUTIN=GET_CCB)

;	0149	    THEN

;	0150		RETURN;

;	0151	

;	0152	

;	0153	!+

;	0154	!CYCLE THROUGH UNTIL NOTHING IN MAILBOX TO DO

;	0155	

;	0156	    WHILE TRUE DO

;	0157		BEGIN

;	0158		IF

;	0159		   NOT GET_BBSMSG()

;	0160		THEN

;	0161		    BEGIN

;	0162		    RESTORE_CHANNEL();

;	0163		    RETURN

;	0164		    END;

;	0165	

;	0166	        !+

;	0167	        !SET UCB FOR SUSPECT FILE INTO OPEN CCB

;	0168	    

;	0169	            $CMKRNL(ROUTIN=SET_UCB);

;	0170	    

;	0171	        !*

;	0172	        !PROCESS THE FILE

;	0173	

;	0174	            SCAN();

;	0175		END;

;	0176	END;





							    .TITLE  GETREQ

							    .IDENT  \X01\



							    .PSECT  $PLIT$,NOWRT,NOEXE,2



					      00000 P.AAB:  .ASCII  \SYS$DISK\						      ;

					      00008 P.AAA:  .LONG   8							      ;

					      0000C 	    .ADDRESS  P.AAB						      ;



							    .PSECT  $GLOBAL$,NOEXE,2



					      00000 CHANNEL::

							    .BLKB   2

					      00002 MBX_CHANNEL::

							    .BLKB   2

					      00004 CCBUCB::.BLKB   4

					      00008 OLD_UCB::

							    .BLKB   4

					      0000C SYS$DISK_UCB::



; Bliss-32 7.352	Saturday 22-AUG-1978 02:54:17	DBB3:[BADBLK.SRC]GETREQ.B32;18					Page 3-2

; Digital Equipment Corporation

;

							    .BLKB   4

					      00010 ACP_MAIL::

							    .BLKB   18



						    DISK_DESC=		P.AAA

							    .GLOBL  DATA_INIT, SCAN, SYS$CMKRNL



							    .PSECT  $CODE$,NOWRT,2



					 0800 00000 MAIN_BAD:

							    .WORD   Save R11						      ; 0088

		         5B 00000000G  9F  9E 00002 	    MOVAB   @#SYS$CMKRNL, R11					      ;

		  0000V  CF	       00  FB 00009 	    CALLS   #0, OPEN_CHANNEL					      ; 0135

		         30	       50  E9 0000E 	    BLBC    R0, 3$						      ;

		  0000G  CF	       00  FB 00011 	    CALLS   #0, DATA_INIT					      ; 0143

				       7E  D4 00016 	    CLRL    -(SP)						      ; 0148

				0000V  CF  9F 00018 	    PUSHAB  GET_CCB						      ;

		         6B	       02  FB 0001C 	    CALLS   #2, SYS$CMKRNL					      ;

		         1F	       50  E9 0001F 	    BLBC    R0, 3$						      ;

		  0000V  CF	       00  FB 00022 1$:     CALLS   #0, GET_BBSMSG					      ; 0159

		         07	       50  E8 00027 	    BLBS    R0, 2$						      ;

		  0000V  CF	       00  FB 0002A 	    CALLS   #0, RESTORE_CHANNEL					      ; 0162

				       10  11 0002F 	    BRB     3$							      ; 0163

				       7E  D4 00031 2$:     CLRL    -(SP)						      ; 0169

				0000V  CF  9F 00033 	    PUSHAB  SET_UCB						      ;

		         6B	       02  FB 00037 	    CALLS   #2, SYS$CMKRNL					      ;

		  0000G  CF	       00  FB 0003A 	    CALLS   #0, SCAN						      ; 0174

				       E1  11 0003F 	    BRB     1$							      ; 0156

				       50  D4 00041 3$:     CLRL    R0							      ; 0088

					   04 00043 	    RET     							      ;



; Routine Size:  68 bytes







; Bliss-32 7.352	Saturday 22-AUG-1978 02:54:17	DBB3:[BADBLK.SRC]GETREQ.B32;18					Page 4

; Digital Equipment Corporation

;

;	0177	GLOBAL ROUTINE GET_CCB  =

;	0178	

;	0179	!++

;	0180	!

;	0181	! FUNCTIONAL DESCRIPTION:

;	0182	!

;	0183	!	THIS ROUTINE LOCATES THE CCB ASSOCIATED WITH A SPECIFIED

;	0184	!	CHANNEL NUMBER. THE ADDRESS OF THE UCB LONGWORD IN THE CCB

;	0185	!	IS SAVED IN CCBUCB AND THE UCB ADDRESS ITSELF IS SAVED IN

;	0186	!	OLD_UCB

;	0187	!

;	0188	!

;	0189	! INPUT PARAMETERS:

;	0190	

;	0191	!	NONE

;	0192	

;	0193	!

;	0194	! IMPLICIT INPUTS:

;	0195	!

;	0196	!	CHANNEL: THE CHANNEL NUMBER WHOSE CCB IS BEING LOCATED

;	0197	!

;	0198	! OUTPUT PARAMETERS:

;	0199	!

;	0200	!	OLD_UCB: THE ADDRESS OF THE SYS$DISK UCB

;	0201	!	CCBUCB: ADDRESS OF THE UCB LONGWORD IN THE SYS$DISK CCB

;	0202	!

;	0203	! IMPLICIT OUTPUTS:

;	0204	!	NONE

;	0205	!

;	0206	! ROUTINE VALUE:

;	0207	!

;	0208	!	IF CCB CAN BE FOUND THE SUCCESS

;	0209	

;	0210	!

;	0211	! SIDE EFFECTS:

;	0212	!	NONE

;	0213	!

;	0214	!--

;	0215	

;	0216	

;	0217	BEGIN

;	0218	

;	0219	LINKAGE

;	0220		L_VERIFYCHAN	= JSB (REGISTER = 0) :

;	0221				  GLOBAL (CCB = 1)

;	0222				  NOPRESERVE (2, 3, 4, 5);

;	0223	

;	0224	GLOBAL REGISTER

;	0225		CCB		= 1 ; ! CCB address returned

;	0226	

;	0227	LOCAL

;	0228		STATUS;				! status of system call

;	0229	

;	0230	EXTERNAL ROUTINE

;	0231		IOC$VERIFYCHAN	: L_VERIFYCHAN ADDRESSING_MODE (ABSOLUTE);



; Bliss-32 7.352	Saturday 22-AUG-1978 02:54:17	DBB3:[BADBLK.SRC]GETREQ.B32;18					Page 4-1

; Digital Equipment Corporation

;

;	0232						! exec routine to find CCB

;	0233	

;	0234	!*

;	0235	!CALL EXEC ROUTINE TO FIND CCB ADDRESS GIVEN CHANNEL NUMBER

;	0236	

;	0237	    STATUS = IOC$VERIFYCHAN (.CHANNEL);

;	0238	

;	0239	!*

;	0240	!SAVE OLD UCB ADDRESS AND ADDRESS OF UCB ADDRESS IN CCB

;	0241	

;	0242	    BEGIN

;	0243	    MAP CCB:REF BLOCK;

;	0244	    CCBUCB=CCB[CCB$L_UCB];

;	0245	    OLD_UCB=.CCB[CCB$L_UCB];

;	0246	    END;

;	0247	

;	0248	RETURN .STATUS

;	0249	END;					! end of routine GET_CCB







							    .GLOBL  IOC$VERIFYCHAN



					 0FFC 00044 	    .ENTRY  GET_CCB, Save R2,R3,R4,R5,R6,R7,R8,R9,R10,R11	      ; 0177

		         50	0000'  CF  3C 00046 	    MOVZWL  CHANNEL, R0						      ; 0237

			    00000000G  9F  16 0004B 	    JSB     @#IOC$VERIFYCHAN					      ;

		  0000'  CF	       51  D0 00051 	    MOVL    CCB, CCBUCB						      ; 0244

		  0000'  CF	       61  D0 00056 	    MOVL    (CCB), OLD_UCB					      ; 0245

					   04 0005B 	    RET     							      ; 0177



; Routine Size:  24 bytes





;	0250	



; Bliss-32 7.352	Saturday 22-AUG-1978 02:54:17	DBB3:[BADBLK.SRC]GETREQ.B32;18					Page 5

; Digital Equipment Corporation

;

;	0251	GLOBAL ROUTINE SET_UCB:NOVALUE=

;	0252	

;	0253	!++

;	0254	! FUNCTIONAL DESCRIPTION:

;	0255	!

;	0256	!	ROUTINE PLACES THE UCB ADDRESS FOUND IN ITS MAIL FROM

;	0257	!	F11ACP INTO THE CCB OF THE OPEN CHANNEL, THEREBY

;	0258	!	HAVING ACCESS TO THE SUSPECT DISK

;	0259	!

;	0260	! FORMAL PARAMETERS:

;	0261	!

;	0262	!	NONE

;	0263	!

;	0264	! IMPLICIT INPUTS:

;	0265	!

;	0266	!	ACP_MAIL: BUFFER CONTAINING MAIL FROM LAST READ OF F11ACP

;	0267	!			MAILBOX

;	0268	!

;	0269	! IMPLICIT OUTPUTS:

;	0270	!

;	0271	!	NONE

;	0272	!

;	0273	! ROUTINE VALUE:

;	0274	! COMPLETION CODES:

;	0275	!

;	0276	!	NONE

;	0277	!

;	0278	! SIDE EFFECTS:

;	0279	!

;	0280	!	NONE

;	0281	!

;	0282	!--

;	0283	

;	0284	BEGIN

;	0285	

;	0286	

;	0287	!*

;	0288	!REPLACE THE UCB ADDRESS

;	0289	

;	0290	    .CCBUCB=.ACP_MAIL[BBS$L_UCB];

;	0291	END;











					 0000 0005C 	    .ENTRY  SET_UCB, Save nothing				      ; 0251

		  0000'  DF	0000'  CF  D0 0005E 	    MOVL    ACP_MAIL+8, @CCBUCB					      ; 0290

					   04 00065 	    RET     							      ; 0251



; Routine Size:  10 bytes







; Bliss-32 7.352	Saturday 22-AUG-1978 02:54:17	DBB3:[BADBLK.SRC]GETREQ.B32;18					Page 6

; Digital Equipment Corporation

;

;	0292	ROUTINE OPEN_CHANNEL=

;	0293	

;	0294	!++

;	0295	! FUNCTIONAL DESCRIPTION:

;	0296	!

;	0297	!	THE ROUTINE OPENS CHANNEL TO THE SYS$DISK AND

;	0298	!	ACP$BADBLOCK_MBX. THE SYS$DISK CHANNEL IS USED TO

;	0299	!	OBTAIN ACCESS TO WHAT MIGHT BE AN ALLOCTATED DISK.

;	0300	!	THE MBX CHANNEL IS USED TO RECEIVE MAIL FROM THE

;	0301	!	F11ACP, THAT IS THE WORK ORDERS FOR FILES TO PROCESS

;	0302	!

;	0303	! FORMAL PARAMETERS:

;	0304	!

;	0305	!	NONE

;	0306	!

;	0307	! IMPLICIT INPUTS:

;	0308	!

;	0309	!	NONE

;	0310	!

;	0311	! IMPLICIT OUTPUTS:

;	0312	!

;	0313	!	CHANNEL: CHANNEL TO SYS$DISK

;	0314	!	MBX_CHANNEL: CHANNEL TO F11ACP MAILBOX

;	0315	!

;	0316	! ROUTINE VALUE:

;	0317	! COMPLETION CODES:

;	0318	!

;	0319	!	SHOULD EITHER $ASSIGN FAIL THEN THE FAILURE CODE IS RETURNED

;	0320	!	OTHERWISE SUCCESS IS RETURNED

;	0321	!

;	0322	! SIDE EFFECTS:

;	0323	!

;	0324	!	NONE

;	0325	!

;	0326	!--

;	0327	

;	0328	BEGIN

;	0329	LOCAL 

;	0330	    STATUS;

;	0331	BIND

;	0332	    MBX_DESC=UPLIT (%CHARCOUNT('ACP$BADBLOCK_MBX'),

;	0333				UPLIT BYTE('ACP$BADBLOCK_MBX'));

;	0334	

;	0335	!+

;	0336	!OPEN A CHANNEL THE THE CURRENT DISK

;	0337	

;	0338	    IF

;	0339		NOT (STATUS=$ASSIGN(CHAN=CHANNEL,DEVNAM=DISK_DESC))

;	0340	    THEN

;	0341		RETURN .STATUS;

;	0342	

;	0343	!+

;	0344	!OPEN A CHANNEL TO THE MAILBOX FROM F11ACP

;	0345	

;	0346	    IF



; Bliss-32 7.352	Saturday 22-AUG-1978 02:54:17	DBB3:[BADBLK.SRC]GETREQ.B32;18					Page 6-1

; Digital Equipment Corporation

;

;	0347		NOT(STATUS=$ASSIGN(CHAN=MBX_CHANNEL,DEVNAM=MBX_DESC))

;	0348	    THEN

;	0349		BEGIN

;	0350		$DASSGN(CHAN=.CHANNEL);

;	0351		RETURN .STATUS

;	0352		END;

;	0353	

;	0354	RETURN TRUE

;	0355	END;







							    .PSECT  $PLIT$,NOWRT,NOEXE,2



					      00010 P.AAD:  .ASCII  \ACP$BADBLOCK_MBX\					      ;

					      00020 P.AAC:  .LONG   16							      ;

					      00024 	    .ADDRESS  P.AAD						      ;



						    MBX_DESC=		P.AAC

							    .GLOBL  SYS$ASSIGN, SYS$DASSGN



							    .PSECT  $CODE$,NOWRT,2



					 0804 00066 OPEN_CHANNEL:

							    .WORD   Save R2,R11						      ; 0292

		         5B 00000000G  9F  9E 00068 	    MOVAB   @#SYS$ASSIGN, R11					      ;

				       7E  7C 0006F 	    CLRQ    -(SP)						      ; 0339

				0000'  CF  9F 00071 	    PUSHAB  CHANNEL						      ;

				0000'  CF  9F 00075 	    PUSHAB  DISK_DESC						      ; 0292

		         6B	       04  FB 00079 	    CALLS   #4, SYS$ASSIGN					      ; 0339

		         52	       50  D0 0007C 	    MOVL    R0, STATUS						      ;

		         1F	       52  E9 0007F 	    BLBC    STATUS, 1$						      ;

				       7E  7C 00082 	    CLRQ    -(SP)						      ; 0347

				0000'  CF  9F 00084 	    PUSHAB  MBX_CHANNEL						      ;

				0000'  CF  9F 00088 	    PUSHAB  MBX_DESC						      ; 0292

		         6B	       04  FB 0008C 	    CALLS   #4, SYS$ASSIGN					      ; 0347

		         52	       50  D0 0008F 	    MOVL    R0, STATUS						      ;

		         10	       52  E8 00092 	    BLBS    STATUS, 2$						      ;

		         7E	0000'  CF  3C 00095 	    MOVZWL  CHANNEL, -(SP)					      ; 0350

	      00000000G  9F	       01  FB 0009A 	    CALLS   #1, @#SYS$DASSGN					      ;

		         50	       52  D0 000A1 1$:     MOVL    STATUS, R0						      ; 0351

					   04 000A4 	    RET     							      ;

		         50	       01  D0 000A5 2$:     MOVL    #1, R0						      ; 0354

					   04 000A8 	    RET     							      ; 0292



; Routine Size:  67 bytes







; Bliss-32 7.352	Saturday 22-AUG-1978 02:54:17	DBB3:[BADBLK.SRC]GETREQ.B32;18					Page 7

; Digital Equipment Corporation

;

;	0356	ROUTINE GET_BBSMSG=

;	0357	

;	0358	!++

;	0359	! FUNCTIONAL DESCRIPTION:

;	0360	!

;	0361	!	THIS ROUTINE ATTEMPTS TO READ MAIL FROM THE

;	0362	!	MAILBOX LINKING THE F11ACP  TO TH BADBLOCK UTILITY

;	0363	!	IF THE READ IS SUCCESSFUL THE MESSAGE TYPE AND LENGTH

;	0364	!	OF THE MAIL IS CHECKED, IF EITHER IS WRONG THE MESSAGE

;	0365	!	IS DISGARDED AND ANOTHER IS READ. IF A READ FAILS,

;	0366	!	THE FAILURE STATUS IS RETURNED BY THE ROUTINE.

;	0367	!

;	0368	! FORMAL PARAMETERS:

;	0369	!

;	0370	!	NONE

;	0371	!

;	0372	! IMPLICIT INPUTS:

;	0373	!

;	0374	!	NONE

;	0375	!

;	0376	! IMPLICIT OUTPUTS:

;	0377	!

;	0378	!	ACP_MAIL: MAIL IS READ INTO THIS BLOCK

;	0379	!

;	0380	! ROUTINE VALUE:

;	0381	! COMPLETION CODES:

;	0382	!

;	0383	!	IF  THE MAILBOX READ FAILS THE FAILURE IS RETURNED

;	0384	!	OTHERWISE TRUE.

;	0385	!

;	0386	! SIDE EFFECTS:

;	0387	!

;	0388	!	NONE

;	0389	!

;	0390	!--

;	0391	

;	0392	BEGIN

;	0393	LOCAL 

;	0394	    STATUS;

;	0395	

;	0396	OWN

;	0397	    MBX_IOSB:VECTOR[4,WORD];

;	0398	

;	0399	!+

;	0400	!LOOP UNTIL AN ERROR OF EOF

;	0401	

;	0402	    WHILE TRUE DO

;	0403	

;	0404	

;	0405	        BEGIN

;	0406		!++

;	0407		!READ FROM THE MAILBOX AND CHECK THE SYS SERV STATUS

;	0408		!__

;	0409		IF NOT (STATUS=$QIOW(CHAN=.MBX_CHANNEL,

;     P 0410				FUNC=IO$_READVBLK+IO$M_NOW,



; Bliss-32 7.352	Saturday 22-AUG-1978 02:54:17	DBB3:[BADBLK.SRC]GETREQ.B32;18					Page 7-1

; Digital Equipment Corporation

;

;     P 0411				IOSB=MBX_IOSB,

;     P 0412				P1=ACP_MAIL,

;     P 0413				P2=BBS$C_LENGTH))

;	0414		

;	0415		THEN

;	0416		    RETURN .STATUS;

;	0417	

;	0418		!++

;	0419		!CHECK IO STATUS

;	0420		!__

;	0421		IF

;	0422		    NOT .MBX_IOSB[0]

;	0423		THEN

;	0424		    RETURN .MBX_IOSB[0];

;	0425	

;	0426		!+

;	0427		!CHECK FOR PROPER MESSAGE TYPE AND LENGTH

;	0428	

;	0429		IF

;	0430	            (.ACP_MAIL[BBS$B_MSGTYPE] EQL MSG$_SCANBAD)

;	0431		    AND

;	0432		    (.MBX_IOSB[1] EQL BBS$C_LENGTH)

;	0433		THEN

;	0434		    RETURN TRUE;

;	0435	

;	0436		END

;	0437	END;







							    .PSECT  $OWN$,NOEXE,2



					      00000 MBX_IOSB:

							    .BLKB   8



							    .GLOBL  SYS$QIOW



							    .PSECT  $CODE$,NOWRT,2



					 0804 000A9 GET_BBSMSG:

							    .WORD   Save R2,R11						      ; 0356

		         5B	0000'  CF  9E 000AB 	    MOVAB   MBX_IOSB, R11					      ;

				       7E  7C 000B0 1$:     CLRQ    -(SP)						      ; 0413

				       7E  7C 000B2 	    CLRQ    -(SP)						      ;

				       12  DD 000B4 	    PUSHL   #18							      ;

				0000'  CF  9F 000B6 	    PUSHAB  ACP_MAIL						      ;

				       7E  7C 000BA 	    CLRQ    -(SP)						      ;

				       5B  DD 000BC 	    PUSHL   R11							      ;

		         7E	  71   8F  9A 000BE 	    MOVZBL  #113, -(SP)						      ;

		         7E	0000'  CF  3C 000C2 	    MOVZWL  MBX_CHANNEL, -(SP)					      ;

				       7E  D4 000C7 	    CLRL    -(SP)						      ;

	      00000000G  9F	       0C  FB 000C9 	    CALLS   #12, @#SYS$QIOW					      ;

		         52	       50  D0 000D0 	    MOVL    R0, STATUS						      ;

		         04	       52  E8 000D3 	    BLBS    STATUS, 2$						      ; 0409

		         50	       52  D0 000D6 	    MOVL    STATUS, R0						      ; 0416



; Bliss-32 7.352	Saturday 22-AUG-1978 02:54:17	DBB3:[BADBLK.SRC]GETREQ.B32;18					Page 7-2

; Digital Equipment Corporation

;

					   04 000D9 	    RET     							      ;

		         04	       6B  E8 000DA 2$:     BLBS    MBX_IOSB, 3$					      ; 0422

		         50	       6B  3C 000DD 	    MOVZWL  MBX_IOSB, R0					      ; 0424

					   04 000E0 	    RET     							      ;

		         28	0000'  CF  91 000E1 3$:     CMPB    ACP_MAIL, #40					      ; 0430

				       C8  12 000E6 	    BNEQ    1$							      ;

		         12	  02   AB  B1 000E8 	    CMPW    MBX_IOSB+2, #18					      ; 0432

				       C2  12 000EC 	    BNEQ    1$							      ;

		         50	       01  D0 000EE 	    MOVL    #1, R0						      ; 0434

					   04 000F1 	    RET     							      ; 0356



; Routine Size:  73 bytes







; Bliss-32 7.352	Saturday 22-AUG-1978 02:54:17	DBB3:[BADBLK.SRC]GETREQ.B32;18					Page 8

; Digital Equipment Corporation

;

;	0438	GLOBAL ROUTINE RESTORE_CHANNEL:NOVALUE=

;	0439	

;	0440	!++

;	0441	! FUNCTIONAL DESCRIPTION:

;	0442	!

;	0443	!	ROUTINE RESTORES THE UCB ADDRESS FO THE SYS$DISK INTO

;	0444	!	THE ACCESSED CCB AND $DASSGN'S BOTH OPEN CHANNELS

;	0445	!

;	0446	! FORMAL PARAMETERS:

;	0447	!

;	0448	!	NONE

;	0449	!

;	0450	! IMPLICIT INPUTS:

;	0451	!

;	0452	!	CHANNEL: SYS$DISK CHANNEL

;	0453	!	MBX_CHANNEL: CHANNEL NUMBER TO F11ACP

;	0454	!

;	0455	! IMPLICIT OUTPUTS:

;	0456	!

;	0457	!	NONE

;	0458	!

;	0459	! ROUTINE VALUE:

;	0460	! COMPLETION CODES:

;	0461	!

;	0462	!	NONE

;	0463	!

;	0464	! SIDE EFFECTS:

;	0465	!

;	0466	!	NONE

;	0467	!

;	0468	!--

;	0469	

;	0470	BEGIN

;	0471	!++

;	0472	!PUT OLD UCB ADDRESS BACK INTO CCB

;	0473	!--

;	0474	

;	0475	    ACP_MAIL[BBS$L_UCB]=.OLD_UCB;

;	0476	    $CMKRNL(ROUTIN=SET_UCB);

;	0477	

;	0478	!++

;	0479	!DE-ASSIGN BOTH ACTIVE CHANNELS

;	0480	!__

;	0481	    $DASSGN(CHAN=.CHANNEL);

;	0482	    $DASSGN(CHAN=.MBX_CHANNEL);		!CLEAR MAILBOX CHANNEL

;	0483	END;











					 0800 000F2 	    .ENTRY  RESTORE_CHANNEL, Save R11				      ; 0438

		         5B 00000000G  9F  9E 000F4 	    MOVAB   @#SYS$DASSGN, R11					      ;

		  0000'  CF	0000'  CF  D0 000FB 	    MOVL    OLD_UCB, ACP_MAIL+8					      ; 0475

				       7E  D4 00102 	    CLRL    -(SP)						      ; 0476



; Bliss-32 7.352	Saturday 22-AUG-1978 02:54:17	DBB3:[BADBLK.SRC]GETREQ.B32;18					Page 8-1

; Digital Equipment Corporation

;

				FF54   CF  9F 00104 	    PUSHAB  SET_UCB						      ;

	      00000000G  9F	       02  FB 00108 	    CALLS   #2, @#SYS$CMKRNL					      ;

		         7E	0000'  CF  3C 0010F 	    MOVZWL  CHANNEL, -(SP)					      ; 0481

		         6B	       01  FB 00114 	    CALLS   #1, SYS$DASSGN					      ;

		         7E	0000'  CF  3C 00117 	    MOVZWL  MBX_CHANNEL, -(SP)					      ; 0482

		         6B	       01  FB 0011C 	    CALLS   #1, SYS$DASSGN					      ;

					   04 0011F 	    RET     							      ; 0438



; Routine Size:  46 bytes







; Bliss-32 7.352	Saturday 22-AUG-1978 02:54:17	DBB3:[BADBLK.SRC]GETREQ.B32;18					Page 9

; Digital Equipment Corporation

;

;	0484	END

;	0485	ELUDOM













;				       PSECT SUMMARY

;

;	Name		 Bytes			       Attributes

;

;  $GLOBAL$       	    34    WRT,  RD ,NOEXE,NOSHR,  LCL,  REL,  CON,NOPIC,ALIGN(2)

;  $PLIT$         	    40  NOWRT,  RD ,NOEXE,NOSHR,  LCL,  REL,  CON,NOPIC,ALIGN(2)

;  $CODE$         	   288  NOWRT,  RD ,  EXE,NOSHR,  LCL,  REL,  CON,NOPIC,ALIGN(2)

;  $OWN$          	     8    WRT,  RD ,NOEXE,NOSHR,  LCL,  REL,  CON,NOPIC,ALIGN(2)









;				LIBRARY STATISTICS

;

;					     -------- Symbols --------    Blocks

;	File				     Total    Loaded   Percent      Read

;

;  DBA4:[SYSLIB]LIB.L32;1		      5582        11         0       231











; Size:		288 code + 82 data bytes

; Run Time:	00:07.5

; Elapsed Time:	00:18.2

; Memory Used:	259 pages

; Compilation Complete

