/ 
/ 
/                   FIRST PRINTING, FEBRUARY 1974
/ 
/ THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO 
/ CHANGE WITHOUT NOTICE AND SHOULD NOT BE CONSTRUED
/ AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
/ DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPON-
/ SIBILITY FOR ANY ERRORS THAT MAY APPEAR IN THIS
/ DOCUMENT.
/ 
/ THE SOFTWARE DESCRIBED IN THIS DOCUMENT IS FUR-
/ NISHED TO THE PURCHASER UNDER A LICENSE FOR USE ON
/ A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH
/ INCLUSION OF DIGITAL'S COPYRIGHT NOTICE) ONLY FOR 
/ USE IN SUCH SYSTEM, EXCEPT AS MAY OTHERWISE BE PRO-
/ VIDED IN WRITING BY DIGITAL.
/ 
/ DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY
/ FOR THE USE OR RELIABILITY OF ITS SOFTWARE ON EQUIP-
/ MENT THAT IS NOT SUPPLIED BY DIGITAL.
/ 
/ COPYRIGHT (C) 1974, BY DIGITAL EQUIPMENT CORPORATION
/ 
/ 
        .EJECT
/ EDIT #6	OCT 23 1974	M. HEBENSTREIT
/ 
/ COPYWRITE 1973 DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
/ 
/ PART OF COP TO CHECK BIT MAPS ON THE RF15, RP02, AND RK05.
/  
	.GLOBL	LOG
DSIZE=137
RPDISK=303
RKDISK=302
IDX=ISZ
ECLA=641000
X10=10
/ 
	JMS*	LOG
	.ASCII "BEGIN BIT MAP VERIFICATION"<15>
/
BEGIN	LAC*	(DSIZE	/ARE THERE ANY RF PLATTERS?
	SPA
	JMP	RP	/NO -- CHECK RP
	LAC	RFFLG
	SZA
	JMP	RP
	DZM	UNIT	/YES -- CLEAR THE UNIT NO.
	LAC	(2	/GET DEVICE CODE
	DAC	DEVICE
	LAC	(1776	/GET 1ST BIT MAP
	JMS	CHECK	/VERIFY THE BIT MAPS
RP	LAC*	(RPDISK	/ARE THE ANY RP02'S?
	SPA
	JMP	RK	/NO -- CHECK FOR THE RK
	IAC
	TCA
	DAC	UNTCNT	/SET UP THE UNIT COUNTER
	LAC	RPFLG
	SZA
	JMP	RK
	DZM	UNIT	/CLEAR THE UNIT NO.
	LAC	(3	/GET THE DEVICE CODE
	DAC	DEVICE
RP1	LAC	(764	/GET THE 1ST BIY MAP
	JMS	CHECK	/VERIFY THE BIT MAPS
	IDX	UNIT	/INCREMENT THE UNIT NO.
	ISZ	UNTCNT	/ALL DONE WITH THE RP'S?
	JMP	RP1	/NO -- CHECK NEXT UNIT
RK	LAC*	(RKDISK	/YES -- TEST THE RK
	SPA
	JMP	EXIT	/NO -- GOTO LOOP AT EXIT
	IAC
	TCA
	DAC	UNTCNT	/SETUP UNIT COUNTER
	LAC	RKFLG
	SZA
	JMP	EXIT
	DZM	UNIT	/CLEAR THE UNIT NO.
	LAC	(24	/GET THE DEVICE CODE
	DAC	DEVICE
RK1	LAC	(1776	/GET THE 1ST BIT MAP
	JMS	CHECK	/CHECK THE BIT MAPS
	IDX	UNIT	/INCREMENT THE UNIT NO.
	ISZ	UNTCNT	/DONE WITH ALL RK'S?
	JMP	RK1	/NO -- CHECK THE NEXT UNIT
EXIT	CLL		/YES -- CHANGE NO. OF BLKS TO ALLOCATE
	LAC	ADCTA
	RAL
	DAC	ADCTA
	ISZ	ADCNT	/DONE WITH ALL ALLOCATES?
	JMP	BEGIN	/NO
	JMS*	LOG
	.ASCII "END BIT MAP VERIFICATION"<15>
	CAL	(10
CHECK	0
	DAC	TEMP	/SAVE THE BLOCK NO.
	LAC	DEVICE	/SET THE DEVICE CODE INTO ALLO AND DEAL CPB
	DAC	ALLO+4
	DAC	DEAL+4
	CLL
	LAC	UNIT
	ALS	17
	DAC	ADCTA+1
	CAL	ALLO	/ALLOCATE SOME BLOCKS
	CAL	AWAIT
	LAC	AEV	/ERROR?
	SPA
	JMS	ALLERR	/YES
CONST	LAC	DEVICE	/CONVERT BLK TO PLAT. AND ADDR.
	SAD	(2
	JMP	CONRF
	CLL
	LAC	TEMP
	LMQ
	LLSS!ECLA 10
	DAC	CTA+0
	LACQ
	DAC	CTA+1
	LAC	UNIT
	ALS	17
	TAD	CTA+0
	DAC	CTA+0
	JMP	CONDON
CONRF	CLL
	LAC	TEMP
	LRS	12
	DAC	CTA+0
	LAC	TEMP
	AND	(1777
	ALS	10
	DAC	CTA+1
CONDON	CAL	GET	/GET THE BIT MAP
	CAL	WAIT
	LAC	EV	/ERROR?
	SMA
	JMP	.+3
	JMS	GETERR	/YES
	JMP	RETURN	/EXIT THIS SUBROUTINE
	CLL		/NO -- CLEAR LINK FOR DIVIDE
	LAC	BUFF+1	/GET THE NO. OF BLOCKS ON THIS MAP
	LMQ		/SET UP TO DIVIDE BY 18(10)
	CLA
	DIV		/DIVIDE BY 18(10)
	22
	SNA		/WAS THERE A REMAINDER?
	JMP	.+4
	LACQ		/YES -- ADD ONE TO RESULT
	IAC
	SKP
	LACQ		/NO -- GET RESULT FROM MQ
	TCA		/SAVE THIS AS A 2'S COMPLEMENT
	DAC	BLKBTS
	LAC	(BUFF+3	/SET UP TO COUNT BITS
	DAC	WDPTR
	DZM	BLOCKS	/ZERO THE BLOCKS COUNTER
LOC2	LAW	-22	/SET UP THE BITS IN THE WORD COUNTER
	DAC	SHIFT
	LAC*	WDPTR	/GET THE NEXT WORD IN THE BIT MAP
LOC1	RCL
	SZL		/ZERO BIT?
	IDX	BLOCKS	/NO -- COUNT THE BIT
	ISZ	SHIFT	/DONE WITH THIS WORD?
	JMP	LOC1	/NO -- EXAMINE THE NEXT BIT
	IDX	WDPTR	/YES -- INCREMENT THE WORD PTR
	ISZ	BLKBTS	/DONE WITH THIS BLOCK?
	JMP	LOC2	/NO -- GET NEXT WORD
	LAC	BUFF+2	/YES -- COMPARE HEADER WD IN BIT MAP
	SAD	BLOCKS
	JMP	.+3
	JMS	BADMAP	/THIS IS A BAD BIT MAP
	JMP	RETURN
	LAC	BUFF+377	/GOOD MAP -- GET NEXT ONE
	SAD	(-1
	JMP	RETURN
	DAC	TEMP	/SAVE THE BLOCK NO.
	JMP	CONST
RETURN	LAC	AEV	/WAS AN ALLOCATE DONE?
	SPA
	JMP*	CHECK	/NO -- DON'T DEALLOCATE
	CAL	DEAL	/YES -- DEALLOCATE THE BLOCK(S)
	CAL	AWAIT
	LAC	AEV
	SPA
	JMS	DEAERR
	JMP*	CHECK
PRINT	2700
	EV
	3
	2
	XX
ALLO	11500
	AEV
	1
	ADCTA
	XX
DEAL	11600
	AEV
	1
	ADCTA
	XX
GET	13000
	EV
	1
	CTA
DEVICE	XX
CTA	XX
	XX
	BUFF
	400
ADCTA	400
	XX
	XX
WAIT	20
	EV
AWAIT	20
	AEV
MSG1	MSG2-MSG1/2*1000
	0
	.ASCII "DEALLOCATE ERROR ON "<175>
MSG2	MSG3-MSG2/2*1000
	0
	.ASCII "ALLOCATE ERROR ON "<175>
MSG3	MSG4-MSG3/2*1000
	0
	.ASCII "GET ERROR ON "<175>
MSG4	MSG5-MSG4/2*1000
	0
	.ASCII "BAD MAP ON "<175>
MSG5	EV-MSG5/2*1000
	0
	.ASCII " _______________________________________"<15>
EV	0
UNIT	0
UNTCNT	0
ADCNT	-4
TEMP	0
TEMP1	0
RFFLG	0
RPFLG	0
RKFLG	0
AEV	0
WDPTR	0
BLOCKS	0
SHIFT	0
BLKBTS	0
BUFF	.BLOCK 400
DEAERR	0
	LAC	(MSG1
	DAC	PRINT+4
	CAL	PRINT
	CAL	WAIT
	JMS	DEVNAM
	JMP*	DEAERR
ALLERR	0
	LAC	(MSG2
	DAC	PRINT+4
	CAL	PRINT
	CAL	WAIT
	JMS	DEVNAM
	JMP*	ALLERR
GETERR	0
	LAC	(MSG3
	DAC	PRINT+4
	CAL	PRINT
	CAL	WAIT
	JMS	DEVNAM
	JMP*	GETERR
BADMAP	0
	LAC	TEMP	/GET THE BLK. NO. OF THE BAD BIT MAP
	JMS	NUMOUT	/PRINT IT OUT
	LAC	(MSG4
	DAC	PRINT+4
	CAL	PRINT
	CAL	WAIT
	JMS	DEVNAM
	LAC	DEVICE
	AND	(7
	AAC	-2
	TAD	(RFFLG
	DAC	TEMP1
	IDX*	TEMP1
	JMP*	BADMAP
DEVNAM	0
	LAC	UNIT
	AND	(7
	CLL
	ALS	17
	TAD	NAM2
	DAC	NAM02
	LAC	DEVICE
	SAD	(2
	JMP	DEVRF
	SAD	(3
	JMP	DEVRP
	LAC	(113
DEVFIN	ALS	4
	TAD	NAM1
	DAC	NAM01
	LAC	(NAMH
	DAC	PRINT+4
	CAL	PRINT
	CAL	WAIT
	LAC	(MSG5
	DAC	PRINT+4
	CAL	PRINT
	CAL	WAIT
	JMP*	DEVNAM
DEVRF	LAC	(106
	SKP
DEVRP	LAC	(120
	JMP	DEVFIN
NAMH	002000
	0
NAM01	0
NAM02	0
NAM1	510006
NAM2	020372
/
/ SUBROUTINE NUMOUT -- PRINT THE CONTENTS OF AC AS AN OCTAL NUMBER
/
/			RETURN AT JMS+1 UNCONDITIONALLY
/
/			ALL REGISTERS ARE MODIFIED INCLUDING NUMO1
/
NUMOUT	0
	LMQ			/SAVE THE NUMBER TO BE PRINTED IN MQ
	LAW	-6		/SET UP DIGIT COUNTER
	DAC	NUMO1
	DZM	OUTBUF+1	/ZERO CHECKSUM WORD IN BUFFER
	CLL
	LAC	(OUTBUF+1	/INIT. X10
	DAC*	(X10
	CLA
	LLS	3		/SHIFT IN A DIGIT
	TAD	(60		/MAKE IT INTO ASCII
	DAC*	X10		/STORE IT IN BUFFER
	ISZ	NUMO1		/HAVE WE DONE 6 DIGITS?
	JMP	.-5		/NO
	CAL	WRT		/YES -- WRITE OUT THE BUFFER
	CAL	WAIT
	JMP*	NUMOUT
NUMO1	0
OUTBUF	5000
	0
	.BLOCK 6
	40
	175
WRT	2700
	EV
	3
	3
	OUTBUF
	.END
	CAL	DEAL	/YES -- DEALLOCATE
	CAL	AWAIT
	LAC	AEV
	SPA
	JMS	DEAERR
	JMP*	CHECK
