RTBWB	MACRO M1110  21-AUG-78 23:25  PAGE 2





      1						.TITLE	RTBWB

      2						.IDENT	/00/

      3

      4					;

      5					; COPYRIGHT (C) 1978

      6					; DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

      7					;

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

      9					; SINGLE COMPUTER SYSTEM AND MAY BE  COPIED ONLY WITH  THE INCLU-

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

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

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

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

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

     15					;

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

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

     18					; EQUIPMENT CORPORATION.

     19					;

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

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

     22					;

     23					; VERSION 00

     24					;

     25					; C. A. MONIA 24-MAR-1978

     26					;

     27					; WRITE THE BOOT BLOCKS OF AN RT-11 FORMATTED DISK

     28					;

     29					; MACRO LIBRARY CALLS

     30					;

     31

     32						.MCALL	FDOF$L,OFNB$R,READ$,WAIT$

     33

     34	000000					FDOF$L			; DEFINE FDB OFFSETS LOCALLY

     35

     36					;

     37					; LOCAL MACROS

     38					;

     39					; READ A BLOCK FROM INPUT FILE

     40					;

     41

     42						.MACRO	READ	FDB

     43						.IF NB	FDB

     44						.IF DIF <FDB>,<R0>

     45						MOV	FDB,R0

     46						.ENDC

     47						.ENDC

     48						CALL	READ

     49						.ENDM

     50

     51					;

     52					; WRITE A BLOCK TO OUTPUT FILE

     53					;

     54

     55						.MACRO	WRITE

     56						CALL	WRITE

     57						.ENDM

RTBWB	MACRO M1110  21-AUG-78 23:25  PAGE 2-1





     58

     59					;

     60					; LOCAL DATA

     61					;

     62					;

     63					; BLOCK BUFFER

     64					;

     65

     66	000000					.PSECT	BLKBF

     67

     68	000000				BUFF:	.BLKB	5.*512.		;

     69		005000 			BUFFLG=.-BUFF

     70

     71					;

     72					; PARAMETER LIST

     73					;

     74

     75	000000					.PSECT

     76

     77	000000				PARAM:	.BLKW	6		;

     78					;+

     79					; **-RTBWB-WRITE THE RT-11 BOOT BLOCKS

     80					;

     81					; THIS ROUTINE IS CALLED TO WRITE A COPY OF THE BOOT PORTION OF A SYSTEM

     82					; FILE INTO THE BOOT BLOCKS OF AN RT-11 DISK.

     83					;

     84					; THE ROUTINE WRITES BLOCK 0 AND BLOCKS 2, 3, 4, AND 5 OF THE DISK FROM THE

     85					; FIRST 5 BLOCKS OF THE RT-11 SYSTEM IMAGE.

     86					;

     87					;-

     88

     89

     90	000014				$RTBWB::			;

     91	000014					SAVRG			; SAVE R3 - R5

     92	000020					OFNB$R	#$INFDB		; OPEN THE INPUT FILE

     93	000036	103010 				BCC	5$		; IF C/C OK

     94	000040	062700 	000110 			ADD	#F.FNB+N.FNAM,R0 ; POINT TO NAMEBLOCK

     95	000044	010002 				MOV	R0,R2		; SET ADDRESS OF NAMEBLOCK

     96	000046					ERROR$	E$R9,S$V2	; REPORT ERROR

     97	000060				5$:				;

     98	000060					READ$	#$INFDB,#BUFF,#BUFFLG ; READ THE BOOT AREA

     99	000104	103002 				BCC	10$		; IF C/C OK

    100	000106					CALL	CKEOF		; ELSE CHECK FOR EOF

    101	000112				10$:				;

    102	000112					WAIT$			; WAIT FOR COMPLETION

    103	000116	103002 				BCC	20$		; IF C/C DONE

    104	000120					CALL	CKEOF		; CHECK FOR EOF

    105	000124				20$:				;

    106	000124	012700 	000000G			MOV	#$OUFDB,R0	; GET THE ADDRESS OF THE OUTPUT FDB

    107	000130	012701 	000000G			MOV	#IO.WLB,R1	; WRITE LOGICAL BLOCK

    108	000134	012702 	000005 			MOV	#5,R2		; NUMBER OF PARAMETERS

    109	000140	012703 	000000'			MOV	#PARAM,R3	; ADDRESS OF PARAMETER BLOCK

    110	000144	010304 				MOV	R3,R4		; COPY PARAMTER LIST ADDRESS

    111	000146	012724 	000000'			MOV	#BUFF,(R4)+	; COPY ADDRESS OF BUFFER

    112	000152	012724 	001000 			MOV	#512.,(R4)+	; SET TO WRITE ONE BLOCK

    113	000156	005024 				CLR	(R4)+		; CLEAR CARRIAGE CONTROL

    114	000160	005024 				CLR	(R4)+		; CLEAR HIGH PART OF LBN

RTBWB	MACRO M1110  21-AUG-78 23:25  PAGE 2-2





    115	000162	005014 				CLR	(R4)		; CLEAR LOW PART OF LBN

    116	000164					CALL	.XQIO		; ISSUE QIO

    117	000170	103432 				BCS	WRTER		; IF C/S - ERROR WRITING FILE

    118	000172	012714 	000002 			MOV	#2,(R4)		; SET TO WRITE LBN 2 - 5

    119	000176	010304 				MOV	R3,R4		; RESET PARAMETER LIST ADDRESS

    120	000200	062724 	001000 			ADD	#512.,(R4)+	; POINT PAST FIRST BLOCK CONTENTS

    121	000204	012724 	004000 			MOV	#<4.*512.>,(R4)+ ; SET LENGTH TO WRITE

    122	000210					CALL	.XQIO		; WRITE THE REMAINDER OF THE BOOT

    123	000214	103420 				BCS	WRTER		; IF C/S ERROR

    124	000216					CALLR	$RTBCL		; CLOSE FILES, EXIT

    125

    126					;

    127					; CHECK FOR END OF FILE

    128					;

    129					; INPUTS:

    130					;

    131					;	R0 = ADDRESS OF FDB

    132					;

    133					; OUTPUTS:

    134					;

    135					;	C/S = END OF FILE ENCOUNTERED

    136					;

    137					; ALL OTHER ERRORS ARE CONSIDERED FATAL.

    138

    139	000222				CKEOF:				;

    140	000222	126027 	000052 	000000G		CMPB	F.ERR(R0),#IE.EOF ; REACHED END OF FILE?

    141	000230	001002 				BNE	IOERR		; IF NO, I/O ERROR

    142	000232	000261 				SEC			; SET CARRY

    143	000234					RETURN			;

    144

    145					;

    146					; I/O ERROR ON FILE

    147					;

    148					; INPUTS:

    149					;

    150					;	R0 = ADDRESS OF FDB

    151					;

    152

    153	000236				IOERR:				;

    154	000236	010002 				MOV	R0,R2		; COPY FDB ADDRESS

    155	000240	062702 	000110 			ADD	#F.FNB+N.FNAM,R2 ; POINT TO FILE NAME

    156	000244					ERROR$	E$R15,S$V2	; FATAL I/O ERROR ON FILE

    157

    158					;

    159					; ERROR WRITING TO OUTPUT DEVICE

    160					;

    161

    162	000256				WRTER:				;

    163	000256					ERROR$	E$R30,S$V2	; ERROR WRITING TO OUTPUT DEVICE

    164

    165		000001 				.END

RTBWB	MACRO M1110  21-AUG-78 23:25  PAGE 2-3

SYMBOL TABLE



BUFF    000000R     002	F.CHR = 000075   	F.NRBD= 000024   	IO.WLB= ****** GX	S.FNB = 000036

BUFFLG= 005000   	F.CNTG= 000034   	F.NREC= 000030   	LF    = 000012   	S.FNBW= 000017

CKEOF   000222R  	F.DFNB= 000046   	F.OVBS= 000030   	N.DID = 000024   	S.FNTY= 000004

CR    = 000015   	F.DSPT= 000044   	F.RACC= 000016   	N.DVNM= 000032   	S.FTYP= 000002

E$R15 = ****** GX	F.DVNM= 000134   	F.RATT= 000001   	N.FID = 000000   	S.NFEN= 000020

E$R30 = ****** GX	F.EFBK= 000010   	F.RCNM= 000034   	N.FNAM= 000006   	VT    = 000013

E$R9  = ****** GX	F.EFN = 000050   	F.RCTL= 000017   	N.FTYP= 000014   	WRTER   000256R

FF    = 000014   	F.EOBB= 000032   	F.RSIZ= 000002   	N.FVER= 000016   	$CMD  = ****** GX

FO.RD = ****** GX	F.ERR = 000052   	F.RTYP= 000000   	N.NEXT= 000022   	$INFDB= ****** GX

F.ACTL= 000076   	F.FACC= 000043   	F.SEQN= 000100   	N.STAT= 000020   	$OUFDB= ****** GX

F.ALOC= 000040   	F.FFBY= 000014   	F.SPDV= 000072   	N.UNIT= 000034   	$RTBCL= ****** GX

F.BBFS= 000062   	F.FNAM= 000110   	F.SPUN= 000074   	PARAM   000000R  	$RTBWB  000014RG

F.BDB = 000070   	F.FNB = 000102   	F.STBK= 000036   	PAR$$$= 000027   	$SAVRG= ****** GX

F.BGBC= 000057   	F.FTYP= 000116   	F.UNIT= 000136   	R$$11M= 000000   	$$    = 000001

F.BKDN= 000026   	F.FVER= 000120   	F.URBD= 000020   	SPA   = 000040   	.OPFNB= ****** G

F.BKDS= 000020   	F.HIBK= 000004   	F.VBN = 000064   	S$V2  = ****** GX	.READ = ****** G

F.BKEF= 000050   	F.LUN = 000042   	F.VBSZ= 000060   	S.FATT= 000016   	.WAIT = ****** G

F.BKP1= 000051   	F.MBCT= 000054   	HT    = 000011   	S.FDB = 000140   	.XQIO = ****** GX

F.BKST= 000024   	F.MBC1= 000055   	IE.EOF= ****** GX	S.FNAM= 000006   	...TPC= 000140

F.BKVB= 000064   	F.MBFG= 000056   	IOERR   000236R



. ABS.	000000	   000

      	000270	   001

BLKBF 	005000	   002

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  2348 WORDS  ( 10 PAGES)

DYNAMIC MEMORY:  3828 WORDS  ( 14 PAGES)

ELAPSED TIME:  00:00:14

OBJ$:RTBWB,LIS$:RTBWB/-SP=SRC$:MACFLM,RTBWB

