Google
 

Trailing-Edge - PDP-10 Archives - BB-H311D-RM - swskit-tools/units.mac
There are 8 other files named units.mac in the archive. Click here to see a list.
	TITLE UNITS  PROGRAM TO TYPE OUT DISK UNIT STATUS INFORMATION
	SUBTTL	MINOR ADDITIONS AND MAJOR CLEANUP BY J. G. ZIMA/JGZ

	SEARCH	MONSYM,MACSYM
	.REQUIRE SYS:MACREL
	.DIRECT	FLBLST
	SALL



;VERSION INFORMATION:

	VWHO==0			;WHO LAST EDITED
	VMAJOR==1		;MAJOR VERSION
	VMINOR==0		;MINOR VERSION
	VEDIT==^D12		;EDIT LEVEL



;REVISION HISTORY:
;
;   1	JGZ	1-APR-79
;		ADD RP07, RP08, RM03.  HANDLE CONTINUE.  GENERAL CLEANUP
;		INCLUDING COMMENTS, ENTRY VECTOR, VERSION NUMBER.
;
;   2	JGZ	1-APR-79
;		ADD ENABLING AND RESTORING OF CAPABILITIES, USE OF ALIAS.
;
;   3	JGZ	15-JAN-80
;		ADD FEATURES FOR RP20, CONTROLLER FIELD, MORE CLEANUP.
;
;   4	JGZ	28-APR-80
;		CENTER THE CHANNEL NUMBER COLUMN. WE'LL NEVER HAVE MORE
;		THAN ONE DIGIT FOR THIS INCARNATION OF THE DISK SYSTEMS.
;
;   5	JGZ	28-APR-80
;		MOVE THE UNIT COLUMN RIGHTMOST POSTION ONE TO THE LEFT.
;
;   6	JGZ	28-APR-80
;		ADD A TIMESTAMP TO THE HEADER LINES.
;
;   7	JGZ	30-APR-80
;		PRETTY THE LISTING A BIT AND REMOVE A FEW UNNEEDED
;		INSTRUCTIONS.
;
;   8	JGZ	4-FEB-83
;		ADD RA80, RA81, RA60 DISK TYPES
;
;   9	JGZ	28-FEB-84
;		CENTER DRIVE, CONTROLLER VALUES BETTER FOR LOOKS.
;
;  10	JGZ	4-APR-84
;		USE VI%DEC FOR DECIMAL VERSION NUMBER.
;
;  11	JGZ	3-JUL-84
;		CHANGE CKU TYPEOUT TO NEW DECIMAL STANDARD FOR 6.0
;
;  12	JGZ	7-DEC-84
;		IMPLEMENT DRIVE SERIAL NUMBER TYPEOUT IN FORWARDS AND
;		BACKWARDS COMPATIBLE MANNER FOR 6.0.
;


;ACCUMULATORS:

	STDAC.			;THE USUAL SET
	
;CONSTANTS:
	
	PDLEN==10		;PUSH DOWN STACK LENGTH
	F%HDR==1B0		;HEADER TYPED FLAG
	F%DSN==1B1		;DO DSN TYPEOUT


;FOR VERSION COMPATIBILITY:

	IFNDEF CNFIG%,<CNFIG%==<JSYS	627>>
	IFNDEF .MSDSN,<.MSDSN==33>
	SUBTTL	ENTRY VECTOR AND MAIN ROUTINE


;ENTRY VECTOR

EVEC:	JRST	UNITS		;START ADDRESS
	JRST	UNITS		;REENTER ADDRESS
	BYTE	(3)VWHO(9)VMAJOR(6)VMINOR(18)VI%DEC+VEDIT ;VERSION


;AND THE PROGRAM BEGINS HERE

UNITS:	RESET			;TRADITIONAL
	SETZB	F,T1		;CLEAR FLAGS,T1
	MOVEI	T2,RNUBLK	;POINT TO AN ARG BLOCK
	AOS	RNUBLK		;NEED COUNT OF AT LEAST ONE
	TXO	F,F%DSN		;ASSUME CAN DO
	CNFIG%			;SEE IF CNFIG% IS THERE (V6 OR LATER)
	 ERJMP [TXZ	F,F%DSN	;NOPE, DON'T DO DRIVE SERIAL NUMBER
		JRST	.+1]	;CONTINUE
	MOVE	P,[IOWD PDLEN,PDL] ;INITIALIZE THE STACK
	MOVEI	T1,.FHSLF	;US
	RPCAP			;OUR CAPABILITIES
	PUSH	P,T3		;SAVE FORMER
	PUSH	P,T2		; CAPS AND MASK
	IOR	T3,T2		;ASK FOR OUR WORLD
	EPCAP			; AND TRY TO GET IT
	CALL	CNFINF		;PRINT IT ALL
	MOVEI	T1,.FHSLF	;US AGAIN
	POP	P,T2		;RESTORE OUR FORMER
	POP	P,T3		;CAPABILITIES
	EPCAP			; TO USER
	HALTF			;AND WE ARE DONE
	JRST	UNITS		;DO IT AGAIN ON CONTINUE
	SUBTTL	ROUTINES TO DO THE WORK


;ROUTINE TO SETUP STRING CONTAINING AVAILABLE UNIT INFO AND TYPE IT

CNFINF:	SETOM	RNUBLK+.MSRCH	;INIT FOR FIRST CHANNEL
	SETOM	RNUBLK+.MSRCT	;		CONTROLLER
	SETOM	RNUBLK+.MSRUN	;		UNIT

CNFIN1:	CALL	GTUSTS		;GET STATUS OF NEXT UNIT
	 JRST	CNFIN3		;NO MORE - DONE
	HRROI	T1,HHDR1	;POINT TO HEADER
	TXNN	F,F%HDR		;TYPED HEADER YET?
	PSOUT			;NO, OUTPUT IT
	MOVX	T1,.PRIOU	;TO TERMINAL
	SETOM	T2		;NOW
	SETZM	T3		;AND DEFAULT DATE-TIME FORMAT
	TXNN	F,F%HDR		;CHECK FLAG
	ODTIM			;GIVE TIMESTAMP
	HRROI	T1,HHDR2	;REST OF HEADER
	TXNE	F,F%DSN		;DSN TYPEOUT HEADER?
	 HRROI	T1,HHDR3	; YES
	TXON	F,F%HDR		;CHECK/SET FLAG TO SAY ALREADY DONE
	PSOUT			;PRINT LAST PART OF HEADER
	MOVE	Q2,RNUBLK+.MSRST	;GET STATUS WORD
	HRROI	T1,[ASCIZ "  No "]	;ASSUME NOT MOUNTED
	TXNE	Q2,MS%MNT		;MOUNTED?
	HRROI	T1,[ASCIZ "  Yes"]	;CHANGE OUR MIND
	PSOUT			;AND PRINT
	MOVEI	T3,5		;6 SPACES
	CALL	SPACN		;SPACE OVER
	LOAD	T3,MS%TYP,Q2	;FETCH THE UNIT TYPE CODE
	HRROI	T1,[ASCIZ "UNK "] ;ASSUME UNKNOWN FOR OUT OF RANGE
	CAIG	T3,MXUTYP	;VALID TYPE?
	MOVE	T1,UNTYTB(T3)	;GET NAME OF UNIT TYPE
	PSOUT			;TYPE IT
	MOVE	T2,RNUBLK+.MSRCH ;GET CHANNEL NUMBER
	MOVX	T3,NO%MAG+NO%LFL+FLD(^D6,NO%COL)+^D10
	MOVEI	T1,.PRIOU
	NOUT			;TYPE IT IN DECIMAL
	 JFCL
	MOVE	T2,RNUBLK+.MSRUN ;GET UNIT NUMBER
	MOVX	T3,NO%MAG+NO%LFL+FLD(^D8,NO%COL)+^D10
	MOVEI	T1,.PRIOU
	NOUT			;TYPE IT IN DECIMAL
	 JFCL
	MOVE	T2,RNUBLK+.MSRCT ;GET CONTROLLER NUMBER
	JUMPL	T2,[	TMSG	<        --    > ;NEGATIVE MEANS NONE
			JRST	CNFINC]	;TYPE AND CONTINUE IN-LINE
	MOVX	T3,NO%MAG+NO%LFL+FLD(^D10,NO%COL)+^D10
	MOVEI	T1,.PRIOU
	NOUT			;TYPE NON-NEGATIVE CONTROLLER IN DECIMAL
	 JFCL
	TMSG	<    >		;SPACE OVER
CNFINC:	MOVEI	T3,2		;SPACE OVER
	CALL	SPACN
	MOVEI	T3,":"		;A COLON FOR CLASS
	MOVE	T2,RNUBLK+.MSRSA ;POINT FIRST TO ALIAS
	TXNN	Q2,MS%MNT	;MOUNTED?
	MOVE	T2,RNUBLK+.MSRSN ;NO--USE VOLUME NAME
	IDPB	T3,T2		;STICK A COLON AFTER NAME
	SETZ	T3,		;AND A NULL TO TIE OFF
	IDPB	T3,T2		;TIED
	HRROI	T2,ALIBUF	;ASSUME STR NAME
	TXNN	Q2,MS%MNT	;MOUNTED?
	HRROI	T2,NAMBUF	; NO--TYPE VOLUME NAME
	TXNE	Q2,MS%ERR	;ERROR READING HOME BLOCKS?
	HRROI	T2,[ASCIZ "Error reading home blocks"]
	TXNE	Q2,MS%HBB	;VALID HOME BLOCKS?
	HRROI	T2,[ASCIZ "Bad home blocks"]
	TXNE	Q2,MS%DIA	;MAINT MODE?
	HRROI	T2,[ASCIZ "Maintenance mode"]
	TXNE	Q2,MS%OFL	;OFF-LINE?
	HRROI	T2,[ASCIZ "Off-line"]
	MOVEI	T3,^D17		;MAX CHARACTERS
	MOVEI	T4,0		;TERMINATOR
	MOVEI	T1,.PRIOU
	SOUT			;DUMP STRING SO FAR
	AOS	T3		;ACCOUNT FOR IT
	CALL	SPACN		;T3 HAS CHARS REMAINING
	TXNE	Q2,MS%DIA!MS%OFL!MS%HBB!MS%ERR
	 JRST CNFIN2		;NO MORE INFO

	HLRZ	T2,RNUBLK+.MSRNS ;GET LOGICAL UNIT #
	MOVEI	T3,^D10		;DECIMAL
	MOVEI	T1,.PRIOU
	NOUT
	 JFCL
	TMSG	< (>		;SPACE AND OPEN PAREN
	HLRZ	T2,RNUBLK+.MSRNS ;GET UNIT # AGAIN
	AOS	T2		;CHANGE TO ORDINAL
	MOVEI	T1,.PRIOU
	NOUT			;DUMP IT
	 JFCL
	TMSG	< of >
	HRRZ	T2,RNUBLK+.MSRNS ;GET # OF UNITS IN STR
	MOVEI	T1,.PRIOU	;STILL DECIMAL, BUT RELOAD .PRIOU
	NOUT			;DUMP IT
	 JFCL
	TMSG	<)   >		;CLOSE PAREN
	MOVE	T2,RNUBLK+.MSDSN ;GET DRIVE SERIAL NUMBER
	MOVX	T3,NO%MAG+NO%LFL+FLD(^D5,NO%COL)+^D10
	MOVEI	T1,.PRIOU
	TXNE	F,F%DSN		;DO IT?
	NOUT			;YES
	 JFCL

CNFIN2:	TMSG	<
>				;DO A CRLF TO END LINE
	JRST CNFIN1		;GET NEXT

CNFIN3:	TMSG	<
>				;EXTRA CRLF TO END DISPLAY
	RET			;RETURN

;GTUSTS - ROUTINE TO READ NEXT UNIT STATUS
;RETURNS RETSKP WITH STATUS OR RET ON NO MORE UNITS

GTUSTS:	HRROI	T1,NAMBUF	;PLACE FOR STRUCTURE NAME
	MOVEM	T1,RNUBLK+.MSRSN
	HRROI	T1,ALIBUF	;PLACE FOR ALIAS
	MOVEM	T1,RNUBLK+.MSRSA
	MOVE	T1,[.MSRLN,,.MSRNU] ; LEN,,FCN
	MOVEI	T2,RNUBLK	;ADDRS OF ARGS
	MSTR			;GET STATUS
	 ERJMP [MOVEI	T1,.FHSLF	;OURSELVES
		GETER			;GET OUR LAST ERROR
		HRRZ	T1,T2		;ISOLATE THE CODE
		CAIE	T1,MSTX18	;NO MORE UNITS?
		JSERR			;SOME OTHER ERROR
		RET]			;NO MORE - RETURN
	RETSKP			;GOOD RETURN



;SPACN - ROUTINE TO OUTPUT # SPACES IN T3

SPACN:	TMSG	< >		;SPACE TO THE TTY
	SOJG	T3,SPACN	;LOOP FOR ENOUGH
	RET			; THEN RETURN
	SUBTTL	DATA AREA

;UNIT TYPE NAME TABLE

UNTYTB:	-1,,[ASCIZ "UNK "]	;0 - UNKNOWN
	-1,,[ASCIZ "RP04"]	;1 - RP04
	-1,,[ASCIZ "UNK "]	;2 - UNKNOWN
	-1,,[ASCIZ "UNK "]	;3 - UNKNOWN
	-1,,[ASCIZ "UNK "]	;4 - UNKNOWN
	-1,,[ASCIZ "RP05"]	;5 - RP05
	-1,,[ASCIZ "RP06"]	;6 - RP06
	-1,,[ASCIZ "RP07"]	;7 - RP07
	-1,,[ASCIZ "RP08"]	;10 - RP08 (IF EVER)
	-1,,[ASCIZ "RM03"]	;11 - RM03
	-1,,[ASCIZ "UNK "]	;12 - UNKNOWN
	-1,,[ASCIZ "UNK "]	;13 - UNKNOWN
	-1,,[ASCIZ "UNK "]	;14 - UNKNOWN
	-1,,[ASCIZ "UNK "]	;15 - UNKNOWN
	-1,,[ASCIZ "UNK "]	;16 - UNKNOWN
	-1,,[ASCIZ "UNK "]	;17 - UNKNOWN
	-1,,[ASCIZ "UNK "]	;20 - UNKNOWN
	-1,,[ASCIZ "UNK "]	;21 - UNKNOWN
	-1,,[ASCIZ "UNK "]	;22 - UNKNOWN
	-1,,[ASCIZ "UNK "]	;23 - UNKNOWN
	-1,,[ASCIZ "RP20"]	;24 - RP20
	-1,,[ASCIZ "CI  "]	;25 - CI OR KLIPA NODE
	-1,,[ASCIZ "HSC "]	;26 - HSC50
	-1,,[ASCIZ "RA80"]	;27 - RA80
	-1,,[ASCIZ "RA81"]	;30 - RA81
	-1,,[ASCIZ "RA60"]	;31 - RA60
	-1,,[ASCIZ "RA82"]	;32 - RA82
	-1,,[ASCIZ "RA62"]	;33 - RA62

	MXUTYP==.-UNTYTB-1	;MAX UNIT TYPE



;HEADER LINES

HHDR1:	ASCIZ "
Status of Disk Units at "

HHDR2:	ASCIZ "

Mounted?  Type  Channel  Drive  Controller  Structure name  Logical unit
--------  ----  -------  -----  ----------  --------------  ------------
"

HHDR3:	ASCIZ "

Mounted?  Type  Channel  Drive  Controller  Structure name  Logical unit    DSN
--------  ----  -------  -----  ----------  --------------  ------------    ---
"


PDL:	BLOCK	PDLEN		;THE PUSH DOWN STACK
NAMBUF:	BLOCK	10		;BUFFER FOR STR NAME
ALIBUF:	BLOCK	10		;THE ALIAS
RNUBLK:	BLOCK	.MSRLN+10	;BLOCK FOR .MSRNU FUNC

	END	<3,,EVEC>