Google
 

Trailing-Edge - PDP-10 Archives - AP-4178E-RM - swskit-sources/boot.lis
There is 1 other file named boot.lis in the archive. Click here to see a list.
BOOT - BOOT NEW SYSTEM	MACRO M1108  16-JAN-78 19:39
TABLE OF CONTENTS

    3-  44	EQUATED SYMBOLS
    4- 100	PHASE 1 LOCAL DATA
    5- 188	ERROR MESSAGE
    6- 215	BOOT PHASE I
    8- 419	PHASE 1 - ERROR PROCESSING
BOOT - BOOT NEW SYSTEM	MACRO M1108  16-JAN-78 19:39  PAGE 2
RSXDC -- RSX20F CONDITIONAL DEFINITION MODULE

      1						.TITLE	BOOT - BOOT NEW SYSTEM
      2						.IDENT	"02"
      3
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					;
     21					; VERSION:	02
     22					; BY:		H. LEV
     23					; DATE:		9/1/73
     24					; MODIFIED:	8/9/74 BRAKE INTO TWO MODULES FOR ASSEMBLY PURPOSES
     25					;		3/10/75 SWITCH TO SYSTEM STATE TO SEARCH LISTS
     26					;		4/8/75 ADD RX11 SUPPORT
     27					;		4/11/75 USE SAME DRIVERS FOR BOOT + SAVE
     28					;			AND BOOT SYSTEMS OF ANY SIZE
     29
     30					;
     31					; THIS PROGRAM BOOTS IN AN RSX-11M SYSTEM IMAGE FROM A FILES-11 DEVICE. IT OPENS AN
     32					; RSX-11M TASK IMAGE FILE, VERIFIES THAT IT IS AN OPERATING SYSTEM IMAGE
     33					; (NO TASK HEADER) AND THEN READS THE IMAGE INTO CORE
     34					;
     35
     36						.MCALL	CSI$
     37	000000					CSI$			; DEFINE CSI CONTROL BLOCK OFFSETS
     38						.MCALL	FDOFF$
     39	000000					FDOFF$	DEF$L		; DEFINE FDB OFFSETS
     40						.MCALL	CALL,DIR$,EXIT$S
     41						.MCALL	FDBK$A,FDBF$A,FDBDF$,FDOP$A
     42						.MCALL	FINIT$,FSRSZ$,NMBLK$,RETURN,WTSE$S
BOOT - BOOT NEW SYSTEM	MACRO M1108  16-JAN-78 19:39  PAGE 3
EQUATED SYMBOLS

     44						.SBTTL	EQUATED SYMBOLS
     45					;
     46					; CSI SWITCH FLAGS
     47					;
     48		000001 			FIDBIT	=	1		; /FI FILE ID.
     49					;
     50					; LOGICAL UNITS
     51					;
     52		000001 			LUN1	=	1		; CO LUN
     53		000002 			LUN2	=	2		; LUN FOR SYSTEM IMAGE FILE
     54
     55
     56
     57					;
     58					; LABEL BLOCK OFFSETS
     59					;
     60		000010 			L$BFLG	=	10		; LABEL FLAGS
     61		000014 			L$BLDZ	=	14		; LOAD SIZE IN 32 WORD BLOCKS
     62		000022 			L$BHRB	=	22		; RELATIVE BLOCK OF START OF CODE
     63		000026 			L$BXFR	=	26		; SYSTEM TRANSFER ADDRESS
     64					;
     65					; LABEL FLAG BITS (L$BFLG)
     66					;
     67		040000 			TS$NHD	=	40000		; TASK IMAGE HAS NO HEADER
     68
     69					;
     70					; MISCELANEOUS CONSTANTS
     71					;
     72		000040 			SPA	=	40		;
     73		000015 			CR	=	15		;
     74		000033 			ESC	=	33		;
     75
     76		000001 			EFN1	=	1		; EVENT FLAG TO WAIT ON
     77
     78					;
     79					; DEVICE DRIVER TABLE OFFSETS
     80					;
     81		000000 			DRVNAM	=	0		; DEVICE NAME IN ASCII
     82		000002 			DRVSET	=	2		; DRIVER SET UP ROUTINE
     83		000004 			DRVLLN	=	4		; LOAD LENGTH WORD ADDRESS
     84		000006 			DRVBA	=	6		; BUFFER WORD ADDRESS
     85		000010 			DRVFUN	=	10		; DRIVER FUNCTION CODE ADDRESS
     86		000012 			DRVADR	==	12		; DRIVER ADDRESS
     87		000014 			DRVLEN	==	14		; DRIVER LENGTH IN WORDS
     88		000016 			DRVWRT	=	16		; WRITE FUNCTION CODE (WITH GO BIT)
     89		000020 			DRVRD	=	20		; READ FUNCTION CODE (WITH GO BIT)
     90		000022 			DRVUNT	==	22		; UNIT SELECT BITS IN CORRECT POSITION
     91		000026 			DRCSR	==	26		; ADDRESS OF CSR ADDRESS
     92		000024 			DRVSEL	=	24		; DRIVE SELECT WORD ADDRESS
     93					.IF DF R$$20F
     94		000030 			DRCSRA	=	30		; CSR ADDRESS
     95		000032 			DRVENT	=	32		; LENGTH OF DRIVER ENTRY
     96					.IFF ; .IF DF R$$20F
     97					DRVENT	=	30		; LENGTH OF DRIVER ENTRY
     98					.ENDC ; .IF DF R$$20F
BOOT - BOOT NEW SYSTEM	MACRO M1108  16-JAN-78 19:39  PAGE 4
PHASE 1 LOCAL DATA

    100						.SBTTL	PHASE 1 LOCAL DATA
    101					;
    102					; CSI CONTROL BLOCK
    103					;
    104	000000				BOTCSI:	.BLKB	C.SIZE		;
    105
    106
    107					;
    108					; DISK FILE DESCRIPTOR BLOCK
    109					;
    110	000054				BOTFDB:	FDBDF$			; ALLOCATE SPACE
    111	000214					FDBK$A	,,,,BOTSTA	; I/O STATUS BLOCK
    112	000214					FDOP$A	LUN2,BOTCSI+C.DSDS,BOTDNB ;
    113	000214					FDBF$A	EFN1		;
    114					;
    115					; COMMAND LINE DPB AND DISK BUFFER
    116					;
    117	000214	   177 	   051 		BOTGCL:	.BYTE	127.,41.	; DK AND LENGTH
    118	000216				BOTBUF:	.BLKB	512.		; COMMAND AND DISK BUFFER
    119
    120					;
    121					; DEFAULT NAME BLOCK
    122					;
    123					.IF DF R$$20F
    124	001216				BOTDNB:	NMBLK$	RSX20F,SYS,,SY
    125					.IFF
    126					BOTDNB:	NMBLK$	RSX11M,SYS,,SY	; DEFAULT TO SY:RSX11M.SYS
    127					.ENDC
    128
    129					;
    130					; I/O STATUS BLOCK
    131					;
    132	001254				BOTSTA:	.BLKW	2		;
    133
    134					;
    135					; DISK FILE QIO DPB
    136					;
    137						.IF	DF R$$11M
    138						.IFF
    139					DSKDPB:	.BYTE	1.,11.		; DIC AND LENGTH
    140						.WORD	0		; FUNCTION CODE
    141						.WORD	LUN2		; LOGICAL UNIT
    142						.WORD	EFN1		; EVENT FLAG TO WAIT ON
    143						.WORD	BOTSTA		; I/O STATUS BLOCK
    144						.WORD	0		; AST
    145					DSKBUF:	.WORD	0		; PARAMETER AREA
    146						.WORD	0,0,0,0		;
    147						.IFT
    148	001260	   001 	   014 		DSKDPB:	.BYTE	1.,12.		; DIC AND LENGTH
    149	001262	000000 				.WORD	0		; FUNCTION CODE
    150	001264	000002 				.WORD	LUN2		;
    151	001266	000001 				.WORD	EFN1		;
    152	001270	001254'				.WORD	BOTSTA		; I/O STATUS BLOCK
    153	001272	000000 				.WORD	0		; AST ADDRESS
    154	001274	000000 			DSKBUF:	.WORD	0		; PARAMETER AREA
    155	001276	000000 	000000 	000000 		.WORD	0,0,0,0,0	;
	001304	000000 	000000
BOOT - BOOT NEW SYSTEM	MACRO M1108  16-JAN-78 19:39  PAGE 4-1
PHASE 1 LOCAL DATA

    156						.ENDC
    157
    158					;
    159					; ERROR MESSAGE DPB
    160					;
    161	001310	   001 	   014 		ERRDPB:	.BYTE	1.,12.		; DIC AND LENGTH
    162	001312	000000G				.WORD	IO.WVB		; FUNCTION CODE
    163	001314	000001 				.WORD	LUN1		; LOGICAL UNIT FOR "CO"
    164	001316	000001 				.WORD	EFN1		; EVENT FLAG
    165	001320	000000 	000000 			.WORD	0,0		; I/O STATUS AND AST
    166	001324	000000 			ERRBUF:	.WORD	0		; BUFFER ADDRESS
    167	001326	000000 				.WORD	0		; LENGTH
    168	001330	000040 				.WORD	40		; CARRIAGE CONTROL
    169
    170					;
    171					; INTIALIZE FSR
    172					;
    173	001332					FSRSZ$	0		; NO BUFFERS NEEDED
    174
    175
    176					;
    177					; CONTROL BLOCK FOR FILBN
    178					;
    179	001332	000054'			LBNBLK:	.WORD	BOTFDB		; FILE DESCRIPTOR BLOCK ADDRESS
    180	001334	001216'				.WORD	BOTDNB		; DEFAULT NAME BLOCK
    181	001336	000000'				.WORD	BOTCSI		; CSI CONTROL BLOCK ADDRESS
    182						.BLKW	2		; SPACE FOR FILE LBN
    183						.IF	DF R$$11M
    184						.BLKW	1		; SPACE FOR UNREDIRECTED UCB ADDRESS
    185						.ENDC
    186						.BLKW	1		; SPACE FOR FILE SIZE IN BLOCKS
BOOT - BOOT NEW SYSTEM	MACRO M1108  16-JAN-78 19:39  PAGE 5
ERROR MESSAGE

    188						.SBTTL	ERROR MESSAGE
    189
    190	001350	   015 	   102 	   117 	ERR1:	.ASCIZ	<15>/BOO -- SYNTAX ERROR/
	001353	   117 	   040 	   055
	001356	   055 	   040 	   123
	001361	   131 	   116 	   124
	001364	   101 	   130 	   040
	001367	   105 	   122 	   122
	001372	   117 	   122 	   000
    191	001375	   015 	   102 	   117 	ERR2:	.ASCIZ	<15>/BOO -- FILE NOT FOUND/
	001400	   117 	   040 	   055
	001403	   055 	   040 	   106
	001406	   111 	   114 	   105
	001411	   040 	   116 	   117
	001414	   124 	   040 	   106
	001417	   117 	   125 	   116
	001422	   104 	   000
    192	001424	   015 	   102 	   117 	ERR3:	.ASCIZ	<15>/BOO -- INVALID LOAD DEVICE/
	001427	   117 	   040 	   055
	001432	   055 	   040 	   111
	001435	   116 	   126 	   101
	001440	   114 	   111 	   104
	001443	   040 	   114 	   117
	001446	   101 	   104 	   040
	001451	   104 	   105 	   126
	001454	   111 	   103 	   105
	001457	   000
    193	001460	   015 	   102 	   117 	ERR4:	.ASCIZ	<15>/BOO -- FILE NOT CONTIGUOUS/
	001463	   117 	   040 	   055
	001466	   055 	   040 	   106
	001471	   111 	   114 	   105
	001474	   040 	   116 	   117
	001477	   124 	   040 	   103
	001502	   117 	   116 	   124
	001505	   111 	   107 	   125
	001510	   117 	   125 	   123
	001513	   000
    194	001514	   015 	   102 	   117 	ERR5:	.ASCIZ	<15>/BOO -- DPB ERROR/
	001517	   117 	   040 	   055
	001522	   055 	   040 	   104
	001525	   120 	   102 	   040
	001530	   105 	   122 	   122
	001533	   117 	   122 	   000
    195	001536	   015 	   102 	   117 	ERR6:	.ASCIZ	<15>/BOO -- LABEL BLOCK READ ERROR/
	001541	   117 	   040 	   055
	001544	   055 	   040 	   114
	001547	   101 	   102 	   105
	001552	   114 	   040 	   102
	001555	   114 	   117 	   103
	001560	   113 	   040 	   122
	001563	   105 	   101 	   104
	001566	   040 	   105 	   122
	001571	   122 	   117 	   122
	001574	   000
    196	001575	   015 	   102 	   117 	ERR7:	.ASCIZ	<15>/BOO -- NOT SYSTEM IMAGE/
	001600	   117 	   040 	   055
	001603	   055 	   040 	   116
BOOT - BOOT NEW SYSTEM	MACRO M1108  16-JAN-78 19:39  PAGE 5-1
ERROR MESSAGE

	001606	   117 	   124 	   040
	001611	   123 	   131 	   123
	001614	   124 	   105 	   115
	001617	   040 	   111 	   115
	001622	   101 	   107 	   105
	001625	   000
    197	001626	   015 	   102 	   117 	ERR8:	.ASCIZ	<15>/BOO -- NO TRANSFER ADDRESS/
	001631	   117 	   040 	   055
	001634	   055 	   040 	   116
	001637	   117 	   040 	   124
	001642	   122 	   101 	   116
	001645	   123 	   106 	   105
	001650	   122 	   040 	   101
	001653	   104 	   104 	   122
	001656	   105 	   123 	   123
	001661	   000
    198						.IF	DF DEBUG
    199					ERR10:	.ASCIZ	<15>/PAR5 SET/
    200					ERR11:	.ASCIZ	<15>/PHASE 2 MOVED/
    201						.ENDC
    202	001662	   015 	   102 	   117 	ERR14:	.ASCIZ	<15>/BOO -- DEVICE NOT MOUNTED/
	001665	   117 	   040 	   055
	001670	   055 	   040 	   104
	001673	   105 	   126 	   111
	001676	   103 	   105 	   040
	001701	   116 	   117 	   124
	001704	   040 	   115 	   117
	001707	   125 	   116 	   124
	001712	   105 	   104 	   000
    203						.IF	DF R$$11M
    204						.IFT
    205	001715	   015 	   102 	   117 	ERR15:	.ASCIZ	<15>/BOO -- PRIVILEGED COMMAND/
	001720	   117 	   040 	   055
	001723	   055 	   040 	   120
	001726	   122 	   111 	   126
	001731	   111 	   114 	   105
	001734	   107 	   105 	   104
	001737	   040 	   103 	   117
	001742	   115 	   115 	   101
	001745	   116 	   104 	   000
    206	001750	   015 	   102 	   117 	ERR16:	.ASCIZ	<15>/BOO -- DEVICE NOT IN SYSTEM/
	001753	   117 	   040 	   055
	001756	   055 	   040 	   104
	001761	   105 	   126 	   111
	001764	   103 	   105 	   040
	001767	   116 	   117 	   124
	001772	   040 	   111 	   116
	001775	   040 	   123 	   131
	002000	   123 	   124 	   105
	002003	   115 	   000
    207						.ENDC
    208					.IF DF R$$20F
    209	002005	   015 	   102 	   117 	PRIPRM:	.ASCIZ	<15>/BOO -- PRIMARY PROTOCOL RUNNING/
	002010	   117 	   040 	   055
	002013	   055 	   040 	   120
	002016	   122 	   111 	   115
	002021	   101 	   122 	   131
BOOT - BOOT NEW SYSTEM	MACRO M1108  16-JAN-78 19:39  PAGE 5-2
ERROR MESSAGE

	002024	   040 	   120 	   122
	002027	   117 	   124 	   117
	002032	   103 	   117 	   114
	002035	   040 	   122 	   125
	002040	   116 	   116 	   111
	002043	   116 	   107 	   000
    210	002046	   102 	   117 	   117 	BTPRMT:	.ASCII	/BOO>/
	002051	   076
    211		000004 			BTPRML=.-BTPRMT
    212					.ENDC ; .IF DF R$$20F
    213						.EVEN
BOOT - BOOT NEW SYSTEM	MACRO M1108  16-JAN-78 19:39  PAGE 6
BOOT PHASE I

    215						.SBTTL	BOOT PHASE I
    216
    217					;+
    218					; *** - BOOTEP ENTRY POINT FOR BOOT COMMAND
    219					;
    220					;	THIS SECTION OF CODE GETS THE MCR COMMAND LINE
    221					;	CALLS CSI TO PARSE AND ANALIZE THE FILE SPECIFICATION.
    222					;	IT THEN OPENS THE FILE AND READS THE FIRST BLOCK WHICH
    223					;	IS THE LABEL BLOCK. THE SECOND SECTION OF CODE IS THEN
    224					;	MOVED TO LOCATION 120000 AND CONTROL IS TRANSFERRED
    225					;	THERE TO CONTINUE THE BOOT PROCESS
    226					;
    227					;-
    228
    229	002052				BOOTEP:	FINIT$			; INIT FCS
    230					.IF DF R$$20F
    231					.IFF
    232						.IF	DF R$$11M
    233						MOV	$TKTCB,R0	; GET OUR TCB ADDRESS
    234						MOV	T.UCB(R0),R0	; GET TI UCB ADDRESS
    235						CALL	$SWSTK,6$	; SWITCH TO SYSTEM STATE
    236					5$:	MOV	U.RED(R0),R0	; FOLLOW REDIRECT POINTER
    237						CMP	R0,U.RED(R0)	; END?
    238						BNE	5$		; NO CONTINUE DOWN LIST
    239						MOV	R0,2(SP)	; SET USER STATE R0
    240						RETURN			; RETURN TO USER STATE
    241					6$:	BIT	#U2.PRV,U.CW2(R0) ; IS TERMINAL PRIVILEGED?
    242						BEQ	12$		; NO , ERROR
    243						.ENDC
    244						DIR$	#BOTGCL		; GET MCR COMMAND LINE
    245						BCS	10$		; ERROR
    246						MOV	#BOTBUF,R0	; GET BUFFER ADDRESS
    247					.IFT
    248	002056	012704 	002046'			MOV	#BTPRMT,R4	; POINT TO PROMPT
    249	002062	012703 	000004 			MOV	#BTPRML,R3	;  AND LENGTH
    250	002066					CALL	.GTCML		; GET THE COMMAND LINE
    251	002072	010400 				MOV	R4,R0		; COPY THE BUFFER POINTER
    252					.ENDC ; .IF DF R$$20F
    253	002074	012705 	001332'			MOV	#LBNBLK,R5	; GET CONTROL BLOCK ADDRESS FOR FILBN
    254	002100					CALL	$FILBN		; GET FILE LBN
    255	002104	103027 				BCC	20$		; SKIP IF NO ERRORS
    256	002106	005201 				INC	R1		; IS IT SYNTAX?
    257	002110	001405 				BEQ	10$		; YES
    258	002112	005201 				INC	R1		; NO, FILE NOT FOUND?
    259	002114	001407 				BEQ	15$		; YES
    260	002116	005201 				INC	R1		; NO, DEVICE NOT MOUNTED?
    261	002120	001407 				BEQ	16$		; YES
    262	002122	000412 				BR	18$		; NO, DEVICE NOT IN SYSTEM
    263	002124	000167 	000672 		10$:	JMP	BTER1		; YES
    264	002130	000167 	000600 		12$:	JMP	BTER15		; PRIVILEGED COMMAND
    265	002134	000167 	000654 		15$:	JMP	BTER2		; FILE NOT FOUND
    266	002140	000167 	000576 		16$:	JMP	BTER14		; DEVICE NOT MOUNTED
    267	002144	000167 	000630 		17$:	JMP	BTER4		;
    268	002150	000167 	000552 		18$:	JMP	BTER16		; DEVICE NOT IN SYSTEM
    269					.IF DF R$$20F
    270	002154	012705 	002005'		199$:	MOV	#PRIPRM,R5	; GET MESSAGE ADDRESS
    271	002160	000167 	000642 			JMP	BTERR		;  AND SEND IT
BOOT - BOOT NEW SYSTEM	MACRO M1108  16-JAN-78 19:39  PAGE 6-1
BOOT PHASE I

    272					.IFTF
    273	002164	005701 			20$:	TST	R1		; IS FILE CONTIGUOUS?
    274	002166	001766 				BEQ	17$		; NO, NOT SYSTEM IMAGE
    275					.IFT
    276	002170	032767 	000000G	000002G		BIT	#EF.PR1,.COMEF+2 ; PRIMARY PROTOCOL?
    277	002176	001366 				BNE	199$		; YES -- PRIMARY PROTOCOL ILLEGAL
    278					.ENDC ;.IF DF R$$20F
    279	002200	016567 	000014 	000000G		MOV	14(R5),$BTFSZ	; SAVE FILE SIZE IN BLOCKS
BOOT - BOOT NEW SYSTEM	MACRO M1108  16-JAN-78 19:39  PAGE 7
BOOT PHASE I

    281					;
    282					; CHECK FOR VALID DEVICE
    283					;
    284	002206	016567 	000006 	000000G		MOV	6(R5),$BTLBN	; SET LBN
    285	002214	016567 	000010 	000002G		MOV	10(R5),$BTLBN+2	;
    286	002222	011500 				MOV	(R5),R0		; GET FDB ADDRESS
    287	002224	012704 	000000G			MOV	#$DVDRV,R4	; GET ADDRESS OF DRIVER TABLE
    288	002230	026064 	000134 	000000 	25$:	CMP	F.DVNM(R0),DRVNAM(R4) ; IS THIS THE DEVICE?
    289	002236	001407 				BEQ	30$		; YES
    290	002240	062704 	000032 			ADD	#DRVENT,R4	; NO, INDEX TO NEXT ENTRY
    291	002244	005764 	000000 			TST	DRVNAM(R4)	; END OF TABLE?
    292	002250	001367 				BNE	25$		; NO
    293	002252	000167 	000530 			JMP	BTER3		; YES, ERROR
    294	002256	016067 	000134 	000000G	30$:	MOV	F.DVNM(R0),$BTDEV ; GET DEVICE MNEMONIC
    295	002264	016067 	000136 	000000G		MOV	F.UNIT(R0),$BTLUN ; SAVE LOGICAL DEVICE NUMBER
    296					;
    297					; READ LABEL BLOCK
    298					;
    299	002272	016500 	000012 			MOV	12(R5),R0	; GET UCB ADDRESS
    300					.IF DF R$$20F
    301					.IFF
    302						CALL	$SWSTK,40$	; SWITCH TO SYSTEM STATE
    303					35$:	MOV	U.RED(R0),R0	; FOLLOW REDIRECT POINTER
    304						CMP	R0,U.RED(R0)	; END OF LIST?
    305						BNE	35$		; NO, CONTINUE DOWN LIST
    306						MOV	R0,2(SP)	; SET USER R0 WITH UCB ADDRESS
    307						RETURN			; RETURN TO USER STATE
    308					40$:
    309						MOVB	U.UNIT(R0),$BTUNT ; SET PHYSICAL UNIT NUMBER
    310						MOV	U.SCB(R0),R0	; GET SCB ADDRESS
    311						MOV	S.CSR(R0),$BTCSR ; SAVE DEVICE CSR ADDRESS
    312					.IFT ; .IF DF R$$20F
    313	002276	016000 	000000G			MOV	U.RP(R0),R0	;GET UN-REDIRECTED PUD ENTRY ADDRESS
    314	002302	116067 	000000G	000000G		MOVB	U.UN(R0),$BTUNT	; SET PHYSICAL UNIT #
    315	002310	016467 	000030 	000000G		MOV	DRCSRA(R4),$BTCSR ; SET CSR ADDRESS
    316					.ENDC ; .IF DF R$$20F
    317	002316	012767 	000000G	176736 		MOV	#IO.RLB,DSKDPB+2 ; SET READ LOGICAL BLOCK FUNCTION
    318	002324	012767 	000216'	176742 		MOV	#BOTBUF,DSKBUF	; SET BUFFER ADDRESS
    319	002332	012767 	001000 	176736 		MOV	#512.,DSKBUF+2	; SET BUFFER LENGTH
    320	002340	005067 	176734 			CLR	DSKBUF+4	; ZERO CARRIAGE CONTROL
    321	002344	016767 	000000G	176730 		MOV	$BTLBN,DSKBUF+6 ; SET HIGH LBN
    322	002352	016767 	000002G	176724 		MOV	$BTLBN+2,DSKBUF+10 ; AND LOW
    323	002360					DIR$	#DSKDPB		; READ LABEL BLOCK
    324	002366	103406 				BCS	43$		; ERROR IN DPB
    325	002370					WTSE$S	#EFN1		; WAIT TILL DONE
    326	002402	103004 				BCC	47$		; OKAY
    327	002404	000167 	000362 		43$:	JMP	BTER5		; ERROR
    328	002410	000167 	000350 		44$:	JMP	BTER6		;
    329	002414	005367 	176634 		47$:	DEC	BOTSTA		; ANY I/O ERRORS
    330	002420	001373 				BNE	44$		; YES
    331	002422	012705 	000216'			MOV	#BOTBUF,R5	; POINT TO LABEL BLOCK BUFFER
    332	002426	066567 	000022 	000002G		ADD	L$BHRB(R5),$BTLBN+2 ; COMPUTE SYSTEM
    333	002434	005567 	000000G			ADC	$BTLBN		; IMAGE LBN
    334	002440	166567 	000022 	000000G		SUB	L$BHRB(R5),$BTFSZ ; COMPUTE LOAD IMAGE LENGTH
    335	002446	016567 	000014 	000000G		MOV	L$BLDZ(R5),$BTLLN ; SAVE SYSTEM IMAGE LENGTH IN 32 WORD BLOCKS
    336	002454	016567 	000026 	000000G		MOV	L$BXFR(R5),$BTXFR ; SAVE TRANSFER ADDRESS
    337	002462	032765 	040000 	000010 		BIT	#TS$NHD,L$BFLG(R5) ; IS THIS SYSTEM IMAGE? (NO HEADER?)
BOOT - BOOT NEW SYSTEM	MACRO M1108  16-JAN-78 19:39  PAGE 7-1
BOOT PHASE I

    338	002470	001532 				BEQ	BTER7		; NO, NOT OP SYSTEM
    339					;
    340					; COMPUTE MAXIMUM IMAGE TO READ
    341					;
    342						.IF	DF M$$MGE
    343						MOV	#7560,R1	; SET 124K-.5K
    344						.IFF
    345	002472	012701 	001560 			MOV	#1560,R1	; SET 28K-.5K
    346						.ENDC
    347					.IF DF R$$20F
    348	002476	020167 	000000G		50$:	CMP	R1,.MSIZE	; ABOVE SYSTEM TOP?
    349					.IFF
    350					50$:	CMP	R1,$SYSIZ	; ABOVE SYSTEM TOP
    351					.ENDC ; .IF DF R$$20F
    352	002502	103403 				BLO	55$		; NO
    353	002504	162701 	000020 			SUB	#20,R1		; YES, BACK OFF .5K
    354	002510	000772 				BR	50$		; TRY AGAIN
    355	002512	010167 	000000G		55$:	MOV	R1,$BTMAX	; SET MAXIMUM READ LENGTH
    356					;
    357					; SET UP DRIVER
    358					;
    359	002516	016701 	000000G			MOV	$BTLLN,R1	; GET LOAD LENGTH IN 32 WORD BLOCKS
    360	002522	020167 	000000G			CMP	R1,$BTMAX	; HIGHER THAN TOP OF CORE?
    361	002526	101402 				BLOS	57$		; NO
    362	002530	016701 	000000G			MOV	$BTMAX,R1	; YES, USE TOP OF CORE
    363	002534	062701 	000007 		57$:	ADD	#7,R1		; ROUND UP TO NEXT LBN
    364	002540	006201 				ASR	R1		; CONVERT TO NUMBER OF LBNS
    365	002542	006201 				ASR	R1		;
    366	002544	006201 				ASR	R1		;
    367	002546	005767 	000000G			TST	$BTXFR		; SAVED SYSTEM?
    368	002552	001002 				BNE	58$		; NO
    369	002554	012701 	000001 			MOV	#1,R1		; YES, READ ONLY ONE BLOCK
    370	002560	010174 	000004 		58$:	MOV	R1,@DRVLLN(R4)	; SET LOAD LENGTH
    371	002564	005074 	000006 			CLR	@DRVBA(R4)	; SET STARTING BUFFER ADDRESS TO ZERO
    372	002570	116474 	000020 	000010 		MOVB	DRVRD(R4),@DRVFUN(R4) ; SET READ FUNCTION
    373	002576	016774 	000000G	000026 		MOV	$BTCSR,@DRCSR(R4) ; SET CSR ADDRESS
    374	002604	010405 				MOV	R4,R5		; COPY DRIVER TABLE ENTRY ADDRESS
    375	002606					CALL	@DRVSET(R5)	; SET UP DRIVER
    376	002612	056575 	000022 	000024 		BIS	DRVUNT(R5),@DRVSEL(R5) ; SET UNIT SELECT
    377					;
    378					; MOVE DRIVER TO CORRECT PLACE IN PHASE2
    379					;
    380	002620	016500 	000012 			MOV	DRVADR(R5),R0	; GET DRIVER ADDRESS
    381	002624	016502 	000014 			MOV	DRVLEN(R5),R2	; GET LENGTH IN WORDS
    382	002630	012701 	000000G			MOV	#$DRVER,R1	; GET DESTINATION ADDRESS
    383	002634	012021 			60$:	MOV	(R0)+,(R1)+	; MOVE DRIVER
    384	002636	005302 				DEC	R2		; DONE?
    385	002640	003375 				BGT	60$		; NO, LOOP
    386					;
    387					; SWITCH TO SYSTEM STATE AND MOVE REST OF BOOT TO TOP OF MEMORY
    388					;
    389	002642	032767 	000001 	000000G		BIT	#1,$BTXFR	; IS THERE A TRANSFER ADDRESS (MUST BE EVEN)
    390	002650	001037 				BNE	BTER8		; NO, ODD ADDRESS
    391					.IF DF R$$20F
    392					.IFF
    393						CALL	$SWSTK,90$	; SWITCH TO SYSTEM STATE
    394					.ENDC ;.IF DF R$$20F
BOOT - BOOT NEW SYSTEM	MACRO M1108  16-JAN-78 19:39  PAGE 7-2
BOOT PHASE I

    395	002652	052737 	000340 	000000G		BIS	#340,@#PS	; INHIBIT INTERRUPTS
    396	002660	016705 	000000G			MOV	$BTMAX,R5	;;; GET ADDRESS TO MOVE TO
    397						.IF	DF M$$MGE
    398						MOV	R5,@#KISAR6	;;; SET APR6
    399						MOV	#1400,R5	;;; SET TO USE APR6
    400						.ENDC
    401	002664	010504 				MOV	R5,R4		;;; COPY
    402	002666	012702 	000006 			MOV	#6,R2		;;; SET SHIFT COUNT
    403	002672	006305 			87$:	ASL	R5		;;; SHIFT UP
    404	002674	005302 				DEC	R2		;;; DONE?
    405	002676	001375 				BNE	87$		;;; NO, LOOP
    406	002700	010504 				MOV	R5,R4		;;; SAVE FOR BASE OF PHASE 2
    407	002702	012701 	000000C			MOV	#$BTEND-$BTPH2,R1 ;;; SET LENGTH OF MOVE IN BYTES
    408	002706	006201 				ASR	R1		;;; CONVERT TO WORDS
    409	002710	012700 	000000G			MOV	#$BTPH2,R0	;;; SET SOURCE ADDRESS
    410	002714	012024 			90$:	MOV	(R0)+,(R4)+	;;; MOVE A WORD
    411	002716	005301 				DEC	R1		;;; DONE
    412	002720	001375 				BNE	90$		;;; NO, LOOP
    413						.IF	DF DEBUG
    414						MOV	#ERR11,R0
    415						CALL	TYPE
    416						.ENDC
    417	002722	000165 	000000C			JMP	$BTEP2-$BTPH2(R5) ;;; GO TO MOVED ROUTINE
BOOT - BOOT NEW SYSTEM	MACRO M1108  16-JAN-78 19:39  PAGE 8
PHASE 1 - ERROR PROCESSING

    419						.SBTTL	PHASE 1 - ERROR PROCESSING
    420
    421	002726	012705 	001750'		BTER16:	MOV	#ERR16,R5	; DEVICE NOT IN SYSTEM
    422	002732	000435 				BR	BTERR		;
    423	002734	012705 	001715'		BTER15:	MOV	#ERR15,R5	; PRIVILEGED COMMAND
    424	002740	000432 				BR	BTERR		;
    425	002742	012705 	001662'		BTER14:	MOV	#ERR14,R5	; DEVICE NOT MOUNTED
    426	002746	000427 				BR	BTERR		;
    427	002750	012705 	001626'		BTER8:	MOV	#ERR8,R5	; NO TRANSFER ADDRESS
    428	002754	000424 				BR	BTERR		;
    429	002756	012705 	001575'		BTER7:	MOV	#ERR7,R5	; NOT SYSTEM IMAGE
    430	002762	000421 				BR	BTERR		;
    431	002764	012705 	001536'		BTER6:	MOV	#ERR6,R5	; LABEL BLOCK READ ERROR
    432	002770	000416 				BR	BTERR		;
    433	002772	012705 	001514'		BTER5:	MOV	#ERR5,R5	; DPB ERROR
    434	002776	000413 				BR	BTERR		;
    435	003000	012705 	001460'		BTER4:	MOV	#ERR4,R5	; FILE NOT CONTIGUOUS
    436	003004	000410 				BR	BTERR		;
    437	003006	012705 	001424'		BTER3:	MOV	#ERR3,R5	; INVALID LOAD DEVICE
    438	003012	000405 				BR	BTERR		;
    439	003014	012705 	001375'		BTER2:	MOV	#ERR2,R5	; OPEN ERROR
    440	003020	000402 				BR	BTERR
    441	003022	012705 	001350'		BTER1:	MOV	#ERR1,R5	; SYNTAX ERROR
    442	003026	010500 			BTERR:	MOV	R5,R0		; COPY ADDRESS
    443	003030	105720 			10$:	TSTB	(R0)+		; IS NEXT CHAR END?
    444	003032	001376 				BNE	10$		; NO, LOOP
    445	003034	005300 				DEC	R0		; FIX FOR CORRECT COUNT
    446	003036	160500 				SUB	R5,R0		; COMPUTE LENGTH
    447	003040	010567 	176260 			MOV	R5,ERRBUF	; SET BUFFER ADDRESS
    448	003044	010067 	176256 			MOV	R0,ERRBUF+2	; AND LENGTH
    449	003050					DIR$	#ERRDPB		; WRITE IT OUT
    450	003056	103405 				BCS	20$		; ERROR
    451	003060					WTSE$S	#EFN1		; WAIT TILL DONE
    452	003072				20$:	EXIT$S			; EXIT
    453		002052'				.END	BOOTEP
BOOT - BOOT NEW SYSTEM	MACRO M1108  16-JAN-78 19:39  PAGE 8-1
SYMBOL TABLE

BOOTEP  002052R  	C.MKW2= 000026   	ESC   = 000033   	F.RATT= 000001   	S.FDB = 000140
BOTBUF  000216R  	C.SIZE= 000054   	FIDBIT= 000001   	F.RCNM= 000034   	S.FNAM= 000006
BOTCSI  000000R  	C.STAT= 000001   	F.ALOC= 000040   	F.RCTL= 000017   	S.FNB = 000036
BOTDNB  001216R  	C.SWAD= 000022   	F.BBFS= 000062   	F.RSIZ= 000002   	S.FNBW= 000017
BOTFDB  000054R  	C.TYPR= 000000   	F.BDB = 000070   	F.RTYP= 000000   	S.FNTY= 000004
BOTGCL  000214R  	DRCSR = 000026 G 	F.BGBC= 000057   	F.STBK= 000036   	S.FTYP= 000002
BOTSTA  001254R  	DRCSRA= 000030   	F.BKDN= 000026   	F.UNIT= 000136   	S.NFEN= 000020
BTERR   003026R  	DRVADR= 000012 G 	F.BKDS= 000020   	F.URBD= 000020   	TS$NHD= 040000
BTER1   003022R  	DRVBA = 000006   	F.BKEF= 000050   	F.VBN = 000064   	U.RP  = ****** GX
BTER14  002742R  	DRVENT= 000032   	F.BKP1= 000051   	F.VBSZ= 000060   	U.UN  = ****** GX
BTER15  002734R  	DRVFUN= 000010   	F.BKST= 000024   	IO.RLB= ****** GX	$BTCSR= ****** GX
BTER16  002726R  	DRVLEN= 000014 G 	F.BKVB= 000064   	IO.WVB= ****** GX	$BTDEV= ****** GX
BTER2   003014R  	DRVLLN= 000004   	F.CNTG= 000034   	LBNBLK  001332R  	$BTEND= ****** GX
BTER3   003006R  	DRVNAM= 000000   	F.DFNB= 000046   	LUN1  = 000001   	$BTEP2= ****** GX
BTER4   003000R  	DRVRD = 000020   	F.DSPT= 000044   	LUN2  = 000002   	$BTFSZ= ****** GX
BTER5   002772R  	DRVSEL= 000024   	F.DVNM= 000134   	L$BFLG= 000010   	$BTLBN= ****** GX
BTER6   002764R  	DRVSET= 000002   	F.EFBK= 000010   	L$BHRB= 000022   	$BTLLN= ****** GX
BTER7   002756R  	DRVUNT= 000022 G 	F.EFN = 000050   	L$BLDZ= 000014   	$BTLUN= ****** GX
BTER8   002750R  	DRVWRT= 000016   	F.EOBB= 000032   	L$BXFR= 000026   	$BTMAX= ****** GX
BTPRML= 000004   	DSKBUF  001274R  	F.ERR = 000052   	N.DID = 000024   	$BTPH2= ****** GX
BTPRMT  002046R  	DSKDPB  001260R  	F.FACC= 000043   	N.DVNM= 000032   	$BTUNT= ****** GX
CR    = 000015   	EFN1  = 000001   	F.FFBY= 000014   	N.FID = 000000   	$BTXFR= ****** GX
CS.DIF= 000002   	EF.PR1= ****** GX	F.FNAM= 000110   	N.FNAM= 000006   	$DRVER= ****** GX
CS.DVF= 000004   	ERRBUF  001324R  	F.FNB = 000102   	N.FTYP= 000014   	$DVDRV= ****** GX
CS.EQU= 000040   	ERRDPB  001310R  	F.FTYP= 000116   	N.FVER= 000016   	$FILBN= ****** GX
CS.INP= 000001   	ERR1    001350R  	F.FVER= 000120   	N.NEXT= 000022   	$$    = 000075
CS.MOR= 000020   	ERR14   001662R  	F.HIBK= 000004   	N.STAT= 000020   	.COMEF= ****** GX
CS.NMF= 000001   	ERR15   001715R  	F.LUN = 000042   	N.UNIT= 000034   	.FINIT= ****** G
CS.OUT= 000002   	ERR16   001750R  	F.MBCT= 000054   	PRIPRM  002005R  	.FSRCB= ****** G
CS.WLD= 000010   	ERR2    001375R  	F.MBC1= 000055   	PS    = ****** GX	.GTCML= ****** GX
C.CMLD= 000002   	ERR3    001424R  	F.MBFG= 000056   	R$$11M= 000001   	.MSIZE= ****** GX
C.DEVD= 000006   	ERR4    001460R  	F.NRBD= 000024   	R$$20F= 000001   	...PC1= 000054R
C.DIRD= 000012   	ERR5    001514R  	F.NREC= 000030   	SPA   = 000040   	...PC2= 001232R
C.DSDS= 000006   	ERR6    001536R  	F.OVBS= 000030   	S.BFHD= 000020   	...PC3= 000054R
C.FILD= 000016   	ERR7    001575R  	F.RACC= 000016   	S.FATT= 000016   	...TPC= 000020
C.MKW1= 000024   	ERR8    001626R

. ABS.	000000	   000
      	003100	   001
$$FSR1	000000	   002
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2933 WORDS  ( 12 PAGES)
DYNAMIC MEMORY:  4160 WORDS  ( 16 PAGES)
ELAPSED TIME:  00:00:31
,[52,20]BOOT.LIS/-SP/CRF=[52,30]RSXDC,BOOT
BOOT       CREATED BY  MACRO  ON 16-JAN-78 AT 19:39	PAGE 1

SYMBOL CROSS REFERENCE                                  CREF         

SYMBOL	VALUE		REFERENCES

BOOTEP	  002052 R	#6-229      8-453     
BOTBUF	  000216 R	#4-118      7-318      7-331     
BOTCSI	  000000 R	#4-104      4-112      4-181     
BOTDNB	  001216 R	 4-112     #4-124      4-180     
BOTFDB	  000054 R	#4-110      4-179     
BOTGCL	  000214 R	#4-117     
BOTSTA	  001254 R	 4-111     #4-132      4-152     *7-329     
BTERR 	  003026 R	 6-271      8-422      8-424      8-426      8-428      8-430      8-432      8-434      8-436     
                         8-438      8-440     #8-442     
BTER1 	  003022 R	 6-263     #8-441     
BTER14	  002742 R	 6-266     #8-425     
BTER15	  002734 R	 6-264     #8-423     
BTER16	  002726 R	 6-268     #8-421     
BTER2 	  003014 R	 6-265     #8-439     
BTER3 	  003006 R	 7-293     #8-437     
BTER4 	  003000 R	 6-267     #8-435     
BTER5 	  002772 R	 7-327     #8-433     
BTER6 	  002764 R	 7-328     #8-431     
BTER7 	  002756 R	 7-338     #8-429     
BTER8 	  002750 R	 7-390     #8-427     
BTPRML	= 000004	#5-211      6-249     
BTPRMT	  002046 R	#5-210      5-211      6-248     
CR    	= 000015	#3-73      
C.DSDS	= 000006	 4-112     
C.SIZE	= 000054	 4-104     
DEBUG 	= ******	 5-198      7-413     
DRCSR 	= 000026  G	#3-91       7-373     
DRCSRA	= 000030	#3-94       7-315     
DRVADR	= 000012  G	#3-86       7-380     
DRVBA 	= 000006	#3-84       7-371     
DRVENT	= 000032	#3-95       7-290     
DRVFUN	= 000010	#3-85       7-372     
DRVLEN	= 000014  G	#3-87       7-381     
DRVLLN	= 000004	#3-83       7-370     
DRVNAM	= 000000	#3-81       7-288      7-291     
DRVRD 	= 000020	#3-89       7-372     
DRVSEL	= 000024	#3-92       7-376     
DRVSET	= 000002	#3-82       7-375      7-375     
DRVUNT	= 000022  G	#3-90       7-376     
DRVWRT	= 000016	#3-88      
DSKBUF	  001274 R	#4-154     *7-318     *7-319     *7-320     *7-321     *7-322     
DSKDPB	  001260 R	#4-148     *7-317      7-323     
EFN1  	= 000001	#3-76       4-113      4-151      4-164      7-325      8-451     
EF.PR1	= ******  GX	 6-276     
ERRBUF	  001324 R	#4-166     *8-447     *8-448     
ERRDPB	  001310 R	#4-161      8-449     
ERR1  	  001350 R	#5-190      8-441     
ERR14 	  001662 R	#5-202      8-425     
ERR15 	  001715 R	#5-205      8-423     
ERR16 	  001750 R	#5-206      8-421     
ERR2  	  001375 R	#5-191      8-439     
ERR3  	  001424 R	#5-192      8-437     
BOOT       CREATED BY  MACRO  ON 16-JAN-78 AT 19:39	PAGE 2

SYMBOL CROSS REFERENCE                                  CREF         

SYMBOL	VALUE		REFERENCES

ERR4  	  001460 R	#5-193      8-435     
ERR5  	  001514 R	#5-194      8-433     
ERR6  	  001536 R	#5-195      8-431     
ERR7  	  001575 R	#5-196      8-429     
ERR8  	  001626 R	#5-197      8-427     
ESC   	= 000033	#3-74      
FIDBIT	= 000001	#3-48      
F.BKST	= 000024	 4-111     
F.DFNB	= 000046	 4-112     
F.DSPT	= 000044	 4-112     
F.DVNM	= 000134	 7-288      7-294     
F.EFN 	= 000050	 4-113     
F.LUN 	= 000042	 4-112     
F.UNIT	= 000136	 7-295     
IO.RLB	= ******  GX	 7-317     
IO.WVB	= ******  GX	 4-162     
LBNBLK	  001332 R	#4-179      6-253     
LUN1  	= 000001	#3-52       4-163     
LUN2  	= 000002	#3-53       4-112      4-150     
L$BFLG	= 000010	#3-60       7-337     
L$BHRB	= 000022	#3-62       7-332      7-334     
L$BLDZ	= 000014	#3-61       7-335     
L$BXFR	= 000026	#3-63       7-336     
M$$MGE	= ******	 7-342      7-397     
N.DVNM	= 000032	 4-124     
N.FNAM	= 000006	 4-124     
N.FTYP	= 000014	 4-124     
PRIPRM	  002005 R	#5-209      6-270     
PS    	= ******  GX	 7-395     
R$$11M	= 000001	#1-25       4-137      4-183      5-203     
R$$20F	= 000001	#1-24       3-93       4-123      5-208      6-230      6-269      7-300      7-347      7-391     
SPA   	= 000040	#3-72      
S.BFHD	= 000020	 4-173      4-173     
S.FDB 	= 000140	 4-110      4-110     
S.FNAM	= 000006	 4-124      4-124     
S.FNB 	= 000036	 4-124     
S.FTYP	= 000002	 4-124      4-124     
TS$NHD	= 040000	#3-67       7-337     
U.RP  	= ******  GX	 7-313     
U.UN  	= ******  GX	 7-314     
$BTCSR	= ******  GX	*7-315      7-373     
$BTDEV	= ******  GX	*7-294     
$BTEND	= ******  GX	 7-407     
$BTEP2	= ******  GX	 7-417     
$BTFSZ	= ******  GX	*6-279     *7-334     
$BTLBN	= ******  GX	*7-284     *7-285      7-321      7-322     *7-332     *7-333     
$BTLLN	= ******  GX	*7-335      7-359     
$BTLUN	= ******  GX	*7-295     
$BTMAX	= ******  GX	*7-355      7-360      7-362      7-396     
$BTPH2	= ******  GX	 7-407      7-409      7-417     
$BTUNT	= ******  GX	*7-314     
$BTXFR	= ******  GX	*7-336      7-367      7-389     
BOOT       CREATED BY  MACRO  ON 16-JAN-78 AT 19:39	PAGE 3

SYMBOL CROSS REFERENCE                                  CREF         

SYMBOL	VALUE		REFERENCES

$DRVER	= ******  GX	 7-382     
$DVDRV	= ******  GX	 7-287     
$FILBN	= ******  GX	 6-254      6-254     
$$    	= 000075	#6-250      6-250     #6-254      6-254     #7-375      7-375     
.COMEF	= ******  GX	 6-276     
.FINIT	= ******  G	 6-229      6-229     
.FSRCB	= ******  G	 4-173     
.GTCML	= ******  GX	 6-250      6-250     
.MSIZE	= ******  GX	 7-348     
...PC1	= 000054 R	#4-110      4-111      4-112      4-112      4-112      4-113      4-124      4-124     #4-124     
                         4-124      4-124      4-124      4-124     #4-124     
...PC2	= 001232 R	#4-111      4-111     #4-112      4-112     #4-112      4-112     #4-112      4-112     #4-113     
                         4-113     #4-124      4-124      4-124     #4-124      4-124      4-124     
...PC3	= 000054 R	#4-124      4-124     
BOOT       CREATED BY  MACRO  ON 16-JAN-78 AT 19:39	PAGE 4

MACRO CROSS REFERENCE                                   CREF         

MACRO NAME	REFERENCES

BDOFF$		#4-173     
CALL  		#1-23      #2-40       6-250      6-254      7-375     
CBYTE$		#4-111     #4-111     #4-112     #4-112     #4-112     #4-113     #4-113     #4-113     #4-113     
CSI$  		#2-36      #2-37      
CWORD$		#4-111      4-111      4-111      4-111      4-111      4-111     #4-112      4-112      4-112     #4-113     
                 4-113     #4-124      4-124      4-124     
DEF$L 		#4-173     
DIR$  		#2-40      #7-323     #7-325     #7-325     #8-449     #8-451     #8-451     #8-452     #8-452     
ERR$  		#7-323     #7-325     #8-449     #8-451     #8-452     
EXIT$S		#2-40      #8-452     
FDBDF$		#2-41      #4-110     
FDBF$A		#2-41       4-113     
FDBK$A		#2-41       4-111     
FDBSZ$		#4-110     #4-110     
FDOFF$		#2-38      #2-39      #4-111     #4-111     #4-112     #4-112     #4-113     #4-113     
FDOP$A		#2-41       4-112     
FINIT$		#2-42      #6-229     
FSRSZ$		#2-42      #4-173     
MOV$  		#7-325     #7-325     #8-451     #8-451     
NBOFF$		#4-124      4-124     
NMBLK$		#2-42      #4-124     
RAD50$		#4-124     #4-124     #4-124     
RETURN		#1-23      #2-42      
WTSE$S		#2-42      #7-325     #8-451     
BOTSET - SET UP DRIVERS FOR BOO	MACRO M1108  16-JAN-78 19:39
TABLE OF CONTENTS

    3-  33	SET DF DRIVER DISK ADDRESS
    4-  48	SET DK DISK ADDRESS
    5-  78	SET DP DISK ADDRESS
    6- 110	SET DB DISK ADDRESS
    7- 149	SET UP DECTAPE AND RS03/04
    8- 164	SET DX DISK BOOT DRIVER AND EMPTY SILO ADDRESS
BOTSET - SET UP DRIVERS FOR BOO	MACRO M1108  16-JAN-78 19:39  PAGE 2
RSXDC -- RSX20F CONDITIONAL DEFINITION MODULE

      1						.TITLE	BOTSET - SET UP DRIVERS FOR BOOT
      2						.IDENT	"01"
      3					;
      4					;
      5					;                             COPYRIGHT (C) 1975, 1978 BY
      6					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      7					;
      8					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      9					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
     10					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     11					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     12					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     13					;
     14					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     15					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     16					;       CORPORATION.
     17					;
     18					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     19					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     20					;
     21					;
     22
     23
     24					; VERSION:	01
     25					; BY:		H.LEV
     26					; DATE:		4/11/75	BASED ON SAVSET.MAC
     27
     28					;
     29					; THIS MODULE SETS UP THE DEVICE DRIVERS TO BOOT IN
     30					; A SYSTEM IMAGE.
     31					;
BOTSET - SET UP DRIVERS FOR BOO	MACRO M1108  16-JAN-78 19:39  PAGE 3
SET DF DRIVER DISK ADDRESS

     33						.SBTTL	SET DF DRIVER DISK ADDRESS
     34	000000	005001 			$SETDF::CLR	R1		; ZERO LOW VBN
     35					;
     36					; COMPUTE DISK ADDRESS AND SET IT IN DRIVER
     37					;
     38	000002	016702 	000002G			MOV	$BTLBN+2,R2	; GET LBN OF SYSTEM IMAGE
     39	000006	150201 				BISB	R2,R1		; SET LOW PART OF ADDRESS
     40	000010	042702 	000377 			BIC	#377,R2		; CLEAR IT OUT OF HIGH PART
     41	000014	000301 				SWAB	R1		; SHIFT LOW PART TO 256 WORD POSITION
     42	000016	000302 				SWAB	R2		; SHIFT HIGH PART DOWN
     43	000020	010167 	000000G			MOV	R1,$DFDAR	; SET DISK ADDRESS
     44	000024	010267 	000000G			MOV	R2,$DFDAE	; AND EXTENSION
     45	000030	005065 	000000G			CLR	DRVUNT(R5)	; NO UNIT TO SELECT
     46	000034					RETURN			;
BOTSET - SET UP DRIVERS FOR BOO	MACRO M1108  16-JAN-78 19:39  PAGE 4
SET DK DISK ADDRESS

     48						.SBTTL	SET DK DISK ADDRESS
     49	000036	016703 	000002G		$SETDK:: MOV	$BTLBN+2,R3	; GET LBN OF SYSTEM IMAGE
     50					;
     51					; COMPUTE DISK ADDRESS AND SET IN DRIVER
     52					;
     53	000042	005002 				CLR	R2		; ZERO QUOTIENT (CYLINDER)
     54	000044	012704 	000014 			MOV	#12.,R4		; SET DIVISOR (SECTORS/CYLINDER)
     55	000050	020304 			10$:	CMP	R3,R4		; MORE WHOLE CYLINDERS LEFT?
     56	000052	002403 				BLT	20$		; NO
     57	000054	005202 				INC	R2		; YES, INCREMENT CYLINDER COUNT
     58	000056	160403 				SUB	R4,R3		; DECREASE BY ONE CYLINDERS WORTH OF TRACKS
     59	000060	003373 				BGT	10$		; LOOP IF MORE
     60	000062	006302 			20$:	ASL	R2		; SHIFT UP CYLINDER
     61	000064	006302 				ASL	R2		; TO CORRECT POSITION
     62	000066	006302 				ASL	R2		;
     63	000070	006302 				ASL	R2		;
     64	000072	005004 				CLR	R4		;
     65	000074	010204 				MOV	R2,R4		; SET CYLINDER
     66	000076	050304 				BIS	R3,R4		; MERGE IN SECTOR
     67	000100	010467 	000000G			MOV	R4,$DKDAR	; SET IT FOR DRIVER
     68	000104	116704 	000000G			MOVB	$BTUNT,R4	; GET UNIT NUMBER
     69	000110	042704 	177400 			BIC	#177400,R4	; CLEAR HIGH BITS
     70	000114	000241 				CLC			; ZERO CARRY
     71	000116	006004 				ROR	R4		; SHIFT IT UP
     72	000120	006004 				ROR	R4		; TO HIGH
     73	000122	006004 				ROR	R4		; POSITION
     74	000124	006004 				ROR	R4		;
     75	000126	010465 	000000G			MOV	R4,DRVUNT(R5) ; SAVE UNIT SELECT CODE
     76	000132					RETURN			;
BOTSET - SET UP DRIVERS FOR BOO	MACRO M1108  16-JAN-78 19:39  PAGE 5
SET DP DISK ADDRESS

     78						.SBTTL	SET DP DISK ADDRESS
     79	000134	116702 	000000G		$SETDP:: MOVB	$BTLBN,R2	; GET HIGH LBN OF SYSTEM IMAGE
     80	000140	016701 	000002G			MOV	$BTLBN+2,R1	; GET LOW LBN
     81					;
     82					; COMPUTE DISK ADDRESS, SET IT IN DRIVER
     83					;
     84	000144	042702 	177400 			BIC	#177400,R2	; CLEAR OFF SIGN BITS
     85	000150	005003 				CLR	R3		; ZERO QUOTIENT (TRACKS)
     86	000152	012704 	000012 			MOV	#10.,R4		; SET DIVISOR (SECTORS/TRACK)
     87	000156	020104 			10$:	CMP	R1,R4		; ANY TRACKS LEFT ?
     88	000160	103002 				BHIS	20$		; YES
     89	000162	005702 				TST	R2		; NO, ANY HIGH PART LEFT?
     90	000164	001404 				BEQ	30$		; NO, DONE
     91	000166	005203 			20$:	INC	R3		; YES, INCREMENT WHOLE TRACK COUNT
     92	000170	160401 				SUB	R4,R1		; SUBTRACT A WHOLE TRACK FROM SECTORS
     93	000172	005602 				SBC	R2		;
     94	000174	000770 				BR	10$		; LOOP
     95	000176	010167 	000000G		30$:	MOV	R1,$DPDA	; SET SECTOR ADDRESS
     96	000202	012704 	000024 			MOV	#20.,R4		; SET DIVISOR (TRACKS/CYLINDER)
     97	000206	020304 			40$:	CMP	R3,R4		; A WHOLE CYLINDER LEFT?
     98	000210	103403 				BLO	50$		; NO
     99	000212	005202 				INC	R2		; YES, INCREMENT CYLINDER COUNT
    100	000214	160403 				SUB	R4,R3		; SUBTRACT A WHOLE CYLINDER FROM TRACKS
    101	000216	101373 				BHI	40$		; LOOP TIL DONE
    102	000220	000303 			50$:	SWAB	R3		; SHIFT UP TRACK
    103	000222	050367 	000000G			BIS	R3,$DPDA	; AND SET IT FOR DRIVER
    104	000226	010267 	000000G			MOV	R2,$DPCA	; SET CYLINDER
    105	000232	116704 	000000G			MOVB	$BTUNT,R4	; GET UNIT SELECT
    106	000236	000304 				SWAB	R4		; SHIFT TO HIGH BYTE
    107	000240	010465 	000000G			MOV	R4,DRVUNT(R5)	; SAVE IT
    108	000244					RETURN			;
BOTSET - SET UP DRIVERS FOR BOO	MACRO M1108  16-JAN-78 19:39  PAGE 6
SET DB DISK ADDRESS

    110						.SBTTL	SET DB DISK ADDRESS
    111	000246	116702 	000000G		$SETDB:: MOVB	$BTLBN,R2	; GET HIGH LBN OF SYSTEM IMAGE
    112	000252	042702 	177400 			BIC	#177400,R2	;
    113	000256	016700 	000002G			MOV	$BTLBN+2,R0	; GET LOW LBN
    114					;
    115					; CONVERT LBN TO SECTOR, TRACK, CYLINDER
    116					;
    117					.IF DF R$$20F
    118	000262	012703 	000024 			MOV	#20.,R3		; SET SECTORS/TRACK
    119					.IFF
    120						MOV	#22.,R3		; SET SECTORS PER TRACK
    121					.ENDC
    122	000266	005001 				CLR	R1		; ZERO TRACK COUNT
    123	000270	020003 			10$:	CMP	R0,R3		; ANY WHOLE TRACKS LEFT?
    124	000272	103002 				BHIS	20$		; YES
    125	000274	005702 				TST	R2		; MAYBE
    126	000276	001404 				BEQ	30$		; NO
    127	000300	160300 			20$:	SUB	R3,R0		; SUBTRACT A WHOLE TRACK OF SECTORS
    128	000302	005602 				SBC	R2		;
    129	000304	005201 				INC	R1		; INCREMENT TRACK COUNT
    130	000306	000770 				BR	10$		; LOOP
    131	000310	012703 	000023 		30$:	MOV	#19.,R3		; SET TRACKS PER CYLINDER
    132	000314	020103 			40$:	CMP	R1,R3		; ANY WHOLE CYLINDERS LEFT?
    133	000316	103403 				BLO	50$		; NO
    134	000320	160301 				SUB	R3,R1		; YES, SUBTRACT A CYLINDER OF TRACKS
    135	000322	005202 				INC	R2		; INCREMENT CYLINDER COUNT
    136	000324	000773 				BR	40$		; LOOP
    137					;
    138					; AT THIS POINT R0-SECTOR, R1-TRACK, AND R2-CYLINDER
    139					;
    140	000326	000301 			50$:	SWAB	R1		; SHIFT TRACK TO HIGH BYTE
    141	000330	050100 				BIS	R1,R0		; COMBINE TRACK AND SECTOR
    142	000332	010067 	000000G			MOV	R0,$DBDA	; SET IT IN TRACK SECTOR SELECT
    143	000336	010267 	000000G			MOV	R2,$DBCA	; SET CYLINDER SELECT
    144	000342	016704 	000000G			MOV	$BTUNT,R4	; GET UNIT
    145	000346	000304 				SWAB	R4		; SHIFT TO HIGH BYTE
    146	000350	010465 	000000G			MOV	R4,DRVUNT(R5)	; SAVE IT
    147	000354					RETURN			;
BOTSET - SET UP DRIVERS FOR BOO	MACRO M1108  16-JAN-78 19:39  PAGE 7
SET UP DECTAPE AND RS03/04

    149						.SBTTL	SET UP DECTAPE AND RS03/04
    150					;
    151	000356	016767 	000002G	000000G	$SETDT:: MOV	$BTLBN+2,$DTBLK	; SET LBN OF SYSTEM IMAGE
    152	000364	016704 	000000G			MOV	$BTUNT,R4	; GET LOAD UNIT
    153	000370	000304 				SWAB	R4		; SHIFT TO HIGH BYTE
    154	000372	010465 	000000G			MOV	R4,DRVUNT(R5) ; SAVE IT
    155	000376					RETURN			;
    156
    157
    158	000400	016767 	000002G	000000G	$SETDS:: MOV	$BTLBN+2,$DSDA	; SET LBN OF SYSTEM IMAGE
    159	000406	016704 	000000G			MOV	$BTUNT,R4	; GET UNIT SELECT
    160	000412	000304 				SWAB	R4		; SHIFT UP TO UNIT SELECT FIELD
    161	000414	010465 	000000G			MOV	R4,DRVUNT(R5) ; SET UNIT SELECT
    162	000420					RETURN			;
BOTSET - SET UP DRIVERS FOR BOO	MACRO M1108  16-JAN-78 19:39  PAGE 8
SET DX DISK BOOT DRIVER AND EMPTY SILO ADDRESS

    164						.SBTTL	SET DX DISK BOOT DRIVER AND EMPTY SILO ADDRESS
    165	000422	016704 	000002G		$SETDX:: MOV	$BTLBN+2,R4	; GET SYSTEM IMAGE LBN
    166	000426	006304 				ASL	R4		; CONVERT TO LOGICAL SECTOR NUMBER
    167	000430	006304 				ASL	R4		;
    168	000432	010467 	000000G			MOV	R4,$DXBLK	; SET IT IN DRIVER
    169	000436	012767 	000003 	000000G		MOV	#3,$DXSLO	; SET SILO FUNCTION TO EMPTY
    170	000444	016767 	000016 	000000G		MOV	20$,$DXMOV	; GET INSTRUCTION TO EMPTY SILO
    171	000452	016704 	000000G			MOV	$BTUNT,R4	; GET UNIT SELECT
    172	000456	000304 				SWAB	R4		; SHIFT UP HIGH
    173	000460	010465 	000000G			MOV	R4,DRVUNT(R5) ; SET IT IN TABLE
    174	000464					RETURN			;
    175
    176	000466	111224 			20$:	MOVB	(R2),(R4)+	; EMPTY SILO
    177		000001 				.END
BOTSET - SET UP DRIVERS FOR BOO	MACRO M1108  16-JAN-78 19:39  PAGE 8-1
SYMBOL TABLE

DRVUNT= ****** GX	$DBCA = ****** GX	$DPCA = ****** GX	$DXMOV= ****** GX	$SETDP  000134RG
R$$11M= 000001   	$DBDA = ****** GX	$DPDA = ****** GX	$DXSLO= ****** GX	$SETDS  000400RG
R$$20F= 000001   	$DFDAE= ****** GX	$DSDA = ****** GX	$SETDB  000246RG 	$SETDT  000356RG
$BTLBN= ****** GX	$DFDAR= ****** GX	$DTBLK= ****** GX	$SETDF  000000RG 	$SETDX  000422RG
$BTUNT= ****** GX	$DKDAR= ****** GX	$DXBLK= ****** GX	$SETDK  000036RG

. ABS.	000000	   000
      	000470	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  341 WORDS  ( 2 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:09
,[52,20]BOTSET.LIS/-SP/CRF=[52,30]RSXDC,BOTSET
BOTSET     CREATED BY  MACRO  ON 16-JAN-78 AT 19:40	PAGE 1

SYMBOL CROSS REFERENCE                                  CREF         

SYMBOL	VALUE		REFERENCES

DRVUNT	= ******  GX	*3-45      *4-75      *5-107     *6-146     *7-154     *7-161     *8-173     
R$$11M	= 000001	#1-25      
R$$20F	= 000001	#1-24       6-117     
$BTLBN	= ******  GX	 3-38       4-49       5-79       5-80       6-111      6-113      7-151      7-158      8-165     
$BTUNT	= ******  GX	 4-68       5-105      6-144      7-152      7-159      8-171     
$DBCA 	= ******  GX	*6-143     
$DBDA 	= ******  GX	*6-142     
$DFDAE	= ******  GX	*3-44      
$DFDAR	= ******  GX	*3-43      
$DKDAR	= ******  GX	*4-67      
$DPCA 	= ******  GX	*5-104     
$DPDA 	= ******  GX	*5-95      *5-103     
$DSDA 	= ******  GX	*7-158     
$DTBLK	= ******  GX	*7-151     
$DXBLK	= ******  GX	*8-168     
$DXMOV	= ******  GX	*8-170     
$DXSLO	= ******  GX	*8-169     
$SETDB	  000246 RG	#6-111     
$SETDF	  000000 RG	#3-34      
$SETDK	  000036 RG	#4-49      
$SETDP	  000134 RG	#5-79      
$SETDS	  000400 RG	#7-158     
$SETDT	  000356 RG	#7-151     
$SETDX	  000422 RG	#8-165     
BOTSET     CREATED BY  MACRO  ON 16-JAN-78 AT 19:40	PAGE 2

MACRO CROSS REFERENCE                                   CREF         

MACRO NAME	REFERENCES

CALL  		#1-23      
RETURN		#1-23       3-46       4-76       5-108      6-147      7-155      7-162      8-174     
BOTPH2  -  BOOT PHASE 2	MACRO M1108  16-JAN-78 19:39
TABLE OF CONTENTS

    3-  38	EQUATED SYMBOLS + GLOBAL DATA
    4-  68	PHASE 2 BOOT IN SYSTEM
    5- 138	PHASE 2 SUBROUTINES
BOTPH2  -  BOOT PHASE 2	MACRO M1108  16-JAN-78 19:39  PAGE 2
RSXDC -- RSX20F CONDITIONAL DEFINITION MODULE

      1						.TITLE	BOTPH2  -  BOOT PHASE 2
      2						.IDENT	"01"
      3
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					;
     21					; VERSION:	01
     22					; BY:		H. LEV
     23					; DATE:		9/1/73
     24					; MODIFIED:	8/9/74 BRAKE BOOT INTO TWO SEPARATE MODULES
     25					;		4/8/75 ADD RX11 SUPPORT
     26					;		6/21/75 ADD 11/70 EXTENDED MEMORY SUPPORT
     27
     28					;
     29					;
     30					; THI S IS PHASE 2 OF THE BOOT PROGRAM.  IT CONTAINS THE
     31					; DRIVERS WHICH READ IN THE BOOTABLE IMAGE FROM A VALID SYSTEM
     32					; RESIDENCE DEVICE.  IT IS MOVED TO THE TOP OF CORE (MAX 27.5K)
     33					; AND MEMORY MAPPING (IF ANY) IS TURNED OFF.  ONCE THE IMAGE IS IN CORE
     34					; IT PASSES CONTROL TO THE ENTRY POINT
     35
     36						.MCALL	CALL,RETURN
BOTPH2  -  BOOT PHASE 2	MACRO M1108  16-JAN-78 19:39  PAGE 3
EQUATED SYMBOLS + GLOBAL DATA

     38						.SBTTL	EQUATED SYMBOLS + GLOBAL DATA
     39					;
     40					; TERMINAL REGISTERS
     41					;
     42		177564 			TPS	=	177564		; OUTPUT STATUS
     43		177566 			TPB	=	177566		; OUTPUT BUFFER
     44
     45	000000				$BTPH2::			; START OF PHASE 2 CODE
     46						.BLKW	4		; STACK
     47	000010				$BTSTK::			;
     48
     49	000010				$BTLBN::.BLKW	2		; LOAD IMAGE LBN
     50	000014				$BTLLN::.BLKW	1		; LOAD LENGTH
     51	000016				$BTXFR::.BLKW	1		; TRANSFER ADDRESS
     52	000020				$BTDEV::.BLKW	1		; LOAD DEVICE IN ASCII
     53	000022				$BTLUN::.BLKW	1		; LOGICAL DEVICE NUMBER
     54	000024				$BTUNT::.BLKW	1		; LOAD PHYSICAL UNIT NUMBER
     55	000026	000000 			$BTMAX::.WORD	0		; MAX WORDS TO BOOT WITHOUT OVERWRITING PHASE 2
     56	000030	000000 			$BTFSZ::.WORD	0		; SYSTEM IMAGE FILE SIZE
     57	000032	000000 			$BTCSR::.WORD	0		; LOAD DEVICE CSR ADDRESS
     58					;
     59					; ERROR MESSAGE
     60					;
     61						.IF	DF DEBUG
     62					ERR12:	.ASCIZ	<15>/PHASE 2 UP/
     63					ERR13:	.ASCIZ	/TASK READ IN/
     64						.ENDC
     65						.EVEN
     66
BOTPH2  -  BOOT PHASE 2	MACRO M1108  16-JAN-78 19:39  PAGE 4
PHASE 2 BOOT IN SYSTEM

     68						.SBTTL	PHASE 2 BOOT IN SYSTEM
     69
     70					;+
     71					; *** - $BTEP2 - BOOT PHASE 2
     72					;
     73					;	THIS SECTION OF CODE EXECUTES AT PRIORITY 7
     74					;	IT READS THE SYSTEM
     75					;	INTO CORE AND TRANSFERS CONTROL TO IT.
     76					;
     77					; INPUT:
     78					;
     79					;	$BTLBN - SYSTEM IMAGE LOGICAL BLOCK NUMBER
     80					;	$BTLUN - LOAD IMAGE LENGTH IN 32 BLOCKS
     81					;	$BTXFR - TRANSFER ADDRESS
     82					;	$BTDEN - LOAD DEVICE IN ASCII
     83					;	$BTUNT - LOAD UNIT NUMBER BINARY
     84					;
     85					; OUTPUT:
     86					;
     87					;	THE FOLLOWING REGISTERS ARE PASSED TO THE NEW SYSTEM
     88					;	R0 - PHYSICAL UNIT NUMBER OF BOOT DEVICE
     89					;	R1 - LOAD LBN HIGH PART
     90					;	R2 - LOAD LBN LOW PART
     91					;	R3 - LOAD UNIT NUMBER
     92					;	R4 - LOAD DEVICE IN ASCII
     93					;	R5 - LOAD LENGTH IN 256 WORD BLOCKS
     94					;
     95					;-
     96	000034				$BTEP2::
     97
     98						.IF	DF M$$MGE
     99
    100						MOV	@#KISAR6,@#KISAR6-2 ;;; SET TO USE APR5
    101						MOV	#5$-$BTPH2,R0	;;; GET OFFSET TO USE AS ADDRESS
    102						ADD	#120000,R0	;;; SET ADDRESS TO MAP THROUGH APR5
    103						MOV	R0,PC		;;; SWITCH TO APR5
    104					5$:	MOV	#1000,@#KISAR0+10 ;;; SET MAPPING FOR APR4
    105						BIS	#4000,@#PS	;;; SELECT REGISTER SET 1
    106						BIT	#4000,@#PS	;;; IS IT SELECTED? (ONLY 11/45 AND 11/70 HAVE IT)
    107						BEQ	7$		;;; NO
    108						BIC	#4000,@#PS	;;; YES, SELECT REGISTER SET ZERO
    109						CLR	@#SR3		;;; DISABLE MAPPING AND UNIBUS MAP
    110
    111						.ENDC
    112
    113	000034	010706 			7$:	MOV	PC,SP		;;; SET STACK ADDRESS
    114	000036	062706 	177752 			ADD	#$BTSTK-.,SP	;;;
    115
    116						.IF	DF DEBUG
    117						HALT
    118						MOV	PC,R0
    119						ADD	#ERR12-.,R0
    120						CALL	TYPE
    121						.ENDC
    122
    123	000042	000240 			$DRVER:: .REPT	240
    124						NOP			;;;
BOTPH2  -  BOOT PHASE 2	MACRO M1108  16-JAN-78 19:39  PAGE 4-1
PHASE 2 BOOT IN SYSTEM

    125						.ENDM
    126
    127	000542	016700 	177256 		XFR:	MOV	$BTUNT,R0	;;; GET PHYSICAL UNIT NUMBER
    128	000546	016701 	177236 			MOV	$BTLBN,R1	;;; SET LBN
    129	000552	016702 	177234 			MOV	$BTLBN+2,R2	;;;
    130	000556	016703 	177240 			MOV	$BTLUN,R3	;;; LOAD LOGICAL UNIT NUMBER
    131	000562	016704 	177232 			MOV	$BTDEV,R4	;;; AND DEVICE
    132	000566	016705 	177236 			MOV	$BTFSZ,R5	;;; GET FILE SIZE IN BLOCKS
    133					.IF DF R$$20F
    134	000572	000005 				RESET
    135					.ENDC
    136	000574	000177 	177216 			JMP	@$BTXFR		;;; TRANSFER CONTROL TO NEW SYSTEM.
BOTPH2  -  BOOT PHASE 2	MACRO M1108  16-JAN-78 19:39  PAGE 5
PHASE 2 SUBROUTINES

    138						.SBTTL	PHASE 2 SUBROUTINES
    139						.IF	DF DEBUG
    140					;+
    141					; *** - TYPE - PRINT OUT MESSAGE ON TT0:
    142					; *** - TYPIT - PRINT OUT CHARACTER IN R1
    143					;
    144					; INPUT:
    145					;
    146					;	R0-MESSAGE ADDRESS
    147					;
    148					;-
    149					TYPE:	MOVB	#15,R1		;;; SET CR
    150						CALL	TYPIT		;;;
    151						MOVB	#12,R1		;;; LF
    152						CALL	TYPIT		;;;
    153					10$:	MOVB	(R0)+,R1	;;; GET NEXT MESSAGE CHARACTER
    154						BEQ	20$		;;; SKIP IF END
    155						CALL	TYPIT		;;; TYPE IT OUT
    156						BR	10$		;;; LOOP
    157					20$:	MOVB	#12,R1		;;; TYPE LF
    158						CALL	TYPIT		;;;
    159						RETURN			;;; RETURN
    160					;
    161					; TYPE A CHARACTER
    162					;
    163					TYPIT:	MOVB	R1,@#TPB	;;; PRINT CHARACTER
    164					10$:	TSTB	@#TPS		;;; WAIT TILL
    165						BPL	10$		;;; DONE
    166						RETURN			;;; RETURN
    167						.ENDC
    168	000600				$BTEND::
    169		000001 				.END
BOTPH2  -  BOOT PHASE 2	MACRO M1108  16-JAN-78 19:39  PAGE 5-1
SYMBOL TABLE

R$$11M= 000001   	XFR     000542R  	$BTEP2  000034RG 	$BTLUN  000022RG 	$BTUNT  000024RG
R$$20F= 000001   	$BTCSR  000032RG 	$BTFSZ  000030RG 	$BTMAX  000026RG 	$BTXFR  000016RG
TPB   = 177566   	$BTDEV  000020RG 	$BTLBN  000010RG 	$BTPH2  000000RG 	$DRVER  000042RG
TPS   = 177564   	$BTEND  000600RG 	$BTLLN  000014RG 	$BTSTK  000010RG

. ABS.	000000	   000
      	000600	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  253 WORDS  ( 1 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:12
,[52,20]BOTPH2.LIS/-SP/CRF=[52,30]RSXDC,BOTPH2
BOTPH2     CREATED BY  MACRO  ON 16-JAN-78 AT 19:39	PAGE 1

SYMBOL CROSS REFERENCE                                  CREF         

SYMBOL	VALUE		REFERENCES

DEBUG 	= ******	 3-61       4-116      5-139     
M$$MGE	= ******	 4-98      
R$$11M	= 000001	#1-25      
R$$20F	= 000001	#1-24       4-133     
TPB   	= 177566	#3-43      
TPS   	= 177564	#3-42      
XFR   	  000542 R	#4-127     
$BTCSR	  000032 RG	#3-57      
$BTDEV	  000020 RG	#3-52       4-131     
$BTEND	  000600 RG	#5-168     
$BTEP2	  000034 RG	#4-96      
$BTFSZ	  000030 RG	#3-56       4-132     
$BTLBN	  000010 RG	#3-49       4-128      4-129     
$BTLLN	  000014 RG	#3-50      
$BTLUN	  000022 RG	#3-53       4-130     
$BTMAX	  000026 RG	#3-55      
$BTPH2	  000000 RG	#3-45      
$BTSTK	  000010 RG	#3-47       4-114     
$BTUNT	  000024 RG	#3-54       4-127     
$BTXFR	  000016 RG	#3-51       4-136     
$DRVER	  000042 RG	#4-123     
BOTPH2     CREATED BY  MACRO  ON 16-JAN-78 AT 19:39	PAGE 2

MACRO CROSS REFERENCE                                   CREF         

MACRO NAME	REFERENCES

CALL  		#1-23      #2-36      
RETURN		#1-23      #2-36      
BOTCMD -- BOOT COMMAND ROUTINES	MACRO M1108  16-JAN-78 19:40
TABLE OF CONTENTS

    3-  26	COMMAND ROUTINES
BOTCMD -- BOOT COMMAND ROUTINES	MACRO M1108  16-JAN-78 19:40  PAGE 2
RSXDC -- RSX20F CONDITIONAL DEFINITION MODULE

      1						.TITLE	BOTCMD -- BOOT COMMAND ROUTINES
      2						.IDENT	/003A/
      3					;
      4					;                             COPYRIGHT (C) 1975, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					;	MODULE: BOTCMD -- COMMAND ROUTINES FOR BOOT
     21					;
     22					;	AUTHOR: TOM PORCHER
     23					;
     24					;	DATE: 8 APR 76
BOTCMD -- BOOT COMMAND ROUTINES	MACRO M1108  16-JAN-78 19:40  PAGE 3
COMMAND ROUTINES

     26						.SBTTL	COMMAND ROUTINES
     27					;
     28					; GENERAL NOTES:
     29					;
     30					; R0 IS ALWAYS USED AS A POINTER TO THE COMMAND STRING.  ON CALL,
     31					; IT POINTS TO THE NEXT CHARACTER TO BE PROCESSED.  ON RETURN, R0
     32					; ALWAYS POINTS TO THE CHARACTER AFTER THE LAST ONE PROCESSED, I.E.
     33					; THE NEXT ONE TO BE PROCESSED.
     34					;
     35					; NOTE THAT END-OF-LINE IS A ZERO BYTE
     36					;
     37					;
     38					; $GNBLK -- GET NEXT NON-BLANK CHARACTER
     39					;
     40					; RETURNS WITH R0 POINTING BEYOND THE NEXT NON-BLANK CHARACTER
     41					;	R1 --	NUMBER OF BLANKS SEEN
     42					;	R2 --	NON-BLANK CHARACTER
     43					;	CC-C SET IF END-OF-LINE
     44					;
     45	000000				$GNBLK::
     46	000000	005001 				CLR	R1		;RESET CHAR COUNT
     47	000002				10$:
     48	000002	000261 				SEC			;ASSUME EOL
     49	000004	112002 				MOVB	(R0)+,R2	;GET A CHARACTER
     50	000006	001411 				BEQ	40$		;EOL-- GIVE UP
     51	000010	122702 	000040 			CMPB	#' ,R2		;THIS BLANK?
     52	000014	001403 				BEQ	20$		;YES-- EAT IT
     53	000016	122702 	000011 			CMPB	#'	,R2	;OR A TAB?
     54	000022	001002 				BNE	30$		;NO-- ALL DONE
     55	000024				20$:
     56	000024	005201 				INC	R1		;BUMP BLANK COUNT
     57	000026	000765 				BR	10$		;BACK FOR MORE
     58					;
     59	000030				30$:
     60	000030	000241 				CLC			;NOT EOL-- CLEAR CARRY OUT
     61	000032				40$:
     62	000032					RETURN			; FROM $GNBLK
     63					;
     64					; $GTNUM -- GET OCTAL NUMBER
     65					;
     66					; RETURNS WITH NON-DIGIT OR IF MORE THAN A BYTE'S WORTH
     67					;	R1 --	NUMBER
     68					;	R2 --	TERMINATING CHARACTER
     69					;	CC-C SET IF LARGER THAN ONE WORD
     70					;
     71	000034				$GTNUM::
     72	000034	005001 				CLR	R1		;CLEAR RESULT
     73	000036				10$:
     74	000036	112002 				MOVB	(R0)+,R2	;GET A DIGIT
     75	000040	122702 	000060 			CMPB	#'0,R2		;IS IT TOO LOW?
     76	000044	101015 				BHI	50$		;YES-- RETURN CARRY CLEAR
     77	000046	120227 	000067 			CMPB	R2,#'7		;TOO HIGH?
     78	000052	101012 				BHI	50$		;YES-- RETURN CC-C CLEAR
     79	000054	042702 	177770 			BIC	#^C<7>,R2	;OK-- TRIM TO A DIGIT
     80		000003 			.REPT 3
     81						ASL	R1		;SHIFT OLD NUMBER A BIT
     82						BCS	50$		;CARRY OUT-- NUMBER TOO BIG-- CC-C SET
BOTCMD -- BOOT COMMAND ROUTINES	MACRO M1108  16-JAN-78 19:40  PAGE 3-1
COMMAND ROUTINES

     83					.ENDR
     84	000074	060201 				ADD	R2,R1		;ACCUMULATE THIS DIGIT
     85	000076	000757 				BR	10$		;FETCH ANOTHER DIGIT
     86					;
     87	000100				50$:
     88	000100					RETURN			;FROM $GTNUM
     89					;
     90					; $FDLOG -- FIND PUD ENTRY ADDRESS FOR DEVICE STRING
     91					;	R0 -- POINTER TO DEVICE STRING
     92					;	R3 -- POINTER TO SCRATCH AREA
     93					; RETURN:
     94					;	R1 -- PUD ENTRY ADDRESS
     95					;
     96	000102				$FDLOG::
     97	000102	112023 				MOVB	(R0)+,(R3)+	;GET FIRST BYTE OF NAME
     98	000104	112023 				MOVB	(R0)+,(R3)+	; AND SECOND
     99	000106	014303 				MOV	-(R3),R3	;COLLECT THE NAME
    100	000110					CALL	$GTNUM		;GET UNIT #
    101	000114	103417 				BCS	90$		;OOPS
    102					;
    103	000116	010102 				MOV	R1,R2		;SAVE THAT NUMBER
    104	000120	012701 	000000G			MOV	#.PUDBA,R1	;POINT TO START OF PUD
    105	000124				10$:
    106	000124	020361 	000000G			CMP	R3,U.DN(R1)	;MATCH NAME?
    107	000130	001003 				BNE	30$		;NO-- GO ON
    108	000132	120261 	000000G			CMPB	R2,U.UN(R1)	;YES-- HOW ABOUT THE UNIT?
    109	000136	001406 				BEQ	90$		;YES-- THIS IS IT
    110	000140				30$:
    111	000140	062701 	000000G			ADD	#U.SZ,R1	;BUMP TO NEXT PUD ENTRY
    112	000144	020127 	000000G			CMP	R1,#.PUDEA	;BEYOND END?
    113	000150	103765 				BLO	10$		;NO-- KEEP ON LOOKING
    114	000152	000261 				SEC			;NOT FOUND-- SET CC-C
    115	000154				90$:
    116	000154					RETURN			;FROM $FDLOG
    117		000001 				.END
BOTCMD -- BOOT COMMAND ROUTINES	MACRO M1108  16-JAN-78 19:40  PAGE 3-2
SYMBOL TABLE

R$$11M= 000001   	U.SZ  = ****** GX	$FDLOG  000102RG 	$GTNUM  000034RG 	.PUDBA= ****** GX
R$$20F= 000001   	U.UN  = ****** GX	$GNBLK  000000RG 	$$    = 000067   	.PUDEA= ****** GX
U.DN  = ****** GX

. ABS.	000000	   000
      	000156	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  296 WORDS  ( 2 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:06
,[52,20]BOTCMD.LIS/-SP/CRF=[52,30]RSXDC,BOTCMD
BOTCMD     CREATED BY  MACRO  ON 16-JAN-78 AT 19:40	PAGE 1

SYMBOL CROSS REFERENCE                                  CREF         

SYMBOL	VALUE		REFERENCES

R$$11M	= 000001	#1-25      
R$$20F	= 000001	#1-24      
U.DN  	= ******  GX	 3-106     
U.SZ  	= ******  GX	 3-111     
U.UN  	= ******  GX	 3-108     
$FDLOG	  000102 RG	#3-96      
$GNBLK	  000000 RG	#3-45      
$GTNUM	  000034 RG	#3-71       3-100      3-100     
$$    	= 000067	#3-100      3-100     
.PUDBA	= ******  GX	 3-104     
.PUDEA	= ******  GX	 3-112     
BOTCMD     CREATED BY  MACRO  ON 16-JAN-78 AT 19:40	PAGE 2

MACRO CROSS REFERENCE                                   CREF         

MACRO NAME	REFERENCES

CALL  		#1-23       3-100     
RETURN		#1-23       3-62       3-88       3-116     
SPCDRV  -  RSX11M SAVE + BOOT D	MACRO M1108  16-JAN-78 19:40
TABLE OF CONTENTS

    3-  45	EQUATED SYMBOLS
    4- 115	LOCAL DATA
    5- 248	DF DRIVER
    6- 289	DK DRIVER
    7- 342	DP DRIVER
    8- 387	DEC-TAPE DRIVER
    9- 457	DS DRIVER
   10- 506	RP04 DRIVER
   11- 564	RX01 DRIVER
SPCDRV  -  RSX11M SAVE + BOOT D	MACRO M1108  16-JAN-78 19:40  PAGE 2
RSXDC -- RSX20F CONDITIONAL DEFINITION MODULE

      1						.TITLE	SPCDRV  -  RSX11M SAVE + BOOT DEVICE DRIVERS
      2						.IDENT	"02"
      3					;
      4					;
      5					;                             COPYRIGHT (C) 1974, 1978 BY
      6					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      7					;
      8					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      9					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
     10					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     11					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     12					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     13					;
     14					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     15					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     16					;       CORPORATION.
     17					;
     18					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     19					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     20					;
     21
     22
     23					;
     24					; VERSION:	02
     25					; BY:		H.LEV
     26					; DATE:		12/2/74
     27					; MODIFIED:	8/6/74	BRAKE SAVE INTO SEPARATE SOURCE MODULES
     28					;		3/4/75	FIX DECTAPE DRIVER
     29					;		3/18/75 ADD RX01 FLOPPY DISK SUPPORT
     30					;		4/11/75 CHANGE TO USE FOR BOTH SAVE + BOOT
     31					;
     32
     33					;
     34					; THIS MODULE CONTAINS THE DEVICE DRIVERS FOR ALL RSX11M
     35					; SYSTEM RESIDENCE DEVICES.
     36					;
     37
     38
     39					.IF DF R$$20F
     40					.IFF
     41						.MCALL	HWDDF$
     42						HWDDF$
     43					.ENDC
SPCDRV  -  RSX11M SAVE + BOOT D	MACRO M1108  16-JAN-78 19:40  PAGE 3
EQUATED SYMBOLS

     45						.SBTTL	EQUATED SYMBOLS
     46					;
     47					; RF DISK CONTROLLER REGISTERS
     48					;
     49		000000 			RFDCS	=	0		; DEVICE CONTROL AND STATUS
     50		000002 			RFWC	=	2		; WORD COUNT
     51		000004 			RFCMA	=	4		; CURRENT MEMORY ADDRESS
     52		000006 			RFDAR	=	6		; DISK ADDRESS
     53		000010 			RFDAE	=	10		; DISK ADDRESS EXTENSION AND ERROR
     54
     55					;
     56					; RK DISK CONTROLLER REGISTERS
     57					;
     58		177774 			RKDS	=	-4		; DRIVE STATUS
     59		177776 			RKER	=	-2		; ERROR
     60		000000 			RKCS	=	0		; CONTROL STATUS
     61		000002 			RKWC	=	2		; WORD COUNT
     62		000004 			RKBA	=	4		; BUFFER ADDRESS
     63		000006 			RKDA	=	6		; DISK ADDRESS
     64
     65					;
     66					; RP DISK CONTROLLER REGISTERS
     67					;
     68		177774 			RPDS	=	-4		; DEVICE STATUS
     69		177776 			RPER	=	-2		; ERROR
     70		000000 			RPCS	=	0		; CONTROL STATUS
     71		000002 			RPWC	=	2		; WORD COUNT
     72		000004 			RPBA	=	4		; BUFFER ADDRESS
     73		000006 			RPCA	=	6		; CYLINDER ADDRESS
     74		000010 			RPDA	=	10		; DISK ADDRESS
     75
     76					;
     77					; DECTAPE CONTROLLER REGISTERS
     78					;
     79		177776 			TCST	=	-2		; CONTROL AND STATUS
     80		000000 			TCCM	=	0		; COMMAND
     81		000002 			TCWC	=	2		; WORD COUNT
     82		000004 			TCBA	=	4		; BUFFER ADDRESS
     83		000006 			TCDT	=	6		; DATA REGISTER
     84
     85
     86					;
     87					; RS03/RS04 FIXED HEAD DISK CONTROLLER REGISTERS
     88					;
     89		000000 			RSCS1	=	0		; CONTROL STATUS 1
     90		000002 			RSWC	=	2		; WORD COUNT
     91		000004 			RSBA	=	4		; BUFFER ADDRESS
     92		000006 			RSDA	=	6		; DISK ADDRESS
     93		000010 			RSCS2	=	10		; CONTROL AND STATUS 2
     94		000012 			RSDS	=	12		; DRIVE STATUS
     95		000014 			RSER	=	14		; ERROR
     96		000016 			RSAS	=	16		; ATTENTION SUMMARY
     97		000026 			RSDT	=	26		; DRIVE TYPE
     98
     99
    100					;
    101					; RP04 DISK PACK DRIVER
SPCDRV  -  RSX11M SAVE + BOOT D	MACRO M1108  16-JAN-78 19:40  PAGE 3-1
EQUATED SYMBOLS

    102					;
    103		000000 			RJPCS1	=	0		; OFFSET TO CONTROL / STATUS 1
    104		000002 			RJPWC	=	2		; WORD COUNT
    105		000004 			RJPBA	=	4		; BUFFER ADDRESS
    106		000006 			RJPDA	=	6		; DISK TRACK/SECTOR ADDRESS
    107		000010 			RJPCS2	=	10		; CONTROL/STATUS 2
    108		000012 			RJPDS	=	12		; DRIVE STATUS
    109		000014 			RJPER1	=	14		; ERROR 1
    110		000032 			RJPOF	=	32		; OFFSET
    111		000034 			RJPDC	=	34		; CYLINDER ADDRESS
    112
    113		000004 			BLKLEN	=	4.		; BLOCKS TO READ TO GET 1024. WORDS
SPCDRV  -  RSX11M SAVE + BOOT D	MACRO M1108  16-JAN-78 19:40  PAGE 4
LOCAL DATA

    115						.SBTTL	LOCAL DATA
    116					;
    117					; DEVICE AND DRIVER TABLES
    118					; FORMAT:
    119					;	WORD 1	- DEVICE MNEMONIC IN ASCII
    120					;	WORD 2	- DRIVER SET UP ROUTINE ADDRESS
    121					;	WORD 3 	- LOAD LENGTH STORAGE AREA
    122					;	WORD 4	- BUFFER ADDRESS FOR I/O
    123					;	WORD 5	- FUNCTION CODE STORAGE AREA
    124					;	WORD 6	- DRIVER ADDRESS
    125					;	WORD 7	- DRIVER LENGTH IN WORDS
    126					;	WORD 8  - WRITE FUNCTION CODE
    127					;	WORD 9  - READ FUNCTION CODE
    128					;	WORD 10 - UNIT SELECTION
    129					;	WORD 11 - UNIT SELECTION REGISTER ADDRESS
    130					;	WORD 12 - ADDRESS OF CSR ADDRESS SAVE AREA
    131					;	WORD 13 - ADDRESS OF CSR (RSX-20F ONLY)
    132					;
    133	000000	   104 	   106 		$DVDRV::.ASCII	/DF/		; 0 FIXED RF DISK
    134	000002	000000G				.WORD	$SETDF		; 2
    135	000004	000270'				.WORD	DFLLEN		; 4
    136	000006	000304'				.WORD	DFSA		; 6
    137	000010	000364'				.WORD	DFFUN		; 10
    138	000012	000266'				.WORD	$DFDRV		; 12
    139	000014	000055 				.WORD	<DFEND-$DFDRV>/2 ; 14
    140	000016	000003 				.WORD	3		; 16
    141	000020	000005 				.WORD	5		; 20
    142	000022	000000 				.WORD	0		; 22
    143	000024	000364'				.WORD	DFFUN		; 24
    144	000026	000274'				.WORD	DFCSR		;
    145					.IF DF R$$20F
    146	000030	000000 				.WORD	0
    147					.ENDC
    148
    149	000032	   104 	   113 			.ASCII	/DK/		; DISK CARTRIDGE DRIVE RK
    150	000034	000000G				.WORD	$SETDK		;
    151	000036	000442'				.WORD	DKLLEN		;
    152	000040	000434'				.WORD	DKSA		;
    153	000042	000546'				.WORD	DKFUN		;
    154	000044	000422'				.WORD	$DKDRV		;
    155	000046	000105 				.WORD	<DKEND-$DKDRV>/2 ;
    156	000050	000003 				.WORD	3		;
    157	000052	000005 				.WORD	5		;
    158	000054	000000 				.WORD	0		;
    159	000056	000546'				.WORD	DKFUN		;
    160	000060	000424'				.WORD	DKCSR		;
    161					.IF DF R$$20F
    162	000062	000000 				.WORD	0
    163					.ENDC
    164
    165	000064	   104 	   120 			.ASCII	/DP/		; DISK PACK DRIVE RP
    166	000066	000000G				.WORD	$SETDP		;
    167	000070	000672'				.WORD	DPLLEN		;
    168	000072	000650'				.WORD	DPSA		;
    169	000074	000752'				.WORD	DPFUN		;
    170	000076	000636'				.WORD	$DPDRV		;
    171	000100	000067 				.WORD	<DPEND-$DPDRV>/2 ;
SPCDRV  -  RSX11M SAVE + BOOT D	MACRO M1108  16-JAN-78 19:40  PAGE 4-1
LOCAL DATA

    172	000102	000003 				.WORD	3		;
    173	000104	000005 				.WORD	5		;
    174	000106	000000 				.WORD	0		;
    175	000110	000752'				.WORD	DPFUN		;
    176	000112	000640'				.WORD	DPCSR		;
    177					.IF DF R$$20F
    178	000114	000000 				.WORD	0
    179					.ENDC
    180
    181	000116	   104 	   124 			.ASCII	/DT/		; DEC-TAPE TC
    182	000120	000000G				.WORD	$SETDT		;
    183	000122	001200'				.WORD	DTLLEN		;
    184	000124	001030'				.WORD	DTSA		;
    185	000126	001204'				.WORD	DTFUN		;
    186	000130	001016'				.WORD	$DTDRV		;
    187	000132	000137 				.WORD	<DTEND-$DTDRV>/2	;
    188	000134	000014 				.WORD	14		;
    189	000136	000004 				.WORD	4		;
    190	000140	000000 				.WORD	0		;
    191	000142	001204'				.WORD	DTFUN		;
    192	000144	001024'				.WORD	DTCSR		;
    193					.IF DF R$$20F
    194	000146	177340 				.WORD	177340
    195					.ENDC
    196
    197
    198	000150	   104 	   123 			.ASCII	/DS/		; RS03/RS04 FIXED HEAD DISK
    199	000152	000000G				.WORD	$SETDS		;
    200	000154	001320'				.WORD	DSLLEN		;
    201	000156	001334'				.WORD	DSSA		;
    202	000160	001442'				.WORD	DSFUN		;
    203	000162	001316'				.WORD	$DSDRV		;
    204	000164	000076 				.WORD	<DSEND-$DSDRV>/2	;
    205	000166	000061 				.WORD	61		;
    206	000170	000071 				.WORD	71		;
    207	000172	000000 				.WORD	0		;
    208	000174	001442'				.WORD	DSFUN		;
    209	000176	001324'				.WORD	DSCSR		;
    210					.IF DF R$$20F
    211	000200	000000 				.WORD	0
    212					.ENDC
    213
    214
    215	000202	   104 	   102 			.ASCII	/DB/		; RP04 DISK PACK DRIVE
    216	000204	000000G				.WORD	$SETDB		;
    217	000206	001516'				.WORD	DBLLEN		;
    218	000210	001532'				.WORD	DBSA		;
    219	000212	001660'				.WORD	DBFUN		;
    220	000214	001514'				.WORD	$DBDRV		;
    221	000216	000113 				.WORD	<DBEND-$DBDRV>/2 ;
    222	000220	000061 				.WORD	61		;
    223	000222	000071 				.WORD	71		;
    224	000224	000000 				.WORD	0		;
    225	000226	001660'				.WORD	DBFUN		;
    226	000230	001522'				.WORD	DBCSR		;
    227					.IF DF R$$20F
    228	000232	176700 				.WORD	176700
SPCDRV  -  RSX11M SAVE + BOOT D	MACRO M1108  16-JAN-78 19:40  PAGE 4-2
LOCAL DATA

    229					.ENDC
    230
    231
    232	000234	   104 	   130 			.ASCII	/DX/		;  RX01 FLOPPY DISK DRIVE
    233	000236	000000G				.WORD	$SETDX		;
    234	000240	001756'				.WORD	DXLLEN		;
    235	000242	001752'				.WORD	DXSA		;
    236	000244	002044'				.WORD	DXFUN		;
    237	000246	001744'				.WORD	$DXDRV		;
    238	000250	000216 				.WORD	<DXEND-$DXDRV>/2 ;
    239	000252	000005 				.WORD	5		;
    240	000254	000007 				.WORD	7		;
    241	000256	000000 				.WORD	0		;
    242	000260	002044'				.WORD	DXFUN		;
    243	000262	001746'				.WORD	DXCSR		;
    244					.IF DF R$$20F
    245	000264	177170 				.WORD	177170
    246					.ENDC
SPCDRV  -  RSX11M SAVE + BOOT D	MACRO M1108  16-JAN-78 19:40  PAGE 5
DF DRIVER

    248						.SBTTL	DF DRIVER
    249	000266	012700 			$DFDRV::MOV	(PC)+,R0	;;; GET LOAD LENGTH
    250	000270	000000 			DFLLEN:	.WORD	0		;;;
    251	000272	012705 				MOV	(PC)+,R5	;;; GET CSR ADDRESS
    252	000274	000000 			DFCSR:	.WORD	0		;;;
    253	000276	105065 	000000 			CLRB	RFDCS(R5)	;;; ZERO FUNCTION CODE
    254	000302	012765 	000000 	000004 		MOV	#0,RFCMA(R5)	;;; SET STARTING BUFFER ADDRESS
    255		000304'			DFSA	=	.-4		;;;
    256	000310	012765 	000000 	000006 		MOV	#0,RFDAR(R5)	;;; SET STARTING DISK ADDRESS
    257		000312'			$DFDAR	==	.-4		;;;
    258	000316	012765 	000000 	000010 		MOV	#0,RFDAE(R5)	;;; SET ADDRESS EXTENSION
    259		000320'			$DFDAE	==	.-4		;;;
    260					;
    261					; GET NEXT CHUNK OF DATA TO PROCESS
    262					;
    263	000324	162700 	000004 		DF1:	SUB	#BLKLEN,R0	;;; FULL BLOCK LEFT TO PROCESS?
    264	000330	100006 				BPL	10$		;;; YES
    265	000332	062700 	000004 			ADD	#BLKLEN,R0	;;; NO, COMPUTE RESIDUAL COUNT
    266	000336	003427 				BLE	DFEXIT		;;; DONE
    267	000340	010001 				MOV	R0,R1		;;; COPY BLOCKS TO READ
    268	000342	005000 				CLR	R0		;;; SET RESIDUAL COUNT TO ZERO
    269	000344	000402 				BR	20$		;;;
    270	000346	012701 	000004 		10$:	MOV	#BLKLEN,R1	;;; SET TO READ BLKLEN*256 WORDS
    271	000352	000301 			20$:	SWAB	R1		;;; MULTIPLY WORD COUNT BY 256
    272	000354	005401 				NEG	R1		;;; CONVERT TO TWOS COMPLEMENT
    273	000356	010165 	000002 			MOV	R1,RFWC(R5)	;;; SET WORD COUNT REGISTER
    274					;
    275					; START I/O
    276					;
    277	000362	152765 	000000 	000000 		BISB	#0,RFDCS(R5)	;;; SET FUNCTION CODE
    278		000364'			DFFUN	=	.-4		;;;
    279	000370	105765 	000000 		30$:	TSTB	RFDCS(R5)	;;; DONE?
    280	000374	100375 				BPL	30$		;;; NO, WAIT
    281	000376	105765 	000001 			TSTB	RFDCS+1(R5)	;;; ANY ERRORS?
    282	000402	100350 				BPL	DF1		;;; NO
    283	000404	032765 	002000 	000010 		BIT	#2000,RFDAE(R5)	;;; YES, NON-EXISTANT MEMORY?
    284	000412	001001 				BNE	DFEXIT		;;; YES
    285	000414	000724 				BR	$DFDRV		;;; NO, ERROR, RETRY IT
    286	000416	005004 			DFEXIT:	CLR	R4		;;; ZERO UNIT NUMBER
    287	000420				DFEND:	RETURN			;;; DRIVER END
SPCDRV  -  RSX11M SAVE + BOOT D	MACRO M1108  16-JAN-78 19:40  PAGE 6
DK DRIVER

    289						.SBTTL	DK DRIVER
    290	000422	012705 			$DKDRV::MOV	(PC)+,R5	;;; GET CSR ADDRESS
    291	000424	000000 			DKCSR:	.WORD	0		;;;
    292	000426	105065 	000000 			CLRB	RKCS(R5)	;;; ZERO FUNCTION CODE
    293	000432	012765 	000000 	000004 		MOV	#0,RKBA(R5)	;;; SET BUFFER ADDRESS
    294		000434'			DKSA	=	.-4		;;;
    295	000440	012700 				MOV	(PC)+,R0	;;; GET LOAD LENGTH
    296	000442	000000 			DKLLEN: .WORD	0		;;;
    297	000444	126727 	000077 	177777 		CMPB	DKFUN+1,#-1	;;; UNIT SPECIFIED?
    298	000452	001407 				BEQ	DK2		;;; NO
    299	000454	156767 	000067 	000021 		BISB	DKFUN+1,$DKDAR+1 ;;; YES SET UNIT SELECT FIELD
    300	000462	016765 	000014 	000006 		MOV	$DKDAR,RKDA(R5)	;;; AND SET DISK ADDRESS
    301	000470	000406 				BR	DK1		;;;
    302	000472	042765 	017777 	000006 	DK2:	BIC	#17777,RKDA(R5)	;;; CLEAR OLD DISK ADDRESS
    303	000500	052765 	000000 	000006 		BIS	#0,RKDA(R5)	;;; SET STARTING DISK ADDRESS, USE CURRENT UNIT
    304		000502'			$DKDAR	==	.-4		;;;
    305					;
    306					; GET NEXT CHUNK OF DATA TO PROCESS
    307					;
    308	000506	162700 	000004 		DK1:	SUB	#BLKLEN,R0	;;; FULL BLOCK LEFT ?
    309	000512	100006 				BPL	10$		;;; YES
    310	000514	062700 	000004 			ADD	#BLKLEN,R0	;;; NO, COMPUTE RESIDUAL COUNT
    311	000520	003427 				BLE	DKEXIT		;;; DONE
    312	000522	010001 				MOV	R0,R1		;;; COPY COUNT
    313	000524	005000 				CLR	R0		;;; ZERO RESIDUAL COUNT
    314	000526	000402 				BR	20$		;;;
    315	000530	012701 	000004 		10$:	MOV	#BLKLEN,R1	;;; SET TO READ BLKLEN*256. WORDS
    316	000534	000301 			20$:	SWAB	R1		;;; MULTIPLY SECTOR COUNT BY 256 WORDS
    317	000536	005401 				NEG	R1		;;; SET TWOS COMPLEMENT OF COUNT
    318					;
    319					; START I/O
    320					;
    321	000540	010165 	000002 			MOV	R1,RKWC(R5)	;;; SET WORD COUNT
    322	000544	152765 	000000 	000000 		BISB	#0,RKCS(R5)	;;; SET FUNCTION
    323		000546'			DKFUN	=	.-4		;;;
    324	000552	105765 	000000 		30$:	TSTB	RKCS(R5)	;;; DONE?
    325	000556	100375 				BPL	30$		;;; NO, WAIT
    326	000560	105765 	000001 			TSTB	RKCS+1(R5)	;;; ANY ERRORS?
    327	000564	100350 				BPL	DK1		;;; NO
    328	000566	032765 	002000 	177776 		BIT	#2000,RKER(R5)	;;; YES, NON-EXISTANT MEMORY?
    329	000574	001001 				BNE	DKEXIT		;;; YES
    330	000576	000711 				BR	$DKDRV		;;; NO, ERROR, RETRY IT
    331	000600	016504 	000006 		DKEXIT:	MOV	RKDA(R5),R4	;;; GET DISK ADDRESS
    332	000604	012765 	000001 	000000 		MOV	#1,RKCS(R5)	;;; CLEAR CONTROLLER
    333	000612	000241 				CLC			;;; ZERO CARRY BIT
    334	000614	042704 	017777 			BIC	#17777,R4	;;; CLEAR ALL BUT DRIVE SELECT
    335	000620	010465 	000006 			MOV	R4,RKDA(R5)	;;; RESTORE DRIVE SELECT
    336	000624	006104 				ROL	R4		;;; SHIFT
    337	000626	006104 				ROL	R4		;;; IT
    338	000630	006104 				ROL	R4		;;; DOWN
    339	000632	006104 				ROL	R4		;;;
    340	000634				DKEND:	RETURN			;;; END OF DRIVER
SPCDRV  -  RSX11M SAVE + BOOT D	MACRO M1108  16-JAN-78 19:40  PAGE 7
DP DRIVER

    342						.SBTTL	DP DRIVER
    343	000636	012705 			$DPDRV::MOV	(PC)+,R5	;;; GET CSR ADDRESS
    344	000640	000000 			DPCSR:	.WORD	0		;;;
    345	000642	105065 	000000 			CLRB	RPCS(R5)	;;; ZERO FUNCTION CODE
    346	000646	012765 	000000 	000004 		MOV	#0,RPBA(R5)	;;; SET STARTING BUFFER ADDRESS
    347		000650'			DPSA	=	.-4		;;;
    348	000654	012765 	000000 	000010 		MOV	#0,RPDA(R5)	;;; SET DISK ADDRESS
    349		000656'			$DPDA	==	.-4		;;;
    350	000662	012765 	000000 	000006 		MOV	#0,RPCA(R5)	;;; SET CYLINDER ADDRESS
    351		000664'			$DPCA	==	.-4		;;;
    352	000670	012700 				MOV	(PC)+,R0	;;; GET LOAD LENGTH
    353	000672	000000 			DPLLEN: .WORD	0		;;;
    354	000674	126727 	000053 	177777 		CMPB	DPFUN+1,#-1	;;; UNIT SPECIFIED?
    355	000702	001403 				BEQ	DP1		;;; NO, USE CURRENT UNIT
    356	000704	116765 	000043 	000001 		MOVB	DPFUN+1,RPCS+1(R5) ;;; YES, THEN SET IT
    357					;
    358					; GET NEXT CHUNK OF DATA TO PROCESS
    359					;
    360	000712	162700 	000004 		DP1:	SUB	#BLKLEN,R0	;;; FULL BLOCK LEFT TO PROCESS?
    361	000716	100006 				BPL	10$		;;; YES
    362	000720	062700 	000004 			ADD	#BLKLEN,R0	;;; NO, COMPUTE RESIDUAL COUNT
    363	000724	003427 				BLE	DPEXIT		;;; DONE
    364	000726	010001 				MOV	R0,R1		;;; COPY COUNT
    365	000730	005000 				CLR	R0		;;; ZERO RESIDUAL COUNT
    366	000732	000402 				BR	20$		;;;
    367	000734	012701 	000004 		10$:	MOV	#BLKLEN,R1	;;; SET TO READ BLKLEN*256.
    368	000740	000301 			20$:	SWAB	R1		;;; CONVERT SECTORS TO WORDS
    369	000742	005401 				NEG	R1		;;; TO TWOS COMPLEMENT OF WORD COUNT
    370					;
    371					; START I/O
    372					;
    373	000744	010165 	000002 			MOV	R1,RPWC(R5)	;;; SET WORD COUNT
    374	000750	152765 	000000 	000000 		BISB	#0,RPCS(R5)	;;; SET FUNCTION AND GO BIT
    375		000752'			DPFUN	=	.-4		;;;
    376	000756	105765 	000000 		30$:	TSTB	RPCS(R5)	;;; DONE?
    377	000762	100375 				BPL	30$		;;; NO, WAIT
    378	000764	105765 	000001 			TSTB	RPCS+1(R5)	;;; YES, ANY ERRORS?
    379	000770	100350 				BPL	DP1		;;; NO
    380	000772	032765 	000004 	177776 		BIT	#4,RPER(R5)	;;; YES, IS IT NON-EXISTANT MEMORY?
    381	001000	001001 				BNE	DPEXIT		;;; YES
    382	001002	000715 				BR	$DPDRV		;;; NO, ERROR, RETRY IT
    383	001004	116504 	000001 		DPEXIT:	MOVB	RPCS+1(R5),R4	;;; GET DRIVE SELECT FIELD
    384	001010	042704 	177770 			BIC	#177770,R4	;;; CLEAR OFF OTHER BITS
    385	001014				DPEND:	RETURN			;;; END OF DRIVER
SPCDRV  -  RSX11M SAVE + BOOT D	MACRO M1108  16-JAN-78 19:40  PAGE 8
DEC-TAPE DRIVER

    387						.SBTTL	DEC-TAPE DRIVER
    388	001016	012701 			$DTDRV::MOV	(PC)+,R1	;;; GET BLOCK NUMBER
    389	001020	000000 			$DTBLK::.WORD	0		;;;
    390	001022	012705 				MOV	(PC)+,R5	;;; GET CSR ADDRESS
    391	001024	000000 			DTCSR:	.WORD	0		;;;
    392	001026	012765 	000000 	000004 		MOV	#0,TCBA(R5)	;;; SET STARTING BUFFER ADDRESS
    393		001030'			DTSA	=	.-4		;;;
    394	001034	126727 	000145 	177777 		CMPB	DTFUN+1,#-1	;;; UNIT SPECIFIED?
    395	001042	001403 				BEQ	DTSRC		;;; NO, USE CURRENT UNIT
    396	001044	116765 	000135 	000001 		MOVB	DTFUN+1,TCCM+1(R5) ;;; YES, THEN SET IT
    397					;
    398					; SEARCH FOR CORRECT BLOCK
    399					;
    400	001052	010100 			DTSRC:	MOV	R1,R0		;;; COPY IT
    401	001054	162700 	000003 			SUB	#3,R0		;;; POINT TO 3 BLOCKS BEFORE
    402	001060	052765 	004000 	000000 		BIS	#4000,TCCM(R5)	;;; SET REVERSE MODE
    403	001066	112765 	000003 	000000 		MOVB	#3,TCCM(R5)	;;; SET BLOCK SEARCH FUNCTION
    404	001074	105765 	000000 		10$:	TSTB	TCCM(R5)	;;; READY?
    405	001100	100375 				BPL	10$		;;; NO, WAIT
    406	001102	105765 	000001 			TSTB	TCCM+1(R5)	;;; ERROR?
    407	001106	100010 				BPL	DTCMP		;;; NO
    408	001110	005765 	177776 		DTERR:	TST	TCST(R5)	;;; YES, END ZONE?
    409	001114	100340 				BPL	$DTDRV		;;; NO, ERROR, RETRY IT
    410	001116	032765 	004000 	000000 	10$:	BIT	#4000,TCCM(R5)	;;; GOING IN REVERSE DIRECTION?
    411	001124	001752 				BEQ	DTSRC		;;; NO, THEN WE HAVE TO SEARCH BACKWARD
    412	001126	000403 				BR	DTFWD		;;; YES, THEN GO FORWARD
    413	001130	166500 	000006 		DTCMP:	SUB	TCDT(R5),R0	;;; GOING IN RIGHT DIRECTION?
    414	001134	002746 				BLT	DTSRC		;;; YES, CONTINUE
    415	001136	010100 			DTFWD:	MOV	R1,R0		;;; NO, GO FORWARD
    416	001140	042765 	004000 	000000 		BIC	#4000,TCCM(R5)	;;; CLEAR REVERSE BIT
    417	001146	112765 	000003 	000000 		MOVB	#3,TCCM(R5)	;;; SEARCH FORWARD
    418	001154	032765 	100200 	000000 	10$:	BIT	#100200,TCCM(R5) ;;; READY?
    419	001162	100752 				BMI	DTERR		;;; YES AND WITH ERROR
    420	001164	001773 				BEQ	10$		;;; NO, WAIT
    421	001166	166500 	000006 			SUB	TCDT(R5),R0	;;; AT BLOCK WE WANT?
    422	001172	003361 				BGT	DTFWD		;;; NOT YET
    423	001174	002726 				BLT	DTSRC		;;; WHOOPS, WE PASSED IT
    424	001176	012700 				MOV	(PC)+,R0	;;; GET LENGTH
    425	001200	000000 			DTLLEN: .WORD	0		;;;
    426	001202	112765 	000000 	000000 		MOVB	#0,TCCM(R5)	;;; SET FUNCTION CODE (NO GO BIT)
    427		001204'			DTFUN	=	.-4		;;;
    428					;
    429					; GET NEXT CHUNK OF DATA TO PROCESS
    430					;
    431	001210	162700 	000004 		DT1:	SUB	#BLKLEN,R0	;;; FULL BLOCK LEFT?
    432	001214	100006 				BPL	10$		;;; YES
    433	001216	062700 	000004 			ADD	#BLKLEN,R0	;;; NO, COMPUTE RESIDUAL COUNT
    434	001222	003425 				BLE	DTEXIT		;;; DONE IF ZERO
    435	001224	010001 				MOV	R0,R1		;;; COPY COUNT
    436	001226	005000 				CLR	R0		;;; ZERO RESIDUAL COUNT
    437	001230	000402 				BR	20$		;;;
    438	001232	012701 	000004 		10$:	MOV	#BLKLEN,R1	;;; SET BLOCK COUNT
    439	001236	000301 			20$:	SWAB	R1		;;; CONVERT TO WORD COUNT
    440	001240	005401 				NEG	R1		;;; SET TO TWOS COMPLEMENT WORD COUNT
    441					;
    442					; START I/O
    443					;
SPCDRV  -  RSX11M SAVE + BOOT D	MACRO M1108  16-JAN-78 19:40  PAGE 8-1
DEC-TAPE DRIVER

    444	001242	010165 	000002 			MOV	R1,TCWC(R5)	;;; SET WORD COUNT
    445	001246	105265 	000000 			INCB	TCCM(R5)	;;; SET GO BIT
    446	001252	105765 	000000 		30$:	TSTB	TCCM(R5)	;;; DONE?
    447	001256	100375 				BPL	30$		;;; NO, WAIT
    448	001260	105765 	000001 			TSTB	TCCM+1(R5)	;;; ANY ERRORS
    449	001264	100351 				BPL	DT1		;;; NO, PROCESS ON!
    450	001266	032765 	000400 	177776 		BIT	#400,TCST(R5)	;;; YES, NON-EXISTANT MEMORY?
    451	001274	001650 				BEQ	$DTDRV		;;; NO, ERROR, RETRY IT
    452	001276	116504 	000001 		DTEXIT:	MOVB	TCCM+1(R5),R4	;;; GET DRIVE SELECT
    453	001302	042704 	177770 			BIC	#177770,R4	;;; CLEAR ALL OTHER BITS
    454	001306	112765 	000011 	000000 		MOVB	#11,TCCM(R5)	;;; STOP TAPE MOTION
    455	001314				DTEND:	RETURN			;;; END OF DRIVER
SPCDRV  -  RSX11M SAVE + BOOT D	MACRO M1108  16-JAN-78 19:40  PAGE 9
DS DRIVER

    457						.SBTTL	DS DRIVER
    458	001316	012700 			$DSDRV::MOV	(PC)+,R0	;;; GET LOAD LENGTH
    459	001320	000000 			DSLLEN:	.WORD	0		;;;
    460	001322	012705 				MOV	(PC)+,R5	;;; GET CSR ADDRESS
    461	001324	000000 			DSCSR:	.WORD	0		;;;
    462	001326	005065 	000000 			CLR	RSCS1(R5)	;;; ZERO FUNCTION CODE AND MEM EXTEN
    463	001332	012765 	000000 	000004 		MOV	#0,RSBA(R5)	;;; SET STARTING BUFFER ADDRESS
    464		001334'			DSSA	=	.-4		;;;
    465	001340	126727 	000077 	177777 		CMPB	DSFUN+1,#-1	;;; UNIT SPECIFIED?
    466	001346	001403 				BEQ	10$		;;; NO , USE CURRENT ONE
    467	001350	116765 	000067 	000010 		MOVB	DSFUN+1,RSCS2(R5) ;;; YES, SET UNIT SELECT
    468	001356	012701 			10$:	MOV	(PC)+,R1	;;; GET DISK ADDRESS
    469	001360	000000 			$DSDA::	.WORD	0		;;;
    470	001362	032765 	000002 	000026 		BIT	#2,RSDT(R5)	;;; IS THIS AN RS04?
    471	001370	001001 				BNE	20$		;;; YES
    472	001372	006301 				ASL	R1		;;; NO, 64 WORDS/SECTOR; DOUBLE IT
    473	001374	006301 			20$:	ASL	R1		;;; 128 WORDS PER SECTOR DOUBLE TO 256
    474	001376	010165 	000006 			MOV	R1,RSDA(R5)	;;; SET TRACK SECTOR ADDRESS
    475					;
    476					; GET NEXT BLOCK OF DATA TO PROCESS
    477					;
    478	001402	162700 	000004 		DS1:	SUB	#BLKLEN,R0	;;; FULL BLOCK LEFT?
    479	001406	100006 				BPL	10$		;;; YES
    480	001410	062700 	000004 			ADD	#BLKLEN,R0	;;; NO, GET RESIDUAL COUNT
    481	001414	003432 				BLE	DSEXIT		;;; DONE IF ZERO
    482	001416	010001 				MOV	R0,R1		;;; COPY COUNT
    483	001420	005000 				CLR	R0		;;; ZERO RESIDUAL COUNT
    484	001422	000402 				BR	20$		;;;
    485	001424	012701 	000004 		10$:	MOV	#BLKLEN,R1	;;; SET TO READ BLKLEN*256.
    486	001430	000301 			20$:	SWAB	R1		;;; CONVERT LOGICAL SECTORS TO WORDS
    487	001432	005401 				NEG	R1		;;;
    488					;
    489					; START I/O
    490					;
    491	001434	010165 	000002 			MOV	R1,RSWC(R5)	;;; SET WORD COUNT
    492	001440	152765 	000000 	000000 		BISB	#0,RSCS1(R5)	;;; SET FUNCTION CODE
    493		001442'			DSFUN	=	.-4		;;;
    494	001446	105765 	000000 		30$:	TSTB	RSCS1(R5)	;;; DONE?
    495	001452	100375 				BPL	30$		;;; NO, LOOP UNTIL IT IS
    496	001454	105765 	000001 			TSTB	RSCS1+1(R5)	;;; ANY ERRORS?
    497	001460	100350 				BPL	DS1		;;; NO
    498	001462	032765 	004000 	000010 		BIT	#4000,RSCS2(R5)	;;; NON-EXISTANT MEMORY?
    499	001470	001004 				BNE	DSEXIT		;;; YES, STOP READING
    500	001472	112765 	000011 	000000 		MOVB	#11,RSCS1(R5)	;;; NO, CLEAR DRIVE
    501	001500	000706 				BR	$DSDRV		;;; TRY AGAIN
    502	001502	116504 	000010 		DSEXIT:	MOVB	RSCS2(R5),R4	;;; GET UNIT NUMBER
    503	001506	042704 	177770 			BIC	#177770,R4	;;; CLEAR ALL BUT UNIT NUMBER
    504	001512				DSEND:	RETURN			;;;
SPCDRV  -  RSX11M SAVE + BOOT D	MACRO M1108  16-JAN-78 19:40  PAGE 10
RP04 DRIVER

    506						.SBTTL	RP04 DRIVER
    507	001514	012700 			$DBDRV::MOV	(PC)+,R0	;;; GET LOAD LENGTH
    508	001516	000000 			DBLLEN:.WORD	0		;;;
    509	001520	012705 				MOV	(PC)+,R5	;;; GET CSR ADDRESS
    510	001522	000000 			DBCSR:	.WORD	0		;;;
    511	001524	005065 	000000 			CLR	RJPCS1(R5)	;;; ZERO FUNCTION CODE AND MEM EXTEN BITS
    512	001530	012765 	000000 	000004 		MOV	#0,RJPBA(R5)	;;; SET STARTING BUFFER ADDRESS
    513		001532'			DBSA	=	.-4		;;;
    514	001536	126727 	000117 	177777 		CMPB	DBFUN+1,#-1	;;; UNIT SPECIFIED?
    515	001544	001403 				BEQ	10$		;;; NO, USE CURRENT ONE
    516	001546	116765 	000107 	000010 		MOVB	DBFUN+1,RJPCS2(R5) ;;; SET UNIT SELECT FIELD
    517	001554	012765 	000023 	000000 	10$:	MOV	#23,RJPCS1(R5)	;;; ISSUE PACK ACKNOWLEDGE FUNCTION
    518	001562	012765 	000000 	000006 		MOV	#0,RJPDA(R5)	;;; SET SECTOR/TRACK ADDRESS
    519		001564'			$DBDA	==	.-4		;;;
    520	001570	012765 	000000 	000034 		MOV	#0,RJPDC(R5)	;;; SET CYLINDER ADDRESS
    521		001572'			$DBCA	==	.-4		;;;
    522					.IF DF R$$20F
    523	001576	052765 	004000 	000032 		BIS	#4000,RJPOF(R5)	;;; SET INHIBIT ECC
    524					.IFF
    525						BIS	#14000,RJPOF(R5) ;;; SET 16 BIT MODE, INHIBIT ECC
    526					.ENDC ; .IF DF R$$20F
    527	001604	016501 	000012 			MOV	RJPDS(R5),R1	;;; GET DRIVE STATUS
    528	001610	005101 				COM	R1		;;; COMPLEMENT BITS
    529	001612	032701 	010300 			BIT	#10300,R1	;;; MEDIUM ON-LINE,READY, AND VOLUME VALID
    530	001616	001041 				BNE	DBCLR		;;; NO, ERROR
    531					;
    532					; GET NEXT BLOCK OF DATA TO PROCESS
    533					;
    534	001620	162700 	000004 		DB1:	SUB	#BLKLEN,R0	;;; FULL BLOCK LEFT?
    535	001624	100006 				BPL	10$		;;; YES
    536	001626	062700 	000004 			ADD	#BLKLEN,R0	;;; NO, GET RESIDUAL COUNT
    537	001632	003437 				BLE	DBEXIT		;;; DONE IF ZERO
    538	001634	010001 				MOV	R0,R1		;;; COPY COUNT
    539	001636	005000 				CLR	R0		;;; ZERO RESIDUAL COUNT
    540	001640	000402 				BR	20$		;;;
    541	001642	012701 	000004 		10$:	MOV	#BLKLEN,R1	;;; SET TO READ BLKLEN*256.
    542	001646	000301 			20$:	SWAB	R1		;;; CONVERT SECTORS  TO WORDS
    543	001650	005401 				NEG	R1		;;;
    544					;
    545					; START I/O
    546					;
    547	001652	010165 	000002 			MOV	R1,RJPWC(R5)	;;; SET WORD COUNT
    548	001656	112765 	000000 	000000 		MOVB	#0,RJPCS1(R5)	;;; SET FUNCTION CODE
    549		001660'			DBFUN	=	.-4		;;;
    550	001664	105765 	000000 		30$:	TSTB	RJPCS1(R5)	;;; DONE?
    551	001670	100375 				BPL	30$		;;; NO, LOOP UNTIL IT IS
    552	001672	032765 	060000 	000000 		BIT	#60000,RJPCS1(R5) ;;; TRANSFER ERROR OR MASSBUSS CONTROL PARITY  ERROR?
    553	001700	001004 				BNE	40$		;;; YES-- CHECK ERROR OUT
    554	001702	032765 	140000 	000012 		BIT	#140000,RJPDS(R5) ;;; ATTENTION OR ERROR?
    555	001710	001743 				BEQ	DB1		;;; NO-- CONTINUE TRANSFER
    556	001712	032765 	004000 	000010 	40$:	BIT	#4000,RJPCS2(R5) ;;; YES, IS IT NON-EXISTENT MEMORY?
    557	001720	001004 				BNE	DBEXIT		;;;
    558	001722	112765 	000011 	000000 	DBCLR:	MOVB	#11,RJPCS1(R5)	;;; ISSUE DRIVE CLEAR
    559	001730	000671 				BR	$DBDRV		;;; TRY AGAIN
    560	001732	116504 	000010 		DBEXIT:	MOVB	RJPCS2(R5),R4	;;; GET UNIT SELECT FIELD
    561	001736	042704 	177770 			BIC	#177770,R4	;;; CLEAR HIGH BITS
    562	001742				DBEND:	RETURN			;;;
SPCDRV  -  RSX11M SAVE + BOOT D	MACRO M1108  16-JAN-78 19:40  PAGE 11
RX01 DRIVER

    564						.SBTTL	RX01 DRIVER
    565	001744	012705 			$DXDRV:: MOV	(PC)+,R5	;;; GET CSR ADDRESS
    566	001746	000000 			DXCSR:	.WORD	0		;;;
    567	001750	012704 				MOV	(PC)+,R4	;;; GET BUFFER ADDRESS
    568	001752	000000 			DXSA:	.WORD	0		;;;
    569	001754	012703 				MOV	(PC)+,R3	;;; GET LOAD LENGTH IN LOGICAL BLOCKS
    570	001756	000000 			DXLLEN:	.WORD	0		;;;
    571
    572						.IF	DF M$$MGE
    573
    574						CLC			;;; CLEAR CARRY
    575						ROL	R4		;;; CONVERT BASE ADDRESS
    576						ROL	R4		;;; TO 32 WORD BLOCK ADDRESS
    577						SWAB	R4		;;;
    578						MOV	R4,@#KISAR6	;;; SET UP MAPPING REGISTER
    579
    580						.ENDC
    581
    582	001760	006303 				ASL	R3		;;; CONVERT TO LENGTH
    583	001762	006303 				ASL	R3		;;; LOGICAL SECTORS
    584	001764	126727 	000055 	177777 		CMPB	DXFUN+1,#-1	;;; UNIT SPECIFIED?
    585	001772	001002 				BNE	DX2		;;; YES
    586	001774	110067 	000045 			MOVB	R0,DXFUN+1	;;; NO, SET IT
    587	002000	042767 	000020 	000036 	DX2:	BIC	#20,DXFUN	;;; DEFAULT TO UNIT ZERO
    588	002006	105767 	000033 			TSTB	DXFUN+1		;;; UNIT 0?
    589	002012	001403 				BEQ	10$		;;; YES
    590	002014	052767 	000020 	000022 		BIS	#20,DXFUN	;;; NO, SELECT UNIT 1
    591	002022	026727 	000076 	000003 	10$:	CMP	$DXSLO,#3	;;; READING FROM DISK?
    592	002030	001033 				BNE	DXSILO		;;; NO, FILL SILO BEFORE WRITING
    593	002032	012701 			DXLOOP:	MOV	(PC)+,R1	;;; GET LOGICAL SECTOR NUMBER
    594					;
    595					; PERFORM SILO/DISK TRANSFER
    596					;
    597	002034	000000 			$DXBLK:: .WORD	0		;;;
    598	002036					CALL	$TRKSC		;;; CONVERT LOGICAL SECTOR TO TRACK/SECTOR
    599	002042	112715 				MOVB	(PC)+,(R5)	;;; START FUNCTION
    600	002044	000000 			DXFUN:	.WORD	0		;;;
    601	002046					CALL	TRWAIT		;;; WAIT
    602	002052	103734 				BCS	$DXDRV		;;; ERROR
    603	002054	110165 	000002 			MOVB	R1,2(R5)	;;; SET SECTOR
    604	002060					CALL	TRWAIT		;;; WAIT
    605	002064	103727 				BCS	$DXDRV		;;; ERROR
    606	002066	110065 	000002 			MOVB	R0,2(R5)	;;; SET TRACK
    607	002072					CALL	TRWAIT		;;; WAIT
    608	002076	103322 				BCC	$DXDRV		;;; ERROR
    609	002100	005267 	177730 			INC	$DXBLK		;;; UPDATE LOGICAL SECTOR NUMBER
    610	002104	026727 	000014 	000003 		CMP	$DXSLO,#3	;;; READING FROM DISK?
    611	002112	001402 				BEQ	DXSILO		;;; YES
    612	002114	005303 				DEC	R3		;;; NO, ALL BLOCKS PROCESSED?
    613	002116	003446 				BLE	DXNXM		;;; YES
    614					;
    615					; PERFORM SILO/MEMORY TRANSFER
    616					;
    617						.ENABL	LSB
    618	002120	010502 			DXSILO:	MOV	R5,R2		;;; COPY CSR ADDRESS
    619	002122	012722 				MOV	(PC)+,(R2)+	;;; SET EMPTY/FILL SILO
    620	002124	000000 			$DXSLO:: .WORD	0		;;;
SPCDRV  -  RSX11M SAVE + BOOT D	MACRO M1108  16-JAN-78 19:40  PAGE 11-1
RX01 DRIVER

    621	002126	012700 	000200 			MOV	#128.,R0	;;; SET COUNT OF BYTES IN SILO
    622
    623						.IF	DF M$$MGE
    624
    625						MOV	#140000,R4	;;; SET BASE ADDRESS OF BUFFER TO USE APR6
    626
    627						.ENDC
    628
    629	002132	132715 	000240 		10$:	BITB	#240,(R5)	;;; DONE?
    630	002136	100402 				BMI	$DXMOV		;;; YES
    631	002140	001774 				BEQ	10$		;;; NO
    632	002142	000403 				BR	DXEF		;;; YES, SILO EMPTY
    633	002144	111224 			$DXMOV:: MOVB	(R2),(R4)+	;;; MOVE NEXT BYTE
    634	002146	005300 				DEC	R0		;;; DONE?
    635	002150	000770 				BR	10$		;;; LOOP
    636	002152	005700 			DXEF:	TST	R0		;;; ALL BYTES IN SILO TRANSFERRED?
    637	002154	001273 				BNE	$DXDRV		;;; NO, ERROR
    638
    639						.IF	DF M$$MGE
    640
    641						ADD	#2,@#KISAR6	;;; UPDATE BUFFER POINTER
    642
    643						.ENDC
    644
    645	002156	005767 	000120 			TST	TRPFLG		;;; IS NXM TRAP SET UP?
    646	002162	001016 				BNE	15$		;;; YES
    647	002164	010700 				MOV	PC,R0		;;; NO, GET ADDRESS OF TRAP ROUTINE
    648	002166	062700 	000110 			ADD	#DXTRP4-.,R0	;;;
    649	002172	013746 	000004 			MOV	@#4,-(SP)	;;; SAVE CURRENT TRAP ADDRESS
    650	002176	010037 	000004 			MOV	R0,@#4		;;; SET UP TRAP ADDRESS
    651	002202	013746 	000006 			MOV	@#6,-(SP)	;;; SAVE PS
    652	002206	012737 	000340 	000006 		MOV	#340,@#6	;;; SET NEW PS
    653	002214	005267 	000062 			INC	TRPFLG		;;; SET NXM SET UP
    654	002220	026727 	177700 	000003 	15$:	CMP	$DXSLO,#3	;;; READING FROM DISK?
    655	002226	001301 				BNE	DXLOOP		;;; NO MUST WRITE SILO OUT
    656	002230	005303 				DEC	R3		;;; ALL SECTORS READ?
    657	002232	003277 				BGT	DXLOOP		;;; NO
    658	002234	010300 			DXNXM:	MOV	R3,R0		;;; GET NUMBER OF SECTORS LEFT TO READ
    659	002236	006200 				ASR	R0		;;; CONVERT TO LOGICAL BLOCKS
    660	002240	006200 				ASR	R0		;;;
    661	002242	116704 	177577 			MOVB	DXFUN+1,R4	;;; GET UNIT NUMBER
    662	002246	012637 	000006 			MOV	(SP)+,@#6	;;; RESET LOW CORE
    663	002252	012637 	000004 			MOV	(SP)+,@#4	;;; TRAP VECTOR
    664	002256	000450 				BR	DXEND		;;; DONE
    665						.DSABL	LSB
    666					;
    667					; WAIT FOR DISK TO SHOW READY
    668					;
    669	002260	000241 			TRWAIT:	CLC			;;; DEFAULT TO TR READY
    670	002262	132715 	000240 		10$:	BITB	#240,(R5)	;;; DONE?
    671	002266	100402 				BMI	20$		;;; YES
    672	002270	001774 				BEQ	10$		;;; NO, LOOP
    673	002272	000261 				SEC			;;; YES
    674	002274				20$:	RETURN			;;;
    675					;
    676					; PROCESS NON-EXISTANT MEMORY TRAP (STOP READING OR WRITING)
    677					;
SPCDRV  -  RSX11M SAVE + BOOT D	MACRO M1108  16-JAN-78 19:40  PAGE 11-2
RX01 DRIVER

    678	002276	022626 			DXTRP4:	CMP	(SP)+,(SP)+	;;; CLEAR STACK
    679	002300	000755 				BR	DXNXM		;;;
    680	002302	000000 			TRPFLG:	.WORD	0		;;; TRAP FLAG, 0=NOT SET UP, 1=SET UP
    681					;
    682					; CONVERT LOGICAL SECTOR NUMBER TO PHYSICAL TRACK/SECTOR PAIR
    683					; INPUT:
    684					;	R1 - LOGICAL SECTOR
    685					; OUTPUT:
    686					;	R0 - TRACK
    687					;	R1 - SECTOR
    688					;
    689	002304	012700 	000010 		$TRKSC:: MOV	#8.,R0		;;; SET COUNT
    690	002310	012702 	006400 			MOV	#6400,R2	;;; AND DIVISOR
    691	002314	020201 			30$:	CMP	R2,R1		;;; DOES 26. GO INTO DIVIDEND?
    692	002316	101002 				BHI	40$		;;; BRANCH IF NOT, C CLEAR
    693	002320	160201 				SUB	R2,R1		;;; SUBTRACT 26. FROM DIVIDEND
    694	002322	000261 				SEC			;;;
    695	002324	006101 			40$:	ROL	R1		;;; SHIFT DIVIDEND AND QUOTIENT
    696	002326	005300 				DEC	R0		;;; DONE?
    697	002330	003371 				BGT	30$		;;; NO, LOOP
    698	002332	110100 				MOVB	R1,R0		;;; GET TRACK
    699	002334	105001 				CLRB	R1		;;; CLEAR TRACK
    700	002336	000301 				SWAB	R1		;;; SHIFT DOWN SECTOR
    701	002340	022701 	000014 			CMP	#12.,R1		;;; C=1 IF 13<=R1<=25
    702	002344	006101 				ROL	R1		;;; DOUBLE FOR INTERLEAVE FACTOR
    703	002346	006300 				ASL	R0		;;; ADD TRACK - TRACK SKEW
    704	002350	060001 				ADD	R0,R1		;;; SKEW BY 2*TRACK
    705	002352	060001 				ADD	R0,R1		;;; SKEW BY 4*TRACK
    706	002354	060001 				ADD	R0,R1		;;; SKEW BY 6*TRACK
    707	002356	006200 				ASR	R0		;;; RESTORE TRACK NUMBER
    708	002360	012702 	000032 			MOV	#26.,R2		;;; SET MODULUS
    709	002364	160201 			50$:	SUB	R2,R1		;;; MODULO SECTOR INTO RANGE -26. TO -1
    710	002366	002376 				BGE	50$		;;; LOOP TILL REMAINDER GOES NEGATIVE
    711	002370	060201 				ADD	R2,R1		;;; CONVERT TO RANGE 0 - 25.
    712	002372	005200 				INC	R0		;;; BUMP TRACK TO SKIP TRACK ZERO
    713	002374	005201 				INC	R1		;;; AND SECTOR TO RANGE 1 - 26.
    714	002376					RETURN			;;;
    715	002400				DXEND:	RETURN			;;;
    716		000001 				.END
SPCDRV  -  RSX11M SAVE + BOOT D	MACRO M1108  16-JAN-78 19:40  PAGE 11-3
SYMBOL TABLE

BLKLEN= 000004   	DPFUN = 000752R  	DXLOOP  002032R  	RPCA  = 000006   	$DFDAE= 000320RG
DBCLR   001722R  	DPLLEN  000672R  	DXNXM   002234R  	RPCS  = 000000   	$DFDAR= 000312RG
DBCSR   001522R  	DPSA  = 000650R  	DXSA    001752R  	RPDA  = 000010   	$DFDRV  000266RG
DBEND   001742R  	DP1     000712R  	DXSILO  002120R  	RPDS  = 177774   	$DKDAR= 000502RG
DBEXIT  001732R  	DSCSR   001324R  	DXTRP4  002276R  	RPER  = 177776   	$DKDRV  000422RG
DBFUN = 001660R  	DSEND   001512R  	DX2     002000R  	RPWC  = 000002   	$DPCA = 000664RG
DBLLEN  001516R  	DSEXIT  001502R  	RFCMA = 000004   	RSAS  = 000016   	$DPDA = 000656RG
DBSA  = 001532R  	DSFUN = 001442R  	RFDAE = 000010   	RSBA  = 000004   	$DPDRV  000636RG
DB1     001620R  	DSLLEN  001320R  	RFDAR = 000006   	RSCS1 = 000000   	$DSDA   001360RG
DFCSR   000274R  	DSSA  = 001334R  	RFDCS = 000000   	RSCS2 = 000010   	$DSDRV  001316RG
DFEND   000420R  	DS1     001402R  	RFWC  = 000002   	RSDA  = 000006   	$DTBLK  001020RG
DFEXIT  000416R  	DTCMP   001130R  	RJPBA = 000004   	RSDS  = 000012   	$DTDRV  001016RG
DFFUN = 000364R  	DTCSR   001024R  	RJPCS1= 000000   	RSDT  = 000026   	$DVDRV  000000RG
DFLLEN  000270R  	DTEND   001314R  	RJPCS2= 000010   	RSER  = 000014   	$DXBLK  002034RG
DFSA  = 000304R  	DTERR   001110R  	RJPDA = 000006   	RSWC  = 000002   	$DXDRV  001744RG
DF1     000324R  	DTEXIT  001276R  	RJPDC = 000034   	R$$11M= 000001   	$DXMOV  002144RG
DKCSR   000424R  	DTFUN = 001204R  	RJPDS = 000012   	R$$20F= 000001   	$DXSLO  002124RG
DKEND   000634R  	DTFWD   001136R  	RJPER1= 000014   	TCBA  = 000004   	$SETDB= ****** GX
DKEXIT  000600R  	DTLLEN  001200R  	RJPOF = 000032   	TCCM  = 000000   	$SETDF= ****** GX
DKFUN = 000546R  	DTSA  = 001030R  	RJPWC = 000002   	TCDT  = 000006   	$SETDK= ****** GX
DKLLEN  000442R  	DTSRC   001052R  	RKBA  = 000004   	TCST  = 177776   	$SETDP= ****** GX
DKSA  = 000434R  	DT1     001210R  	RKCS  = 000000   	TCWC  = 000002   	$SETDS= ****** GX
DK1     000506R  	DXCSR   001746R  	RKDA  = 000006   	TRPFLG  002302R  	$SETDT= ****** GX
DK2     000472R  	DXEF    002152R  	RKDS  = 177774   	TRWAIT  002260R  	$SETDX= ****** GX
DPCSR   000640R  	DXEND   002400R  	RKER  = 177776   	$DBCA = 001572RG 	$TRKSC  002304RG
DPEND   001014R  	DXFUN   002044R  	RKWC  = 000002   	$DBDA = 001564RG 	$$    = 000067
DPEXIT  001004R  	DXLLEN  001756R  	RPBA  = 000004   	$DBDRV  001514RG

. ABS.	000000	   000
      	002402	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  998 WORDS  ( 4 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:26
,[52,20]SPCDRV.LIS/-SP/CRF=[52,30]RSXDC,SPCDRV
SPCDRV     CREATED BY  MACRO  ON 16-JAN-78 AT 19:40	PAGE 1

SYMBOL CROSS REFERENCE                                  CREF         

SYMBOL	VALUE		REFERENCES

BLKLEN	= 000004	#3-113      5-263      5-265      5-270      6-308      6-310      6-315      7-360      7-362     
                         7-367      8-431      8-433      8-438      9-478      9-480      9-485      10-534     10-536    
                         10-541    
DBCLR 	  001722 R	 10-530    #10-558    
DBCSR 	  001522 R	 4-226     #10-510    
DBEND 	  001742 R	 4-221     #10-562    
DBEXIT	  001732 R	 10-537     10-557    #10-560    
DBFUN 	= 001660 R	 4-219      4-225      10-514     10-516    #10-549    
DBLLEN	  001516 R	 4-217     #10-508    
DBSA  	= 001532 R	 4-218     #10-513    
DB1   	  001620 R	#10-534     10-555    
DFCSR 	  000274 R	 4-144     #5-252     
DFEND 	  000420 R	 4-139     #5-287     
DFEXIT	  000416 R	 5-266      5-284     #5-286     
DFFUN 	= 000364 R	 4-137      4-143     #5-278     
DFLLEN	  000270 R	 4-135     #5-250     
DFSA  	= 000304 R	 4-136     #5-255     
DF1   	  000324 R	#5-263      5-282     
DKCSR 	  000424 R	 4-160     #6-291     
DKEND 	  000634 R	 4-155     #6-340     
DKEXIT	  000600 R	 6-311      6-329     #6-331     
DKFUN 	= 000546 R	 4-153      4-159      6-297      6-299     #6-323     
DKLLEN	  000442 R	 4-151     #6-296     
DKSA  	= 000434 R	 4-152     #6-294     
DK1   	  000506 R	 6-301     #6-308      6-327     
DK2   	  000472 R	 6-298     #6-302     
DPCSR 	  000640 R	 4-176     #7-344     
DPEND 	  001014 R	 4-171     #7-385     
DPEXIT	  001004 R	 7-363      7-381     #7-383     
DPFUN 	= 000752 R	 4-169      4-175      7-354      7-356     #7-375     
DPLLEN	  000672 R	 4-167     #7-353     
DPSA  	= 000650 R	 4-168     #7-347     
DP1   	  000712 R	 7-355     #7-360      7-379     
DSCSR 	  001324 R	 4-209     #9-461     
DSEND 	  001512 R	 4-204     #9-504     
DSEXIT	  001502 R	 9-481      9-499     #9-502     
DSFUN 	= 001442 R	 4-202      4-208      9-465      9-467     #9-493     
DSLLEN	  001320 R	 4-200     #9-459     
DSSA  	= 001334 R	 4-201     #9-464     
DS1   	  001402 R	#9-478      9-497     
DTCMP 	  001130 R	 8-407     #8-413     
DTCSR 	  001024 R	 4-192     #8-391     
DTEND 	  001314 R	 4-187     #8-455     
DTERR 	  001110 R	#8-408      8-419     
DTEXIT	  001276 R	 8-434     #8-452     
DTFUN 	= 001204 R	 4-185      4-191      8-394      8-396     #8-427     
DTFWD 	  001136 R	 8-412     #8-415      8-422     
DTLLEN	  001200 R	 4-183     #8-425     
DTSA  	= 001030 R	 4-184     #8-393     
DTSRC 	  001052 R	 8-395     #8-400      8-411      8-414      8-423     
DT1   	  001210 R	#8-431      8-449     
DXCSR 	  001746 R	 4-243     #11-566    
SPCDRV     CREATED BY  MACRO  ON 16-JAN-78 AT 19:40	PAGE 2

SYMBOL CROSS REFERENCE                                  CREF         

SYMBOL	VALUE		REFERENCES

DXEF  	  002152 R	 11-632    #11-636    
DXEND 	  002400 R	 4-238      11-664    #11-715    
DXFUN 	  002044 R	 4-236      4-242      11-584    *11-586    *11-587     11-588    *11-590    #11-600     11-661    
DXLLEN	  001756 R	 4-234     #11-570    
DXLOOP	  002032 R	#11-593     11-655     11-657    
DXNXM 	  002234 R	 11-613    #11-658     11-679    
DXSA  	  001752 R	 4-235     #11-568    
DXSILO	  002120 R	 11-592     11-611    #11-618    
DXTRP4	  002276 R	 11-648    #11-678    
DX2   	  002000 R	 11-585    #11-587    
M$$MGE	= ******	 11-572     11-623     11-639    
RFCMA 	= 000004	#3-51      *5-254     
RFDAE 	= 000010	#3-53      *5-258      5-283     
RFDAR 	= 000006	#3-52      *5-256     
RFDCS 	= 000000	#3-49      *5-253     *5-277      5-279      5-281     
RFWC  	= 000002	#3-50      *5-273     
RJPBA 	= 000004	#3-105     *10-512    
RJPCS1	= 000000	#3-103     *10-511    *10-517    *10-548     10-550     10-552    *10-558    
RJPCS2	= 000010	#3-107     *10-516     10-556     10-560    
RJPDA 	= 000006	#3-106     *10-518    
RJPDC 	= 000034	#3-111     *10-520    
RJPDS 	= 000012	#3-108      10-527     10-554    
RJPER1	= 000014	#3-109     
RJPOF 	= 000032	#3-110     *10-523    
RJPWC 	= 000002	#3-104     *10-547    
RKBA  	= 000004	#3-62      *6-293     
RKCS  	= 000000	#3-60      *6-292     *6-322      6-324      6-326     *6-332     
RKDA  	= 000006	#3-63      *6-300     *6-302     *6-303      6-331     *6-335     
RKDS  	= 177774	#3-58      
RKER  	= 177776	#3-59       6-328     
RKWC  	= 000002	#3-61      *6-321     
RPBA  	= 000004	#3-72      *7-346     
RPCA  	= 000006	#3-73      *7-350     
RPCS  	= 000000	#3-70      *7-345     *7-356     *7-374      7-376      7-378      7-383     
RPDA  	= 000010	#3-74      *7-348     
RPDS  	= 177774	#3-68      
RPER  	= 177776	#3-69       7-380     
RPWC  	= 000002	#3-71      *7-373     
RSAS  	= 000016	#3-96      
RSBA  	= 000004	#3-91      *9-463     
RSCS1 	= 000000	#3-89      *9-462     *9-492      9-494      9-496     *9-500     
RSCS2 	= 000010	#3-93      *9-467      9-498      9-502     
RSDA  	= 000006	#3-92      *9-474     
RSDS  	= 000012	#3-94      
RSDT  	= 000026	#3-97       9-470     
RSER  	= 000014	#3-95      
RSWC  	= 000002	#3-90      *9-491     
R$$11M	= 000001	#1-25      
R$$20F	= 000001	#1-24       2-39       4-145      4-161      4-177      4-193      4-210      4-227      4-244     
                         10-522    
TCBA  	= 000004	#3-82      *8-392     
TCCM  	= 000000	#3-80      *8-396     *8-402     *8-403      8-404      8-406      8-410     *8-416     *8-417     
SPCDRV     CREATED BY  MACRO  ON 16-JAN-78 AT 19:40	PAGE 3

SYMBOL CROSS REFERENCE                                  CREF         

SYMBOL	VALUE		REFERENCES

                         8-418     *8-426     *8-445      8-446      8-448      8-452     *8-454     
TCDT  	= 000006	#3-83       8-413      8-421     
TCST  	= 177776	#3-79       8-408      8-450     
TCWC  	= 000002	#3-81      *8-444     
TRPFLG	  002302 R	 11-645    *11-653    #11-680    
TRWAIT	  002260 R	 11-601     11-601     11-604     11-604     11-607     11-607    #11-669    
$DBCA 	= 001572 RG	#10-521    
$DBDA 	= 001564 RG	#10-519    
$DBDRV	  001514 RG	 4-220      4-221     #10-507     10-559    
$DFDAE	= 000320 RG	#5-259     
$DFDAR	= 000312 RG	#5-257     
$DFDRV	  000266 RG	 4-138      4-139     #5-249      5-285     
$DKDAR	= 000502 RG	*6-299      6-300     #6-304     
$DKDRV	  000422 RG	 4-154      4-155     #6-290      6-330     
$DPCA 	= 000664 RG	#7-351     
$DPDA 	= 000656 RG	#7-349     
$DPDRV	  000636 RG	 4-170      4-171     #7-343      7-382     
$DSDA 	  001360 RG	#9-469     
$DSDRV	  001316 RG	 4-203      4-204     #9-458      9-501     
$DTBLK	  001020 RG	#8-389     
$DTDRV	  001016 RG	 4-186      4-187     #8-388      8-409      8-451     
$DVDRV	  000000 RG	#4-133     
$DXBLK	  002034 RG	#11-597    *11-609    
$DXDRV	  001744 RG	 4-237      4-238     #11-565     11-602     11-605     11-608     11-637    
$DXMOV	  002144 RG	 11-630    #11-633    
$DXSLO	  002124 RG	 11-591     11-610    #11-620     11-654    
$SETDB	= ******  GX	 4-216     
$SETDF	= ******  GX	 4-134     
$SETDK	= ******  GX	 4-150     
$SETDP	= ******  GX	 4-166     
$SETDS	= ******  GX	 4-199     
$SETDT	= ******  GX	 4-182     
$SETDX	= ******  GX	 4-233     
$TRKSC	  002304 RG	 11-598     11-598    #11-689    
$$    	= 000067	#11-598     11-598    #11-601     11-601    #11-604     11-604    #11-607     11-607    
SPCDRV     CREATED BY  MACRO  ON 16-JAN-78 AT 19:40	PAGE 4

MACRO CROSS REFERENCE                                   CREF         

MACRO NAME	REFERENCES

CALL  		#1-23       11-598     11-601     11-604     11-607    
RETURN		#1-23       5-287      6-340      7-385      8-455      9-504      10-562     11-674     11-714     11-715    
FILBN - FIND FILE AND RETURN LB	MACRO M1108  16-JAN-78 19:40
TABLE OF CONTENTS

    3-  60	LOCAL DATA
    4- 111	INITIALIZE CONTROL BLOCKS
    5- 183	PARSE /FI AND /BL
    6- 233	PARSE FILE NAME, FIND FILE
    7- 327	ERROR PROCESSING
FILBN - FIND FILE AND RETURN LB	MACRO M1108  16-JAN-78 19:40  PAGE 2
RSXDC -- RSX20F CONDITIONAL DEFINITION MODULE

      1						.TITLE	FILBN - FIND FILE AND RETURN LBN
      2						.IDENT	"02"
      3
      4					;
      5					;                             COPYRIGHT (C) 1974, 1978 BY
      6					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      7					;
      8					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      9					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
     10					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     11					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     12					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     13					;
     14					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     15					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     16					;       CORPORATION.
     17					;
     18					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     19					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     20					;
     21					;
     22
     23					; VERSION:	02
     24					; BY:		H.LEV
     25					; DATE:		1/25/74
     26					; MODIFIED:	3/10/75		FIX CSI CALLS
     27
     28					;
     29					; THIS SUBROUTINE IS USED TO TAKE A FILE NAME, FILE ID, OR LOGICAL BLOCK NUMBER
     30					; FROM A BUFFER AND RETURN THE LBN OF THE FILE.
     31					;
     32
     33						.MCALL	CALL,CSI$,CSI$2,DIR$,QIO$,RETURN,WTSE$S
     34
     35					;
     36					; EQUATED SYMBOLS
     37					;
     38
     39		000040 			EFN	=	32.		; EVENT FLAG TO WAIT ON SAME AS FCS USES
     40
     41
     42					;
     43					; PARAMETER BLOCK OFFSETS
     44					;
     45		000000 			FDB	=	0		; ADDRESS OF FILE DESCRIPTOR BLOCK
     46		000002 			DNB	=	2		; ADDRESS OF DEFAULT NAME BLOCK
     47		000004 			CSI	=	4		; ADDRESS OF CSI CONTROL BLOCK
     48		000006 			FILID	=	6		; TWO WORD AREA FOR FILE ID
     49		000006 			LBN	=	6		; TWO WORDS FOR RETURNING LBN
     50		000012 			UCB	=	12		; UNREDIRECTED UCB ADDRESS
     51		000014 			FILSIZ	=	14		; FILE SIZE IN BLOCKS
     52					;
     53					; KEYWORD FLAGS
     54					;
     55		000001 			FIFND	=	1		; /FI FOUND
     56		000002 			BLFND	=	2		; /BL FOUND
     57
FILBN - FIND FILE AND RETURN LB	MACRO M1108  16-JAN-78 19:40  PAGE 2-1
RSXDC -- RSX20F CONDITIONAL DEFINITION MODULE

     58
FILBN - FIND FILE AND RETURN LB	MACRO M1108  16-JAN-78 19:40  PAGE 3
LOCAL DATA

     60						.SBTTL	LOCAL DATA
     61					;
     62					; LOCAL DATA
     63					;
     64
     65					;
     66					; DPB FOR READING STATISTICS BLOCK
     67					;
     68						.IF	DF R$$11M
     69						.IFF
     70					STBDPB:	.BYTE	1.,11.		; DIC AND LENGTH
     71						.WORD	IO.RAT		; FUNCTION, READ ATTRIBUTES
     72						.WORD	0		; UNIT
     73						.WORD	EFN		; EVENT FLAG
     74						.WORD	FNDSTA		; I/O STATUS BLOCK
     75						.WORD	0		; AST ADDRESS
     76						.WORD	0,0,FNDSTB	; PARAMETERS
     77
     78						.IFT
     79	000000				STBDPB:	QIO$	IO.RAT,,EFN,,FNDSTA,,<0,FNDATT>
     80
     81	000020	   367 	   012 		FNDATT:	.BYTE	-9.,10.
     82	000022	000032'				.WORD	FNDSTB
     83	000024	000000 				.WORD	0
     84						.ENDC
     85
     86					;
     87					; I/O STATUS BLOCK
     88					;
     89	000026	000000 	000000 		FNDSTA:	.WORD	0,0		;
     90
     91					;
     92					; STATISTICS BLOCK
     93					;
     94	000032				FNDSTB:	.BLKW	5.		;
     95
     96					;
     97					; KEYWD FLAG
     98					;
     99	000044	000000 			KEYWD:	.WORD	0		;
    100
    101
    102
    103					;
    104					; DEFAULT DEVICE NAME
    105					;
    106						.IF	DF R$$11M
    107	000046	   123 	   131 	   060 	SY0:	.ASCIZ	/SY0:/
	000051	   072 	   000
    108						.EVEN
    109						.ENDC
FILBN - FIND FILE AND RETURN LB	MACRO M1108  16-JAN-78 19:40  PAGE 4
INITIALIZE CONTROL BLOCKS

    111						.SBTTL	INITIALIZE CONTROL BLOCKS
    112					;+
    113					; *** - $FILBN  -  FIND FILE LBN FROM NAME, FILE ID, OR BLOCK NUMBER.
    114					;	THE FILE NAME, FILE ID, OR BLOCK NUMBER IS PARSED FROM THE BUFFER
    115					;	PASSED TO THIS SUBROUTINE. DEFAULTS FOR UNIT, FILENAME
    116					;	EXTENTION AND VERSION ARE FROM THE DNB PASSED TO IT.
    117					;	THIS ROUTINE DOES A PARSE/FIND FOR THE FILE AND THEN
    118					;	A READ ATTRIBUTES TO GET THE LBN OF THE FIRST RECOND IN THE
    119					;	FILE.  ONLY CONTIGUOUS FILES MAY BE ACCESSED, OTHERS WILL
    120					;	RETURN ERRORS. IF THE BLOCK NUMBER IS GIVEN EXPLICITLY,
    121					;	THE USER MUST BE SURE THE FILE IS CONTIGUOUS.
    122					;
    123					;
    124					;	FORMAT OF STRING INPUT:
    125					;		DEV:[UIC]FILENAME.EXT;VERSION
    126					;		DEV:/FI=ID:SEQ
    127					;		DEV:/BL=LBN
    128					;
    129					; INPUT:
    130					;	R0 - BUFFER ADDRESS
    131					;	R5 - ADDRESS OF 6 WORD PARAMETER BLOCK
    132					;		(R5) - ADDRESS OF FDB WITH STATISTICS BLOCK POINTER
    133					;		2(R5) - ADDRESS OF DEFAULT NAME BLOCK
    134					;		4(R5) - ADDRESS OF CSI CONTROL BLOCK
    135					;		6(R5) - TWO WORDS FOR RETURNING LBN
    136					;		12(R5) - UNREDIRECTED UCB ADDRESS (RSX-11M ONLY)
    137					;		14(R5) - FILE SIZE IN DISK BLOCKS
    138					;
    139					; OUTPUT:
    140					;	CARRY CLEAR - GOT LBN
    141					;		R0 - UPDATED BUFFER POINTER
    142					;		R1 - =0 NOT CONTIGUOUS; <>0 CONTIGUOUS
    143					;		R5 - UNCHANGED
    144					;	CARRY SET - ERROR DETECTED
    145					;		R0 - UNPREDICTABLE
    146					;		R1 - ERROR CODE
    147					;			-1  - SYNTAX ERROR
    148					;			-2  - PARSE/FIND/READ ERROR
    149					;		R5 - UNCHANGED
    150					;
    151					;	ALL REGISTERS ARE USED INCLUDING R4.
    152					;
    153					;-
    154	000054	005065 	000006 		$FILBN::CLR	FILID(R5)	; ZERO FILE ID
    155	000060	005065 	000010 			CLR	FILID+2(R5)	;
    156	000064	005067 	177754 			CLR	KEYWD		; ZERO KEYWORD FLAG
    157	000070	016504 	000000 			MOV	FDB(R5),R4	; GET FDB ADDRESS
    158	000074				10$:	CALL	$GNBLK		; GET NEXT NON-BLANK CHARACTER
    159	000100	103004 				BCC	20$		; GOT A CHARACTER
    160	000102	005064 	000000G			CLR	F.DSPT(R4)	; END OF LINE, NO LINE TO PARSE
    161	000106	000167 	000404 			JMP	94$		; SKIP ALL THAT CSI STUFF
    162					.IF DF R$$20F
    163	000112				20$:
    164					.IFF
    165					20$:	TST	R1		; ANY BLANKS SEEN?
    166						BEQ	10$		; NO, LOOP
    167					.ENDC ; .IF DF R$$20F
FILBN - FIND FILE AND RETURN LB	MACRO M1108  16-JAN-78 19:40  PAGE 4-1
INITIALIZE CONTROL BLOCKS

    168	000112	016503 	000004 			MOV	CSI(R5),R3	; GET CSI CONTROL BLOCK ADDRESS
    169	000116	005300 				DEC	R0		; POINT TO FIRST CHARACTER
    170	000120	010063 	000004 			MOV	R0,C.CMLD+2(R3)	; SET BUFFER POINTER FOR CSI
    171	000124	005004 				CLR	R4		; ZERO LINE LENGTH
    172	000126				40$:	CALL	$GNBLK		; GET NEXT NON-BLANK
    173	000132	103407 				BCS	55$		; END OF LINE
    174	000134	120227 	000057 			CMPB	R2,#'/		; IS IT SWITCH?
    175	000140	001406 				BEQ	60$		; YES
    176	000142	005204 			50$:	INC	R4		; INCREMENT LENGTH OF LINE
    177	000144	005301 				DEC	R1		; ANY BLANKS?
    178	000146	001775 				BEQ	50$		; YES, INCLUDE THEM
    179	000150	000766 				BR	40$		; NO, LOOP TILL END OF LINE
    180	000152	005300 			55$:	DEC	R0		; POINT TO LINE TERMINATOR
    181	000154	000507 				BR	70$		; SKIP
FILBN - FIND FILE AND RETURN LB	MACRO M1108  16-JAN-78 19:40  PAGE 5
PARSE /FI AND /BL

    183						.SBTTL	PARSE /FI AND /BL
    184					;
    185					; GET FILE ID, IF ANY
    186					;
    187	000156	005300 			60$:	DEC	R0		; POINT TO "/"
    188	000160	126027 	000001 	000106 		CMPB	1(R0),#'F	; IS SWITCH /FI?
    189	000166	001037 				BNE	67$		; NO
    190	000170	126027 	000002 	000111 		CMPB	2(R0),#'I	; MAYBE
    191	000176	001076 				BNE	70$		; NO
    192	000200	062700 	000003 			ADD	#3,R0		; YES, SKIP OVER IT THEN
    193	000204					CALL	$GNBLK		; GET NEXT NON-BLANK
    194	000210	103424 				BCS	65$		; EOL, SYNTAX ERROR
    195	000212	120227 	000075 			CMPB	R2,#'=		; EQUALS?
    196	000216	001021 				BNE	65$		; YES, ERROR
    197	000220					CALL	$GTNUM		; GET INDEX INTO INDEX FILE
    198	000224	122702 	000072 			CMPB	#':,R2		; GOOD TERMINATOR?
    199	000230	001014 				BNE	65$		; NO, SYNTAX ERROR
    200	000232	010165 	000006 			MOV	R1,FILID(R5)	; STORE IT
    201	000236	001411 				BEQ	65$		; ZERO IS ILLEGAL, SYNTAX ERROR
    202	000240					CALL	$GTNUM		; GET FILE SEQUENCE NUMBER
    203	000244	005300 				DEC	R0		; BACK UP CHARACTER POINTER TO TERMINATOR
    204	000246	052767 	000001 	177570 		BIS	#FIFND,KEYWD	; SET /FI= FOUND FLAG
    205	000254	010165 	000010 			MOV	R1,FILID+2(R5)	; STORE IT
    206	000260	001045 				BNE	70$		; GOOD FILE ID
    207	000262	000167 	000556 		65$:	JMP	FNDSYN		; ZERO IS ILLEGAL, SYNTAX ERROR
    208					;
    209					; GET LOGICAL BLOCK NUMBER IF /BL=LBN IS GIVEN
    210					;
    211	000266	126027 	000001 	000102 	67$:	CMPB	1(R0),#'B	; IS THIS SWITCH /BL=?
    212	000274	001037 				BNE	70$		; NO
    213	000276	126027 	000002 	000114 		CMPB	2(R0),#'L	; MAYBE
    214	000304	001033 				BNE	70$		; DEFINATELY NOT
    215	000306	062700 	000003 			ADD	#3,R0		; YES, SKIP OVER KEYWORD
    216	000312					CALL	$GNBLK		; GET NEXT NON-BLANK CHARACTER
    217	000316	103761 				BCS	65$		; EOL IS SYNTAX ERROR
    218	000320	120227 	000075 			CMPB	R2,#'=		; IS IT EQUALS?
    219	000324	001356 				BNE	65$		; NO, SYNTAX ERROR
    220	000326	010501 				MOV	R5,R1		; YES, POINT TO
    221	000330	062701 	000006 			ADD	#LBN,R1		; AREA FOR LBN
    222	000334					CALL	.COT2B		; CONVERT FROM OCTAL TO BINARY
    223	000340	011102 				MOV	(R1),R2		; SWAP HIGH
    224	000342	016111 	000002 			MOV	2(R1),(R1)	; AND
    225	000346	010261 	000002 			MOV	R2,2(R1)	; LOW PARTS FOR PROPER ORDER
    226	000352	005300 				DEC	R0		; POINT BUFFER AT TERMINATOR
    227	000354	051102 				BIS	(R1),R2		; MERGE LBN BITS
    228	000356	001741 				BEQ	65$		; ZERO IS AN ERROR
    229	000360	105761 	000001 			TSTB	1(R1)		; IS LBN > 24. BITS?
    230	000364	001336 				BNE	65$		; YES, ERROR
    231	000366	052767 	000002 	177450 		BIS	#BLFND,KEYWD	; SET /BL= FOUND
FILBN - FIND FILE AND RETURN LB	MACRO M1108  16-JAN-78 19:40  PAGE 6
PARSE FILE NAME, FIND FILE

    233						.SBTTL	PARSE FILE NAME, FIND FILE
    234					;
    235					; CALL CSI IF NEEDED
    236					;
    237	000374	016502 	000000 		70$:	MOV	FDB(R5),R2	; GET FDB ADDRESS
    238	000400	010463 	000002 			MOV	R4,C.CMLD(R3)	; STORE STRING LENGTH
    239	000404	001405 				BEQ	80$		; ZERO LENGTH STRING, SKIP CSI STUFF
    240	000406	062703 	000006 			ADD	#C.DSDS,R3	; GET ADDRESS OF DATA SET DESCRIPTOR
    241	000412	010362 	000000G			MOV	R3,F.DSPT(R2)	; SET IT IN FDB
    242	000416	000402 				BR	90$		;
    243	000420	010004 			80$:	MOV	R0,R4		; SAVE BUFFER POINTER
    244	000422	000435 				BR	94$		;
    245	000424	010004 			90$:	MOV	R0,R4		; SAVE BUFFER POINTER
    246	000426	016500 	000004 			MOV	CSI(R5),R0	; GET CSI BLOCK ADDRESS
    247	000432					CALL	.CSI1		; CHECK SYNTAX OF LINE
    248	000436	103504 				BCS	112$		; SYNTAX ERROR
    249	000440					CSI$2	R0,INPUT	; SCAN FOR INPUT FILES
    250	000450	103704 				BCS	65$		; SYNTAX ERROR
    251	000452	105760 	000001 			TSTB	C.STAT(R0)	; FILE FOUND?
    252	000456	001301 				BNE	65$		; YES, SYNTAX ERROR
    253	000460					CSI$2	R0,OUTPUT	; SCAN FOR OUTPUT FILE
    254	000470	103674 				BCS	65$		; SYNTAX ERROR
    255	000472	105760 	000001 			TSTB	C.STAT(R0)	; ANY FILES FOUND?
    256	000476	001671 				BEQ	65$		; NO, ERROR
    257	000500	132760 	000020 	000001 		BITB	#CS.MOR,C.STAT(R0) ; MORE THAN ONE?
    258	000506	001156 				BNE	FNDSYN		; YES, SYNTAX ERROR
    259						.IF	DF R$$11M
    260	000510	016000 	000010 			MOV	C.DEVD+2(R0),R0	; POINT TO DEVICE STRING
    261	000514	001002 				BNE	95$		; SKIP IF THERE IS ONE
    262	000516	012700 	000046'		94$:	MOV	#SY0,R0		; OTHER WISE DEFAULT TO SY:
    263	000522	012703 	000026'		95$:	MOV	#FNDSTA,R3	; POINT TO WORK AREA
    264	000526					CALL	$FDLOG		; PARSE DEVICE AND SEARCH FOR UCB ADDRESS
    265	000532	103533 				BCS	FNDIDU		; ERROR
    266	000534	010165 	000012 			MOV	R1,UCB(R5)	; SAVE UCB ADDRESS
    267						.ENDC
    268					;
    269					; FILE NAME IS PARSED, FILE ID IS PARSED
    270					; DO PARSE/FIND OF FILE TO GET UNIT, AND FILE ID
    271					;
    272	000540	016500 	000000 		100$:	MOV	FDB(R5),R0	; SET FDB ADDRESS
    273	000544	010001 				MOV	R0,R1		; COPY
    274	000546	062701 	000000G			ADD	#F.FNB,R1	; SET FNB ADDRESS
    275	000552	016002 	000000G			MOV	F.DSPT(R0),R2	; SET DATA SET POINTER
    276	000556	016503 	000002 			MOV	DNB(R5),R3	; SET ADDRESS OF DEFAULT NAME BLOCK
    277	000562	005063 	000000G			CLR	N.DID(R3)	; ZERO DIRECTORY, SET TO
    278	000566	005063 	000002G			CLR	N.DID+2(R3)	; USE UFD
    279	000572	032767 	000003 	177244 		BIT	#BLFND!FIFND,KEYWD ; IS THERE A FILE ID OR BLOCK NUMBER?
    280	000600	001404 				BEQ	110$		; NO
    281	000602	005363 	000000G			DEC	N.DID(R3)	; YES, SET MFD
    282	000606	005363 	000002G			DEC	N.DID+2(R3)	;
    283	000612				110$:	CALL	.PARSE		; SET FILE NAME IN FDB, ASSIGN LUN
    284	000616	103015 				BCC	115$		; OKAY
    285	000620	122760 	000000G	000000G		CMPB	#IE.PRI,F.ERR(R0) ; PRIVILEDGE ERROR?
    286	000626	001500 				BEQ	FNDMOU		; YES, DEVICE NOT MOUNTED
    287	000630	022760 	000000G	000000G		CMP	#IE.IDU,F.ERR(R0) ; ILLEGAL DEVICE UNIT?
    288	000636	001471 				BEQ	FNDIDU		; YES, DEVICE NOT IN SYSTEM
    289	000640	122760 	000000G	000000G		CMPB	#IE.NSF,F.ERR(R0) ; NO SUCH FILE?
FILBN - FIND FILE AND RETURN LB	MACRO M1108  16-JAN-78 19:40  PAGE 6-1
PARSE FILE NAME, FIND FILE

    290	000646	001473 				BEQ	FNDOPN		; YES
    291	000650	000475 			112$:	BR	FNDSYN		; NO, SYNTAX ERROR
    292	000652	032767 	000002 	177164 	115$:	BIT	#BLFND,KEYWD	; /BL SEEN?
    293	000660	001075 				BNE	FNDEXT		; YES, DONE THEN!
    294	000662	032767 	000001 	177154 		BIT	#FIFND,KEYWD	; NO, /FI SEEN?
    295	000670	001015 				BNE	120$		; YES, DON'T DO FIND
    296	000672					CALL	.FIND		; NO, GET FILE ID
    297	000676	103457 				BCS	FNDOPN		; ERROR
    298	000700	016065 	000000G	000006 		MOV	F.FNB(R0),FILID(R5) ; MOVE FILE ID
    299	000706	016065 	000002G	000010 		MOV	F.FNB+2(R0),FILID+2(R5) ; TO PARAMETER AREA
    300	000714	132760 	000000G	000000G		BITB	#FD.REC,F.RCTL(R0) ; IS THIS A RECORD DEVICE?
    301	000722	001054 				BNE	FNDEXT		; YES, SKIP READ ATTRIBUTES
    302					;
    303					; WE HAVE FILE ID, READ ATTRIBUTES INTO STATISTICS BLOCK
    304					;
    305	000724	116067 	000000G	177052 	120$:	MOVB	F.LUN(R0),STBDPB+4 ; SET LOGICAL UNIT
    306						.IF	DF R$$11M
    307						.IFF
    308						MOV	R5,R1		; GET ADDRESS
    309						ADD	#FILID,R1	; OF FILE ID
    310						MOV	R1,STBDPB+14	; SET IT IN DPB
    311						.IFT
    312	000732	010167 	177056 			MOV	R1,STBDPB+14	; SET FNB ADDRESS
    313						.ENDC
    314	000736					DIR$	#STBDPB		; ISSUE READ ATTRIBUTE
    315	000744	103434 				BCS	FNDOPN		; ERROR IN DPB
    316	000746					WTSE$S	STBDPB+6	; WAIT FOR IT
    317	000760	103426 				BCS	FNDOPN		; ERROR IN DPB
    318	000762	005367 	177040 			DEC	FNDSTA		; ANY ERRORS?
    319	000766	001023 				BNE	FNDOPN		; YES
    320	000770	016765 	177036 	000006 		MOV	FNDSTB,LBN(R5)	; SAVE HIGH LBN
    321	000776	016701 	177032 			MOV	FNDSTB+2,R1	; GET LOW LBN
    322	001002	010165 	000010 			MOV	R1,LBN+2(R5)	; SAVE LOW LBN
    323	001006	016765 	177026 	000014 		MOV	FNDSTB+6,FILSIZ(R5) ; GET FILE SIZE
    324	001014	156701 	177012 			BISB	FNDSTB,R1	; COMBINE LBNS TO SEE IF CONTIGOUS
    325	001020	000415 				BR	FNDEXT		;
FILBN - FIND FILE AND RETURN LB	MACRO M1108  16-JAN-78 19:40  PAGE 7
ERROR PROCESSING

    327						.SBTTL	ERROR PROCESSING
    328					;
    329					; ERRORS
    330					;
    331	001022	012701 	177774 		FNDIDU:	MOV	#-4,R1		; SET DEVICE NOT IN SYSTEM
    332	001026	000410 				BR	FNDERR		;
    333	001030	012701 	177775 		FNDMOU:	MOV	#-3,R1		; SET DEVICE NOT MOUNTED ERROR
    334	001034	000405 				BR	FNDERR		;
    335	001036	012701 	177776 		FNDOPN:	MOV	#-2,R1		; SET PARSE/FIND/READ ERROR
    336	001042	000402 				BR	FNDERR		;
    337	001044	012701 	177777 		FNDSYN:	MOV	#-1,R1		; SET SYNTAX ERROR
    338	001050	000261 			FNDERR:	SEC			; SET ERROR FLAG
    339	001052	000402 				BR	FNDXIT		;
    340
    341
    342	001054	010400 			FNDEXT:	MOV	R4,R0		; RESET BUFFER POINTER
    343	001056	000241 				CLC			;
    344	001060				FNDXIT:	RETURN			;
    345		000001 				.END
FILBN - FIND FILE AND RETURN LB	MACRO M1108  16-JAN-78 19:40  PAGE 7-1
SYMBOL TABLE

BLFND = 000002   	C.MKW1= 000024   	FNDEXT  001054R  	IE.PRI= ****** GX	STBDPB  000000R
CSI   = 000004   	C.MKW2= 000026   	FNDIDU  001022R  	IO.RAT= ****** GX	SY0     000046R
CS.DIF= 000002   	C.SIZE= 000054   	FNDMOU  001030R  	KEYWD   000044R  	UCB   = 000012
CS.DVF= 000004   	C.STAT= 000001   	FNDOPN  001036R  	LBN   = 000006   	$FDLOG= ****** GX
CS.EQU= 000040   	C.SWAD= 000022   	FNDSTA  000026R  	N.DID = ****** GX	$FILBN  000054RG
CS.INP= 000001   	C.TYPR= 000000   	FNDSTB  000032R  	PAR$$$= 000000   	$GNBLK= ****** GX
CS.MOR= 000020   	DNB   = 000002   	FNDSYN  001044R  	Q.IOAE= 000012   	$GTNUM= ****** GX
CS.NMF= 000001   	EFN   = 000040   	FNDXIT  001060R  	Q.IOEF= 000006   	$$    = 000067
CS.OUT= 000002   	FDB   = 000000   	F.DSPT= ****** GX	Q.IOFN= 000002   	$$$ARG= 000010
CS.WLD= 000010   	FD.REC= ****** GX	F.ERR = ****** GX	Q.IOLU= 000004   	$$$OST= 000014
C.CMLD= 000002   	FIFND = 000001   	F.FNB = ****** GX	Q.IOPL= 000014   	.COT2B= ****** GX
C.DEVD= 000006   	FILID = 000006   	F.LUN = ****** GX	Q.IOPR= 000007   	.CSI1 = ****** GX
C.DIRD= 000012   	FILSIZ= 000014   	F.RCTL= ****** GX	Q.IOSB= 000010   	.CSI2 = ****** G
C.DSDS= 000006   	FNDATT  000020R  	IE.IDU= ****** GX	R$$11M= 000001   	.FIND = ****** GX
C.FILD= 000016   	FNDERR  001050R  	IE.NSF= ****** GX	R$$20F= 000001   	.PARSE= ****** GX

. ABS.	000000	   000
      	001062	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  1709 WORDS  ( 7 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:24
,[52,20]FILBN.LIS/-SP/CRF=[52,30]RSXDC,FILBN
FILBN      CREATED BY  MACRO  ON 16-JAN-78 AT 19:40	PAGE 1

SYMBOL CROSS REFERENCE                                  CREF         

SYMBOL	VALUE		REFERENCES

BLFND 	= 000002	#2-56       5-231      6-279      6-292     
CSI   	= 000004	#2-47       4-168      6-246     
CS.INP	= 000001	 6-249     
CS.MOR	= 000020	 6-257     
CS.OUT	= 000002	 6-253     
C.CMLD	= 000002	*4-170     *6-238     
C.DEVD	= 000006	 6-260     
C.DSDS	= 000006	 6-240     
C.SIZE	= 000054	 6-249      6-253     
C.STAT	= 000001	 6-251      6-255      6-257     
DNB   	= 000002	#2-46       6-276     
EFN   	= 000040	#2-39       3-79      
FDB   	= 000000	#2-45       4-157      6-237      6-272     
FD.REC	= ******  GX	 6-300     
FIFND 	= 000001	#2-55       5-204      6-279      6-294     
FILID 	= 000006	#2-48      *4-154     *4-155     *5-200     *5-205     *6-298     *6-299     
FILSIZ	= 000014	#2-51      *6-323     
FNDATT	  000020 R	 3-79      #3-81      
FNDERR	  001050 R	 7-332      7-334      7-336     #7-338     
FNDEXT	  001054 R	 6-293      6-301      6-325     #7-342     
FNDIDU	  001022 R	 6-265      6-288     #7-331     
FNDMOU	  001030 R	 6-286     #7-333     
FNDOPN	  001036 R	 6-290      6-297      6-315      6-317      6-319     #7-335     
FNDSTA	  000026 R	 3-79      #3-89       6-263     *6-318     
FNDSTB	  000032 R	 3-82      #3-94       6-320      6-321      6-323      6-324     
FNDSYN	  001044 R	 5-207      6-258      6-291     #7-337     
FNDXIT	  001060 R	 7-339     #7-344     
F.DSPT	= ******  GX	*4-160     *6-241      6-275     
F.ERR 	= ******  GX	 6-285      6-287      6-289     
F.FNB 	= ******  GX	 6-274      6-298      6-299     
F.LUN 	= ******  GX	 6-305     
F.RCTL	= ******  GX	 6-300     
IE.IDU	= ******  GX	 6-287     
IE.NSF	= ******  GX	 6-289     
IE.PRI	= ******  GX	 6-285     
IO.RAT	= ******  GX	 3-79      
KEYWD 	  000044 R	#3-99      *4-156     *5-204     *5-231      6-279      6-292      6-294     
LBN   	= 000006	#2-49       5-221     *6-320     *6-322     
N.DID 	= ******  GX	*6-277     *6-278     *6-281     *6-282     
PAR$$$	= 000000	#6-249      6-249     #6-253      6-253     
Q.IOAE	= 000012	#3-79      
Q.IOEF	= 000006	#3-79      
Q.IOFN	= 000002	#3-79      
Q.IOLU	= 000004	#3-79      
Q.IOPL	= 000014	#3-79      
Q.IOPR	= 000007	#3-79      
Q.IOSB	= 000010	#3-79      
R$$11M	= 000001	#1-25       3-68       3-106      6-259      6-306     
R$$20F	= 000001	#1-24       4-162     
STBDPB	  000000 R	#3-79      *6-305     *6-312      6-314      6-316     
SY0   	  000046 R	#3-107      6-262     
UCB   	= 000012	#2-50      *6-266     
FILBN      CREATED BY  MACRO  ON 16-JAN-78 AT 19:40	PAGE 2

SYMBOL CROSS REFERENCE                                  CREF         

SYMBOL	VALUE		REFERENCES

$FDLOG	= ******  GX	 6-264      6-264     
$FILBN	  000054 RG	#4-154     
$GNBLK	= ******  GX	 4-158      4-158      4-172      4-172      5-193      5-193      5-216      5-216     
$GTNUM	= ******  GX	 5-197      5-197      5-202      5-202     
$$    	= 000067	#4-158      4-158     #4-172      4-172     #5-193      5-193     #5-197      5-197     #5-202     
                         5-202     #5-216      5-216     #5-222      5-222     #6-247      6-247     #6-264      6-264     
                        #6-283      6-283     #6-296      6-296     
$$$ARG	= 000010	#3-79       3-79      #3-79       3-79      #3-79       3-79      
$$$GLB	= ******	 3-79       3-79       3-79       3-79       3-79       3-79       3-79       3-79      
$$$OST	= 000014	#3-79       3-79       3-79      #3-79       3-79       3-79      #3-79       3-79       3-79      
                        #3-79       3-79       3-79      #3-79       3-79       3-79      #3-79       3-79       3-79      
                        #3-79       3-79      
.COT2B	= ******  GX	 5-222      5-222     
.CSI1 	= ******  GX	 6-247      6-247     
.CSI2 	= ******  G	 6-249      6-249      6-253      6-253     
.FIND 	= ******  GX	 6-296      6-296     
.PARSE	= ******  GX	 6-283      6-283     
FILBN      CREATED BY  MACRO  ON 16-JAN-78 AT 19:40	PAGE 3

MACRO CROSS REFERENCE                                   CREF         

MACRO NAME	REFERENCES

CALL  		#1-23      #2-33       4-158      4-172      5-193      5-197      5-202      5-216      5-222      6-247     
                 6-264      6-283      6-296     
CSI$  		#2-33      #6-249     #6-253     
CSI$2 		#2-33      #6-249     #6-253     
DIR$  		#2-33       6-314     #6-316      6-316     
ERR$  		#6-314     #6-316     
LDR0$ 		#6-249      6-249     #6-253      6-253     
MOV$  		#6-316      6-316     
OFF$  		#3-79      #3-79      #3-79      #3-79      #3-79      #3-79      #3-79      #3-79      #3-79      
QDPB$ 		#3-79       3-79      
QIO$  		#2-33      #3-79      
RETURN		#1-23      #2-33       7-344     
WTSE$S		#2-33      #6-316     
COT2B - CONVERT FROM OCTAL TO T	MACRO M1108  16-JAN-78 19:46  PAGE 1


      1						.TITLE	COT2B - CONVERT FROM OCTAL TO TWO BINARY WORDS
      2						.IDENT	"01"
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					;
     21
     22					;
     23					; VERSION: 	01
     24					; BY:		H.LEV
     25					; DATE:		09/19/73
     26					;
     27						.MCALL	RETURN
     28
     29					;+
     30					; *** - .COT2B  - CONVERT OCTAL NUMBER TO TWO BINARY WORDS
     31					;		THIS SUBROUTINE CONVERTS AN ASCII OCTAL
     32					;		NUMBER TO BINARY.  IT ACCEPTS ONLY
     33					;		OCTAL DIGITS.
     34					;
     35					; INPUT:
     36					;	R0 - ADDRESS OF NEXT DIGIT IN BUFFER FOR NUMBER
     37					;	R1 - ADDRESS OF TWO WORD FIELD TO PUT CONVERTED NUMBER IN
     38					;		WORD 1 - LOW 16 BITS
     39					;		WORD 2 - HIGH 16 BITS
     40					;
     41					; OUTPUT:
     42					;	R0 - UPDATED BUFFER POINTER
     43					;	R1 - UNCHANGED
     44					;	R2 - TERMINATING CHARACTER
     45					;
     46					;	CARRY BIT
     47					;		CLEAR - ONLY 16 BIT NUMBER
     48					;		SET - 32 BIT NUMBER
     49					;
     50					;-
     51	000000	005011 			.COT2B::CLR	(R1)		; ZERO OUT LOW 16 BITS
     52	000002	005061 	000002 			CLR	2(R1)		; ZERO OUT HIGH 16 BITS
     53	000006	112002 			10$:	MOVB	(R0)+,R2	; GET NEXT CHARACTER
     54	000010	120227 	000060 			CMPB	R2,#'0		; IS IT <0 ?
     55	000014	002420 				BLT	30$		; YES
     56	000016	120227 	000067 			CMPB	R2,#'7		; IS IT >7 ?
     57	000022	003015 				BGT	30$		; YES
COT2B - CONVERT FROM OCTAL TO T	MACRO M1108  16-JAN-78 19:46  PAGE 1-1


     58	000024	042702 	177770 			BIC	#177770,R2	; STRIP OF ASCII BITS
     59	000030	012746 	000003 			MOV	#3,-(SP)	; SET SHIFT COUNT
     60	000034	000241 			20$:	CLC			; ZERO CARRY BIT
     61	000036	006111 				ROL	(R1)		; ROTATE BIT 15
     62	000040	006161 	000002 			ROL	2(R1)		; INTO BIT 16
     63	000044	005316 				DEC	(SP)		; DONE ?
     64	000046	001372 				BNE	20$		; NO, LOOP FOR THREE BITS
     65	000050	005726 				TST	(SP)+		; POP OFF COUNTER
     66	000052	050211 				BIS	R2,(R1)		; PUT IT IN
     67	000054	000754 				BR	10$		; GET NEXT DIGIT
     68	000056	005761 	000002 		30$:	TST	2(R1)		; IS THERE MORE THAN 16 BITS ?
     69	000062	001401 				BEQ	50$		; NO
     70	000064	000261 				SEC			; YES, SET 32 BIT FLAG
     71	000066				50$:	RETURN			; RETURN TO CALLER
     72
     73		000001 				.END
COT2B - CONVERT FROM OCTAL TO T	MACRO M1108  16-JAN-78 19:46  PAGE 1-2
SYMBOL TABLE

.COT2B  000000RG

. ABS.	000000	   000
      	000070	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  116 WORDS  ( 1 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:06
,[52,20]COT2B.LIS/-SP/CRF=[53,30]COT2B.MAC
COT2B      CREATED BY  MACRO  ON 16-JAN-78 AT 19:46	PAGE 1

SYMBOL CROSS REFERENCE                                  CREF         

SYMBOL	VALUE		REFERENCES

.COT2B	  000000 RG	#1-51      
COT2B      CREATED BY  MACRO  ON 16-JAN-78 AT 19:46	PAGE 2

MACRO CROSS REFERENCE                                   CREF         

MACRO NAME	REFERENCES

RETURN		#1-27       1-71      
GTCML - GET COMMAND LINE WITH C	MACRO M1108  16-JAN-78 19:46  PAGE 1


      1					.TITLE	GTCML - GET COMMAND LINE WITH CONTINUATIONS
      2
      3					.IDENT	"V0004"
      4
      5					;                             COPYRIGHT (C) 1975, 1978 BY
      6					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      7					;
      8					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      9					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
     10					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     11					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     12					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     13					;
     14					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     15					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     16					;       CORPORATION.
     17					;
     18					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     19					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     20					;
     21					;
     22					; ANDREW C. GOLDSTEIN  23 JAN 75  19:57
     23
     24					;
     25					; THIS ROUTINE ACCEPTS A COMMAND LINE WITH CONTINUATIONS FOR THE FILES
     26					; MCR FUNCTIONS. IT FIRST GETS THE MCR COMMAND LINE. IF THERE IS NONE,
     27					; OR IF CONTINUATIONS ARE CALLED FOR, IT PROMPTS AND READS INPUT FROM
     28					; THE TASK'S LUN #1, WHICH IS HOPEFULLY ASSIGNED TO TI. ALL ERROR
     29					; HANDLING IS DONE INTERNALLY.
     30					;
     31
     32		000001 			LUN = 1				; LUN FOR CONSOLE I/O
     33		000001 			EFN = 1				; LIKEWISE EFN
     34
     35		000015 			CR  = 15			; CARRIAGE RETURN CHAR
     36
     37						.MCALL	QIOW$,QIOW$S,GMCR$,DIR$,CALL,RETURN,EXIT$S
     38					;
     39					; BUFFER TO BUILD COMMAND LINE
     40					;
     41		000376 			BUFSIZ = 256.-2.
     42
     43	000000				BUFFER:	GMCR$
     44						.BLKB	BUFSIZ+BUFFER+G.MCRB-.
     45					;
     46					; QIO TO OUTPUT PROMPT TO TERMINAL
     47					;
     48	000400				PROMPT:	QIOW$	IO.WVB,LUN,EFN,,IOSTAT,,<,,<'$>>
     49
     50	000422				IOSTAT:	.BLKW	2		; I/O STATUS BLOCK
     51					;
     52					; ERROR MESSAGES FOR VARIOUS FORMS OF LOSSAGE
     53					;
     54	000426	   015 	   130 	   130 	IOERRM:	.ASCII	<CR>"XXX -- COMMAND I/O ERROR"
	000431	   130 	   040 	   055
	000434	   055 	   040 	   103
	000437	   117 	   115 	   115
GTCML - GET COMMAND LINE WITH C	MACRO M1108  16-JAN-78 19:46  PAGE 1-1


	000442	   101 	   116 	   104
	000445	   040 	   111 	   057
	000450	   117 	   040 	   105
	000453	   122 	   122 	   117
	000456	   122
     55		000031 			IOERRL = .-IOERRM
     56
     57	000457	   015 	   130 	   130 	OVERM:	.ASCII	<CR>"XXX -- COMMAND TOO LONG"
	000462	   130 	   040 	   055
	000465	   055 	   040 	   103
	000470	   117 	   115 	   115
	000473	   101 	   116 	   104
	000476	   040 	   124 	   117
	000501	   117 	   040 	   114
	000504	   117 	   116 	   107
     58		000030 			OVERL = .-OVERM
     59
     60						.EVEN
GTCML - GET COMMAND LINE WITH C	MACRO M1108  16-JAN-78 19:46  PAGE 2


     62					;+
     63					;
     64					; *** - .GTCML - GET COMMAND LINE WITH CONTINUATION
     65					;
     66					; THIS ROUTINE OBTAINS A COMMAND LINE FROM THE MCR COMMAND LINE
     67					; BUFFER OR FROM THE CONSOLE TERMINAL. A TRAILING HYPHEN (-)
     68					; CAUSES CONTINUATION: THE ROUTINE PROMPTS AND ACCEPTS ANOTHER
     69					; LINE FROM THE CONSOLE TERMINAL.
     70					;
     71					; INPUTS:
     72					;
     73					;	R3 = LENGTH OF PROMPT STRING
     74					;	R4 = ADDRESS OF PROMPT STRING
     75					;
     76					; OUTPUTS:
     77					;
     78					;	R3 = LENGTH OF COMMAND STRING
     79					;	R4 = ADDRESS OF COMMAND STRING
     80					;	R0-R2 ARE GARBAGED
     81					;
     82					;-
     83
     84						.ENABL	LSB
     85
     86	000510				.GTCML::
     87	000510	010467 	177700 			MOV	R4,PROMPT+Q.IOPL ; SET UP PROMPT STRING
     88	000514	010367 	177676 			MOV	R3,PROMPT+Q.IOPL+2 ; IN QIO DPB
     89	000520	012701 	000376 			MOV	#BUFSIZ,R1	; AND MAXIMUM BYTE COUNT
     90	000524					DIR$	#BUFFER		; TRY FOR MCR COMMAND BUFFER
     91	000532	103421 				BCS	30$		; BRANCH IF NONE
     92	000534	013703 	000000G			MOV	@#$DSW,R3	; PICK UP THE BYTE COUNT
     93	000540	001416 				BEQ	30$		; BRANCH IF NULL
     94	000542	160301 				SUB	R3,R1		; COMPUTE SPACE LEFT
     95	000544	012704 	000002'			MOV	#BUFFER+G.MCRB,R4 ; POINT TO START OF ACTUAL COMMAND LINE
     96	000550				10$:	CALL	SPTEST		; SEARCH FOR THE FIRST SPACE
     97	000554	103003 				BCC	20$
     98	000556	005204 				INC	R4		; TRY NEXT CHARACTER
     99	000560	077305 				SOB	R3,10$
    100	000562	000405 				BR	30$		; NO SPACES - THROW COMMAND LINE AWAY
    101
    102	000564				20$:	CALL	SPTEST		; NOW LOOK FOR FIRST REAL COMMAND CHAR
    103	000570	103411 				BCS	40$
    104	000572	005204 				INC	R4		; TRY THE NEXT
    105	000574	077305 				SOB	R3,20$
    106					;
    107					; THERE IS NO MCR COMMAND LINE, EITHER BECAUSE THE DIRECTIVE FAILED
    108					; OR THERE WAS NO USEFUL INFORMATION IN IT. SET UP TO GET COMMAND
    109					; FROM THE TERMINAL.
    110					;
    111	000576	012704 	000002'		30$:	MOV	#BUFFER+G.MCRB,R4 ; RE-INIT POINTER
    112	000602	005003 				CLR	R3
    113	000604	012701 	000376 			MOV	#BUFSIZ,R1	; R1 = SPACE AVAILABLE
    114	000610	010400 				MOV	R4,R0		; R0 = ADDRESS FOR INPUT
    115	000612	000411 				BR	60$
    116					;
    117					; WE HAVE A GOOD MCR COMMAND LINE. UPDATE VARIOUS REGISTERS.
    118					;
GTCML - GET COMMAND LINE WITH C	MACRO M1108  16-JAN-78 19:46  PAGE 2-1


    119	000614	010400 			40$:	MOV	R4,R0		; POINT TO END OF DATA
    120	000616	060300 				ADD	R3,R0
    121					;
    122					; WE HAVE A COMMAND LINE FROM SOMEWHERE. LOOK FOR CONTINUATION.
    123					;
    124	000620	126027 	177777 	000055 	50$:	CMPB	-1(R0),#'-	; CONTINUATION CHARACTER IS A "-"
    125	000626	001051 				BNE	EOL		; NO - ALL DONE
    126	000630	005300 				DEC	R0		; YES - THROW IT AWAY
    127	000632	005201 				INC	R1
    128	000634	005303 				DEC	R3		; ADJUST THE CHARACTER COUNT
    129					;
    130					; READ AN INPUT LINE FROM THE TERMINAL.
    131					;
    132	000636				60$:	DIR$	#PROMPT		; OUTPUT THE PROMPT STRING
    133	000644	103444 				BCS	IOERR		; CHECK FOR DIRECTIVE ERROR
    134	000646	105767 	177550 			TSTB	IOSTAT		; AND FOR I/O ERROR
    135	000652	002441 				BLT	IOERR
    136	000654					QIOW$S	#IO.RVB,#LUN,#EFN,,#IOSTAT,,<R0,R1,<#' >>
    137	000716	103417 				BCS	IOERR		; DIRECTIVE ERROR
    138	000720	105767 	177476 			TSTB	IOSTAT
    139	000724	002414 				BLT	IOERR		; I/O ERROR
    140	000726	105767 	177471 			TSTB	IOSTAT+1	; CHECK FOR A TERMINATED LINE
    141	000732	001422 				BEQ	OVER		; NO - BUFFER HAS OVERFLOWED
    142	000734	016702 	177464 			MOV	IOSTAT+2,R2	; GET THE BYTE COUNT
    143	000740	001736 				BEQ	60$		; IGNORE NULL LINES
    144	000742	160201 				SUB	R2,R1		; ADJUST THE REMAINING SPACE COUNT
    145	000744	060203 				ADD	R2,R3		; ACCUMULATE BYTE COUNT
    146	000746	060200 				ADD	R2,R0		; POINT TO NEW END OF DATA
    147	000750	000723 				BR	50$		; AND LOOK FOR CONTINUATION AGAIN
    148					;
    149					; END OF LINE
    150					;
    151	000752	105010 			EOL:	CLRB	(R0)		; THROW IN A TERMINATING NULL
    152	000754					RETURN
    153					;
    154					; TO HERE ON I/O ERROR
    155					;
    156	000756	126727 	177440 	000000G	IOERR:	CMPB	IOSTAT,#IE.EOF	; LOOK FOR CONTROL Z
    157	000764	001441 				BEQ	90$		; YES - JUST GET OUT QUIETLY
    158	000766	012700 	000426'			MOV	#IOERRM,R0	; SET UP MESSAGE POINTER
    159	000772	012701 	000031 			MOV	#IOERRL,R1	; AND BYTE COUNT
    160	000776	000404 				BR	70$
    161					;
    162					; TO HERE IF THE INPUT BUFFER OVERFLOWS
    163					;
    164	001000	012700 	000457'		OVER:	MOV	#OVERM,R0
    165	001004	012701 	000030 			MOV	#OVERL,R1
    166	001010	010002 			70$:	MOV	R0,R2
    167	001012	005202 				INC	R2
    168	001014	012703 	000003 			MOV	#3,R3		; COUNT 3 BYTES OF THE PROMPT STRING
    169	001020	016704 	177370 			MOV	PROMPT+Q.IOPL,R4 ; POINT TO PROMPT STRING
    170	001024	112422 			80$:	MOVB	(R4)+,(R2)+	; COPY PROMPT INTO ERROR MESSAGE
    171	001026	077302 				SOB	R3,80$
    172	001030					QIOW$S	#IO.WVB,#LUN,#EFN,,,,<R0,R1,<#' >>
    173	001070				90$:	EXIT$S			; DON'T GO AWAY MAD, JUST GO AWAY....
    174
    175					;
GTCML - GET COMMAND LINE WITH C	MACRO M1108  16-JAN-78 19:46  PAGE 2-2


    176					; SUBROUTINE TO CHECK FOR BLANKS OR TABS. R4 POINTS TO CHARACTER
    177					; BEING TESTED